VTK  9.3.0
vtkConvexHull2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
39 #ifndef vtkConvexHull2D_h
40 #define vtkConvexHull2D_h
41 
42 #include "vtkPolyDataAlgorithm.h"
43 #include "vtkRenderingAnnotationModule.h" // For export macro
44 #include "vtkSmartPointer.h" // needed for ivars
45 
46 VTK_ABI_NAMESPACE_BEGIN
47 class vtkCoordinate;
48 class vtkPoints;
49 class vtkPolygon;
50 class vtkPolyLine;
51 class vtkRenderer;
52 class vtkTransform;
54 
55 class VTKRENDERINGANNOTATION_EXPORT vtkConvexHull2D : public vtkPolyDataAlgorithm
56 {
57 public:
58  static vtkConvexHull2D* New();
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
66  vtkGetMacro(ScaleFactor, double);
67  vtkSetMacro(ScaleFactor, double);
69 
71 
74  vtkGetMacro(Outline, bool);
75  vtkSetMacro(Outline, bool);
76  vtkBooleanMacro(Outline, bool);
78 
80  {
81  BoundingRectangle = 0,
82  ConvexHull
83  };
84 
86 
89  vtkGetMacro(HullShape, int);
90  vtkSetClampMacro(HullShape, int, 0, 1);
92 
94 
98  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
99  vtkGetMacro(MinHullSizeInWorld, double);
101 
103 
107  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
108  vtkGetMacro(MinHullSizeInDisplay, int);
110 
112 
115  void SetRenderer(vtkRenderer* renderer);
118 
122  vtkMTimeType GetMTime() override;
123 
125 
129  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
130  static void CalculateConvexHull(
131  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
133 
134 protected:
136  ~vtkConvexHull2D() override;
137 
142 
143 private:
144  vtkConvexHull2D(const vtkConvexHull2D&) = delete;
145  void operator=(const vtkConvexHull2D&) = delete;
146 
147  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
148 
149  double ScaleFactor;
150  bool Outline;
151  int HullShape;
152  int MinHullSizeInDisplay;
153  double MinHullSizeInWorld;
154  vtkRenderer* Renderer;
155 
158  vtkSmartPointer<vtkTransform> OutputTransform;
159  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
160  vtkSmartPointer<vtkPolyLine> OutlineSource;
161  vtkSmartPointer<vtkPolygon> HullSource;
162 };
163 
164 VTK_ABI_NAMESPACE_END
165 #endif // vtkConvexHull2D_h
Produce filled convex hulls around a set of points.
vtkRenderer * GetRenderer()
Renderer needed for MinHullSizeInDisplay calculation.
~vtkConvexHull2D() override
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
static void CalculateBoundingRectangle(vtkPoints *inPoints, vtkPoints *outPoints, double minimumHullSize=1.0)
Convenience methods to calculate a convex hull from a set of vtkPointS.
void SetRenderer(vtkRenderer *renderer)
Renderer needed for MinHullSizeInDisplay calculation.
static vtkConvexHull2D * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void CalculateConvexHull(vtkPoints *inPoints, vtkPoints *outPoints, double minimumHullSize=1.0)
Convenience methods to calculate a convex hull from a set of vtkPointS.
vtkMTimeType GetMTime() override
The modified time of this filter.
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:78
a simple class to control print indentation
Definition: vtkIndent.h:38
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:38
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
cell represents a set of 1D lines
Definition: vtkPolyLine.h:39
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:41
abstract specification for renderers
Definition: vtkRenderer.h:71
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
@ Coordinate
Definition: vtkX3D.h:44
@ Transform
Definition: vtkX3D.h:41
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
#define VTK_DOUBLE_MAX
Definition: vtkType.h:154
#define VTK_INT_MAX
Definition: vtkType.h:144