VTK  9.3.1
vtkPointsProjectedHull.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 
17 #ifndef vtkPointsProjectedHull_h
18 #define vtkPointsProjectedHull_h
19 
20 #include "vtkCommonDataModelModule.h" // For export macro
21 #include "vtkPoints.h"
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class VTKCOMMONDATAMODEL_EXPORT vtkPointsProjectedHull : public vtkPoints
25 {
26  vtkTypeMacro(vtkPointsProjectedHull, vtkPoints);
27 
28 public:
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
31  static vtkPointsProjectedHull* New();
32 
38  int RectangleIntersectionX(vtkPoints* R);
39 
45  int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
46  int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
47 
52  int RectangleIntersectionY(vtkPoints* R);
53 
59  int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
60  int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
61 
66  int RectangleIntersectionZ(vtkPoints* R);
67 
73  int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
74  int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
75 
82  int GetCCWHullX(float* pts, int len);
83  int GetCCWHullX(double* pts, int len);
84 
91  int GetCCWHullY(float* pts, int len);
92  int GetCCWHullY(double* pts, int len);
93 
100  int GetCCWHullZ(float* pts, int len);
101  int GetCCWHullZ(double* pts, int len);
102 
108  int GetSizeCCWHullX();
109 
115  int GetSizeCCWHullY();
116 
122  int GetSizeCCWHullZ();
123 
124  void Initialize() override;
125  void Reset() override { this->Initialize(); }
126 
132  void Update();
133 
134 protected:
136  ~vtkPointsProjectedHull() override;
137 
138 private:
139  int RectangleIntersection(double hmin, double hmax, double vmin, double vmax, int direction);
140  int GrahamScanAlgorithm(int direction);
141  void GetPoints();
142  int RectangleBoundingBoxIntersection(
143  double hmin, double hmax, double vmin, double vmax, int direction);
144  int RectangleOutside(double hmin, double hmax, double vmin, double vmax, int direction);
145 
146  int RectangleOutside1DPolygon(double hmin, double hmax, double vmin, double vmax, int dir);
147 
148  void InitFlags();
149  void ClearAllocations();
150 
151  static int RemoveExtras(double* pts, int n);
152  static double Distance(double* p1, double* p2);
153  static vtkIdType PositionInHull(double* base, double* top, double* pt);
154  static int OutsideLine(
155  double hmin, double hmax, double vmin, double vmax, double* p0, double* p1, double* insidePt);
156  static int OutsideHorizontalLine(
157  double vmin, double vmax, double* p0, double* p1, double* insidePt);
158  static int OutsideVerticalLine(
159  double hmin, double hmax, double* p0, double* p1, double* insidePt);
160 
161  double* Pts;
162  vtkIdType Npts;
163  vtkTimeStamp PtsTime;
164 
165  double* CCWHull[3];
166  float HullBBox[3][4];
167  int HullSize[3];
168  vtkTimeStamp HullTime[3];
169 
171  void operator=(const vtkPointsProjectedHull&) = delete;
172 };
173 VTK_ABI_NAMESPACE_END
174 #endif
static vtkPoints * New()
virtual void Initialize()
Return object to instantiated state.
record modification and/or execution time
Definition: vtkTimeStamp.h:24
int vtkIdType
Definition: vtkType.h:315
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void GetPoints(vtkIdList *ptId, vtkPoints *outPoints)
Given a list of pt ids, return an array of points.
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions ...
void Reset() override
Make object look empty but do not delete memory.
represent and manipulate 3D points
Definition: vtkPoints.h:28