VTK  9.3.0
vtkPolyDataNormals.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
56#ifndef vtkPolyDataNormals_h
57#define vtkPolyDataNormals_h
58
59#include "vtkFiltersCoreModule.h" // For export macro
61
62VTK_ABI_NAMESPACE_BEGIN
63class vtkFloatArray;
64class vtkIdList;
65class vtkPolyData;
66
67class VTKFILTERSCORE_EXPORT vtkPolyDataNormals : public vtkPolyDataAlgorithm
68{
69public:
71 void PrintSelf(ostream& os, vtkIndent indent) override;
72
79
81
86 vtkSetClampMacro(FeatureAngle, double, 0.0, 180.0);
87 vtkGetMacro(FeatureAngle, double);
89
91
94 vtkSetMacro(Splitting, vtkTypeBool);
95 vtkGetMacro(Splitting, vtkTypeBool);
96 vtkBooleanMacro(Splitting, vtkTypeBool);
98
100
103 vtkSetMacro(Consistency, vtkTypeBool);
104 vtkGetMacro(Consistency, vtkTypeBool);
105 vtkBooleanMacro(Consistency, vtkTypeBool);
107
109
120 vtkSetMacro(AutoOrientNormals, vtkTypeBool);
121 vtkGetMacro(AutoOrientNormals, vtkTypeBool);
122 vtkBooleanMacro(AutoOrientNormals, vtkTypeBool);
124
126
129 vtkSetMacro(ComputePointNormals, vtkTypeBool);
130 vtkGetMacro(ComputePointNormals, vtkTypeBool);
131 vtkBooleanMacro(ComputePointNormals, vtkTypeBool);
133
135
138 vtkSetMacro(ComputeCellNormals, vtkTypeBool);
139 vtkGetMacro(ComputeCellNormals, vtkTypeBool);
140 vtkBooleanMacro(ComputeCellNormals, vtkTypeBool);
142
144
150 vtkSetMacro(FlipNormals, vtkTypeBool);
151 vtkGetMacro(FlipNormals, vtkTypeBool);
152 vtkBooleanMacro(FlipNormals, vtkTypeBool);
154
156
161 vtkSetMacro(NonManifoldTraversal, vtkTypeBool);
162 vtkGetMacro(NonManifoldTraversal, vtkTypeBool);
163 vtkBooleanMacro(NonManifoldTraversal, vtkTypeBool);
165
167
172 vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
173 vtkGetMacro(OutputPointsPrecision, int);
175
176protected:
178 ~vtkPolyDataNormals() override = default;
179
180 // Usual data generation method
182
193
194private:
195 double CosAngle;
196
197 struct MarkAndSplitFunctor;
198
199 // Uses the list of cell ids (this->Wave) to propagate a wave of
200 // checked and properly ordered polygons.
201 void TraverseAndOrder(vtkPolyData* oldMesh, vtkPolyData* newMesh, vtkIdList* wave,
202 vtkIdList* wave2, vtkIdList* cellPointIds, vtkIdList* cellIds, vtkIdList* neighborPointIds,
203 std::vector<char>& visited, vtkIdType& numFlips);
204
205 // check all the points whether they lie on a feature
206 // edge. If so, split the point (i.e., duplicate it) to topologically
207 // separate the mesh.
208 void ExecuteMarkAndSplit(vtkPolyData* oldMesh, vtkPolyData* newMesh, vtkFloatArray* cellNormals,
209 vtkIdList* map, vtkIdType numPoints, vtkIdType numPolys, double cosAngle);
210
211 vtkPolyDataNormals(const vtkPolyDataNormals&) = delete;
212 void operator=(const vtkPolyDataNormals&) = delete;
213};
214
215VTK_ABI_NAMESPACE_END
216#endif
dynamic, self-adjusting array of float
list of point or cell ids
Definition vtkIdList.h:23
a simple class to control print indentation
Definition vtkIndent.h:29
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 ComputePointNormals
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:80
int vtkTypeBool
Definition vtkABI.h:64
int vtkIdType
Definition vtkType.h:315