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
64#ifndef vtkPlanesIntersection_h
65#define vtkPlanesIntersection_h
66
67#include "vtkCommonDataModelModule.h" // For export macro
68#include "vtkPlanes.h"
69
70class vtkPoints;
72class vtkCell;
73
74class VTKCOMMONDATAMODEL_EXPORT vtkPlanesIntersection : public vtkPlanes
75{
77
78public:
79 void PrintSelf(ostream& os, vtkIndent indent) override;
80
82
90 void SetRegionVertices(double* v, int nvertices);
92 // Retained for backward compatibility
93 int GetNumRegionVertices() { return this->GetNumberOfRegionVertices(); }
94 int GetRegionVertices(double* v, int nvertices);
95
102
111 static int PolygonIntersectsBBox(double bounds[6], vtkPoints* pts);
112
121
122protected:
123 static void ComputeNormal(double* p1, double* p2, double* p3, double normal[3]);
124 static double EvaluatePlaneEquation(double* x, double* p);
125 static void PlaneEquation(double* n, double* x, double* p);
126 static int GoodNormal(double* n);
127 static int Invert3x3(double M[3][3]);
128
131
132private:
133 int IntersectsBoundingBox(vtkPoints* R);
134 int EnclosesBoundingBox(vtkPoints* R);
135 int EvaluateFacePlane(int plane, vtkPoints* R);
136 int IntersectsProjection(vtkPoints* R, int direction);
137
138 void SetPlaneEquations();
139 void ComputeRegionVertices();
140
141 void planesMatrix(int p1, int p2, int p3, double M[3][3]) const;
142 int duplicate(double testv[3]) const;
143 void planesRHS(int p1, int p2, int p3, double r[3]) const;
144 int outsideRegion(double v[3]);
145
146 // plane equations
147 double* Planes;
148
149 // vertices of convex regions enclosed by the planes, also
150 // the ccw hull of that region projected in 3 orthog. directions
151 vtkPointsProjectedHull* RegionPts;
152
154 void operator=(const vtkPlanesIntersection&) = delete;
155};
156#endif
abstract class to specify cell behavior
Definition: vtkCell.h:150
a simple class to control print indentation
Definition: vtkIndent.h:119
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:162
the convex hull of the orthogonal projection of the vtkPoints in the 3 coordinate directions
represent and manipulate 3D points
Definition: vtkPoints.h:149
@ direction
Definition: vtkX3D.h:266