VTK
vtkHyperOctreeCutter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkHyperOctreeCutter.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=========================================================================*/
49#ifndef vtkHyperOctreeCutter_h
50#define vtkHyperOctreeCutter_h
51
52#include "vtkFiltersHyperTreeModule.h" // For export macro
54
55#include "vtkContourValues.h" // Needed for inline methods
56
57#include "vtkCutter.h" // for VTK_SORT_BY_VALUE and VTK_SORT_BY_CELL
58
59//#define VTK_SORT_BY_VALUE 0
60//#define VTK_SORT_BY_CELL 1
61// This does not really belong here, ut it is for a temporary
62// fix until this filter can be converted to geernate unstructured grids.
63//#define VTK_NUMBER_OF_CELL_TYPES 68
64
67class vtkHyperOctree;
70class vtkTetra;
73
74class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeCutter : public vtkPolyDataAlgorithm
75{
76public:
78 void PrintSelf(ostream& os, vtkIndent indent);
79
85
90 void SetValue(int i, double value)
91 {this->ContourValues->SetValue(i,value);}
92
96 double GetValue(int i)
97 {return this->ContourValues->GetValue(i);}
98
103 double *GetValues()
104 {return this->ContourValues->GetValues();}
105
111 void GetValues(double *contourValues)
112 {this->ContourValues->GetValues(contourValues);}
113
119 void SetNumberOfContours(int number)
120 {this->ContourValues->SetNumberOfContours(number);}
121
126 {return this->ContourValues->GetNumberOfContours();}
127
132 void GenerateValues(int numContours, double range[2])
133 {this->ContourValues->GenerateValues(numContours, range);}
134
139 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
140 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
141
147
149
153 vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
155
157
162 vtkSetMacro(GenerateCutScalars,int);
163 vtkGetMacro(GenerateCutScalars,int);
164 vtkBooleanMacro(GenerateCutScalars,int);
166
168
173 vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
175
177
192 vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
193 vtkGetMacro(SortBy,int);
195 {this->SetSortBy(VTK_SORT_BY_VALUE);}
197 {this->SetSortBy(VTK_SORT_BY_CELL);}
199
201
204 const char *GetSortByAsString()
205 {
206 if ( this->SortBy == VTK_SORT_BY_VALUE )
207 {
208 return "SortByValue";
209 }
210 else
211 {
212 return "SortByCell";
213 }
214 }
216
222
223protected:
226
230
237 int level,
238 double bounds[6]);
239
241
242
247
250
251
255
260 vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
261
262 int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
263
264
268
271
272 vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
274 vtkIdType TemplateCounter; // record the number of octants that succceed
275 // to use the template triangulator
276
277 // in VTK_SORT_BY_VALUE case, rejection test need to combine all values.
281
282private:
283 vtkHyperOctreeCutter(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
284 void operator=(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
285};
286
287#endif
object to represent cell connectivity
Definition: vtkCellArray.h:51
represent and manipulate cell attribute data
Definition: vtkCellData.h:39
helper object to manage setting and generating contour values
represent and manipulate attribute data in a dataset
dynamic, self-adjusting array of double
A concrete implementation of vtkHyperOctreePointsGrabber used by vtkClipHyperOctree and vtkHyperOctre...
Objects that can traverse hyperoctree nodes.
Cut vtkHyperOctree with user-specified implicit function.
vtkMTimeType GetMTime()
Override GetMTime because we delegate to vtkContourValues and refer to vtkImplicitFunction.
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
double * GetValues()
Get a pointer to an array of contour values.
virtual void SetCutFunction(vtkImplicitFunction *)
Specify the implicit function to perform the cutting.
vtkContourValues * ContourValues
vtkImplicitFunction * CutFunction
int GetNumberOfContours()
Get the number of contours in the list of contour values.
vtkOrderedTriangulator * Triangulator
vtkHyperOctreeCutter(vtkImplicitFunction *cf=NULL)
vtkDoubleArray * CellScalars
void SetValue(int i, double value)
Set a particular contour value at contour number i.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
virtual int FillInputPortInformation(int port, vtkInformation *info)
Fill the input port information objects for this algorithm.
vtkHyperOctreeCursor * Sibling
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
static vtkHyperOctreeCutter * New()
Construct with user-specified implicit function; initial value of 0.0; and generating cut scalars tur...
void SetLocator(vtkIncrementalPointLocator *locator)
Specify a spatial locator for merging points.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void CutNode(vtkHyperOctreeCursor *cursor, int level, double bounds[6])
Cut the sub-hierarchy pointed by cursor.
vtkIncrementalPointLocator * Locator
vtkHyperOctreeClipCutPointsGrabber * Grabber
vtkDataSetAttributes * InCD
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
void CreateDefaultLocator()
Create default locator.
double GetValue(int i)
Get the ith contour value.
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
vtkDoubleArray * TetScalars
A dataset structured as a tree where each node has exactly 2^n children.
abstract interface for implicit functions
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
helper class to generate triangulations
represent and manipulate point attribute data
Definition: vtkPointData.h:38
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
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:46
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:48
@ info
Definition: vtkX3D.h:376
@ level
Definition: vtkX3D.h:395
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:59
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:60
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248