VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
50 #ifndef __vtkHyperOctreeContourFilter_h
51 #define __vtkHyperOctreeContourFilter_h
52 
53 #include "vtkFiltersHyperTreeModule.h" // For export macro
54 #include "vtkPolyDataAlgorithm.h"
55 
56 #include "vtkContourValues.h" // Needed for inline methods
57 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE
58 
60 class vtkHyperOctree;
61 class vtkOrderedTriangulator;
62 class vtkTetra;
64 
65 class vtkUnstructuredGrid;
66 class vtkUnsignedCharArray;
67 class vtkIdTypeArray;
68 class vtkHyperOctreeContourPointsGrabber;
69 class vtkBitArray;
70 
71 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeContourFilter : public vtkPolyDataAlgorithm
72 {
73 public:
75  void PrintSelf(ostream& os, vtkIndent indent);
76 
80 
86  void SetValue(int i, double value)
87  {
88  this->ContourValues->SetValue(i,value);
89  }
91 
93 
94  double GetValue(int i)
95  {
96  return this->ContourValues->GetValue(i);
97  }
99 
101 
103  double *GetValues()
104  {
105  return this->ContourValues->GetValues();
106  }
108 
110 
113  void GetValues(double *contourValues)
114  {
115  this->ContourValues->GetValues(contourValues);
116  }
118 
120 
123  void SetNumberOfContours(int number)
124  {
125  this->ContourValues->SetNumberOfContours(number);
126  }
128 
130 
132  {
133  return this->ContourValues->GetNumberOfContours();
134  }
136 
138 
140  void GenerateValues(int numContours, double range[2])
141  {
142  this->ContourValues->GenerateValues(numContours, range);
143  }
145 
147 
149  void GenerateValues(int numContours, double
150  rangeStart, double rangeEnd)
151  {
152  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
153  }
155 
157  unsigned long GetMTime();
158 
160 
162  void SetLocator(vtkIncrementalPointLocator *locator);
163  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
165 
168  void CreateDefaultLocator();
169 
170 protected:
173 
174  virtual int RequestData(vtkInformation* request,
175  vtkInformationVector** inputVector,
176  vtkInformationVector* outputVector);
177  virtual int RequestUpdateExtent(vtkInformation*,
178  vtkInformationVector**,
179  vtkInformationVector*);
180  virtual int FillInputPortInformation(int port, vtkInformation *info);
181 
183  void ContourNode();
184 
186  double ComputePointValue(int ptIndices[3]);
187 
188  void ContourNode1D();
189 
192 
193  vtkIdList *CellPts; // for 2D case
194 
195  vtkHyperOctree *Input;
197 
201 
203  vtkPointData *InPD;
205  vtkPointData *OutPD;
206  vtkOrderedTriangulator *Triangulator;
207 
208  vtkHyperOctreeCursor *Sibling; // to avoid allocation in the loop
209 
210 
211  vtkDoubleArray *CellScalars;
213  vtkDoubleArray *TetScalars;
214 
215  vtkPolygon *Polygon;
216 
219 
220  vtkIdType CellTypeCounter[65536]; // up-to-65536 points per octant
221  vtkIdType TotalCounter;
222  vtkIdType TemplateCounter; // record the number of octants that succceed
223  // to use the template triangulator
224 
225  vtkDataArray *InScalars;
226  vtkHyperOctreeContourPointsGrabber *Grabber;
227 
228  vtkDoubleArray *PointScalars;
229  int SortBy;
230  int Iter; // iterate over contour values in case of VTK_SORT_BY_CELL
231 
232  vtkLine *Line;
233  double LeftValue;
234  double LeftCoord;
235 
236  //BTX
237  friend class vtkHyperOctreeContourPointsGrabber;
238  //ETX
239 private:
240  vtkHyperOctreeContourFilter(const vtkHyperOctreeContourFilter&); // Not implemented.
241  void operator=(const vtkHyperOctreeContourFilter&); // Not implemented.
242 };
243 #endif
helper object to manage setting and generating contour values
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkHyperOctreeContourPointsGrabber * Grabber
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
vtkIncrementalPointLocator * Locator
represent and manipulate cell attribute data
Definition: vtkCellData.h:37
Abstract class in support of both point location and point insertion.
void SetValue(int i, double value)
void GenerateValues(int numContours, double range[2])
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:82
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
a 3D cell that represents a tetrahedron
Definition: vtkTetra.h:46
virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Superclass for algorithms that produce only polydata as output.
void GetValues(double *contourValues)
Objects that can traverse hyperoctree nodes.
object to represent cell connectivity
Definition: vtkCellArray.h:49
generate isosurfaces/isolines from scalar values