VTK  9.1.0
vtkPointsProjectedHull.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPointsProjectedHull.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/*----------------------------------------------------------------------------
16 Copyright (c) Sandia Corporation
17 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
18----------------------------------------------------------------------------*/
19
41#ifndef vtkPointsProjectedHull_h
42#define vtkPointsProjectedHull_h
43
44#include "vtkCommonDataModelModule.h" // For export macro
45#include "vtkPoints.h"
46
47class VTKCOMMONDATAMODEL_EXPORT vtkPointsProjectedHull : public vtkPoints
48{
50
51public:
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
55
62
68 int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
69 int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
70
76
82 int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
83 int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
84
90
96 int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
97 int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
98
105 int GetCCWHullX(float* pts, int len);
106 int GetCCWHullX(double* pts, int len);
107
114 int GetCCWHullY(float* pts, int len);
115 int GetCCWHullY(double* pts, int len);
116
123 int GetCCWHullZ(float* pts, int len);
124 int GetCCWHullZ(double* pts, int len);
125
132
139
146
147 void Initialize() override;
148 void Reset() override { this->Initialize(); }
149
155 void Update();
156
157protected:
160
161private:
162 int RectangleIntersection(double hmin, double hmax, double vmin, double vmax, int direction);
163 int GrahamScanAlgorithm(int direction);
164 void GetPoints();
165 int RectangleBoundingBoxIntersection(
166 double hmin, double hmax, double vmin, double vmax, int direction);
167 int RectangleOutside(double hmin, double hmax, double vmin, double vmax, int direction);
168
169 int RectangleOutside1DPolygon(double hmin, double hmax, double vmin, double vmax, int dir);
170
171 void InitFlags();
172 void ClearAllocations();
173
174 static int RemoveExtras(double* pts, int n);
175 static double Distance(double* p1, double* p2);
176 static vtkIdType PositionInHull(double* base, double* top, double* pt);
177 static int OutsideLine(
178 double hmin, double hmax, double vmin, double vmax, double* p0, double* p1, double* insidePt);
179 static int OutsideHorizontalLine(
180 double vmin, double vmax, double* p0, double* p1, double* insidePt);
181 static int OutsideVerticalLine(
182 double hmin, double hmax, double* p0, double* p1, double* insidePt);
183
184 double* Pts;
185 vtkIdType Npts;
186 vtkTimeStamp PtsTime;
187
188 double* CCWHull[3];
189 float HullBBox[3][4];
190 int HullSize[3];
191 vtkTimeStamp HullTime[3];
192
194 void operator=(const vtkPointsProjectedHull&) = delete;
195};
196#endif
a simple class to control print indentation
Definition: vtkIndent.h:43
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
int GetSizeCCWHullY()
Returns the number of points in the convex hull of the projection of the points down the positive y-a...
int GetCCWHullY(double *pts, int len)
int GetCCWHullZ(double *pts, int len)
int RectangleIntersectionY(vtkPoints *R)
of the parallel projection along the Y axis of the points
int GetSizeCCWHullX()
Returns the number of points in the convex hull of the projection of the points down the positive x-a...
int RectangleIntersectionX(vtkPoints *R)
determine whether the resulting rectangle intersects the convex hull of the projection of the points ...
~vtkPointsProjectedHull() override
int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax)
the convex hull of the projection of the points along the positive X-axis.
int GetCCWHullZ(float *pts, int len)
Returns the coordinates (x, y) of the points in the convex hull of the projection of the points down ...
int GetCCWHullX(float *pts, int len)
Returns the coordinates (y,z) of the points in the convex hull of the projection of the points down t...
int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax)
int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax)
void Update()
Forces recalculation of convex hulls, use this if you delete/add points.
int GetCCWHullY(float *pts, int len)
Returns the coordinates (z, x) of the points in the convex hull of the projection of the points down ...
int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax)
the convex hull of the projection of the points along the positive Y-axis.
int GetSizeCCWHullZ()
Returns the number of points in the convex hull of the projection of the points down the positive z-a...
int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax)
the convex hull of the projection of the points along the positive Z-axis.
void Reset() override
Make object look empty but do not delete memory.
static vtkPointsProjectedHull * New()
int GetCCWHullX(double *pts, int len)
int RectangleIntersectionZ(vtkPoints *R)
of the parallel projection along the Z axis of the points
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void Initialize() override
Return object to instantiated state.
int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax)
represent and manipulate 3D points
Definition: vtkPoints.h:43
void GetPoints(vtkIdList *ptId, vtkPoints *outPoints)
Given a list of pt ids, return an array of points.
virtual void Initialize()
Return object to instantiated state.
record modification and/or execution time
Definition: vtkTimeStamp.h:42
@ top
Definition: vtkX3D.h:508
@ direction
Definition: vtkX3D.h:266
@ dir
Definition: vtkX3D.h:330
int vtkIdType
Definition: vtkType.h:332