Thanks to visit codestin.com
Credit goes to vtk.org

VTK  9.5.20250921
vtkHull.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
61#ifndef vtkHull_h
62#define vtkHull_h
63
64#include "vtkFiltersCoreModule.h" // For export macro
66#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
67#include <vector> //for storing planes
68
69VTK_ABI_NAMESPACE_BEGIN
70class vtkCellArray;
71class vtkPlanes;
72class vtkPoints;
73class vtkPolyData;
74
75class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkHull : public vtkPointSetAlgorithm
76{
77public:
79
83 static vtkHull* New();
85 void PrintSelf(ostream& os, vtkIndent indent) override;
87
92
94
105 int AddPlane(double A, double B, double C);
106 int AddPlane(double plane[3]);
108
110
118 void SetPlane(int i, double A, double B, double C);
119 void SetPlane(int i, double plane[3]);
121
123
127 int AddPlane(double A, double B, double C, double D);
128 int AddPlane(double plane[3], double D);
129 void SetPlane(int i, double A, double B, double C, double D);
130 void SetPlane(int i, double plane[3], double D);
132
137 void SetPlanes(vtkPlanes* planes);
138
143
150
158
164
175
177
188 void GenerateHull(vtkPolyData* pd, double* bounds);
190 vtkPolyData* pd, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax);
192
193protected:
194 vtkHull() = default;
195 ~vtkHull() override = default;
196
197 // The planes - 4 doubles per plane for A, B, C, D.
198 std::vector<double> Planes;
199
200 // Internal method used to find the position of each plane
202
203 // Internal method used to create the actual polygons from the set
204 // of planes
205 void ClipPolygonsFromPlanes(vtkPoints* points, vtkCellArray* polys, const double* bounds);
206
207 // Internal method used to create the initial "big" polygon from the
208 // plane equation. This polygon is clipped by all other planes to form
209 // the final polygon (or it may be clipped entirely)
210 void CreateInitialPolygon(double*, int, const double*);
211
212 // The method that does it all...
214
215 // Specify that the output is of type vtkPolyData
216 int FillOutputPortInformation(int port, vtkInformation* info) override;
217
218private:
219 vtkHull(const vtkHull&) = delete;
220 void operator=(const vtkHull&) = delete;
221};
222
223VTK_ABI_NAMESPACE_END
224#endif
object to represent cell connectivity
produce an n-sided convex hull
Definition vtkHull.h:76
void AddCubeVertexPlanes()
Add the 8 planes that represent the vertices of a cube - the combination of the three face planes con...
int GetNumberOfPlanes()
Get the number of planes in the current set of planes.
void AddCubeEdgePlanes()
Add the 12 planes that represent the edges of a cube - halfway between the two connecting face planes...
void RemoveAllPlanes()
Remove all planes from the current set of planes.
void ClipPolygonsFromPlanes(vtkPoints *points, vtkCellArray *polys, const double *bounds)
void SetPlane(int i, double plane[3], double D)
Variations of AddPlane()/SetPlane() that allow D to be set.
int FillOutputPortInformation(int port, vtkInformation *info) override
Fill the output port information objects for this algorithm.
void SetPlane(int i, double plane[3])
Set the normal values for plane i.
int AddPlane(double plane[3], double D)
Variations of AddPlane()/SetPlane() that allow D to be set.
int AddPlane(double plane[3])
Add a plane to the current set of planes.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods to instantiate, obtain type information, and print information about the class.
~vtkHull() override=default
void AddRecursiveSpherePlanes(int level)
Add the planes that represent the normals of the vertices of a polygonal sphere formed by recursively...
void ComputePlaneDistances(vtkPointSet *input)
vtkHull()=default
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void CreateInitialPolygon(double *, int, const double *)
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)
A special method that is used to generate a polyhedron directly from a set of n 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)
Variations of AddPlane()/SetPlane() that allow D to be set.
static vtkHull * New()
Standard methods to instantiate, obtain type information, and print information about the class.
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),...
void SetPlanes(vtkPlanes *planes)
Set all the planes at once using a vtkPlanes implicit function.
std::vector< double > Planes
Definition vtkHull.h:198
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:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
implicit function for convex set of planes
Definition vtkPlanes.h:151
Superclass for algorithms that produce output of the same type as input.
concrete class for storing a set of points
Definition vtkPointSet.h:98
represent and manipulate 3D points
Definition vtkPoints.h:139
concrete dataset represents vertices, lines, polygons, and triangle strips
#define VTK_MARSHALAUTO