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 =========================================================================*/
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) VTK_OVERRIDE;
72 
78  static vtkPolyDataNormals *New();
79 
81 
86  vtkSetClampMacro(FeatureAngle,double,0.0,180.0);
87  vtkGetMacro(FeatureAngle,double);
89 
91 
94  vtkSetMacro(Splitting,int);
95  vtkGetMacro(Splitting,int);
96  vtkBooleanMacro(Splitting,int);
98 
100 
103  vtkSetMacro(Consistency,int);
104  vtkGetMacro(Consistency,int);
105  vtkBooleanMacro(Consistency,int);
107 
109 
120  vtkSetMacro(AutoOrientNormals, int);
121  vtkGetMacro(AutoOrientNormals, int);
122  vtkBooleanMacro(AutoOrientNormals, int);
124 
126 
129  vtkSetMacro(ComputePointNormals,int);
130  vtkGetMacro(ComputePointNormals,int);
131  vtkBooleanMacro(ComputePointNormals,int);
133 
135 
138  vtkSetMacro(ComputeCellNormals,int);
139  vtkGetMacro(ComputeCellNormals,int);
140  vtkBooleanMacro(ComputeCellNormals,int);
142 
144 
150  vtkSetMacro(FlipNormals,int);
151  vtkGetMacro(FlipNormals,int);
152  vtkBooleanMacro(FlipNormals,int);
154 
156 
161  vtkSetMacro(NonManifoldTraversal,int);
162  vtkGetMacro(NonManifoldTraversal,int);
163  vtkBooleanMacro(NonManifoldTraversal,int);
165 
167 
172  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
173  vtkGetMacro(OutputPointsPrecision, int);
175 
176 protected:
178  ~vtkPolyDataNormals() VTK_OVERRIDE {}
179 
180  // Usual data generation method
182 
183  double FeatureAngle;
184  int Splitting;
185  int Consistency;
186  int FlipNormals;
187  int AutoOrientNormals;
188  int NonManifoldTraversal;
189  int ComputePointNormals;
190  int ComputeCellNormals;
191  int NumFlips;
192  int OutputPointsPrecision;
193 
194 private:
195  vtkIdList *Wave;
196  vtkIdList *Wave2;
197  vtkIdList *CellIds;
198  vtkIdList *Map;
199  vtkPolyData *OldMesh;
200  vtkPolyData *NewMesh;
201  int *Visited;
202  vtkFloatArray *PolyNormals;
203  double CosAngle;
204 
205  // Uses the list of cell ids (this->Wave) to propagate a wave of
206  // checked and properly ordered polygons.
207  void TraverseAndOrder(void);
208 
209  // Check the point id give to see whether it lies on a feature
210  // edge. If so, split the point (i.e., duplicate it) to topologically
211  // separate the mesh.
212  void MarkAndSplit(vtkIdType ptId);
213 
214 private:
215  vtkPolyDataNormals(const vtkPolyDataNormals&) VTK_DELETE_FUNCTION;
216  void operator=(const vtkPolyDataNormals&) VTK_DELETE_FUNCTION;
217 };
218 
219 #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:287
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.