VTK
vtkPlanesIntersection.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPlanesIntersection.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 
41 #ifndef __vtkPlanesIntersection_h
42 #define __vtkPlanesIntersection_h
43 
44 #include "vtkPlanes.h"
45 
46 class vtkPoints;
48 class vtkCell;
49 
51 {
52  vtkTypeMacro(vtkPlanesIntersection, vtkPlanes);
53 
54 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
57  static vtkPlanesIntersection *New();
58 
62  void SetRegionVertices(vtkPoints *pts);
63  void SetRegionVertices(double *v, int nvertices);
64  int GetNumRegionVertices();
65  int GetRegionVertices(double *v, int nvertices);
66 
70  int IntersectsRegion(vtkPoints *R);
71 
76  static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts);
77 
83  static vtkPlanesIntersection *Convert3DCell(vtkCell *cell);
84 
85 protected:
86 
87  static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3]);
88  static double EvaluatePlaneEquation(double *x, double *p);
89  static void PlaneEquation(double *n, double *x, double *p);
90  static int GoodNormal(double *n);
91  static int Invert3x3(double M[3][3]);
92 
95 
96 private:
97 
98  int IntersectsBoundingBox(vtkPoints *R);
99  int EnclosesBoundingBox(vtkPoints *R);
100  int EvaluateFacePlane(int plane, vtkPoints *R);
101  int IntersectsProjection(vtkPoints *R, int direction);
102 
103  void SetPlaneEquations();
104  void ComputeRegionVertices();
105 
106  void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
107  int duplicate(double testv[3]) const;
108  void planesRHS(int p1, int p2, int p3, double r[3]) const;
109  int outsideRegion(double v[3]) ;
110 
111  // plane equations
112  double *Plane;
113 
114  // vertices of convex regions enclosed by the planes, also
115  // the ccw hull of that region projected in 3 orthog. directions
116  vtkPointsProjectedHull *regionPts;
117 
118  vtkPlanesIntersection(const vtkPlanesIntersection&); // Not implemented
119  void operator=(const vtkPlanesIntersection&); // Not implemented
120 };
121 #endif
122 
123 
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_FILTERING_EXPORT
static vtkPlanes * New()
vtkPlane * Plane
Definition: vtkPlanes.h:115
implicit function for convex set of planes
Definition: vtkPlanes.h:52
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
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