VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkInfovisCoreModule.h" // For export macro
54 #include "vtkPolyDataAlgorithm.h"
55 #include "vtkSmartPointer.h" // needed for ivars
56 
57 class vtkCoordinate;
58 class vtkPoints;
59 class vtkPolygon;
60 class vtkPolyLine;
61 class vtkRenderer;
62 class vtkTransform;
64 
65 class VTKINFOVISCORE_EXPORT vtkConvexHull2D: public vtkPolyDataAlgorithm
66 {
67 public:
68  static vtkConvexHull2D *New();
69  vtkTypeMacro(vtkConvexHull2D, vtkPolyDataAlgorithm);
70  void PrintSelf(ostream& os, vtkIndent indent);
71 
73 
74  vtkGetMacro(ScaleFactor, double);
75  vtkSetMacro(ScaleFactor, double);
77 
79 
80  vtkGetMacro(Outline, bool);
81  vtkSetMacro(Outline, bool);
82  vtkBooleanMacro(Outline, bool);
84 
85  enum HullShapes {
86  BoundingRectangle = 0,
87  ConvexHull
88  };
89 
91 
92  vtkGetMacro(HullShape, int);
93  vtkSetClampMacro(HullShape, int, 0, 1);
95 
97 
99  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
100  vtkGetMacro(MinHullSizeInWorld, double);
102 
103 
105 
107  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
108  vtkGetMacro(MinHullSizeInDisplay, int);
110 
112 
114  void SetRenderer(vtkRenderer* renderer);
115  vtkRenderer* GetRenderer();
117 
119  virtual unsigned long GetMTime();
120 
122 
124  static void CalculateBoundingRectangle(vtkPoints* inPoints,
125  vtkPoints* outPoints, double minimumHullSize=1.0);
126  static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
127  double minimumHullSize=1.0);
129 
130 protected:
131  vtkConvexHull2D();
132  ~vtkConvexHull2D();
133 
135 
137  int RequestData(vtkInformation *, vtkInformationVector **,
138  vtkInformationVector *);
140 
141 private:
142  vtkConvexHull2D(const vtkConvexHull2D&); // Not implemented.
143  void operator=(const vtkConvexHull2D&); // Not implemented.
144 
145  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
146 
147  double ScaleFactor;
148  bool Outline;
149  int HullShape;
150  int MinHullSizeInDisplay;
151  double MinHullSizeInWorld;
152  vtkRenderer* Renderer;
153 
154  vtkSmartPointer<vtkCoordinate> Coordinate;
155  vtkSmartPointer<vtkTransform> Transform;
156  vtkSmartPointer<vtkTransform> OutputTransform;
157  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
158  vtkSmartPointer<vtkPolyLine> OutlineSource;
159  vtkSmartPointer<vtkPolygon> HullSource;
160 };
161 
162 #endif // __vtkConvexHull2D_h
transform points and associated normals and vectors for polygonal dataset
Produce filled convex hulls around a set of points.