VTK  9.3.20240329
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
46 
47 VTK_ABI_NAMESPACE_BEGIN
48 class vtkCoordinate;
49 class vtkPoints;
50 class vtkPolygon;
51 class vtkPolyLine;
52 class vtkRenderer;
53 class vtkTransform;
55 
56 class VTKRENDERINGANNOTATION_EXPORT VTK_MARSHALAUTO vtkConvexHull2D : public vtkPolyDataAlgorithm
57 {
58 public:
59  static vtkConvexHull2D* New();
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
67  vtkGetMacro(ScaleFactor, double);
68  vtkSetMacro(ScaleFactor, double);
70 
72 
75  vtkGetMacro(Outline, bool);
76  vtkSetMacro(Outline, bool);
77  vtkBooleanMacro(Outline, bool);
79 
81  {
82  BoundingRectangle = 0,
83  ConvexHull
84  };
85 
87 
90  vtkGetMacro(HullShape, int);
91  vtkSetClampMacro(HullShape, int, 0, 1);
93 
95 
99  vtkSetClampMacro(MinHullSizeInWorld, double, 0.0, VTK_DOUBLE_MAX);
100  vtkGetMacro(MinHullSizeInWorld, double);
102 
104 
108  vtkSetClampMacro(MinHullSizeInDisplay, int, 0, VTK_INT_MAX);
109  vtkGetMacro(MinHullSizeInDisplay, int);
111 
113 
116  void SetRenderer(vtkRenderer* renderer);
119 
123  vtkMTimeType GetMTime() override;
124 
126 
130  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
131  static void CalculateConvexHull(
132  vtkPoints* inPoints, vtkPoints* outPoints, double minimumHullSize = 1.0);
134 
135 protected:
137  ~vtkConvexHull2D() override;
138 
143 
144 private:
145  vtkConvexHull2D(const vtkConvexHull2D&) = delete;
146  void operator=(const vtkConvexHull2D&) = delete;
147 
148  void ResizeHullToMinimumInDisplay(vtkPolyData* hullPolyData);
149 
150  double ScaleFactor;
151  bool Outline;
152  int HullShape;
153  int MinHullSizeInDisplay;
154  double MinHullSizeInWorld;
155  vtkRenderer* Renderer;
156 
159  vtkSmartPointer<vtkTransform> OutputTransform;
160  vtkSmartPointer<vtkTransformPolyDataFilter> OutputTransformFilter;
161  vtkSmartPointer<vtkPolyLine> OutlineSource;
162  vtkSmartPointer<vtkPolygon> HullSource;
163 };
164 
165 VTK_ABI_NAMESPACE_END
166 #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
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
represent and manipulate 3D points
Definition: vtkPoints.h:139
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:181
cell represents a set of 1D lines
Definition: vtkPolyLine.h:139
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:132
abstract specification for renderers
Definition: vtkRenderer.h:172
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:160
@ 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
#define VTK_MARSHALAUTO