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,vtkTypeBool);
101  vtkGetMacro(Splitting,vtkTypeBool);
102  vtkBooleanMacro(Splitting,vtkTypeBool);
104 
106 
109  vtkSetMacro(Consistency,vtkTypeBool);
110  vtkGetMacro(Consistency,vtkTypeBool);
111  vtkBooleanMacro(Consistency,vtkTypeBool);
113 
115 
126  vtkSetMacro(AutoOrientNormals, vtkTypeBool);
127  vtkGetMacro(AutoOrientNormals, vtkTypeBool);
128  vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
130 
132 
135  vtkSetMacro(ComputePointNormals,vtkTypeBool);
136  vtkGetMacro(ComputePointNormals,vtkTypeBool);
137  vtkBooleanMacro(ComputePointNormals,vtkTypeBool);
139 
141 
144  vtkSetMacro(ComputeCellNormals,vtkTypeBool);
145  vtkGetMacro(ComputeCellNormals,vtkTypeBool);
146  vtkBooleanMacro(ComputeCellNormals,vtkTypeBool);
148 
150 
156  vtkSetMacro(FlipNormals,vtkTypeBool);
157  vtkGetMacro(FlipNormals,vtkTypeBool);
158  vtkBooleanMacro(FlipNormals,vtkTypeBool);
160 
162 
167  vtkSetMacro(NonManifoldTraversal,vtkTypeBool);
168  vtkGetMacro(NonManifoldTraversal,vtkTypeBool);
169  vtkBooleanMacro(NonManifoldTraversal,vtkTypeBool);
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
vtkTypeBool AutoOrientNormals
vtkTypeBool ComputePointNormals
int vtkIdType
Definition: vtkType.h:348
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
~vtkPolyDataNormals() override
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
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
Store zero or more vtkInformation instances.
vtkTypeBool NonManifoldTraversal
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool ComputeCellNormals