VTK
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 =========================================================================*/
63 #ifndef vtkPolyDataNormals_h
64 #define vtkPolyDataNormals_h
65 
66 #include "vtkFiltersCoreModule.h" // For export macro
67 #include "vtkPolyDataAlgorithm.h"
68 
69 class vtkFloatArray;
70 class vtkIdList;
71 class vtkPolyData;
72 
73 class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
74 {
75 public:
77  void PrintSelf(ostream& os, vtkIndent indent) override;
78 
84  static vtkPolyDataNormals *New();
85 
87 
92  vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
93  vtkGetMacro(FeatureAngle,double);
95 
97 
100  vtkSetMacro(Splitting,int);
101  vtkGetMacro(Splitting,int);
102  vtkBooleanMacro(Splitting,int);
104 
106 
109  vtkSetMacro(Consistency,int);
110  vtkGetMacro(Consistency,int);
111  vtkBooleanMacro(Consistency,int);
113 
115 
126  vtkSetMacro(AutoOrientNormals, int);
127  vtkGetMacro(AutoOrientNormals, int);
128  vtkBooleanMacro(AutoOrientNormals, int);
130 
132 
135  vtkSetMacro(ComputePointNormals,int);
136  vtkGetMacro(ComputePointNormals,int);
137  vtkBooleanMacro(ComputePointNormals,int);
139 
141 
144  vtkSetMacro(ComputeCellNormals,int);
145  vtkGetMacro(ComputeCellNormals,int);
146  vtkBooleanMacro(ComputeCellNormals,int);
148 
150 
156  vtkSetMacro(FlipNormals,int);
157  vtkGetMacro(FlipNormals,int);
158  vtkBooleanMacro(FlipNormals,int);
160 
162 
167  vtkSetMacro(NonManifoldTraversal,int);
168  vtkGetMacro(NonManifoldTraversal,int);
169  vtkBooleanMacro(NonManifoldTraversal,int);
171 
173 
178  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
179  vtkGetMacro(OutputPointsPrecision, int);
181 
182 protected:
184  ~vtkPolyDataNormals() override {}
185 
186  // Usual data generation method
188 
189  double FeatureAngle;
197  int NumFlips;
199 
200 private:
201  vtkIdList *Wave;
202  vtkIdList *Wave2;
203  vtkIdList *CellIds;
204  vtkIdList *Map;
205  vtkPolyData *OldMesh;
206  vtkPolyData *NewMesh;
207  int *Visited;
208  vtkFloatArray *PolyNormals;
209  double CosAngle;
210 
211  // Uses the list of cell ids (this->Wave) to propagate a wave of
212  // checked and properly ordered polygons.
213  void TraverseAndOrder(void);
214 
215  // Check the point id give to see whether it lies on a feature
216  // edge. If so, split the point (i.e., duplicate it) to topologically
217  // separate the mesh.
218  void MarkAndSplit(vtkIdType ptId);
219 
220 private:
221  vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
222  void operator=(const vtkPolyDataNormals&) = delete;
223 };
224 
225 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:41
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
~vtkPolyDataNormals() override
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
list of point or cell ids
Definition: vtkIdList.h:36
compute normals for polygonal mesh
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.