VTK
vtkImageMarchingCubes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageMarchingCubes.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 =========================================================================*/
41 #ifndef __vtkImageMarchingCubes_h
42 #define __vtkImageMarchingCubes_h
43 
44 #include "vtkPolyDataAlgorithm.h"
45 
46 #include "vtkContourValues.h" // Needed for direct access to ContourValues
47 
48 class vtkCellArray;
49 class vtkFloatArray;
50 class vtkImageData;
51 class vtkPoints;
52 
54 {
55 public:
56  static vtkImageMarchingCubes *New();
58  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
62  void SetValue(int i, double value);
63  double GetValue(int i);
64  double *GetValues();
65  void GetValues(double *contourValues);
66  void SetNumberOfContours(int number);
67  int GetNumberOfContours();
68  void GenerateValues(int numContours, double range[2]);
69  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
71 
74  unsigned long int GetMTime();
75 
77 
78  vtkSetMacro(ComputeScalars, int);
79  vtkGetMacro(ComputeScalars, int);
80  vtkBooleanMacro(ComputeScalars, int);
82 
84 
88  vtkSetMacro(ComputeNormals, int);
89  vtkGetMacro(ComputeNormals, int);
90  vtkBooleanMacro(ComputeNormals, int);
92 
94 
100  vtkSetMacro(ComputeGradients, int);
101  vtkGetMacro(ComputeGradients, int);
102  vtkBooleanMacro(ComputeGradients, int);
104 
105  // Should be protected, but the templated functions need these
106  int ComputeScalars;
110 
116 
117  int GetLocatorPoint(int cellX, int cellY, int edge);
118  void AddLocatorPoint(int cellX, int cellY, int edge, int ptId);
119  void IncrementLocatorZ();
120 
122 
125  vtkSetMacro(InputMemoryLimit, int);
126  vtkGetMacro(InputMemoryLimit, int);
128 
129 protected:
132 
135 
137 
143 
146 
147  void March(vtkImageData *inData, int chunkMin, int chunkMax,
148  int numContours, double *values);
149  void InitializeLocator(int min0, int max0, int min1, int max1);
150  void DeleteLocator();
151  int *GetLocatorPointer(int cellX, int cellY, int edge);
152 
153 private:
154  vtkImageMarchingCubes(const vtkImageMarchingCubes&); // Not implemented.
155  void operator=(const vtkImageMarchingCubes&); // Not implemented.
156 };
157 
159 
161 inline void vtkImageMarchingCubes::SetValue(int i, double value)
162 {this->ContourValues->SetValue(i,value);}
164 
166 
168 {return this->ContourValues->GetValue(i);}
170 
172 
175 {return this->ContourValues->GetValues();}
177 
179 
182 inline void vtkImageMarchingCubes::GetValues(double *contourValues)
183 {this->ContourValues->GetValues(contourValues);}
185 
187 
191 {this->ContourValues->SetNumberOfContours(number);}
193 
195 
197 {return this->ContourValues->GetNumberOfContours();}
199 
201 
203 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
204 {this->ContourValues->GenerateValues(numContours, range);}
206 
208 
210 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
211  rangeStart, double rangeEnd)
212 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
214 
215 #endif