VTK  9.1.0
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
51#ifndef vtkPlanesIntersection_h
52#define vtkPlanesIntersection_h
53
54#include "vtkCommonDataModelModule.h" // For export macro
55#include "vtkPlanes.h"
56
57class vtkPoints;
59class vtkCell;
60
61class VTKCOMMONDATAMODEL_EXPORT vtkPlanesIntersection : public vtkPlanes
62{
64
65public:
66 void PrintSelf(ostream& os, vtkIndent indent) override;
67
69
77 void SetRegionVertices(double* v, int nvertices);
79 // Retained for backward compatibility
80 int GetNumRegionVertices() { return this->GetNumberOfRegionVertices(); }
81 int GetRegionVertices(double* v, int nvertices);
82
89
98 static int PolygonIntersectsBBox(double bounds[6], vtkPoints* pts);
99
108
109protected:
110 static void ComputeNormal(double* p1, double* p2, double* p3, double normal[3]);
111 static double EvaluatePlaneEquation(double* x, double* p);
112 static void PlaneEquation(double* n, double* x, double* p);
113 static int GoodNormal(double* n);
114 static int Invert3x3(double M[3][3]);
115
118
119private:
120 int IntersectsBoundingBox(vtkPoints* R);
121 int EnclosesBoundingBox(vtkPoints* R);
122 int EvaluateFacePlane(int plane, vtkPoints* R);
123 int IntersectsProjection(vtkPoints* R, int direction);
124
125 void SetPlaneEquations();
126 void ComputeRegionVertices();
127
128 void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
129 int duplicate(double testv[3]) const;
130 void planesRHS(int p1, int p2, int p3, double r[3]) const;
131 int outsideRegion(double v[3]);
132
133 // plane equations
134 double* Planes;
135
136 // vertices of convex regions enclosed by the planes, also
137 // the ccw hull of that region projected in 3 orthog. directions
138 vtkPointsProjectedHull* RegionPts;
139
141 void operator=(const vtkPlanesIntersection&) = delete;
142};
143#endif
abstract class to specify cell behavior
Definition: vtkCell.h:67
a simple class to control print indentation
Definition: vtkIndent.h:43
A vtkPlanesIntersection object is a vtkPlanes object that can compute whether the arbitrary convex re...
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)
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
static vtkPlanesIntersection * Convert3DCell(vtkCell *cell)
Another convenience function provided by this class, returns the vtkPlanesIntersection object represe...
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 vtkPlanesIntersection * New()
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:59
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
represent and manipulate 3D points
Definition: vtkPoints.h:43
@ direction
Definition: vtkX3D.h:266