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
53 #include "vtkPolyDataAlgorithm.h"
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 
67 class vtkHyperOctree;
70 class vtkTetra;
73 
74 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeCutter : public vtkPolyDataAlgorithm
75 {
76 public:
78  void PrintSelf(ostream& os, vtkIndent indent);
79 
84  static vtkHyperOctreeCutter *New();
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 
152  virtual void SetCutFunction(vtkImplicitFunction*);
153  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
155 
157 
162  vtkSetMacro(GenerateCutScalars,int);
163  vtkGetMacro(GenerateCutScalars,int);
164  vtkBooleanMacro(GenerateCutScalars,int);
166 
168 
172  void SetLocator(vtkIncrementalPointLocator *locator);
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 
221  void CreateDefaultLocator();
222 
223 protected:
226 
230 
236  void CutNode(vtkHyperOctreeCursor *cursor,
237  int level,
238  double bounds[6]);
239 
241 
242 
244  int SortBy;
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.
278  int *AllLess;
281 
282 private:
283  vtkHyperOctreeCutter(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
284  void operator=(const vtkHyperOctreeCutter&) VTK_DELETE_FUNCTION;
285 };
286 
287 #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:37
vtkDoubleArray * TetScalars
Store vtkAlgorithm input/output information.
Cut vtkHyperOctree with user-specified implicit function.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
represent and manipulate cell attribute data
Definition: vtkCellData.h:38
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:287
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
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.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
vtkIncrementalPointLocator * Locator
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
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:39
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:45
represent and manipulate attribute data in a dataset
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:59
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:50
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:60
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:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.