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 
45 #ifndef vtkPlanesIntersection_h
46 #define vtkPlanesIntersection_h
47 
48 #include "vtkCommonDataModelModule.h" // For export macro
49 #include "vtkPlanes.h"
50 
51 class vtkPoints;
53 class vtkCell;
54 
55 class VTKCOMMONDATAMODEL_EXPORT vtkPlanesIntersection : public vtkPlanes
56 {
58 
59 public:
60  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
61 
63 
71  void SetRegionVertices(double *v, int nvertices);
73  // Retained for backward compatibility
75  {
76  return this->GetNumberOfRegionVertices();
77  }
78  int GetRegionVertices(double *v, int nvertices);
79 
86 
95  static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts);
96 
105 
106 protected:
107 
108  static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3]);
109  static double EvaluatePlaneEquation(double *x, double *p);
110  static void PlaneEquation(double *n, double *x, double *p);
111  static int GoodNormal(double *n);
112  static int Invert3x3(double M[3][3]);
113 
115  ~vtkPlanesIntersection() VTK_OVERRIDE;
116 
117 private:
118 
119  int IntersectsBoundingBox(vtkPoints *R);
120  int EnclosesBoundingBox(vtkPoints *R);
121  int EvaluateFacePlane(int plane, vtkPoints *R);
122  int IntersectsProjection(vtkPoints *R, int direction);
123 
124  void SetPlaneEquations();
125  void ComputeRegionVertices();
126 
127  void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
128  int duplicate(double testv[3]) const;
129  void planesRHS(int p1, int p2, int p3, double r[3]) const;
130  int outsideRegion(double v[3]) ;
131 
132  // plane equations
133  double *Plane;
134 
135  // vertices of convex regions enclosed by the planes, also
136  // the ccw hull of that region projected in 3 orthog. directions
137  vtkPointsProjectedHull *RegionPts;
138 
139  vtkPlanesIntersection(const vtkPlanesIntersection&) VTK_DELETE_FUNCTION;
140  void operator=(const vtkPlanesIntersection&) VTK_DELETE_FUNCTION;
141 };
142 #endif
143 
144 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkPlanesIntersection::GetRegionVertices
int GetRegionVertices(double *v, int nvertices)
vtkPlanesIntersection::ComputeNormal
static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3])
vtkPlanesIntersection::Invert3x3
static int Invert3x3(double M[3][3])
vtkPlanesIntersection::GetNumberOfRegionVertices
int GetNumberOfRegionVertices()
vtkPlanesIntersection::SetRegionVertices
void SetRegionVertices(vtkPoints *pts)
It helps if you know the vertices of the convex region.
vtkX3D::direction
@ direction
Definition: vtkX3D.h:260
vtkPlanesIntersection::GoodNormal
static int GoodNormal(double *n)
vtkPlanesIntersection::Convert3DCell
static vtkPlanesIntersection * Convert3DCell(vtkCell *cell)
Another convenience function provided by this class, returns the vtkPlanesIntersection object represe...
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:55
vtkPlanesIntersection::GetNumRegionVertices
int GetNumRegionVertices()
Definition: vtkPlanesIntersection.h:74
vtkPlanesIntersection::New
static vtkPlanesIntersection * New()
vtkPlanesIntersection
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
Definition: vtkPlanesIntersection.h:56
vtkPointsProjectedHull
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
Definition: vtkPointsProjectedHull.h:39
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:60
vtkPlanesIntersection::PlaneEquation
static void PlaneEquation(double *n, double *x, double *p)
vtkPlanesIntersection::PolygonIntersectsBBox
static int PolygonIntersectsBBox(double bounds[6], vtkPoints *pts)
A convenience function provided by this class, returns 1 if the polygon defined in pts intersects the...
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkPlanesIntersection::IntersectsRegion
int IntersectsRegion(vtkPoints *R)
Return 1 if the axis aligned box defined by R intersects the region defined by the planes,...
vtkPlanesIntersection::~vtkPlanesIntersection
~vtkPlanesIntersection() override
M
#define M(row, col)
vtkPlanes.h
vtkPlanesIntersection::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.