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 {
53  vtkTypeMacro(vtkPlanesIntersection, vtkPlanes);
54 
55 public:
56  void PrintSelf(ostream& os, vtkIndent indent);
57 
58  static vtkPlanesIntersection *New();
59 
63  void SetRegionVertices(vtkPoints *pts);
64  void SetRegionVertices(double *v, int nvertices);
65  int GetNumRegionVertices();
66  int GetRegionVertices(double *v, int nvertices);
67 
71  int IntersectsRegion(vtkPoints *R);
72 
77  static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts);
78 
84  static vtkPlanesIntersection *Convert3DCell(vtkCell *cell);
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 
void PrintSelf(ostream &os, vtkIndent indent)
static vtkPlanes * New()
vtkPlane * Plane
Definition: vtkPlanes.h:116
implicit function for convex set of planes
Definition: vtkPlanes.h:53
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
abstract class to specify cell behavior
Definition: vtkCell.h:61
a simple class to control print indentation
Definition: vtkIndent.h:38
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions ...
#define M(row, col)
#define VTKCOMMONDATAMODEL_EXPORT
represent and manipulate 3D points
Definition: vtkPoints.h:38