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 "vtkCommonDataModelModule.h" // For export macro
45 #include "vtkPlanes.h"
46 
47 class vtkPoints;
49 class vtkCell;
50 
52 {
54 
55 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
59 
64  void SetRegionVertices(double *v, int nvertices);
66  int GetRegionVertices(double *v, int nvertices);
67 
72 
77  static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts);
78 
85 
86 protected:
87 
88  static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3]);
89  static double EvaluatePlaneEquation(double *x, double *p);
90  static void PlaneEquation(double *n, double *x, double *p);
91  static int GoodNormal(double *n);
92  static int Invert3x3(double M[3][3]);
93 
96 
97 private:
98 
99  int IntersectsBoundingBox(vtkPoints *R);
100  int EnclosesBoundingBox(vtkPoints *R);
101  int EvaluateFacePlane(int plane, vtkPoints *R);
102  int IntersectsProjection(vtkPoints *R, int direction);
103 
104  void SetPlaneEquations();
105  void ComputeRegionVertices();
106 
107  void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
108  int duplicate(double testv[3]) const;
109  void planesRHS(int p1, int p2, int p3, double r[3]) const;
110  int outsideRegion(double v[3]) ;
111 
112  // plane equations
113  double *Plane;
114 
115  // vertices of convex regions enclosed by the planes, also
116  // the ccw hull of that region projected in 3 orthog. directions
117  vtkPointsProjectedHull *regionPts;
118 
119  vtkPlanesIntersection(const vtkPlanesIntersection&); // Not implemented
120  void operator=(const vtkPlanesIntersection&); // Not implemented
121 };
122 #endif
123 
124 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkPlanesIntersection::GetRegionVertices
int GetRegionVertices(double *v, int nvertices)
vtkPlanesIntersection::ComputeNormal
static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3])
vtkPlanesIntersection::~vtkPlanesIntersection
~vtkPlanesIntersection()
vtkPlanesIntersection::Invert3x3
static int Invert3x3(double M[3][3])
vtkCommonDataModelModule.h
vtkPlanesIntersection::SetRegionVertices
void SetRegionVertices(vtkPoints *pts)
vtkX3D::direction
@ direction
Definition: vtkX3D.h:260
vtkPlanesIntersection::GoodNormal
static int GoodNormal(double *n)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::n
GLclampd n
Definition: vtkgl.h:14370
vtkgl::v
const GLdouble * v
Definition: vtkgl.h:11595
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkPlanesIntersection::Convert3DCell
static vtkPlanesIntersection * Convert3DCell(vtkCell *cell)
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:54
vtkPlanesIntersection::GetNumRegionVertices
int GetNumRegionVertices()
vtkPlanesIntersection::New
static vtkPlanesIntersection * New()
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:52
vtkPointsProjectedHull
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
Definition: vtkPointsProjectedHull.h:38
vtkPlanesIntersection::SetRegionVertices
void SetRegionVertices(double *v, int nvertices)
vtkPlanesIntersection::vtkPlanesIntersection
vtkPlanesIntersection()
vtkPlanesIntersection::EvaluatePlaneEquation
static double EvaluatePlaneEquation(double *x, double *p)
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:62
vtkPlanesIntersection::PlaneEquation
static void PlaneEquation(double *n, double *x, double *p)
vtkPlanesIntersection::PolygonIntersectsBBox
static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkPlanesIntersection::IntersectsRegion
int IntersectsRegion(vtkPoints *R)
M
#define M(row, col)
vtkgl::r
GLdouble GLdouble GLdouble r
Definition: vtkgl.h:11610
vtkPlanesIntersection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
VTKCOMMONDATAMODEL_EXPORT
#define VTKCOMMONDATAMODEL_EXPORT
Definition: vtkCommonDataModelModule.h:15
vtkPlanes::Plane
vtkPlane * Plane
Definition: vtkPlanes.h:116
vtkPlanes.h