VTK  9.2.5
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 =========================================================================*/
172 #ifndef vtkPolyDataNormals_h
173 #define vtkPolyDataNormals_h
174 
175 #include "vtkFiltersCoreModule.h" // For export macro
176 #include "vtkPolyDataAlgorithm.h"
177 
178 class vtkFloatArray;
179 class vtkIdList;
180 class vtkPolyData;
181 
182 class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
183 {
184 public:
186  void PrintSelf(ostream& os, vtkIndent indent) override;
187 
194 
196 
201  vtkSetClampMacro(FeatureAngle, double, 0.0, 180.0);
202  vtkGetMacro(FeatureAngle, double);
204 
206 
209  vtkSetMacro(Splitting, vtkTypeBool);
210  vtkGetMacro(Splitting, vtkTypeBool);
211  vtkBooleanMacro(Splitting, vtkTypeBool);
213 
215 
218  vtkSetMacro(Consistency, vtkTypeBool);
219  vtkGetMacro(Consistency, vtkTypeBool);
220  vtkBooleanMacro(Consistency, vtkTypeBool);
222 
224 
235  vtkSetMacro(AutoOrientNormals, vtkTypeBool);
236  vtkGetMacro(AutoOrientNormals, vtkTypeBool);
237  vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
239 
241 
244  vtkSetMacro(ComputePointNormals, vtkTypeBool);
245  vtkGetMacro(ComputePointNormals, vtkTypeBool);
246  vtkBooleanMacro(ComputePointNormals, vtkTypeBool);
248 
250 
253  vtkSetMacro(ComputeCellNormals, vtkTypeBool);
254  vtkGetMacro(ComputeCellNormals, vtkTypeBool);
255  vtkBooleanMacro(ComputeCellNormals, vtkTypeBool);
257 
259 
265  vtkSetMacro(FlipNormals, vtkTypeBool);
266  vtkGetMacro(FlipNormals, vtkTypeBool);
267  vtkBooleanMacro(FlipNormals, vtkTypeBool);
269 
271 
276  vtkSetMacro(NonManifoldTraversal, vtkTypeBool);
277  vtkGetMacro(NonManifoldTraversal, vtkTypeBool);
278  vtkBooleanMacro(NonManifoldTraversal, vtkTypeBool);
280 
282 
287  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
288  vtkGetMacro(OutputPointsPrecision, int);
290 
291 protected:
293  ~vtkPolyDataNormals() override = default;
294 
295  // Usual data generation method
297 
298  double FeatureAngle;
306  int NumFlips;
308 
309 private:
310  vtkIdList* Wave;
311  vtkIdList* Wave2;
312  vtkIdList* CellIds;
313  vtkIdList* CellPoints;
314  vtkIdList* NeighborPoints;
315  vtkIdList* Map;
316  vtkPolyData* OldMesh;
317  vtkPolyData* NewMesh;
318  int* Visited;
319  vtkFloatArray* PolyNormals;
320  double CosAngle;
321 
322  // Uses the list of cell ids (this->Wave) to propagate a wave of
323  // checked and properly ordered polygons.
324  void TraverseAndOrder(void);
325 
326  // Check the point id give to see whether it lies on a feature
327  // edge. If so, split the point (i.e., duplicate it) to topologically
328  // separate the mesh.
329  void MarkAndSplit(vtkIdType ptId);
330 
331 private:
332  vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
333  void operator=(const vtkPolyDataNormals&) = delete;
334 };
335 
336 #endif
dynamic, self-adjusting array of float
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
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:200
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332