VTK
vtkHyperOctreeDualGridContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperOctreeDualGridContourFilter.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 =========================================================================*/
40 #ifndef vtkHyperOctreeDualGridContourFilter_h
41 #define vtkHyperOctreeDualGridContourFilter_h
42 
43 #include "vtkFiltersHyperTreeModule.h" // For export macro
44 #include "vtkPolyDataAlgorithm.h"
45 
46 #include "vtkContourValues.h" // Needed for inline methods
47 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE
48 
49 class vtkHyperOctree;
50 class vtkTetra;
53 
57 class vtkIdTypeArray;
58 class vtkBitArray;
60 
61 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeDualGridContourFilter : public vtkPolyDataAlgorithm
62 {
63 public:
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
72 
81  void SetValue(int i, double value)
82  {
83  this->ContourValues->SetValue(i,value);
84  }
85 
89  double GetValue(int i)
90  {
91  return this->ContourValues->GetValue(i);
92  }
93 
98  double *GetValues()
99  {
100  return this->ContourValues->GetValues();
101  }
102 
108  void GetValues(double *contourValues)
109  {
110  this->ContourValues->GetValues(contourValues);
111  }
112 
118  void SetNumberOfContours(int number)
119  {
120  this->ContourValues->SetNumberOfContours(number);
121  }
122 
127  {
128  return this->ContourValues->GetNumberOfContours();
129  }
130 
135  void GenerateValues(int numContours, double range[2])
136  {
137  this->ContourValues->GenerateValues(numContours, range);
138  }
139 
144  void GenerateValues(int numContours, double
145  rangeStart, double rangeEnd)
146  {
147  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
148  }
149 
154 
156 
160  void SetLocator(vtkIncrementalPointLocator *locator);
161  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
163 
168  void CreateDefaultLocator();
169 
170 protected:
173 
174  virtual int RequestData(vtkInformation* request,
175  vtkInformationVector** inputVector,
176  vtkInformationVector* outputVector);
177  virtual int RequestUpdateExtent(vtkInformation*,
181 
185  void ContourNode();
186 
187  void TraverseNeighborhoodRecursively(
188  vtkHyperOctreeLightWeightCursor* neighborhood,
189  unsigned short* xyzIds);
190  void EvaluatePoint(vtkHyperOctreeLightWeightCursor* neighborhood,
191  unsigned short* xyzIds);
192 
193  void ContourNode1D();
194 
197 
200 
202 
206  // To compute points on the fly.
207  // These are set to the input origin and size.
208  double Origin[3];
209  double Size[3];
210 
211  // This is a table for traversing a neighborhood down an octree.
212  // 8 children x 8 cursors
213  // First three bits encode the child, rest encode the cursor id.
214  // 8xCursorId + childId.
215  unsigned char NeighborhoodTraversalTable[64];
216  void GenerateTraversalTable();
217 
218 private:
220  void operator=(const vtkHyperOctreeDualGridContourFilter&) VTK_DELETE_FUNCTION;
221 };
222 #endif
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
double * GetValues()
Get a pointer to an array of contour values.
Abstract class in support of both point location and point insertion.
dynamic, self-adjusting array of vtkIdType
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
A dataset structured as a tree where each node has exactly 2^n children.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
void SetValue(int i, double value)
Methods to set / get contour values.
static vtkPolyDataAlgorithm * New()
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
double GetValue(int i)
Get the ith contour value.
represent and manipulate attribute data in a dataset
dynamic, self-adjusting array of unsigned char
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Objects that can traverse hyperoctree nodes.
object to represent cell connectivity
Definition: vtkCellArray.h:50
void GetValues(double *contourValues)
Fill a supplied list with contour values.
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
generate isosurfaces/isolines from scalar values
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.