VTK
vtkConvexHull2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkConvexHull2D.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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  =========================================================================*/
15 
50 #ifndef __vtkConvexHull2D_h
51 #define __vtkConvexHull2D_h
52 
53 #include "vtkPolyDataAlgorithm.h"
54 #include "vtkSmartPointer.h" // needed for ivars
55 
56 class vtkCoordinate;
57 class vtkPoints;
58 class vtkPolygon;
59 class vtkPolyLine;
60 class vtkRenderer;
61 class vtkTransform;
63 
65 {
66 public:
67  static vtkConvexHull2D *New();
69  void PrintSelf(ostream& os, vtkIndent indent);
70 
72 
73  vtkGetMacro(ScaleFactor, double);
74  vtkSetMacro(ScaleFactor, double);
76 
78 
79  vtkGetMacro(Outline, bool);
80  vtkSetMacro(Outline, bool);
81  vtkBooleanMacro(Outline, bool);
83 
84  enum HullShapes {
85  BoundingRectangle = 0,
86  ConvexHull
87  };
88 
90 
91  vtkGetMacro(HullShape, int);
92  vtkSetClampMacro(HullShape, int, 0, 1);
94 
96 
98  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
99  vtkGetMacro(MinHullSizeInWorld, double);
101 
102 
104 
106  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
107  vtkGetMacro(MinHullSizeInDisplay, int);
109 
111 
113  void SetRenderer(vtkRenderer* renderer);
114  vtkRenderer* GetRenderer();
116 
118  virtual unsigned long GetMTime();
119 
121 
123  static void CalculateBoundingRectangle(vtkPoints* inPoints,
124  vtkPoints* outPoints, double minimumHullSize=1.0);
125  static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
126  double minimumHullSize=1.0);
128 
129 protected:
130  vtkConvexHull2D();
131  ~vtkConvexHull2D();
132 
134 
139 
140 private:
141  vtkConvexHull2D(const vtkConvexHull2D&); // Not implemented.
142  void operator=(const vtkConvexHull2D&); // Not implemented.
143 
144  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
145 
146  double ScaleFactor;
147  bool Outline;
148  int HullShape;
149  int MinHullSizeInDisplay;
150  double MinHullSizeInWorld;
151  vtkRenderer* Renderer;
152 
155  vtkSmartPointer<vtkTransform> OutputTransform;
156  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
157  vtkSmartPointer<vtkPolyLine> OutlineSource;
158  vtkSmartPointer<vtkPolygon> HullSource;
159 };
160 
161 #endif // __vtkConvexHull2D_h