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 =========================================================================*/
39 #ifndef vtkMarchingCubes_h
40 #define vtkMarchingCubes_h
41 
42 #include "vtkFiltersCoreModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 #include "vtkContourValues.h" // Needed for direct access to ContourValues
46 
48 
49 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
50 {
51 public:
52  static vtkMarchingCubes *New();
54  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
55 
56  // Methods to set contour values
57  void SetValue(int i, double value);
58  double GetValue(int i);
59  double *GetValues();
60  void GetValues(double *contourValues);
61  void SetNumberOfContours(int number);
62  int GetNumberOfContours();
63  void GenerateValues(int numContours, double range[2]);
64  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
65 
66  // Because we delegate to vtkContourValues
67  vtkMTimeType GetMTime() VTK_OVERRIDE;
68 
70 
76  vtkSetMacro(ComputeNormals,int);
77  vtkGetMacro(ComputeNormals,int);
78  vtkBooleanMacro(ComputeNormals,int);
80 
82 
90  vtkSetMacro(ComputeGradients,int);
91  vtkGetMacro(ComputeGradients,int);
92  vtkBooleanMacro(ComputeGradients,int);
94 
96 
99  vtkSetMacro(ComputeScalars,int);
100  vtkGetMacro(ComputeScalars,int);
101  vtkBooleanMacro(ComputeScalars,int);
103 
105 
109  void SetLocator(vtkIncrementalPointLocator *locator);
110  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
112 
117  void CreateDefaultLocator();
118 
119 protected:
121  ~vtkMarchingCubes() VTK_OVERRIDE;
122 
123  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
124  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
125 
126  vtkContourValues *ContourValues;
127  int ComputeNormals;
128  int ComputeGradients;
129  int ComputeScalars;
130  vtkIncrementalPointLocator *Locator;
131 private:
132  vtkMarchingCubes(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
133  void operator=(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
134 };
135 
140 inline void vtkMarchingCubes::SetValue(int i, double value)
141 {this->ContourValues->SetValue(i,value);}
142 
146 inline double vtkMarchingCubes::GetValue(int i)
147 {return this->ContourValues->GetValue(i);}
148 
154 {return this->ContourValues->GetValues();}
155 
161 inline void vtkMarchingCubes::GetValues(double *contourValues)
162 {this->ContourValues->GetValues(contourValues);}
163 
170 {this->ContourValues->SetNumberOfContours(number);}
171 
176 {return this->ContourValues->GetNumberOfContours();}
177 
182 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
183 {this->ContourValues->GenerateValues(numContours, range);}
184 
189 inline void vtkMarchingCubes::GenerateValues(int numContours, double
190  rangeStart, double rangeEnd)
191 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
192 
193 #endif
int GetNumberOfContours()
Get the number of contours in the list of contour values.
helper object to manage setting and generating contour values
Store vtkAlgorithm input/output information.
Abstract class in support of both point location and point insertion.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
static vtkPolyDataAlgorithm * New()
double * GetValues()
Get a pointer to an array of contour values.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:39
generate isosurface(s) from volume
virtual vtkMTimeType GetMTime()
Return this object's modified time.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double GetValue(int i)
Get the ith contour value.
Store zero or more vtkInformation instances.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
void SetValue(int i, double value)
Set the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.