VTK  9.0.1
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 "vtkPolyDataAlgorithm.h"
52 #include "vtkRenderingAnnotationModule.h" // For export macro
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 
88  {
89  BoundingRectangle = 0,
90  ConvexHull
91  };
92 
94 
97  vtkGetMacro(HullShape, int);
98  vtkSetClampMacro(HullShape, int, 0, 1);
100 
102 
106  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
107  vtkGetMacro(MinHullSizeInWorld, double);
109 
111 
115  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
116  vtkGetMacro(MinHullSizeInDisplay, int);
118 
120 
123  void SetRenderer(vtkRenderer* renderer);
126 
130  vtkMTimeType GetMTime() override;
131 
133 
137  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
138  static void CalculateConvexHull(
139  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
141 
142 protected:
144  ~vtkConvexHull2D() override;
145 
150 
151 private:
152  vtkConvexHull2D(const vtkConvexHull2D&) = delete;
153  void operator=(const vtkConvexHull2D&) = delete;
154 
155  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
156 
157  double ScaleFactor;
158  bool Outline;
159  int HullShape;
160  int MinHullSizeInDisplay;
161  double MinHullSizeInWorld;
162  vtkRenderer* Renderer;
163 
166  vtkSmartPointer<vtkTransform> OutputTransform;
167  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
168  vtkSmartPointer<vtkPolyLine> OutlineSource;
169  vtkSmartPointer<vtkPolygon> HullSource;
170 };
171 
172 #endif // vtkConvexHull2D_h
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
VTK_INT_MAX
#define VTK_INT_MAX
Definition: vtkType.h:155
vtkPolygon
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:40
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkSmartPointer< vtkCoordinate >
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
vtkX3D::Transform
@ Transform
Definition: vtkX3D.h:47
vtkConvexHull2D::HullShapes
HullShapes
Definition: vtkConvexHull2D.h:88
vtkPolyDataAlgorithm.h
vtkPolyLine
cell represents a set of 1D lines
Definition: vtkPolyLine.h:37
vtkConvexHull2D::SetRenderer
void SetRenderer(vtkRenderer *renderer)
Renderer needed for MinHullSizeInDisplay calculation.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkConvexHull2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSmartPointer.h
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:46
vtkConvexHull2D::vtkConvexHull2D
vtkConvexHull2D()
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkConvexHull2D::GetMTime
vtkMTimeType GetMTime() override
The modified time of this filter.
vtkConvexHull2D
Produce filled convex hulls around a set of points.
Definition: vtkConvexHull2D.h:64
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:59
vtkConvexHull2D::GetRenderer
vtkRenderer * GetRenderer()
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkConvexHull2D::~vtkConvexHull2D
~vtkConvexHull2D() override
vtkConvexHull2D::New
static vtkConvexHull2D * New()
VTK_DOUBLE_MAX
#define VTK_DOUBLE_MAX
Definition: vtkType.h:165
vtkConvexHull2D::CalculateBoundingRectangle
static void CalculateBoundingRectangle(vtkPoints *inPoints, vtkPoints *outPoints, double minimumHullSize=1.0)
Convenience methods to calculate a convex hull from a set of vtkPointS.
vtkConvexHull2D::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkX3D::Coordinate
@ Coordinate
Definition: vtkX3D.h:50
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkConvexHull2D::CalculateConvexHull
static void CalculateConvexHull(vtkPoints *inPoints, vtkPoints *outPoints, double minimumHullSize=1.0)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:42