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 =========================================================================*/
39 #ifndef __vtkHyperOctreeDualGridContourFilter_h
40 #define __vtkHyperOctreeDualGridContourFilter_h
41 
42 #include "vtkPolyDataAlgorithm.h"
43 
44 #include "vtkContourValues.h" // Needed for inline methods
45 #include "vtkCutter.h" // for VTK_SORT_BY_VALUE
46 
47 class vtkHyperOctree;
48 class vtkTetra;
51 
55 class vtkIdTypeArray;
56 class vtkBitArray;
58 
60 {
61 public:
63  void PrintSelf(ostream& os, vtkIndent indent);
64 
68 
74  void SetValue(int i, double value)
75  {
76  this->ContourValues->SetValue(i,value);
77  }
79 
81 
82  double GetValue(int i)
83  {
84  return this->ContourValues->GetValue(i);
85  }
87 
89 
91  double *GetValues()
92  {
93  return this->ContourValues->GetValues();
94  }
96 
98 
101  void GetValues(double *contourValues)
102  {
103  this->ContourValues->GetValues(contourValues);
104  }
106 
108 
111  void SetNumberOfContours(int number)
112  {
113  this->ContourValues->SetNumberOfContours(number);
114  }
116 
118 
119  int GetNumberOfContours()
120  {
121  return this->ContourValues->GetNumberOfContours();
122  }
124 
126 
128  void GenerateValues(int numContours, double range[2])
129  {
130  this->ContourValues->GenerateValues(numContours, range);
131  }
133 
135 
137  void GenerateValues(int numContours, double
138  rangeStart, double rangeEnd)
139  {
140  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
141  }
143 
145  unsigned long GetMTime();
146 
148 
150  void SetLocator(vtkIncrementalPointLocator *locator);
151  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
153 
156  void CreateDefaultLocator();
157 
158 protected:
161 
162  virtual int RequestData(vtkInformation* request,
163  vtkInformationVector** inputVector,
164  vtkInformationVector* outputVector);
165  virtual int RequestUpdateExtent(vtkInformation*,
169 
171  void ContourNode();
172 
173  void TraverseNeighborhoodRecursively(
174  vtkHyperOctreeLightWeightCursor* neighborhood,
175  unsigned short* xyzIds);
176  void EvaluatePoint(vtkHyperOctreeLightWeightCursor* neighborhood,
177  unsigned short* xyzIds);
178 
179  void ContourNode1D();
180 
183 
186 
188 
192  // To compute points on the fly.
193  // These are set to the input origin and size.
194  double Origin[3];
195  double Size[3];
196 
197  // This is a table for traversing a neighborhood down an octree.
198  // 8 children x 8 cursors
199  // First three bits encode the child, rest encode the cursor id.
200  // 8xCursorId + childId.
201  unsigned char NeighborhoodTraversalTable[64];
202  void GenerateTraversalTable();
203 
204 private:
206  void operator=(const vtkHyperOctreeDualGridContourFilter&); // Not implemented.
207 };
208 #endif