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=========================================================================*/
57#ifndef vtkPolyDataNormals_h
58#define vtkPolyDataNormals_h
59
60#include "vtkFiltersCoreModule.h" // For export macro
62
63class vtkFloatArray;
64class vtkIdList;
65class vtkPolyData;
66
67class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
79
81
86 vtkSetClampMacro(FeatureAngle, double, 0.0, 180.0);
87 vtkGetMacro(FeatureAngle, double);
89
91
94 vtkSetMacro(Splitting, vtkTypeBool);
95 vtkGetMacro(Splitting, vtkTypeBool);
96 vtkBooleanMacro(Splitting, vtkTypeBool);
98
100
103 vtkSetMacro(Consistency, vtkTypeBool);
104 vtkGetMacro(Consistency, vtkTypeBool);
105 vtkBooleanMacro(Consistency, vtkTypeBool);
107
109
120 vtkSetMacro(AutoOrientNormals, vtkTypeBool);
121 vtkGetMacro(AutoOrientNormals, vtkTypeBool);
122 vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
124
126
129 vtkSetMacro(ComputePointNormals, vtkTypeBool);
130 vtkGetMacro(ComputePointNormals, vtkTypeBool);
131 vtkBooleanMacro(ComputePointNormals, vtkTypeBool);
133
135
138 vtkSetMacro(ComputeCellNormals, vtkTypeBool);
139 vtkGetMacro(ComputeCellNormals, vtkTypeBool);
140 vtkBooleanMacro(ComputeCellNormals, vtkTypeBool);
142
144
150 vtkSetMacro(FlipNormals, vtkTypeBool);
151 vtkGetMacro(FlipNormals, vtkTypeBool);
152 vtkBooleanMacro(FlipNormals, vtkTypeBool);
154
156
161 vtkSetMacro(NonManifoldTraversal, vtkTypeBool);
162 vtkGetMacro(NonManifoldTraversal, vtkTypeBool);
163 vtkBooleanMacro(NonManifoldTraversal, vtkTypeBool);
165
167
172 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
173 vtkGetMacro(OutputPointsPrecision, int);
175
176protected:
178 ~vtkPolyDataNormals() override = default;
179
180 // Usual data generation method
182
193
194private:
195 vtkIdList* Wave;
196 vtkIdList* Wave2;
197 vtkIdList* CellIds;
198 vtkIdList* CellPoints;
199 vtkIdList* NeighborPoints;
200 vtkIdList* Map;
201 vtkPolyData* OldMesh;
202 vtkPolyData* NewMesh;
203 int* Visited;
204 vtkFloatArray* PolyNormals;
205 double CosAngle;
206
207 // Uses the list of cell ids (this->Wave) to propagate a wave of
208 // checked and properly ordered polygons.
209 void TraverseAndOrder(void);
210
211 // Check the point id give to see whether it lies on a feature
212 // edge. If so, split the point (i.e., duplicate it) to topologically
213 // separate the mesh.
214 void MarkAndSplit(vtkIdType ptId);
215
216private:
217 vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
218 void operator=(const vtkPolyDataNormals&) = delete;
219};
220
221#endif
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
list of point or cell ids
Definition: vtkIdList.h:31
a simple class to control print indentation
Definition: vtkIndent.h:34
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:86
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332