VTK  9.5.20251216
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
133
134#ifndef vtkPCANormalEstimation_h
135#define vtkPCANormalEstimation_h
136
137#include "vtkConvertToPointCloud.h" // For adding cells to output polydata
138#include "vtkFiltersPointsModule.h" // For export macro
139#include "vtkPolyDataAlgorithm.h"
140#include "vtkSmartPointer.h" // For vtkSmartPointer
141#include "vtkStaticPointLocator.h" // For default locator
142
143VTK_ABI_NAMESPACE_BEGIN
145class vtkIdList;
146struct vtkOrientNormalsWorker;
147
148class VTKFILTERSPOINTS_EXPORT vtkPCANormalEstimation : public vtkPolyDataAlgorithm
149{
150public:
152
158 void PrintSelf(ostream& os, vtkIndent indent) override;
160
164 typedef enum
165 {
166 KNN = 0,
168 } NeighborSearchMode;
169
171
185 vtkSetMacro(SearchMode, int);
186 vtkGetMacro(SearchMode, int);
190
192
198 vtkSetClampMacro(SampleSize, int, 1, VTK_INT_MAX);
199 vtkGetMacro(SampleSize, int);
201
203
209 vtkSetMacro(Radius, double);
210 vtkGetMacro(Radius, double);
212
216 enum Style
217 {
219 POINT = 1,
221 };
222
224
236 vtkSetMacro(NormalOrientation, int);
237 vtkGetMacro(NormalOrientation, int);
242
244
250 vtkSetVector3Macro(OrientationPoint, double);
251 vtkGetVectorMacro(OrientationPoint, double, 3);
253
255
258 vtkSetMacro(FlipNormals, bool);
259 vtkGetMacro(FlipNormals, bool);
260 vtkBooleanMacro(FlipNormals, bool);
262
264
270 vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
272
274
284 vtkSetMacro(CellGenerationMode, int);
285 vtkGetMacro(CellGenerationMode, int);
287
288protected:
291
292 // IVars
293 int SampleSize = 25;
294 double Radius = 0.; // Radius is not checked by default (in meter)
298 double OrientationPoint[3] = { 0. };
299 bool FlipNormals = false;
301
302 // Methods used to produce consistent normal orientations
303 template <typename TPointsRange>
305 TPointsRange& inPts, float* normals, char* pointMap, vtkIdList* wave, vtkIdList* wave2);
306
307 // Pipeline management
309 int FillInputPortInformation(int port, vtkInformation* info) override;
310
311private:
313 void operator=(const vtkPCANormalEstimation&) = delete;
314
316};
317
318VTK_ABI_NAMESPACE_END
319#endif
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
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
Fill the input port information objects for this algorithm.
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