VTK  9.1.0
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=========================================================================*/
166#ifndef vtkPolyDataNormals_h
167#define vtkPolyDataNormals_h
168
169#include "vtkFiltersCoreModule.h" // For export macro
170#include "vtkPolyDataAlgorithm.h"
171
172class vtkFloatArray;
173class vtkIdList;
174class vtkPolyData;
175
176class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
177{
178public:
180 void PrintSelf(ostream& os, vtkIndent indent) override;
181
188
190
195 vtkSetClampMacro(FeatureAngle, double, 0.0, 180.0);
196 vtkGetMacro(FeatureAngle, double);
198
200
203 vtkSetMacro(Splitting, vtkTypeBool);
204 vtkGetMacro(Splitting, vtkTypeBool);
205 vtkBooleanMacro(Splitting, vtkTypeBool);
207
209
212 vtkSetMacro(Consistency, vtkTypeBool);
213 vtkGetMacro(Consistency, vtkTypeBool);
214 vtkBooleanMacro(Consistency, vtkTypeBool);
216
218
229 vtkSetMacro(AutoOrientNormals, vtkTypeBool);
230 vtkGetMacro(AutoOrientNormals, vtkTypeBool);
231 vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
233
235
238 vtkSetMacro(ComputePointNormals, vtkTypeBool);
239 vtkGetMacro(ComputePointNormals, vtkTypeBool);
240 vtkBooleanMacro(ComputePointNormals, vtkTypeBool);
242
244
247 vtkSetMacro(ComputeCellNormals, vtkTypeBool);
248 vtkGetMacro(ComputeCellNormals, vtkTypeBool);
249 vtkBooleanMacro(ComputeCellNormals, vtkTypeBool);
251
253
259 vtkSetMacro(FlipNormals, vtkTypeBool);
260 vtkGetMacro(FlipNormals, vtkTypeBool);
261 vtkBooleanMacro(FlipNormals, vtkTypeBool);
263
265
270 vtkSetMacro(NonManifoldTraversal, vtkTypeBool);
271 vtkGetMacro(NonManifoldTraversal, vtkTypeBool);
272 vtkBooleanMacro(NonManifoldTraversal, vtkTypeBool);
274
276
281 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
282 vtkGetMacro(OutputPointsPrecision, int);
284
285protected:
287 ~vtkPolyDataNormals() override = default;
288
289 // Usual data generation method
291
302
303private:
304 vtkIdList* Wave;
305 vtkIdList* Wave2;
306 vtkIdList* CellIds;
307 vtkIdList* CellPoints;
308 vtkIdList* NeighborPoints;
309 vtkIdList* Map;
310 vtkPolyData* OldMesh;
311 vtkPolyData* NewMesh;
312 int* Visited;
313 vtkFloatArray* PolyNormals;
314 double CosAngle;
315
316 // Uses the list of cell ids (this->Wave) to propagate a wave of
317 // checked and properly ordered polygons.
318 void TraverseAndOrder(void);
319
320 // Check the point id give to see whether it lies on a feature
321 // edge. If so, split the point (i.e., duplicate it) to topologically
322 // separate the mesh.
323 void MarkAndSplit(vtkIdType ptId);
324
325private:
326 vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
327 void operator=(const vtkPolyDataNormals&) = delete;
328};
329
330#endif
dynamic, self-adjusting array of float
list of point or cell ids
Definition: vtkIdList.h:140
a simple class to control print indentation
Definition: vtkIndent.h:113
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:195
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332