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 "vtkRenderingAnnotationModule.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 
66 {
67 public:
68  static vtkConvexHull2D *New();
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 
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 
156  vtkSmartPointer<vtkTransform> OutputTransform;
157  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
158  vtkSmartPointer<vtkPolyLine> OutlineSource;
159  vtkSmartPointer<vtkPolygon> HullSource;
160 };
161 
162 #endif // vtkConvexHull2D_h
#define VTK_DOUBLE_MAX
Definition: vtkType.h:142
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTK_INT_MAX
Definition: vtkType.h:132
abstract specification for renderers
Definition: vtkRenderer.h:63
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
#define VTKRENDERINGANNOTATION_EXPORT
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
Store zero or more vtkInformation instances.
Produce filled convex hulls around a set of points.
represent and manipulate 3D points
Definition: vtkPoints.h:38
cell represents a set of 1D lines
Definition: vtkPolyLine.h:41