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 
31 #ifndef vtkPointsProjectedHull_h
32 #define vtkPointsProjectedHull_h
33 
34 #include "vtkCommonDataModelModule.h" // For export macro
35 #include "vtkPoints.h"
36 
38 {
39  vtkTypeMacro(vtkPointsProjectedHull, vtkPoints);
40 
41 public:
42  void PrintSelf(ostream& os, vtkIndent indent);
43 
44  static vtkPointsProjectedHull *New();
45 
49  int RectangleIntersectionX(vtkPoints *R);
50 
54  int RectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
55  int RectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
56 
59  int RectangleIntersectionY(vtkPoints *R);
60 
64  int RectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
65  int RectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
66 
69  int RectangleIntersectionZ(vtkPoints *R);
70 
74  int RectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
75  int RectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
76 
81  int GetCCWHullX(float *pts, int len);
82  int GetCCWHullX(double *pts, int len);
83 
88  int GetCCWHullY(float *pts, int len);
89  int GetCCWHullY(double *pts, int len);
90 
95  int GetCCWHullZ(float *pts, int len);
96  int GetCCWHullZ(double *pts, int len);
97 
101  int GetSizeCCWHullX();
102 
106  int GetSizeCCWHullY();
107 
111  int GetSizeCCWHullZ();
112 
113  void Initialize();
114  void Reset(){this->Initialize();}
115 
119  void Update();
120 
121 protected:
122 
125 
126 private:
127 
128  int RectangleIntersection(double hmin, double hmax,
129  double vmin, double vmax, int direction);
130  int GrahamScanAlgorithm(int direction);
131  void GetPoints();
132  int RectangleBoundingBoxIntersection(double hmin, double hmax,
133  double vmin, double vmax, int direction);
134  int RectangleOutside(double hmin, double hmax,
135  double vmin, double vmax, int direction);
136 
137  int RectangleOutside1DPolygon(double hmin, double hmax,
138  double vmin, double vmax, int dir);
139 
140  void InitFlags();
141  void ClearAllocations();
142 
143 
144  static int RemoveExtras(double *pts, int n);
145  static double Distance(double *p1, double *p2);
146  static int PositionInHull(double *base, double *top, double *pt);
147  static int OutsideLine(double hmin, double hmax,
148  double vmin, double vmax, double *p0, double *p1, double *insidePt);
149  static int OutsideHorizontalLine(double vmin, double vmax,
150  double *p0, double *p1, double *insidePt);
151  static int OutsideVerticalLine(double hmin, double hmax, double *p0,
152  double *p1, double *insidePt);
153 
154  double *Pts;
155  int Npts;
156  vtkTimeStamp PtsTime;
157 
158  double *CCWHull[3];
159  float HullBBox[3][4];
160  int HullSize[3];
161  vtkTimeStamp HullTime[3];
162 
163  vtkPointsProjectedHull(const vtkPointsProjectedHull&); // Not implemented
164  void operator=(const vtkPointsProjectedHull&); // Not implemented
165 };
166 #endif
167 
168 
void GetPoints(vtkIdList *ptId, vtkPoints *fp)
static vtkPoints * New()
virtual void Initialize()
record modification and/or execution time
Definition: vtkTimeStamp.h:34
virtual void Update()
a simple class to control print indentation
Definition: vtkIndent.h:38
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions ...
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38
void PrintSelf(ostream &os, vtkIndent indent)