VTK
vtkHull.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkHull.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=========================================================================*/
44#ifndef vtkHull_h
45#define vtkHull_h
46
47#include "vtkFiltersCoreModule.h" // For export macro
49
50class vtkCellArray;
51class vtkPlanes;
52class vtkPoints;
53class vtkPolyData;
54
55class VTKFILTERSCORE_EXPORT vtkHull : public vtkPolyDataAlgorithm
56{
57public:
58 static vtkHull *New();
60 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
61
65 void RemoveAllPlanes( void );
66
68
79 int AddPlane( double A, double B, double C );
80 int AddPlane( double plane[3] );
82
84
92 void SetPlane( int i, double A, double B, double C );
93 void SetPlane( int i, double plane[3] );
95
97
101 int AddPlane( double A, double B, double C, double D );
102 int AddPlane( double plane[3], double D );
103 void SetPlane( int i, double A, double B, double C, double D );
104 void SetPlane( int i, double plane[3], double D );
106
111 void SetPlanes( vtkPlanes *planes );
112
114
117 vtkGetMacro( NumberOfPlanes, int );
119
126
134
140
151
153
164 void GenerateHull(vtkPolyData *pd, double *bounds);
165 void GenerateHull(vtkPolyData *pd, double xmin, double xmax,
166 double ymin, double ymax, double zmin, double zmax);
168
169protected:
171 ~vtkHull() VTK_OVERRIDE;
172
173 // The planes - 4 doubles per plane for A, B, C, D
174 double *Planes;
175
176 // This indicates the current size (in planes - 4*sizeof(double)) of
177 // the this->Planes array. Planes are allocated in chunks so that the
178 // array does not need to be reallocated every time a new plane is added
179 int PlanesStorageSize;
180
181 // The number of planes that have been added
182 int NumberOfPlanes;
183
184 // Internal method used to find the position of each plane
185 void ComputePlaneDistances(vtkPolyData *input);
186
187 // Internal method used to create the actual polygons from the set
188 // of planes
189 void ClipPolygonsFromPlanes( vtkPoints *points, vtkCellArray *polys,
190 double *bounds );
191
192 // Internal method used to create the initial "big" polygon from the
193 // plane equation. This polygon is clipped by all other planes to form
194 // the final polygon (or it may be clipped entirely)
195 void CreateInitialPolygon( double *, int, double * );
196
197 // The method that does it all...
198 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
199private:
200 vtkHull(const vtkHull&) VTK_DELETE_FUNCTION;
201 void operator=(const vtkHull&) VTK_DELETE_FUNCTION;
202};
203
204#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
produce an n-sided convex hull
Definition: vtkHull.h:56
void AddCubeVertexPlanes()
Add the 8 planes that represent the vertices of a cube - the combination of the three face planes con...
void AddCubeEdgePlanes()
Add the 12 planes that represent the edges of a cube - halfway between the two connecting face planes...
void SetPlane(int i, double plane[3], double D)
void SetPlane(int i, double plane[3])
int AddPlane(double plane[3], double D)
int AddPlane(double plane[3])
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void AddRecursiveSpherePlanes(int level)
Add the planes that represent the normals of the vertices of a polygonal sphere formed by recursively...
void GenerateHull(vtkPolyData *pd, double *bounds)
A special method that is used to generate a polyhedron directly from a set of n planes.
void GenerateHull(vtkPolyData *pd, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
void RemoveAllPlanes(void)
Remove all planes from the current set of planes.
int AddPlane(double A, double B, double C)
Add a plane to the current set of planes.
void SetPlane(int i, double A, double B, double C, double D)
static vtkHull * New()
int AddPlane(double A, double B, double C, double D)
Variations of AddPlane()/SetPlane() that allow D to be set.
void AddCubeFacePlanes()
Add the six planes that make up the faces of a cube - (1,0,0), (-1, 0, 0), (0,1,0),...
~vtkHull() override
void SetPlanes(vtkPlanes *planes)
Set all the planes at once using a vtkPlanes implicit function.
void SetPlane(int i, double A, double B, double C)
Set the normal values for plane i.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
implicit function for convex set of planes
Definition: vtkPlanes.h:55
represent and manipulate 3D points
Definition: vtkPoints.h:40
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
@ points
Definition: vtkX3D.h:446
@ level
Definition: vtkX3D.h:395