00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00041 #ifndef __vtkPlanesIntersection_h
00042 #define __vtkPlanesIntersection_h
00043
00044 #include "vtkPlanes.h"
00045
00046 class vtkPoints;
00047 class vtkRenderer;
00048 class vtkPointsProjectedHull;
00049 class vtkCell;
00050
00051 class VTK_GRAPHICS_EXPORT vtkPlanesIntersection : public vtkPlanes
00052 {
00053 vtkTypeRevisionMacro(vtkPlanesIntersection, vtkPlanes);
00054
00055 public:
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00058 static vtkPlanesIntersection *New();
00059
00063 void SetRegionVertices(vtkPoints *pts);
00064 void SetRegionVertices(double *v, int nvertices);
00065 int GetNumRegionVertices();
00066 int GetRegionVertices(double *v, int nvertices);
00067
00071 int IntersectsRegion(vtkPoints *R);
00072
00077 static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts);
00078
00084 static vtkPlanesIntersection *Convert3DCell(vtkCell *cell);
00085
00086 protected:
00087
00088 static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3]);
00089 static double EvaluatePlaneEquation(double *x, double *p);
00090 static void PlaneEquation(double *n, double *x, double *p);
00091 static int GoodNormal(double *n);
00092 static int Invert3x3(double M[3][3]);
00093
00094 vtkPlanesIntersection();
00095 ~vtkPlanesIntersection();
00096
00097 private:
00098
00099 int IntersectsBoundingBox(vtkPoints *R);
00100 int EnclosesBoundingBox(vtkPoints *R);
00101 int EvaluateFacePlane(int plane, vtkPoints *R);
00102 int IntersectsProjection(vtkPoints *R, int direction);
00103
00104 void SetPlaneEquations();
00105 void ComputeRegionVertices();
00106
00107 void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
00108 int duplicate(double testv[3]) const;
00109 void planesRHS(int p1, int p2, int p3, double r[3]) const;
00110 int outsideRegion(double v[3]) ;
00111
00112
00113 double *Plane;
00114
00115
00116
00117 vtkPointsProjectedHull *regionPts;
00118
00119 vtkPlanesIntersection(const vtkPlanesIntersection&);
00120 void operator=(const vtkPlanesIntersection&);
00121 };
00122 #endif
00123
00124