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 =========================================================================*/
43 #ifndef vtkHull_h
44 #define vtkHull_h
45 
46 #include "vtkFiltersCoreModule.h" // For export macro
47 #include "vtkPolyDataAlgorithm.h"
48 
49 class vtkCellArray;
50 class vtkPlanes;
51 class vtkPoints;
52 class vtkPolyData;
53 
55 {
56 public:
57  static vtkHull *New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
62  void RemoveAllPlanes( void );
63 
65 
74  int AddPlane( double A, double B, double C );
75  int AddPlane( double plane[3] );
77 
79 
85  void SetPlane( int i, double A, double B, double C );
86  void SetPlane( int i, double plane[3] );
88 
90 
92  int AddPlane( double A, double B, double C, double D );
93  int AddPlane( double plane[3], double D );
94  void SetPlane( int i, double A, double B, double C, double D );
95  void SetPlane( int i, double plane[3], double D );
97 
100  void SetPlanes( vtkPlanes *planes );
101 
103 
104  vtkGetMacro( NumberOfPlanes, int );
106 
112 
118 
122 
131 
133 
141  void GenerateHull(vtkPolyData *pd, double *bounds);
142  void GenerateHull(vtkPolyData *pd, double xmin, double xmax,
143  double ymin, double ymax, double zmin, double zmax);
145 
146 protected:
149 
150  // The planes - 4 doubles per plane for A, B, C, D
151  double *Planes;
152 
153  // This indicates the current size (in planes - 4*sizeof(double)) of
154  // the this->Planes array. Planes are allocated in chunks so that the
155  // array does not need to be reallocated every time a new plane is added
157 
158  // The number of planes that have been added
160 
161  // Internal method used to find the position of each plane
163 
164  // Internal method used to create the actual polygons from the set
165  // of planes
167  double *bounds );
168 
169  // Internal method used to create the initial "big" polygon from the
170  // plane equation. This polygon is clipped by all other planes to form
171  // the final polygon (or it may be clipped entirely)
172  void CreateInitialPolygon( double *, int, double * );
173 
174  // The method that does it all...
176 private:
177  vtkHull(const vtkHull&); // Not implemented.
178  void operator=(const vtkHull&); // Not implemented.
179 };
180 
181 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkHull::GenerateHull
void GenerateHull(vtkPolyData *pd, double *bounds)
vtkHull::AddPlane
int AddPlane(double A, double B, double C)
vtkHull::GenerateHull
void GenerateHull(vtkPolyData *pd, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
vtkHull::New
static vtkHull * New()
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkHull::SetPlane
void SetPlane(int i, double plane[3], double D)
vtkHull::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkHull::NumberOfPlanes
int NumberOfPlanes
Definition: vtkHull.h:159
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkHull::AddPlane
int AddPlane(double plane[3], double D)
vtkHull::PlanesStorageSize
int PlanesStorageSize
Definition: vtkHull.h:156
vtkHull::~vtkHull
~vtkHull()
vtkHull::SetPlane
void SetPlane(int i, double plane[3])
vtkgl::input
GLenum GLenum GLenum input
Definition: vtkgl.h:15941
vtkPlanes
implicit function for convex set of planes
Definition: vtkPlanes.h:54
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkHull::AddRecursiveSpherePlanes
void AddRecursiveSpherePlanes(int level)
vtkFiltersCoreModule.h
vtkPolyDataAlgorithm.h
vtkHull::ClipPolygonsFromPlanes
void ClipPolygonsFromPlanes(vtkPoints *points, vtkCellArray *polys, double *bounds)
vtkHull::ComputePlaneDistances
void ComputePlaneDistances(vtkPolyData *input)
vtkHull::AddCubeFacePlanes
void AddCubeFacePlanes()
vtkHull::AddCubeEdgePlanes
void AddCubeEdgePlanes()
VTKFILTERSCORE_EXPORT
#define VTKFILTERSCORE_EXPORT
Definition: vtkFiltersCoreModule.h:15
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkHull
produce an n-sided convex hull
Definition: vtkHull.h:55
vtkHull::CreateInitialPolygon
void CreateInitialPolygon(double *, int, double *)
vtkHull::SetPlanes
void SetPlanes(vtkPlanes *planes)
vtkHull::SetPlane
void SetPlane(int i, double A, double B, double C)
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::zmax
GLclampd zmax
Definition: vtkgl.h:17479
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkHull::Planes
double * Planes
Definition: vtkHull.h:151
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkHull::SetPlane
void SetPlane(int i, double A, double B, double C, double D)
vtkHull::RemoveAllPlanes
void RemoveAllPlanes(void)
vtkHull::AddPlane
int AddPlane(double A, double B, double C, double D)
vtkHull::vtkHull
vtkHull()
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkHull::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkHull::AddCubeVertexPlanes
void AddCubeVertexPlanes()
vtkHull::AddPlane
int AddPlane(double plane[3])
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44