VTK  9.3.0
vtkPolyDataNormals.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
65#ifndef vtkPolyDataNormals_h
66#define vtkPolyDataNormals_h
67
68#include "vtkFiltersCoreModule.h" // For export macro
70
71VTK_ABI_NAMESPACE_BEGIN
72class vtkFloatArray;
73class vtkIdList;
74class vtkPolyData;
75
76class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
77{
78public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
88
90
95 vtkSetClampMacro(FeatureAngle, double, 0.0, 180.0);
96 vtkGetMacro(FeatureAngle, double);
98
100
103 vtkSetMacro(Splitting, vtkTypeBool);
104 vtkGetMacro(Splitting, vtkTypeBool);
105 vtkBooleanMacro(Splitting, vtkTypeBool);
107
109
112 vtkSetMacro(Consistency, vtkTypeBool);
113 vtkGetMacro(Consistency, vtkTypeBool);
114 vtkBooleanMacro(Consistency, vtkTypeBool);
116
118
129 vtkSetMacro(AutoOrientNormals, vtkTypeBool);
130 vtkGetMacro(AutoOrientNormals, vtkTypeBool);
131 vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
133
135
138 vtkSetMacro(ComputePointNormals, vtkTypeBool);
139 vtkGetMacro(ComputePointNormals, vtkTypeBool);
140 vtkBooleanMacro(ComputePointNormals, vtkTypeBool);
142
144
147 vtkSetMacro(ComputeCellNormals, vtkTypeBool);
148 vtkGetMacro(ComputeCellNormals, vtkTypeBool);
149 vtkBooleanMacro(ComputeCellNormals, vtkTypeBool);
151
153
159 vtkSetMacro(FlipNormals, vtkTypeBool);
160 vtkGetMacro(FlipNormals, vtkTypeBool);
161 vtkBooleanMacro(FlipNormals, vtkTypeBool);
163
165
170 vtkSetMacro(NonManifoldTraversal, vtkTypeBool);
171 vtkGetMacro(NonManifoldTraversal, vtkTypeBool);
172 vtkBooleanMacro(NonManifoldTraversal, vtkTypeBool);
174
176
181 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
182 vtkGetMacro(OutputPointsPrecision, int);
184
185protected:
187 ~vtkPolyDataNormals() override = default;
188
189 // Usual data generation method
191
202
203private:
204 double CosAngle;
205
206 struct MarkAndSplitFunctor;
207
208 // Uses the list of cell ids (this->Wave) to propagate a wave of
209 // checked and properly ordered polygons.
210 void TraverseAndOrder(vtkPolyData* oldMesh, vtkPolyData* newMesh, vtkIdList* wave,
211 vtkIdList* wave2, vtkIdList* cellPointIds, vtkIdList* cellIds, vtkIdList* neighborPointIds,
212 std::vector<char>& visited, vtkIdType& numFlips);
213
214 // check all the points whether they lie on a feature
215 // edge. If so, split the point (i.e., duplicate it) to topologically
216 // separate the mesh.
217 void ExecuteMarkAndSplit(vtkPolyData* oldMesh, vtkPolyData* newMesh, vtkFloatArray* cellNormals,
218 vtkIdList* map, vtkIdType numPoints, vtkIdType numPolys, double cosAngle);
219
220 vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
221 void operator=(const vtkPolyDataNormals&) = delete;
222};
223
224VTK_ABI_NAMESPACE_END
225#endif
dynamic, self-adjusting array of float
list of point or cell ids
Definition vtkIdList.h:32
a simple class to control print indentation
Definition vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
compute normals for polygonal mesh
static vtkPolyDataNormals * New()
Construct with feature angle=30, splitting and consistency turned on, flipNormals turned off,...
~vtkPolyDataNormals() override=default
vtkTypeBool NonManifoldTraversal
vtkTypeBool ComputePointNormals
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:89
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315