Drake Designer
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
vtkSurfaceFitter.h
Go to the documentation of this file.
1 #ifndef __vtkSurfaceFitter_h
2 #define __vtkSurfaceFitter_h
3 
4 #include <vtkPolyDataAlgorithm.h>
5 #include <vtkDRCFiltersModule.h>
6 
7 class vtkPlane;
8 class vtkRectd;
10 
11 class VTKDRCFILTERS_EXPORT vtkSurfaceFitter : public vtkPolyDataAlgorithm
12 {
13 public:
14  vtkTypeMacro(vtkSurfaceFitter, vtkPolyDataAlgorithm);
15  void PrintSelf(ostream& os, vtkIndent indent);
16 
17  static vtkSurfaceFitter *New();
18 
19  // Max average distance error from points to the plane estimate.
20  // Region growing will not add a point that increases the average
21  // error beyond this threshold.
22  vtkSetMacro(MaxError, double);
23  vtkGetMacro(MaxError, double);
24 
25  // Max angle error between a point normal and the estimated plane normal.
26  // Region growing will not add a point whose local normal is more than
27  // the max angle different from the estimated plane normal.
28  vtkSetMacro(MaxAngle, double);
29  vtkGetMacro(MaxAngle, double);
30 
31  // This controls the search distance for region growing from point to point.
32  vtkSetMacro(SearchRadius, double);
33  vtkGetMacro(SearchRadius, double);
34 
35  // Regions below this number of points will be dropped from the results list.
36  vtkSetMacro(MinimumNumberOfPoints, int);
37  vtkGetMacro(MinimumNumberOfPoints, int);
38 
39 
40  // Description:
41  // Access this object in order to set the normal estimation parameters
42  // of the robust normal estimator.
43  vtkGetObjectMacro(RobustNormalEstimator, vtkRobustNormalEstimator);
44 
45 
46  static void ComputePlane(vtkPolyData* polyData, vtkPlane* plane);
47  static void ComputeConvexHull(vtkPolyData* polyData, vtkPlane* plane, vtkPolyData* convexHull);
48  static void ComputeMinimumAreaRectangleFit(vtkPolyData* polyData, vtkPlane* plane, vtkRectd* rectangle);
49  static void ComputeKnownSizeRectangleFit(vtkPolyData* polyData, vtkPlane* plane, vtkRectd* rectangle);
50 
51 
52 protected:
53 
54  double MaxError;
55  double MaxAngle;
56  double SearchRadius;
59 
60  virtual int RequestData(vtkInformation *request,
61  vtkInformationVector **inputVector,
62  vtkInformationVector *outputVector);
63 
64 
66  virtual ~vtkSurfaceFitter();
67 
68 private:
69  vtkSurfaceFitter(const vtkSurfaceFitter&); // Not implemented.
70  void operator=(const vtkSurfaceFitter&); // Not implemented.
71 };
72 
73 #endif
vtkRobustNormalEstimator * RobustNormalEstimator
#define VTKDRCFILTERS_EXPORT