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 =========================================================================*/
48 #ifndef vtkHyperOctreeCutter_h
49 #define vtkHyperOctreeCutter_h
50 
51 #include "vtkFiltersHyperTreeModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 #include "vtkContourValues.h" // Needed for inline methods
55 
56 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE and VTK_SORT_BY_CELL
57 
58 //#define VTK_SORT_BY_VALUE 0
59 //#define VTK_SORT_BY_CELL 1
60 // This does not really belong here, ut it is for a temporary
61 // fix until this filter can be converted to geernate unstructured grids.
62 //#define VTK_NUMBER_OF_CELL_TYPES 68
63 
66 class vtkHyperOctree;
69 class vtkTetra;
72 
74 {
75 public:
77  void PrintSelf(ostream& os, vtkIndent indent);
78 
81  static vtkHyperOctreeCutter *New();
82 
84 
86  void SetValue(int i, double value)
87  {this->ContourValues->SetValue(i,value);}
89 
91 
92  double GetValue(int i)
93  {return this->ContourValues->GetValue(i);}
95 
97 
99  double *GetValues()
100  {return this->ContourValues->GetValues();}
102 
104 
107  void GetValues(double *contourValues)
108  {this->ContourValues->GetValues(contourValues);}
110 
112 
115  void SetNumberOfContours(int number)
116  {this->ContourValues->SetNumberOfContours(number);}
118 
120 
122  {return this->ContourValues->GetNumberOfContours();}
124 
126 
128  void GenerateValues(int numContours, double range[2])
129  {this->ContourValues->GenerateValues(numContours, range);}
131 
133 
135  void GenerateValues(int numContours, double rangeStart, double rangeEnd)
136  {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
138 
141  unsigned long GetMTime();
142 
144 
145  virtual void SetCutFunction(vtkImplicitFunction*);
146  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
148 
150 
153  vtkSetMacro(GenerateCutScalars,int);
154  vtkGetMacro(GenerateCutScalars,int);
155  vtkBooleanMacro(GenerateCutScalars,int);
157 
159 
161  void SetLocator(vtkIncrementalPointLocator *locator);
162  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
164 
166 
176  vtkSetClampMacro(SortBy,int,VTK_SORT_BY_VALUE,VTK_SORT_BY_CELL);
177  vtkGetMacro(SortBy,int);
179  {this->SetSortBy(VTK_SORT_BY_VALUE);}
181  {this->SetSortBy(VTK_SORT_BY_CELL);}
183 
185 
186  const char *GetSortByAsString()
187  {
188  if ( this->SortBy == VTK_SORT_BY_VALUE )
189  {
190  return "SortByValue";
191  }
192  else
193  {
194  return "SortByCell";
195  }
196  }
198 
201  void CreateDefaultLocator();
202 
203 protected:
206 
210 
212 
214  void CutNode(vtkHyperOctreeCursor *cursor,
215  int level,
216  double bounds[6]);
218 
220 
221 
223  int SortBy;
226 
229 
230 
234 
239  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
240 
241  int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
242 
243 
247 
250 
251  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
253  vtkIdType TemplateCounter; // record the number of octants that succceed
254  // to use the template triangulator
255 
256  // in VTK_SORT_BY_VALUE case, rejection test need to combine all values.
257  int *AllLess;
260 
261 private:
262  vtkHyperOctreeCutter(const vtkHyperOctreeCutter&); // Not implemented.
263  void operator=(const vtkHyperOctreeCutter&); // Not implemented.
264 };
265 
266 #endif
abstract interface for implicit functions
helper object to manage setting and generating contour values
vtkImplicitFunction * CutFunction
virtual int FillInputPortInformation(int port, vtkInformation *info)
void SetValue(int i, double value)
represent and manipulate point attribute data
Definition: vtkPointData.h:36
vtkDoubleArray * TetScalars
Store vtkAlgorithm input/output information.
Cut vtkHyperOctree with user-specified implicit function.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
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:275
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
vtkHyperOctreeClipCutPointsGrabber * Grabber
A dataset structured as a tree where each node has exactly 2^n children.
#define VTKFILTERSHYPERTREE_EXPORT
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
vtkIncrementalPointLocator * Locator
void PrintSelf(ostream &os, vtkIndent indent)
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void SetNumberOfContours(int number)
Superclass for algorithms that produce only polydata as output.
vtkDataSetAttributes * InCD
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkContourValues * ContourValues
vtkDoubleArray * CellScalars
const char * GetSortByAsString()
vtkOrderedTriangulator * Triangulator
vtkHyperOctreeCursor * Sibling
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:44
represent and manipulate attribute data in a dataset
#define VTK_SORT_BY_VALUE
Definition: vtkCutter.h:58
Objects that can traverse hyperoctree nodes.
object to represent cell connectivity
Definition: vtkCellArray.h:49
#define VTK_SORT_BY_CELL
Definition: vtkCutter.h:59
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
void GenerateValues(int numContours, double range[2])
void GetValues(double *contourValues)
Store zero or more vtkInformation instances.
represent and manipulate 3D points
Definition: vtkPoints.h:38