Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkPointsProjectedHull.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPointsProjectedHull.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00015 /*----------------------------------------------------------------------------
00016  Copyright (c) Sandia Corporation
00017  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00018 ----------------------------------------------------------------------------*/
00019 
00041 #ifndef __vtkPointsProjectedHull_h
00042 #define __vtkPointsProjectedHull_h
00043 
00044 #include "vtkPoints.h"
00045 
00046 class VTK_PARALLEL_EXPORT vtkPointsProjectedHull : public vtkPoints
00047 {
00048     vtkTypeRevisionMacro(vtkPointsProjectedHull, vtkPoints);
00049 
00050 public:
00051     void PrintSelf(ostream& os, vtkIndent indent);
00052 
00053     static vtkPointsProjectedHull *New();
00054 
00058     int rectangleIntersectionX(vtkPoints *R);
00059 
00063     int rectangleIntersectionX(float ymin, float ymax, float zmin, float zmax);
00064     int rectangleIntersectionX(double ymin, double ymax, double zmin, double zmax);
00065 
00068     int rectangleIntersectionY(vtkPoints *R);
00069 
00073     int rectangleIntersectionY(float zmin, float zmax, float xmin, float xmax);
00074     int rectangleIntersectionY(double zmin, double zmax, double xmin, double xmax);
00075 
00078     int rectangleIntersectionZ(vtkPoints *R);
00079 
00083     int rectangleIntersectionZ(float xmin, float xmax, float ymin, float ymax);
00084     int rectangleIntersectionZ(double xmin, double xmax, double ymin, double ymax);
00085 
00090     int GetCcwHullX(float *pts, int len);
00091     int GetCcwHullX(double *pts, int len);
00092 
00097     int GetCcwHullY(float *pts, int len);
00098     int GetCcwHullY(double *pts, int len);
00099 
00104     int GetCcwHullZ(float *pts, int len);
00105     int GetCcwHullZ(double *pts, int len);
00106 
00110     int GetSizeCcwHullX();
00111 
00115     int GetSizeCcwHullY();
00116 
00120     int GetSizeCcwHullZ();
00121 
00122     void Initialize();
00123     void Reset(){this->Initialize();}
00124 
00128     void Update();
00129 
00130 protected:
00131 
00132     vtkPointsProjectedHull();
00133     ~vtkPointsProjectedHull();
00134 
00135 private:
00136 
00137   int rectangleIntersection(double hmin, double hmax,
00138                             double vmin, double vmax, int direction);
00139   int grahamScanAlgorithm(int direction);
00140   void getPoints();
00141   int rectangleBoundingBoxIntersection(double hmin, double hmax,
00142                             double vmin, double vmax, int direction);
00143   int rectangleOutside(double hmin, double hmax,
00144                             double vmin, double vmax, int direction);
00145 
00146   int rectangleOutside1DPolygon(double hmin, double hmax,
00147                             double vmin, double vmax, int dir);
00148 
00149   void initFlags();
00150   void clearAllocations();
00151 
00152 
00153   static int removeExtras(double *pts, int n);
00154   static double distance(double *p1, double *p2);
00155   static int positionInHull(double *base, double *top, double *pt);
00156   static int outsideLine(double hmin, double hmax,
00157            double vmin, double vmax, double *p0, double *p1, double *insidePt);
00158   static int outsideHorizontalLine(double vmin, double vmax, 
00159            double *p0, double *p1, double *insidePt);
00160   static int outsideVerticalLine(double hmin, double hmax, double *p0, 
00161            double *p1, double *insidePt);
00162 
00163   double *Pts;
00164   int Npts;
00165   vtkTimeStamp PtsTime;
00166 
00167   double *ccwHull[3];
00168   float hullBBox[3][4];
00169   int hullSize[3];
00170   vtkTimeStamp hullTime[3];
00171 
00172   vtkPointsProjectedHull(const vtkPointsProjectedHull&); // Not implemented
00173   void operator=(const vtkPointsProjectedHull&); // Not implemented
00174 };
00175 #endif
00176 
00177