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 =========================================================================*/
53 #ifndef vtkMarchingCubes_h
54 #define vtkMarchingCubes_h
55 
56 #include "vtkFiltersCoreModule.h" // For export macro
57 #include "vtkPolyDataAlgorithm.h"
58 
59 #include "vtkContourValues.h" // Needed for direct access to ContourValues
60 
62 
63 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
64 {
65 public:
66  static vtkMarchingCubes *New();
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
70  // Methods to set contour values
71  void SetValue(int i, double value);
72  double GetValue(int i);
73  double *GetValues();
74  void GetValues(double *contourValues);
75  void SetNumberOfContours(int number);
76  int GetNumberOfContours();
77  void GenerateValues(int numContours, double range[2]);
78  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
79 
80  // Because we delegate to vtkContourValues
81  vtkMTimeType GetMTime() override;
82 
84 
90  vtkSetMacro(ComputeNormals,vtkTypeBool);
91  vtkGetMacro(ComputeNormals,vtkTypeBool);
92  vtkBooleanMacro(ComputeNormals,vtkTypeBool);
94 
96 
104  vtkSetMacro(ComputeGradients,vtkTypeBool);
105  vtkGetMacro(ComputeGradients,vtkTypeBool);
106  vtkBooleanMacro(ComputeGradients,vtkTypeBool);
108 
110 
113  vtkSetMacro(ComputeScalars,vtkTypeBool);
114  vtkGetMacro(ComputeScalars,vtkTypeBool);
115  vtkBooleanMacro(ComputeScalars,vtkTypeBool);
117 
119 
123  void SetLocator(vtkIncrementalPointLocator *locator);
124  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
126 
131  void CreateDefaultLocator();
132 
133 protected:
135  ~vtkMarchingCubes() override;
136 
138  int FillInputPortInformation(int port, vtkInformation *info) override;
139 
145 private:
146  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
147  void operator=(const vtkMarchingCubes&) = delete;
148 };
149 
154 inline void vtkMarchingCubes::SetValue(int i, double value)
155 {this->ContourValues->SetValue(i,value);}
156 
160 inline double vtkMarchingCubes::GetValue(int i)
161 {return this->ContourValues->GetValue(i);}
162 
168 {return this->ContourValues->GetValues();}
169 
175 inline void vtkMarchingCubes::GetValues(double *contourValues)
176 {this->ContourValues->GetValues(contourValues);}
177 
184 {this->ContourValues->SetNumberOfContours(number);}
185 
190 {return this->ContourValues->GetNumberOfContours();}
191 
196 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
197 {this->ContourValues->GenerateValues(numContours, range);}
198 
203 inline void vtkMarchingCubes::GenerateValues(int numContours, double
204  rangeStart, double rangeEnd)
205 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
206 
207 #endif
vtkMarchingCubes::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkMarchingCubes.h:142
vtkMarchingCubes
generate isosurface(s) from volume
Definition: vtkMarchingCubes.h:63
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkX3D::value
Definition: vtkX3D.h:220
vtkMarchingCubes::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingCubes.h:160
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:189
vtkX3D::range
Definition: vtkX3D.h:238
vtkMarchingCubes::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingCubes.h:140
vtkMarchingCubes::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingCubes.h:183
vtkMarchingCubes::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingCubes.h:144
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMarchingCubes::SetValue
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition: vtkMarchingCubes.h:154
vtkMarchingCubes::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingCubes.h:196
vtkPolyDataAlgorithm.h
vtkMarchingCubes::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkMarchingCubes.h:141
vtkX3D::port
Definition: vtkX3D.h:447
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
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
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
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.
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkX3D::info
Definition: vtkX3D.h:376
vtkMarchingCubes::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingCubes.h:167
vtkMarchingCubes::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkMarchingCubes.h:143
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44