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 =========================================================================*/
33 #ifndef vtkMarchingCubes_h
34 #define vtkMarchingCubes_h
35 
36 #include "vtkFiltersCoreModule.h" // For export macro
37 #include "vtkPolyDataAlgorithm.h"
38 
39 #include "vtkContourValues.h" // Needed for direct access to ContourValues
40 
42 
43 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
44 {
45 public:
46  static vtkMarchingCubes *New();
48  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
49 
50  // Methods to set contour values
51  void SetValue(int i, double value);
52  double GetValue(int i);
53  double *GetValues();
54  void GetValues(double *contourValues);
55  void SetNumberOfContours(int number);
56  int GetNumberOfContours();
57  void GenerateValues(int numContours, double range[2]);
58  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
59 
60  // Because we delegate to vtkContourValues
61  vtkMTimeType GetMTime() VTK_OVERRIDE;
62 
64 
70  vtkSetMacro(ComputeNormals,int);
71  vtkGetMacro(ComputeNormals,int);
72  vtkBooleanMacro(ComputeNormals,int);
74 
76 
84  vtkSetMacro(ComputeGradients,int);
85  vtkGetMacro(ComputeGradients,int);
86  vtkBooleanMacro(ComputeGradients,int);
88 
90 
93  vtkSetMacro(ComputeScalars,int);
94  vtkGetMacro(ComputeScalars,int);
95  vtkBooleanMacro(ComputeScalars,int);
97 
99 
103  void SetLocator(vtkIncrementalPointLocator *locator);
104  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
106 
111  void CreateDefaultLocator();
112 
113 protected:
115  ~vtkMarchingCubes() VTK_OVERRIDE;
116 
117  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
118  int FillInputPortInformation(int port, vtkInformation *info) VTK_OVERRIDE;
119 
120  vtkContourValues *ContourValues;
121  int ComputeNormals;
122  int ComputeGradients;
123  int ComputeScalars;
125 private:
126  vtkMarchingCubes(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
127  void operator=(const vtkMarchingCubes&) VTK_DELETE_FUNCTION;
128 };
129 
134 inline void vtkMarchingCubes::SetValue(int i, double value)
135 {this->ContourValues->SetValue(i,value);}
136 
140 inline double vtkMarchingCubes::GetValue(int i)
141 {return this->ContourValues->GetValue(i);}
142 
148 {return this->ContourValues->GetValues();}
149 
155 inline void vtkMarchingCubes::GetValues(double *contourValues)
156 {this->ContourValues->GetValues(contourValues);}
157 
164 {this->ContourValues->SetNumberOfContours(number);}
165 
170 {return this->ContourValues->GetNumberOfContours();}
171 
176 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
177 {this->ContourValues->GenerateValues(numContours, range);}
178 
183 inline void vtkMarchingCubes::GenerateValues(int numContours, double
184  rangeStart, double rangeEnd)
185 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
186 
187 #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.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
Abstract class in support of both point location and point insertion.
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:33
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.