VTK  9.2.6
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 
54 #ifndef vtkPlanesIntersection_h
55 #define vtkPlanesIntersection_h
56 
57 #include "vtkCommonDataModelModule.h" // For export macro
58 #include "vtkPlanes.h"
59 
60 class vtkPoints;
62 class vtkCell;
63 
64 class VTKCOMMONDATAMODEL_EXPORT vtkPlanesIntersection : public vtkPlanes
65 {
67 
68 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
72 
80  void SetRegionVertices(double* v, int nvertices);
82  // Retained for backward compatibility
83  int GetNumRegionVertices() { return this->GetNumberOfRegionVertices(); }
84  int GetRegionVertices(double* v, int nvertices);
85 
92 
101  static int PolygonIntersectsBBox(double bounds[6], vtkPoints* pts);
102 
111 
112 protected:
113  static void ComputeNormal(double* p1, double* p2, double* p3, double normal[3]);
114  static double EvaluatePlaneEquation(double* x, double* p);
115  static void PlaneEquation(double* n, double* x, double* p);
116  static int GoodNormal(double* n);
117  static int Invert3x3(double M[3][3]);
118 
121 
122 private:
123  int IntersectsBoundingBox(vtkPoints* R);
124  int EnclosesBoundingBox(vtkPoints* R);
125  int EvaluateFacePlane(int plane, vtkPoints* R);
126  int IntersectsProjection(vtkPoints* R, int direction);
127 
128  void SetPlaneEquations();
129  void ComputeRegionVertices();
130 
131  void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
132  int duplicate(double testv[3]) const;
133  void planesRHS(int p1, int p2, int p3, double r[3]) const;
134  int outsideRegion(double v[3]);
135 
136  // plane equations
137  double* Planes;
138 
139  // vertices of convex regions enclosed by the planes, also
140  // the ccw hull of that region projected in 3 orthog. directions
141  vtkPointsProjectedHull* RegionPts;
142 
144  void operator=(const vtkPlanesIntersection&) = delete;
145 };
146 #endif
abstract class to specify cell behavior
Definition: vtkCell.h:70
a simple class to control print indentation
Definition: vtkIndent.h:49
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
static vtkPlanesIntersection * Convert3DCell(vtkCell *cell)
Another convenience function provided by this class, returns the vtkPlanesIntersection object represe...
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...
int GetRegionVertices(double *v, int nvertices)
static vtkPlanesIntersection * New()
void SetRegionVertices(double *v, int nvertices)
static void ComputeNormal(double *p1, double *p2, double *p3, double normal[3])
static int GoodNormal(double *n)
static int Invert3x3(double M[3][3])
static double EvaluatePlaneEquation(double *x, double *p)
~vtkPlanesIntersection() override
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
void SetRegionVertices(vtkPoints *pts)
It helps if you know the vertices of the convex region.
static void PlaneEquation(double *n, double *x, double *p)
int IntersectsRegion(vtkPoints *R)
Return 1 if the axis aligned box defined by R intersects the region defined by the planes,...
implicit function for convex set of planes
Definition: vtkPlanes.h:62
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
represent and manipulate 3D points
Definition: vtkPoints.h:49
@ direction
Definition: vtkX3D.h:266