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 
51 #ifndef vtkConvexHull2D_h
52 #define vtkConvexHull2D_h
53 
54 #include "vtkRenderingAnnotationModule.h" // For export macro
55 #include "vtkPolyDataAlgorithm.h"
56 #include "vtkSmartPointer.h" // needed for ivars
57 
58 class vtkCoordinate;
59 class vtkPoints;
60 class vtkPolygon;
61 class vtkPolyLine;
62 class vtkRenderer;
63 class vtkTransform;
65 
66 class VTKRENDERINGANNOTATION_EXPORT vtkConvexHull2D: public vtkPolyDataAlgorithm
67 {
68 public:
69  static vtkConvexHull2D *New();
71  void PrintSelf(ostream& os, vtkIndent indent);
72 
74 
77  vtkGetMacro(ScaleFactor, double);
78  vtkSetMacro(ScaleFactor, double);
80 
82 
85  vtkGetMacro(Outline, bool);
86  vtkSetMacro(Outline, bool);
87  vtkBooleanMacro(Outline, bool);
89 
90  enum HullShapes {
91  BoundingRectangle = 0,
92  ConvexHull
93  };
94 
96 
99  vtkGetMacro(HullShape, int);
100  vtkSetClampMacro(HullShape, int, 0, 1);
102 
104 
108  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
109  vtkGetMacro(MinHullSizeInWorld, double);
111 
112 
114 
118  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
119  vtkGetMacro(MinHullSizeInDisplay, int);
121 
123 
126  void SetRenderer(vtkRenderer* renderer);
127  vtkRenderer* GetRenderer();
129 
133  virtual vtkMTimeType GetMTime();
134 
136 
139  static void CalculateBoundingRectangle(vtkPoints* inPoints,
140  vtkPoints* outPoints, double minimumHullSize=1.0);
141  static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
142  double minimumHullSize=1.0);
144 
145 protected:
146  vtkConvexHull2D();
147  ~vtkConvexHull2D();
148 
154 
155 private:
156  vtkConvexHull2D(const vtkConvexHull2D&) VTK_DELETE_FUNCTION;
157  void operator=(const vtkConvexHull2D&) VTK_DELETE_FUNCTION;
158 
159  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
160 
161  double ScaleFactor;
162  bool Outline;
163  int HullShape;
164  int MinHullSizeInDisplay;
165  double MinHullSizeInWorld;
166  vtkRenderer* Renderer;
167 
170  vtkSmartPointer<vtkTransform> OutputTransform;
171  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
172  vtkSmartPointer<vtkPolyLine> OutlineSource;
173  vtkSmartPointer<vtkPolygon> HullSource;
174 };
175 
176 #endif // vtkConvexHull2D_h
#define VTK_DOUBLE_MAX
Definition: vtkType.h:163
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:153
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:60
Hold a reference to a vtkObjectBase instance.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkMTimeType GetMTime()
Return this object's modified time.
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:45
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:70
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Produce filled convex hulls around a set of points.
represent and manipulate 3D points
Definition: vtkPoints.h:39
cell represents a set of 1D lines
Definition: vtkPolyLine.h:42
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Transform
Definition: ADIOSDefs.h:39