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
int GetNumberOfContours()
Get the number of contours in the list of contour values.
helper object to manage setting and generating contour values
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool ComputeScalars
Abstract class in support of both point location and point insertion.
vtkTypeBool ComputeNormals
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
double GetValue(int i)
Get the ith contour value.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
double * GetValues()
Get a pointer to an array of contour values.
double * GetValues()
Return a pointer to a list of contour values.
vtkIncrementalPointLocator * Locator
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.
vtkTypeBool ComputeGradients
double GetValue(int i)
Get the ith contour value.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
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.
vtkContourValues * ContourValues