VTK  9.6.1
vtkPCANormalEstimation.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
64
65#ifndef vtkPCANormalEstimation_h
66#define vtkPCANormalEstimation_h
67
68#include "vtkConvertToPointCloud.h" // For adding cells to output polydata
69#include "vtkFiltersPointsModule.h" // For export macro
71#include "vtkSmartPointer.h" // For vtkSmartPointer
72#include "vtkStaticPointLocator.h" // For default locator
73
74VTK_ABI_NAMESPACE_BEGIN
76class vtkIdList;
77struct vtkOrientNormalsWorker;
78
79class VTKFILTERSPOINTS_EXPORT vtkPCANormalEstimation : public vtkPolyDataAlgorithm
80{
81public:
83
89 void PrintSelf(ostream& os, vtkIndent indent) override;
91
95 typedef enum
96 {
97 KNN = 0,
99 } NeighborSearchMode;
100
102
116 vtkSetMacro(SearchMode, int);
117 vtkGetMacro(SearchMode, int);
121
123
129 vtkSetClampMacro(SampleSize, int, 1, VTK_INT_MAX);
130 vtkGetMacro(SampleSize, int);
132
134
140 vtkSetMacro(Radius, double);
141 vtkGetMacro(Radius, double);
143
147 enum Style
148 {
150 POINT = 1,
152 };
153
155
167 vtkSetMacro(NormalOrientation, int);
168 vtkGetMacro(NormalOrientation, int);
173
175
181 vtkSetVector3Macro(OrientationPoint, double);
182 vtkGetVectorMacro(OrientationPoint, double, 3);
184
186
189 vtkSetMacro(FlipNormals, bool);
190 vtkGetMacro(FlipNormals, bool);
191 vtkBooleanMacro(FlipNormals, bool);
193
195
201 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
203
205
215 vtkSetMacro(CellGenerationMode, int);
216 vtkGetMacro(CellGenerationMode, int);
218
219protected:
222
223 // IVars
224 int SampleSize = 25;
225 double Radius = 0.; // Radius is not checked by default (in meter)
229 double OrientationPoint[3] = { 0. };
230 bool FlipNormals = false;
232
233 // Methods used to produce consistent normal orientations
234 template <typename TPointsRange>
236 TPointsRange& inPts, float* normals, char* pointMap, vtkIdList* wave, vtkIdList* wave2);
237
238 // Pipeline management
240 int FillInputPortInformation(int port, vtkInformation* info) override;
241
242private:
244 void operator=(const vtkPCANormalEstimation&) = delete;
245
247};
248
249VTK_ABI_NAMESPACE_END
250#endif
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition vtkIdList.h:24
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
vtkSmartPointer< vtkAbstractPointLocator > Locator
void SetSearchModeToRadius()
Configure how the filter selects the neighbor points used to calculate the PCA.
void SetLocator(vtkAbstractPointLocator *locator)
Specify a point locator.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiating, obtaining type information, and printing information.
virtual void SetSearchMode(int)
Configure how the filter selects the neighbor points used to calculate the PCA.
~vtkPCANormalEstimation() override
void TraverseAndFlip(TPointsRange &inPts, float *normals, char *pointMap, vtkIdList *wave, vtkIdList *wave2)
void SetNormalOrientationToPoint()
Configure how the filter addresses consistency in normal oreientation.
void SetNormalOrientationToAsComputed()
Configure how the filter addresses consistency in normal oreientation.
vtkPCANormalEstimation()=default
void SetSearchModeToKNN()
Configure how the filter selects the neighbor points used to calculate the PCA.
virtual void SetNormalOrientation(int)
Configure how the filter addresses consistency in normal oreientation.
static vtkPCANormalEstimation * New()
Standard methods for instantiating, obtaining type information, and printing information.
Style
This enum is used to control how normals oriented is controlled.
int FillInputPortInformation(int port, vtkInformation *info) override
void SetNormalOrientationToGraphTraversal()
Configure how the filter addresses consistency in normal oreientation.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
Hold a reference to a vtkObjectBase instance.
static vtkStaticPointLocator * New()
Construct with automatic computation of divisions, averaging 5 points per bucket.
#define VTK_INT_MAX
Definition vtkType.h:197