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