00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00050 #ifndef __vtkHyperOctreeContourFilter_h
00051 #define __vtkHyperOctreeContourFilter_h
00052
00053 #include "vtkPolyDataAlgorithm.h"
00054
00055 #include "vtkContourValues.h"
00056 #include "vtkCutter.h"
00057
00058 class vtkPointLocator;
00059 class vtkHyperOctree;
00060 class vtkOrderedTriangulator;
00061 class vtkTetra;
00062 class vtkHyperOctreeCursor;
00063
00064 class vtkUnstructuredGrid;
00065 class vtkUnsignedCharArray;
00066 class vtkIdTypeArray;
00067 class vtkHyperOctreeContourPointsGrabber;
00068 class vtkBitArray;
00069
00070 class VTK_GRAPHICS_EXPORT vtkHyperOctreeContourFilter : public vtkPolyDataAlgorithm
00071 {
00072 public:
00073 vtkTypeRevisionMacro(vtkHyperOctreeContourFilter,vtkPolyDataAlgorithm);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00078 static vtkHyperOctreeContourFilter *New();
00079
00085 void SetValue(int i, double value)
00086 {
00087 this->ContourValues->SetValue(i,value);
00088 }
00090
00092
00093 double GetValue(int i)
00094 {
00095 return this->ContourValues->GetValue(i);
00096 }
00098
00100
00102 double *GetValues()
00103 {
00104 return this->ContourValues->GetValues();
00105 }
00107
00109
00112 void GetValues(double *contourValues)
00113 {
00114 this->ContourValues->GetValues(contourValues);
00115 }
00117
00119
00122 void SetNumberOfContours(int number)
00123 {
00124 this->ContourValues->SetNumberOfContours(number);
00125 }
00127
00129
00130 int GetNumberOfContours()
00131 {
00132 return this->ContourValues->GetNumberOfContours();
00133 }
00135
00137
00139 void GenerateValues(int numContours, double range[2])
00140 {
00141 this->ContourValues->GenerateValues(numContours, range);
00142 }
00144
00146
00148 void GenerateValues(int numContours, double
00149 rangeStart, double rangeEnd)
00150 {
00151 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
00152 }
00154
00156 unsigned long GetMTime();
00157
00159
00161 void SetLocator(vtkPointLocator *locator);
00162 vtkGetObjectMacro(Locator,vtkPointLocator);
00164
00167 void CreateDefaultLocator();
00168
00169 protected:
00170 vtkHyperOctreeContourFilter();
00171 ~vtkHyperOctreeContourFilter();
00172
00173 virtual int RequestData(vtkInformation* request,
00174 vtkInformationVector** inputVector,
00175 vtkInformationVector* outputVector);
00176 virtual int RequestUpdateExtent(vtkInformation*,
00177 vtkInformationVector**,
00178 vtkInformationVector*);
00179 virtual int FillInputPortInformation(int port, vtkInformation *info);
00180
00182 void ContourNode();
00183
00185 double ComputePointValue(int ptIndices[3]);
00186
00187 void ContourNode1D();
00188
00189 vtkContourValues *ContourValues;
00190 vtkPointLocator *Locator;
00191
00192 vtkIdList *CellPts;
00193
00194 vtkHyperOctree *Input;
00195 vtkPolyData *Output;
00196
00197 vtkCellArray *NewVerts;
00198 vtkCellArray *NewLines;
00199 vtkCellArray *NewPolys;
00200
00201 vtkCellData *InCD;
00202 vtkPointData *InPD;
00203 vtkCellData *OutCD;
00204 vtkPointData *OutPD;
00205 vtkOrderedTriangulator *Triangulator;
00206
00207 vtkHyperOctreeCursor *Sibling;
00208
00209
00210 vtkDoubleArray *CellScalars;
00211 vtkTetra *Tetra;
00212 vtkDoubleArray *TetScalars;
00213
00214 vtkPolygon *Polygon;
00215
00216 vtkHyperOctreeCursor *Cursor;
00217 vtkHyperOctreeCursor *NeighborCursor;
00218
00219 vtkIdType CellTypeCounter[65536];
00220 vtkIdType TotalCounter;
00221 vtkIdType TemplateCounter;
00222
00223
00224 vtkDataArray *InScalars;
00225 vtkHyperOctreeContourPointsGrabber *Grabber;
00226
00227 vtkDoubleArray *PointScalars;
00228 int SortBy;
00229 int Iter;
00230
00231 vtkLine *Line;
00232 double LeftValue;
00233 double LeftCoord;
00234
00235
00236 friend class vtkHyperOctreeContourPointsGrabber;
00237
00238 private:
00239 vtkHyperOctreeContourFilter(const vtkHyperOctreeContourFilter&);
00240 void operator=(const vtkHyperOctreeContourFilter&);
00241 };
00242 #endif