VTK
vtkHyperOctreeContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkHyperOctreeContourFilter.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 vtkHyperOctreeContourFilter_h
49 #define vtkHyperOctreeContourFilter_h
50 
51 #include "vtkFiltersHyperTreeModule.h" // For export macro
52 #include "vtkPolyDataAlgorithm.h"
53 
54 #include "vtkContourValues.h" // Needed for inline methods
55 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE
56 
58 class vtkHyperOctree;
60 class vtkTetra;
62 
65 class vtkIdTypeArray;
66 class vtkHyperOctreeContourPointsGrabber;
67 class vtkBitArray;
68 
69 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeContourFilter : public vtkPolyDataAlgorithm
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
74 
80 
89  void SetValue(int i, double value)
90  {
91  this->ContourValues->SetValue(i,value);
92  }
93 
97  double GetValue(int i)
98  {
99  return this->ContourValues->GetValue(i);
100  }
101 
106  double *GetValues()
107  {
108  return this->ContourValues->GetValues();
109  }
110 
116  void GetValues(double *contourValues)
117  {
118  this->ContourValues->GetValues(contourValues);
119  }
120 
126  void SetNumberOfContours(int number)
127  {
128  this->ContourValues->SetNumberOfContours(number);
129  }
130 
135  {
136  return this->ContourValues->GetNumberOfContours();
137  }
138 
143  void GenerateValues(int numContours, double range[2])
144  {
145  this->ContourValues->GenerateValues(numContours, range);
146  }
147 
152  void GenerateValues(int numContours, double
153  rangeStart, double rangeEnd)
154  {
155  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
156  }
157 
161  vtkMTimeType GetMTime() VTK_OVERRIDE;
162 
164 
168  void SetLocator(vtkIncrementalPointLocator *locator);
169  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
171 
176  void CreateDefaultLocator();
177 
178 protected:
180  ~vtkHyperOctreeContourFilter() VTK_OVERRIDE;
181 
182  int RequestData(vtkInformation* request,
183  vtkInformationVector** inputVector,
184  vtkInformationVector* outputVector) VTK_OVERRIDE;
185  int RequestUpdateExtent(vtkInformation*,
187  vtkInformationVector*) VTK_OVERRIDE;
188  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
189 
193  void ContourNode();
194 
198  double ComputePointValue(int ptIndices[3]);
199 
200  void ContourNode1D();
201 
202  vtkContourValues *ContourValues;
203  vtkIncrementalPointLocator *Locator;
204 
205  vtkIdList *CellPts; // for 2D case
206 
208  vtkPolyData *Output;
209 
210  vtkCellArray *NewVerts;
211  vtkCellArray *NewLines;
212  vtkCellArray *NewPolys;
213 
214  vtkCellData *InCD;
216  vtkCellData *OutCD;
217  vtkPointData *OutPD;
218  vtkOrderedTriangulator *Triangulator;
219 
220  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
221 
222 
223  vtkDoubleArray *CellScalars;
224  vtkTetra *Tetra;
225  vtkDoubleArray *TetScalars;
226 
227  vtkPolygon *Polygon;
228 
230  vtkHyperOctreeCursor *NeighborCursor;
231 
232  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
233  vtkIdType TotalCounter;
234  vtkIdType TemplateCounter; // record the number of octants that succceed
235  // to use the template triangulator
236 
237  vtkDataArray *InScalars;
238  vtkHyperOctreeContourPointsGrabber *Grabber;
239 
240  vtkDoubleArray *PointScalars;
241  int SortBy;
242  int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
243 
244  vtkLine *Line;
245  double LeftValue;
246  double LeftCoord;
247 
248  friend class vtkHyperOctreeContourPointsGrabber;
249 
250 private:
251  vtkHyperOctreeContourFilter(const vtkHyperOctreeContourFilter&) VTK_DELETE_FUNCTION;
252  void operator=(const vtkHyperOctreeContourFilter&) VTK_DELETE_FUNCTION;
253 };
254 #endif
helper object to manage setting and generating contour values
represent and manipulate point attribute data
Definition: vtkPointData.h:31
double * GetValues()
Get a pointer to an array of contour values.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
represent and manipulate cell attribute data
Definition: vtkCellData.h:32
Abstract class in support of both point location and point insertion.
void SetValue(int i, double value)
Methods to set / get contour values.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
helper class to generate triangulations
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numContours equally spaced contour values between specified range.
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
A dataset structured as a tree where each node has exactly 2^n children.
int GetNumberOfContours()
Get the number of contours in the list of contour values.
dynamic, self-adjusting array of double
static vtkPolyDataAlgorithm * New()
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:41
cell represents a 1D line
Definition: vtkLine.h:29
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
list of point or cell ids
Definition: vtkIdList.h:30
dataset represents arbitrary combinations of all possible cell types
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void GetValues(double *contourValues)
Fill a supplied list with contour values.
a cell that represents an n-sided polygon
Definition: vtkPolygon.h:39
dynamic, self-adjusting array of unsigned char
Objects that can traverse hyperoctree nodes.
object to represent cell connectivity
Definition: vtkCellArray.h:44
dynamic, self-adjusting array of bits
Definition: vtkBitArray.h:33
double GetValue(int i)
Get the ith contour value.
generate isosurfaces/isolines from scalar values
Store zero or more vtkInformation instances.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.