VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 "vtkFiltersGeneralModule.h" // For export macro
45 #include "vtkPolyDataAlgorithm.h"
46 
47 #include "vtkContourValues.h" // Needed for direct access to ContourValues
48 
49 class vtkCellArray;
50 class vtkFloatArray;
51 class vtkImageData;
52 class vtkPoints;
53 
55 {
56 public:
57  static vtkImageMarchingCubes *New();
59  void PrintSelf(ostream& os, vtkIndent indent);
60 
62 
63  void SetValue(int i, double value);
64  double GetValue(int i);
65  double *GetValues();
66  void GetValues(double *contourValues);
67  void SetNumberOfContours(int number);
68  int GetNumberOfContours();
69  void GenerateValues(int numContours, double range[2]);
70  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
72 
75  unsigned long int GetMTime();
76 
78 
79  vtkSetMacro(ComputeScalars, int);
80  vtkGetMacro(ComputeScalars, int);
81  vtkBooleanMacro(ComputeScalars, int);
83 
85 
89  vtkSetMacro(ComputeNormals, int);
90  vtkGetMacro(ComputeNormals, int);
91  vtkBooleanMacro(ComputeNormals, int);
93 
95 
101  vtkSetMacro(ComputeGradients, int);
102  vtkGetMacro(ComputeGradients, int);
103  vtkBooleanMacro(ComputeGradients, int);
105 
106  // Should be protected, but the templated functions need these
107  int ComputeScalars;
111 
117 
118  vtkIdType GetLocatorPoint(int cellX, int cellY, int edge);
119  void AddLocatorPoint(int cellX, int cellY, int edge, vtkIdType ptId);
120  void IncrementLocatorZ();
121 
123 
126  vtkSetMacro(InputMemoryLimit, vtkIdType);
127  vtkGetMacro(InputMemoryLimit, vtkIdType);
129 
130 protected:
133 
136 
138 
144 
147 
148  void March(vtkImageData *inData, int chunkMin, int chunkMax,
149  int numContours, double *values);
150  void InitializeLocator(int min0, int max0, int min1, int max1);
151  void DeleteLocator();
152  vtkIdType *GetLocatorPointer(int cellX, int cellY, int edge);
153 
154 private:
155  vtkImageMarchingCubes(const vtkImageMarchingCubes&); // Not implemented.
156  void operator=(const vtkImageMarchingCubes&); // Not implemented.
157 };
158 
160 
162 inline void vtkImageMarchingCubes::SetValue(int i, double value)
163 {this->ContourValues->SetValue(i,value);}
165 
167 
169 {return this->ContourValues->GetValue(i);}
171 
173 
176 {return this->ContourValues->GetValues();}
178 
180 
183 inline void vtkImageMarchingCubes::GetValues(double *contourValues)
184 {this->ContourValues->GetValues(contourValues);}
186 
188 
192 {this->ContourValues->SetNumberOfContours(number);}
194 
196 
198 {return this->ContourValues->GetNumberOfContours();}
200 
202 
204 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double range[2])
205 {this->ContourValues->GenerateValues(numContours, range);}
207 
209 
211 inline void vtkImageMarchingCubes::GenerateValues(int numContours, double
212  rangeStart, double rangeEnd)
213 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
215 
216 #endif
helper object to manage setting and generating contour values
virtual int FillInputPortInformation(int port, vtkInformation *info)
void SetNumberOfContours(int number)
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
void SetNumberOfContours(const int number)
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:83
dynamic, self-adjusting array of float
Definition: vtkFloatArray.h:45
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
void GenerateValues(int numContours, double range[2])
int vtkIdType
Definition: vtkType.h:268
double GetValue(int i)
generate isosurface(s) from volume/images
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:619
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
double * GetValues()
Superclass for algorithms that produce only polydata as output.
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
GLboolean GLenum GLenum GLvoid * values
Definition: vtkgl.h:11354
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
#define VTKFILTERSGENERAL_EXPORT
void SetValue(int i, double value)
vtkContourValues * ContourValues
object to represent cell connectivity
Definition: vtkCellArray.h:49
Store zero or more vtkInformation instances.
#define vtkBooleanMacro(name, type)
Definition: vtkSetGet.h:234
int GetNumberOfContours()
void GenerateValues(int numContours, double range[2])
GLenum GLint * range
Definition: vtkgl.h:14180
void SetValue(int i, double value)
represent and manipulate 3D points
Definition: vtkPoints.h:39
#define vtkSetMacro(name, type)
Definition: vtkSetGet.h:69