VTK
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 
32 #ifndef vtkPointsProjectedHull_h
33 #define vtkPointsProjectedHull_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkPoints.h"
37 
38 class VTKCOMMONDATAMODEL_EXPORT vtkPointsProjectedHull : public vtkPoints
39 {
41 
42 public:
43  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
44 
46 
53 
59  int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
60  int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
61 
67 
73  int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
74  int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
75 
81 
87  int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
88  int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
89 
96  int GetCCWHullX(float *pts, int len);
97  int GetCCWHullX(double *pts, int len);
98 
105  int GetCCWHullY(float *pts, int len);
106  int GetCCWHullY(double *pts, int len);
107 
114  int GetCCWHullZ(float *pts, int len);
115  int GetCCWHullZ(double *pts, int len);
116 
123 
130 
137 
138  void Initialize() VTK_OVERRIDE;
139  void Reset() VTK_OVERRIDE {this->Initialize();}
140 
146  void Update();
147 
148 protected:
149 
151  ~vtkPointsProjectedHull() VTK_OVERRIDE;
152 
153 private:
154 
155  int RectangleIntersection(double hmin, double hmax,
156  double vmin, double vmax, int direction);
157  int GrahamScanAlgorithm(int direction);
158  void GetPoints();
159  int RectangleBoundingBoxIntersection(double hmin, double hmax,
160  double vmin, double vmax, int direction);
161  int RectangleOutside(double hmin, double hmax,
162  double vmin, double vmax, int direction);
163 
164  int RectangleOutside1DPolygon(double hmin, double hmax,
165  double vmin, double vmax, int dir);
166 
167  void InitFlags();
168  void ClearAllocations();
169 
170 
171  static int RemoveExtras(double *pts, int n);
172  static double Distance(double *p1, double *p2);
173  static int PositionInHull(double *base, double *top, double *pt);
174  static int OutsideLine(double hmin, double hmax,
175  double vmin, double vmax, double *p0, double *p1, double *insidePt);
176  static int OutsideHorizontalLine(double vmin, double vmax,
177  double *p0, double *p1, double *insidePt);
178  static int OutsideVerticalLine(double hmin, double hmax, double *p0,
179  double *p1, double *insidePt);
180 
181  double *Pts;
182  int Npts;
183  vtkTimeStamp PtsTime;
184 
185  double *CCWHull[3];
186  float HullBBox[3][4];
187  int HullSize[3];
188  vtkTimeStamp HullTime[3];
189 
190  vtkPointsProjectedHull(const vtkPointsProjectedHull&) VTK_DELETE_FUNCTION;
191  void operator=(const vtkPointsProjectedHull&) VTK_DELETE_FUNCTION;
192 };
193 #endif
194 
195 
a simple class to control print indentation
Definition: vtkIndent.h:40
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)
static vtkPointsProjectedHull * New()
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.
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:40
virtual void Initialize()
Return object to instantiated state.
record modification and/or execution time
Definition: vtkTimeStamp.h:36
@ top
Definition: vtkX3D.h:502
@ direction
Definition: vtkX3D.h:260
@ dir
Definition: vtkX3D.h:324