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;
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
vtkMarchingCubes
generate isosurface(s) from volume
Definition: vtkMarchingCubes.h:49
vtkX3D::value
Definition: vtkX3D.h:220
vtkMarchingCubes::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingCubes.h:146
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkMarchingCubes::GetNumberOfContours
int GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingCubes.h:175
vtkX3D::range
Definition: vtkX3D.h:238
vtkMarchingCubes::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingCubes.h:169
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMarchingCubes::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingCubes.h:182
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkPolyDataAlgorithm.h
vtkX3D::port
Definition: vtkX3D.h:447
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:51
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContourValues.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkX3D::info
Definition: vtkX3D.h:376
vtkMarchingCubes::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingCubes.h:153
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44