VTK  9.1.0
vtkPolyDataNormals.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPolyDataNormals.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
66#ifndef vtkPolyDataNormals_h
67#define vtkPolyDataNormals_h
68
69#include "vtkFiltersCoreModule.h" // For export macro
71
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 vtkIdList* Wave;
205 vtkIdList* Wave2;
206 vtkIdList* CellIds;
207 vtkIdList* CellPoints;
208 vtkIdList* NeighborPoints;
209 vtkIdList* Map;
210 vtkPolyData* OldMesh;
211 vtkPolyData* NewMesh;
212 int* Visited;
213 vtkFloatArray* PolyNormals;
214 double CosAngle;
215
216 // Uses the list of cell ids (this->Wave) to propagate a wave of
217 // checked and properly ordered polygons.
218 void TraverseAndOrder(void);
219
220 // Check the point id give to see whether it lies on a feature
221 // edge. If so, split the point (i.e., duplicate it) to topologically
222 // separate the mesh.
223 void MarkAndSplit(vtkIdType ptId);
224
225private:
226 vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
227 void operator=(const vtkPolyDataNormals&) = delete;
228};
229
230#endif
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
list of point or cell ids
Definition: vtkIdList.h:40
a simple class to control print indentation
Definition: vtkIndent.h:43
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 ComputeCellNormals
vtkTypeBool ComputePointNormals
vtkTypeBool AutoOrientNormals
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:95
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332