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 
48 #ifndef vtkConvexHull2D_h
49 #define vtkConvexHull2D_h
50 
51 #include "vtkRenderingAnnotationModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 #include "vtkSmartPointer.h" // needed for ivars
54 
55 class vtkCoordinate;
56 class vtkPoints;
57 class vtkPolygon;
58 class vtkPolyLine;
59 class vtkRenderer;
60 class vtkTransform;
62 
63 class VTKRENDERINGANNOTATION_EXPORT vtkConvexHull2D: public vtkPolyDataAlgorithm
64 {
65 public:
66  static vtkConvexHull2D *New();
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
71 
74  vtkGetMacro(ScaleFactor, double);
75  vtkSetMacro(ScaleFactor, double);
77 
79 
82  vtkGetMacro(Outline, bool);
83  vtkSetMacro(Outline, bool);
84  vtkBooleanMacro(Outline, bool);
86 
87  enum HullShapes {
88  BoundingRectangle = 0,
89  ConvexHull
90  };
91 
93 
96  vtkGetMacro(HullShape, int);
97  vtkSetClampMacro(HullShape, int, 0, 1);
99 
101 
105  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
106  vtkGetMacro(MinHullSizeInWorld, double);
108 
109 
111 
115  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
116  vtkGetMacro(MinHullSizeInDisplay, int);
118 
120 
123  void SetRenderer(vtkRenderer* renderer);
124  vtkRenderer* GetRenderer();
126 
130  vtkMTimeType GetMTime() override;
131 
133 
136  static void CalculateBoundingRectangle(vtkPoints* inPoints,
137  vtkPoints* outPoints, double minimumHullSize=1.0);
138  static void CalculateConvexHull(vtkPoints* inPoints, vtkPoints* outPoints,
139  double minimumHullSize=1.0);
141 
142 protected:
143  vtkConvexHull2D();
144  ~vtkConvexHull2D() override;
145 
150  vtkInformationVector *) override;
151 
152 private:
153  vtkConvexHull2D(const vtkConvexHull2D&) = delete;
154  void operator=(const vtkConvexHull2D&) = delete;
155 
156  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
157 
158  double ScaleFactor;
159  bool Outline;
160  int HullShape;
161  int MinHullSizeInDisplay;
162  double MinHullSizeInWorld;
163  vtkRenderer* Renderer;
164 
167  vtkSmartPointer<vtkTransform> OutputTransform;
168  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
169  vtkSmartPointer<vtkPolyLine> OutlineSource;
170  vtkSmartPointer<vtkPolygon> HullSource;
171 };
172 
173 #endif // vtkConvexHull2D_h
#define VTK_DOUBLE_MAX
Definition: vtkType.h:167
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
#define VTK_INT_MAX
Definition: vtkType.h:157
abstract specification for renderers
Definition: vtkRenderer.h:57
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
static vtkPolyDataAlgorithm * New()
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkMTimeType GetMTime()
Return this object's modified time.
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:72
Store zero or more vtkInformation instances.
Produce filled convex hulls around a set of points.
represent and manipulate 3D points
Definition: vtkPoints.h:33
cell represents a set of 1D lines
Definition: vtkPolyLine.h:36
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Transform
Definition: ADIOSDefs.h:40