VTK  9.0.20210616
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
61 #include "vtkPolyDataAlgorithm.h"
62 
63 class vtkFloatArray;
64 class vtkIdList;
65 class vtkPolyData;
66 
67 class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
68 {
69 public:
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 
176 protected:
178  ~vtkPolyDataNormals() override = default;
179 
180  // Usual data generation method
182 
183  double FeatureAngle;
191  int NumFlips;
193 
194 private:
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 
216 private:
217  vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
218  void operator=(const vtkPolyDataNormals&) = delete;
219 };
220 
221 #endif
vtkPolyDataNormals::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyDataNormals::AutoOrientNormals
vtkTypeBool AutoOrientNormals
Definition: vtkPolyDataNormals.h:187
vtkPolyDataNormals::OutputPointsPrecision
int OutputPointsPrecision
Definition: vtkPolyDataNormals.h:192
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkFloatArray
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:36
vtkPolyDataNormals::vtkPolyDataNormals
vtkPolyDataNormals()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkPolyDataNormals::NumFlips
int NumFlips
Definition: vtkPolyDataNormals.h:191
vtkPolyDataNormals::FlipNormals
vtkTypeBool FlipNormals
Definition: vtkPolyDataNormals.h:186
vtkPolyDataAlgorithm.h
vtkPolyDataNormals::Consistency
vtkTypeBool Consistency
Definition: vtkPolyDataNormals.h:185
vtkPolyDataNormals
compute normals for polygonal mesh
Definition: vtkPolyDataNormals.h:68
vtkPolyDataNormals::ComputePointNormals
vtkTypeBool ComputePointNormals
Definition: vtkPolyDataNormals.h:189
vtkPolyDataNormals::FeatureAngle
double FeatureAngle
Definition: vtkPolyDataNormals.h:183
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:31
vtkPolyDataNormals::NonManifoldTraversal
vtkTypeBool NonManifoldTraversal
Definition: vtkPolyDataNormals.h:188
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:74
vtkPolyDataNormals::~vtkPolyDataNormals
~vtkPolyDataNormals() override=default
vtkPolyDataNormals::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkPolyDataNormals::ComputeCellNormals
vtkTypeBool ComputeCellNormals
Definition: vtkPolyDataNormals.h:190
vtkPolyDataNormals::New
static vtkPolyDataNormals * New()
Construct with feature angle=30, splitting and consistency turned on, flipNormals turned off,...
vtkPolyDataNormals::Splitting
vtkTypeBool Splitting
Definition: vtkPolyDataNormals.h:184
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:42