VTK  9.5.2
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;
77
78class VTKFILTERSPOINTS_EXPORT vtkPCANormalEstimation : public vtkPolyDataAlgorithm
79{
80public:
82
88 void PrintSelf(ostream& os, vtkIndent indent) override;
90
94 typedef enum
95 {
96 KNN = 0,
98 } NeighborSearchMode;
99
101
115 vtkSetMacro(SearchMode, int);
116 vtkGetMacro(SearchMode, int);
120
122
128 vtkSetClampMacro(SampleSize, int, 1, VTK_INT_MAX);
129 vtkGetMacro(SampleSize, int);
131
133
139 vtkSetMacro(Radius, double);
140 vtkGetMacro(Radius, double);
142
146 enum Style
147 {
149 POINT = 1,
151 };
152
154
166 vtkSetMacro(NormalOrientation, int);
167 vtkGetMacro(NormalOrientation, int);
172
174
180 vtkSetVector3Macro(OrientationPoint, double);
181 vtkGetVectorMacro(OrientationPoint, double, 3);
183
185
188 vtkSetMacro(FlipNormals, bool);
189 vtkGetMacro(FlipNormals, bool);
190 vtkBooleanMacro(FlipNormals, bool);
192
194
200 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
202
204
214 vtkSetMacro(CellGenerationMode, int);
215 vtkGetMacro(CellGenerationMode, int);
217
218protected:
221
222 // IVars
223 int SampleSize = 25;
224 double Radius = 0.; // Radius is not checked by default (in meter)
228 double OrientationPoint[3] = { 0. };
229 bool FlipNormals = false;
231
232 // Methods used to produce consistent normal orientations
234 vtkPoints* inPts, float* normals, char* pointMap, vtkIdList* wave, vtkIdList* wave2);
235
236 // Pipeline management
238 int FillInputPortInformation(int port, vtkInformation* info) override;
239
240private:
242 void operator=(const vtkPCANormalEstimation&) = delete;
243};
244
245VTK_ABI_NAMESPACE_END
246#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 SetNormalOrientationToPoint()
Configure how the filter addresses consistency in normal oreientation.
void TraverseAndFlip(vtkPoints *inPts, float *normals, char *pointMap, vtkIdList *wave, vtkIdList *wave2)
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.
represent and manipulate 3D points
Definition vtkPoints.h:30
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:161