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 
65 #if !defined(VTK_LEGACY_REMOVE)
68 class vtkHyperOctree;
71 class vtkTetra;
74 
75 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeCutter : public vtkPolyDataAlgorithm
76 {
77 public:
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
85  static vtkHyperOctreeCutter *New();
86 
91  void SetValue(int i, double value)
92  {this->ContourValues->SetValue(i,value);}
93 
97  double GetValue(int i)
98  {return this->ContourValues->GetValue(i);}
99 
104  double *GetValues()
105  {return this->ContourValues->GetValues();}
106 
112  void GetValues(double *contourValues)
113  {this->ContourValues->GetValues(contourValues);}
114 
120  void SetNumberOfContours(int number)
121  {this->ContourValues->SetNumberOfContours(number);}
122 
127  {return this->ContourValues->GetNumberOfContours();}
128 
133  void GenerateValues(int numContours, double range[2])
134  {this->ContourValues->GenerateValues(numContours, range);}
135 
140  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
141  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
142 
147  vtkMTimeType GetMTime() override;
148 
150 
153  virtual void SetCutFunction(vtkImplicitFunction*);
154  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
156 
158 
163  vtkSetMacro(GenerateCutScalars,int);
164  vtkGetMacro(GenerateCutScalars,int);
165  vtkBooleanMacro(GenerateCutScalars,int);
167 
169 
173  void SetLocator(vtkIncrementalPointLocator *locator);
174  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
176 
178 
193  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
194  vtkGetMacro(SortBy,int);
196  {this->SetSortBy(VTK_SORT_BY_VALUE);}
198  {this->SetSortBy(VTK_SORT_BY_CELL);}
200 
202 
205  const char *GetSortByAsString()
206  {
207  if ( this->SortBy == VTK_SORT_BY_VALUE )
208  {
209  return "SortByValue";
210  }
211  else
212  {
213  return "SortByCell";
214  }
215  }
217 
222  void CreateDefaultLocator();
223 
224 protected:
226  ~vtkHyperOctreeCutter() override;
227 
230  int FillInputPortInformation(int port, vtkInformation *info) override;
231 
237  void CutNode(vtkHyperOctreeCursor *cursor,
238  int level,
239  double bounds[6]);
240 
242 
243 
245  int SortBy;
248 
251 
252 
256 
261  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
262 
263  int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
264 
265 
269 
272 
273  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
275  vtkIdType TemplateCounter; // record the number of octants that succceed
276  // to use the template triangulator
277 
278  // in VTK_SORT_BY_VALUE case, rejection test need to combine all values.
279  int *AllLess;
282 
283 private:
285  void operator=(const vtkHyperOctreeCutter&) = delete;
286 };
287 #endif // LEGACY remove
288 
289 #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.
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: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:345
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.
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.