VTK  9.0.1
vtkPCANormalEstimation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPCANormalEstimation.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See LICENSE file 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 =========================================================================*/
55 #ifndef vtkPCANormalEstimation_h
56 #define vtkPCANormalEstimation_h
57 
58 #include "vtkFiltersPointsModule.h" // For export macro
59 #include "vtkPolyDataAlgorithm.h"
60 
62 class vtkIdList;
63 
64 class VTKFILTERSPOINTS_EXPORT vtkPCANormalEstimation : public vtkPolyDataAlgorithm
65 {
66 public:
68 
72  static vtkPCANormalEstimation* New();
74  void PrintSelf(ostream& os, vtkIndent indent) override;
76 
78 
84  vtkSetClampMacro(SampleSize, int, 1, VTK_INT_MAX);
85  vtkGetMacro(SampleSize, int);
87 
91  enum Style
92  {
93  AS_COMPUTED = 0,
94  POINT = 1,
95  GRAPH_TRAVERSAL = 3
96  };
97 
99 
111  vtkSetMacro(NormalOrientation, int);
112  vtkGetMacro(NormalOrientation, int);
113  void SetNormalOrientationToAsComputed() { this->SetNormalOrientation(AS_COMPUTED); }
114  void SetNormalOrientationToPoint() { this->SetNormalOrientation(POINT); }
115  void SetNormalOrientationToGraphTraversal() { this->SetNormalOrientation(GRAPH_TRAVERSAL); }
117 
119 
125  vtkSetVector3Macro(OrientationPoint, double);
126  vtkGetVectorMacro(OrientationPoint, double, 3);
128 
130 
133  vtkSetMacro(FlipNormals, bool);
134  vtkGetMacro(FlipNormals, bool);
135  vtkBooleanMacro(FlipNormals, bool);
137 
139 
144  void SetLocator(vtkAbstractPointLocator* locator);
145  vtkGetObjectMacro(Locator, vtkAbstractPointLocator);
147 
148 protected:
150  ~vtkPCANormalEstimation() override;
151 
152  // IVars
156  double OrientationPoint[3];
158 
159  // Methods used to produce consistent normal orientations
160  void TraverseAndFlip(
161  vtkPoints* inPts, float* normals, char* pointMap, vtkIdList* wave, vtkIdList* wave2);
162 
163  // Pipeline management
165  int FillInputPortInformation(int port, vtkInformation* info) override;
166 
167 private:
169  void operator=(const vtkPCANormalEstimation&) = delete;
170 };
171 
172 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:155
void SetNormalOrientationToPoint()
Configure how the filter addresses consistency in normal oreientation.
static vtkPolyDataAlgorithm * New()
void SetNormalOrientationToGraphTraversal()
Configure how the filter addresses consistency in normal oreientation.
Superclass for algorithms that produce only polydata as output.
generate point normals using local tangent planes
a simple class to control print indentation
Definition: vtkIndent.h:33
abstract class to quickly locate points in 3-space
list of point or cell ids
Definition: vtkIdList.h:30
void SetNormalOrientationToAsComputed()
Configure how the filter addresses consistency in normal oreientation.
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.
Store zero or more vtkInformation instances.
vtkAbstractPointLocator * Locator
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.