VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 =========================================================================*/
39 #ifndef __vtkHyperOctreeDualGridContourFilter_h
40 #define __vtkHyperOctreeDualGridContourFilter_h
41 
42 #include "vtkFiltersHyperTreeModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 #include "vtkContourValues.h" // Needed for inline methods
46 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE
47 
48 class vtkHyperOctree;
49 class vtkTetra;
50 class vtkHyperOctreeCursor;
51 class vtkHyperOctreeLightWeightCursor;
52 
53 class vtkDataSetAttributes;
54 class vtkUnstructuredGrid;
55 class vtkUnsignedCharArray;
56 class vtkIdTypeArray;
57 class vtkBitArray;
58 class vtkIncrementalPointLocator;
59 
60 class VTKFILTERSHYPERTREE_EXPORT vtkHyperOctreeDualGridContourFilter : public vtkPolyDataAlgorithm
61 {
62 public:
63  vtkTypeMacro(vtkHyperOctreeDualGridContourFilter,vtkPolyDataAlgorithm);
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
69 
75  void SetValue(int i, double value)
76  {
77  this->ContourValues->SetValue(i,value);
78  }
80 
82 
83  double GetValue(int i)
84  {
85  return this->ContourValues->GetValue(i);
86  }
88 
90 
92  double *GetValues()
93  {
94  return this->ContourValues->GetValues();
95  }
97 
99 
102  void GetValues(double *contourValues)
103  {
104  this->ContourValues->GetValues(contourValues);
105  }
107 
109 
112  void SetNumberOfContours(int number)
113  {
114  this->ContourValues->SetNumberOfContours(number);
115  }
117 
119 
121  {
122  return this->ContourValues->GetNumberOfContours();
123  }
125 
127 
129  void GenerateValues(int numContours, double range[2])
130  {
131  this->ContourValues->GenerateValues(numContours, range);
132  }
134 
136 
138  void GenerateValues(int numContours, double
139  rangeStart, double rangeEnd)
140  {
141  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
142  }
144 
146  unsigned long GetMTime();
147 
149 
151  void SetLocator(vtkIncrementalPointLocator *locator);
152  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
154 
157  void CreateDefaultLocator();
158 
159 protected:
162 
163  virtual int RequestData(vtkInformation* request,
164  vtkInformationVector** inputVector,
165  vtkInformationVector* outputVector);
166  virtual int RequestUpdateExtent(vtkInformation*,
167  vtkInformationVector**,
168  vtkInformationVector*);
169  virtual int FillInputPortInformation(int port, vtkInformation *info);
170 
172  void ContourNode();
173 
174  void TraverseNeighborhoodRecursively(
175  vtkHyperOctreeLightWeightCursor* neighborhood,
176  unsigned short* xyzIds);
177  void EvaluatePoint(vtkHyperOctreeLightWeightCursor* neighborhood,
178  unsigned short* xyzIds);
179 
180  void ContourNode1D();
181 
182  vtkContourValues *ContourValues;
183  vtkIncrementalPointLocator *Locator;
184 
185  vtkHyperOctree *Input;
186  vtkPolyData *Output;
187 
188  vtkCellArray *NewPolys;
189 
190  vtkDataSetAttributes *InPD;
191  vtkDataSetAttributes *OutPD;
192  vtkDataArray *InScalars;
193  // To compute points on the fly.
194  // These are set to the input origin and size.
195  double Origin[3];
196  double Size[3];
197 
198  // This is a table for traversing a neighborhood down an octree.
199  // 8 children x 8 cursors
200  // First three bits encode the child, rest encode the cursor id.
201  // 8xCursorId + childId.
202  unsigned char NeighborhoodTraversalTable[64];
203  void GenerateTraversalTable();
204 
205 private:
207  void operator=(const vtkHyperOctreeDualGridContourFilter&); // Not implemented.
208 };
209 #endif
void GenerateValues(int numContours, double range[2])
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
generate isosurfaces/isolines from scalar values