VTK
vtkMarchingCubes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMarchingCubes.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 =========================================================================*/
38 #ifndef __vtkMarchingCubes_h
39 #define __vtkMarchingCubes_h
40 
41 #include "vtkPolyDataAlgorithm.h"
42 
43 #include "vtkContourValues.h" // Needed for direct access to ContourValues
44 
46 
48 {
49 public:
50  static vtkMarchingCubes *New();
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
54  // Methods to set contour values
55  void SetValue(int i, double value);
56  double GetValue(int i);
57  double *GetValues();
58  void GetValues(double *contourValues);
59  void SetNumberOfContours(int number);
60  int GetNumberOfContours();
61  void GenerateValues(int numContours, double range[2]);
62  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
63 
64  // Because we delegate to vtkContourValues
65  unsigned long int GetMTime();
66 
68 
72  vtkSetMacro(ComputeNormals,int);
73  vtkGetMacro(ComputeNormals,int);
74  vtkBooleanMacro(ComputeNormals,int);
76 
78 
84  vtkSetMacro(ComputeGradients,int);
85  vtkGetMacro(ComputeGradients,int);
86  vtkBooleanMacro(ComputeGradients,int);
88 
90 
91  vtkSetMacro(ComputeScalars,int);
92  vtkGetMacro(ComputeScalars,int);
93  vtkBooleanMacro(ComputeScalars,int);
95 
97 
99  void SetLocator(vtkIncrementalPointLocator *locator);
100  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
102 
105  void CreateDefaultLocator();
106 
107 protected:
109  ~vtkMarchingCubes();
110 
113 
119 private:
120  vtkMarchingCubes(const vtkMarchingCubes&); // Not implemented.
121  void operator=(const vtkMarchingCubes&); // Not implemented.
122 };
123 
125 
127 inline void vtkMarchingCubes::SetValue(int i, double value)
128 {this->ContourValues->SetValue(i,value);}
130 
132 
133 inline double vtkMarchingCubes::GetValue(int i)
134 {return this->ContourValues->GetValue(i);}
136 
138 
141 {return this->ContourValues->GetValues();}
143 
145 
148 inline void vtkMarchingCubes::GetValues(double *contourValues)
149 {this->ContourValues->GetValues(contourValues);}
151 
153 
157 {this->ContourValues->SetNumberOfContours(number);}
159 
161 
163 {return this->ContourValues->GetNumberOfContours();}
165 
167 
169 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
170 {this->ContourValues->GenerateValues(numContours, range);}
172 
174 
176 inline void vtkMarchingCubes::GenerateValues(int numContours, double
177  rangeStart, double rangeEnd)
178 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
180 
181 #endif