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
vtkHyperOctreeDualGridContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkHyperOctreeDualGridContourFilter.h:196
vtkHyperOctreeDualGridContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkHyperOctreeDualGridContourFilter.h:61
vtkHyperOctreeDualGridContourFilter::Input
vtkHyperOctree * Input
Definition: vtkHyperOctreeDualGridContourFilter.h:198
vtkX3D::value
@ value
Definition: vtkX3D.h:220
vtkDataSetAttributes
represent and manipulate attribute data in a dataset
Definition: vtkDataSetAttributes.h:58
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkPolyDataAlgorithm::RequestUpdateExtent
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
This is called by the superclass.
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:41
vtkHyperOctreeCursor
Objects that can traverse hyperoctree nodes.
Definition: vtkHyperOctreeCursor.h:51
vtkHyperOctreeDualGridContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkHyperOctreeDualGridContourFilter.h:195
vtkX3D::range
@ range
Definition: vtkX3D.h:238
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkHyperOctreeDualGridContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkHyperOctreeDualGridContourFilter.h:98
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkPolyDataAlgorithm.h
vtkHyperOctreeDualGridContourFilter::InPD
vtkDataSetAttributes * InPD
Definition: vtkHyperOctreeDualGridContourFilter.h:203
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkHyperOctreeDualGridContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkHyperOctreeDualGridContourFilter.h:89
vtkHyperOctreeDualGridContourFilter::GetValues
void GetValues(double *contourValues)
Fill a supplied list with contour values.
Definition: vtkHyperOctreeDualGridContourFilter.h:108
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkHyperOctreeDualGridContourFilter::InScalars
vtkDataArray * InScalars
Definition: vtkHyperOctreeDualGridContourFilter.h:205
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkHyperOctreeLightWeightCursor
Definition: vtkHyperOctree.h:616
vtkHyperOctreeDualGridContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkHyperOctreeDualGridContourFilter.h:81
vtkHyperOctreeDualGridContourFilter::OutPD
vtkDataSetAttributes * OutPD
Definition: vtkHyperOctreeDualGridContourFilter.h:204
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkHyperOctreeDualGridContourFilter::GenerateValues
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
Definition: vtkHyperOctreeDualGridContourFilter.h:144
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkIdTypeArray
dynamic, self-adjusting array of vtkIdType
Definition: vtkIdTypeArray.h:41
vtkHyperOctreeDualGridContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkHyperOctreeDualGridContourFilter.h:135
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkHyperOctreeDualGridContourFilter::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkHyperOctreeDualGridContourFilter.h:126
vtkHyperOctreeDualGridContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkHyperOctreeDualGridContourFilter.h:118
vtkBitArray
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:36
vtkUnstructuredGrid
dataset represents arbitrary combinations of all possible cell types
Definition: vtkUnstructuredGrid.h:81
vtkCutter.h
vtkHyperOctree
A dataset structured as a tree where each node has exactly 2^n children.
Definition: vtkHyperOctree.h:143
vtkTetra
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:47
vtkHyperOctreeDualGridContourFilter::Output
vtkPolyData * Output
Definition: vtkHyperOctreeDualGridContourFilter.h:199
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44
vtkHyperOctreeDualGridContourFilter::NewPolys
vtkCellArray * NewPolys
Definition: vtkHyperOctreeDualGridContourFilter.h:201