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 #if !defined(VTK_LEGACY_REMOVE)
50 class vtkHyperOctree;
51 class vtkTetra;
54 
58 class vtkIdTypeArray;
59 class vtkBitArray;
61 
62 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeDualGridContourFilter : public vtkPolyDataAlgorithm
63 {
64 public:
66  void PrintSelf(ostream& os, vtkIndent indent) override;
67 
73 
82  void SetValue(int i, double value)
83  {
84  this->ContourValues->SetValue(i,value);
85  }
86 
90  double GetValue(int i)
91  {
92  return this->ContourValues->GetValue(i);
93  }
94 
99  double *GetValues()
100  {
101  return this->ContourValues->GetValues();
102  }
103 
109  void GetValues(double *contourValues)
110  {
111  this->ContourValues->GetValues(contourValues);
112  }
113 
119  void SetNumberOfContours(int number)
120  {
121  this->ContourValues->SetNumberOfContours(number);
122  }
123 
128  {
129  return this->ContourValues->GetNumberOfContours();
130  }
131 
136  void GenerateValues(int numContours, double range[2])
137  {
138  this->ContourValues->GenerateValues(numContours, range);
139  }
140 
145  void GenerateValues(int numContours, double
146  rangeStart, double rangeEnd)
147  {
148  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
149  }
150 
154  vtkMTimeType GetMTime() override;
155 
157 
161  void SetLocator(vtkIncrementalPointLocator *locator);
162  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
164 
169  void CreateDefaultLocator();
170 
171 protected:
174 
175  int RequestData(vtkInformation* request,
176  vtkInformationVector** inputVector,
177  vtkInformationVector* outputVector) override;
180  vtkInformationVector*) override;
181  int FillInputPortInformation(int port, vtkInformation *info) override;
182 
186  void ContourNode();
187 
188  void TraverseNeighborhoodRecursively(
189  vtkHyperOctreeLightWeightCursor* neighborhood,
190  unsigned short* xyzIds);
191  void EvaluatePoint(vtkHyperOctreeLightWeightCursor* neighborhood,
192  unsigned short* xyzIds);
193 
194  void ContourNode1D();
195 
198 
201 
203 
207  // To compute points on the fly.
208  // These are set to the input origin and size.
209  double Origin[3];
210  double Size[3];
211 
212  // This is a table for traversing a neighborhood down an octree.
213  // 8 children x 8 cursors
214  // First three bits encode the child, rest encode the cursor id.
215  // 8xCursorId + childId.
216  unsigned char NeighborhoodTraversalTable[64];
217  void GenerateTraversalTable();
218 
219 private:
221  void operator=(const vtkHyperOctreeDualGridContourFilter&) = delete;
222 };
223 #endif // LEGACY remove
224 
225 #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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
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.
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.