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 =========================================================================*/
46 #ifndef vtkHyperOctreeCutter_h
47 #define vtkHyperOctreeCutter_h
48 
49 #include "vtkFiltersHyperTreeModule.h" // For export macro
50 #include "vtkPolyDataAlgorithm.h"
51 
52 #include "vtkContourValues.h" // Needed for inline methods
53 
54 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE and VTK_SORT_BY_CELL
55 
56 //#define VTK_SORT_BY_VALUE 0
57 //#define VTK_SORT_BY_CELL 1
58 // This does not really belong here, ut it is for a temporary
59 // fix until this filter can be converted to geernate unstructured grids.
60 //#define VTK_NUMBER_OF_CELL_TYPES 68
61 
64 class vtkHyperOctree;
67 class vtkTetra;
70 
71 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeCutter : public vtkPolyDataAlgorithm
72 {
73 public:
75  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
76 
81  static vtkHyperOctreeCutter *New();
82 
87  void SetValue(int i, double value)
88  {this->ContourValues->SetValue(i,value);}
89 
93  double GetValue(int i)
94  {return this->ContourValues->GetValue(i);}
95 
100  double *GetValues()
101  {return this->ContourValues->GetValues();}
102 
108  void GetValues(double *contourValues)
109  {this->ContourValues->GetValues(contourValues);}
110 
116  void SetNumberOfContours(int number)
117  {this->ContourValues->SetNumberOfContours(number);}
118 
123  {return this->ContourValues->GetNumberOfContours();}
124 
129  void GenerateValues(int numContours, double range[2])
130  {this->ContourValues->GenerateValues(numContours, range);}
131 
136  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
137  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
138 
143  vtkMTimeType GetMTime() VTK_OVERRIDE;
144 
146 
149  virtual void SetCutFunction(vtkImplicitFunction*);
150  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
152 
154 
159  vtkSetMacro(GenerateCutScalars,int);
160  vtkGetMacro(GenerateCutScalars,int);
161  vtkBooleanMacro(GenerateCutScalars,int);
163 
165 
169  void SetLocator(vtkIncrementalPointLocator *locator);
170  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
172 
174 
189  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
190  vtkGetMacro(SortBy,int);
192  {this->SetSortBy(VTK_SORT_BY_VALUE);}
194  {this->SetSortBy(VTK_SORT_BY_CELL);}
196 
198 
201  const char *GetSortByAsString()
202  {
203  if ( this->SortBy == VTK_SORT_BY_VALUE )
204  {
205  return "SortByValue";
206  }
207  else
208  {
209  return "SortByCell";
210  }
211  }
213 
218  void CreateDefaultLocator();
219 
220 protected:
222  ~vtkHyperOctreeCutter() VTK_OVERRIDE;
223 
226  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
227 
233  void CutNode(vtkHyperOctreeCursor *cursor,
234  int level,
235  double bounds[6]);
236 
238 
239 
241  int SortBy;
244 
247 
248 
252 
257  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
258 
259  int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
260 
261 
265 
268 
269  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
271  vtkIdType TemplateCounter; // record the number of octants that succceed
272  // to use the template triangulator
273 
274  // in VTK_SORT_BY_VALUE case, rejection test need to combine all values.
275  int *AllLess;
278 
279 private:
280  vtkHyperOctreeCutter(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
281  void operator=(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
282 };
283 
284 #endif
abstract interface for implicit functions
helper object to manage setting and generating contour values
vtkImplicitFunction * CutFunction
void SetValue(int i, double value)
Set a particular contour value at contour number i.
represent and manipulate point attribute data
Definition: vtkPointData.h:31
vtkDoubleArray * TetScalars
Store vtkAlgorithm input/output information.
Cut vtkHyperOctree with user-specified implicit function.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
Abstract class in support of both point location and point insertion.
helper class to generate triangulations
A concrete implementation of vtkHyperOctreePointsGrabber used by vtkClipHyperOctree and vtkHyperOctre...
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkHyperOctreeClipCutPointsGrabber * Grabber
double GetValue(int i)
Get the ith contour value.
A dataset structured as a tree where each node has exactly 2^n children.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
vtkIncrementalPointLocator * Locator
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void SetSortByToSortByValue()
Set the sorting order for the generated polydata.
Superclass for algorithms that produce only polydata as output.
vtkDataSetAttributes * InCD
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkContourValues * ContourValues
vtkDoubleArray * CellScalars
const char * GetSortByAsString()
Return the sorting procedure as a descriptive character string.
vtkOrderedTriangulator * Triangulator
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkHyperOctreeCursor * Sibling
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
represent and manipulate attribute data in a dataset
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:53
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
Objects that can traverse hyperoctree nodes.
void SetSortByToSortByCell()
Set the sorting order for the generated polydata.
object to represent cell connectivity
Definition: vtkCellArray.h:44
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:54
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
double * GetValues()
Get a pointer to an array of contour values.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Get the number of contours in the list of contour values.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.