VTK  9.2.20230320
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 =========================================================================*/
149 #ifndef vtkMarchingCubes_h
150 #define vtkMarchingCubes_h
151 
152 #include "vtkFiltersCoreModule.h" // For export macro
153 #include "vtkPolyDataAlgorithm.h"
154 
155 #include "vtkContourValues.h" // Needed for direct access to ContourValues
156 
157 VTK_ABI_NAMESPACE_BEGIN
159 
160 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
161 {
162 public:
165  void PrintSelf(ostream& os, vtkIndent indent) override;
166 
167  // Methods to set contour values
168  void SetValue(int i, double value);
169  double GetValue(int i);
170  double* GetValues();
171  void GetValues(double* contourValues);
172  void SetNumberOfContours(int number);
173  vtkIdType GetNumberOfContours();
174  void GenerateValues(int numContours, double range[2]);
175  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
176 
177  // Because we delegate to vtkContourValues
178  vtkMTimeType GetMTime() override;
179 
181 
187  vtkSetMacro(ComputeNormals, vtkTypeBool);
188  vtkGetMacro(ComputeNormals, vtkTypeBool);
189  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
191 
193 
201  vtkSetMacro(ComputeGradients, vtkTypeBool);
202  vtkGetMacro(ComputeGradients, vtkTypeBool);
203  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
205 
207 
210  vtkSetMacro(ComputeScalars, vtkTypeBool);
211  vtkGetMacro(ComputeScalars, vtkTypeBool);
212  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
214 
216 
221  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
223 
229 
230 protected:
232  ~vtkMarchingCubes() override;
233 
236 
242 
243 private:
244  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
245  void operator=(const vtkMarchingCubes&) = delete;
246 };
247 
252 inline void vtkMarchingCubes::SetValue(int i, double value)
253 {
254  this->ContourValues->SetValue(i, value);
255 }
256 
260 inline double vtkMarchingCubes::GetValue(int i)
261 {
262  return this->ContourValues->GetValue(i);
263 }
264 
270 {
271  return this->ContourValues->GetValues();
272 }
273 
279 inline void vtkMarchingCubes::GetValues(double* contourValues)
280 {
281  this->ContourValues->GetValues(contourValues);
282 }
283 
290 {
291  this->ContourValues->SetNumberOfContours(number);
292 }
293 
298 {
299  return this->ContourValues->GetNumberOfContours();
300 }
301 
306 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
307 {
308  this->ContourValues->GenerateValues(numContours, range);
309 }
310 
315 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
316 {
317  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
318 }
319 
320 VTK_ABI_NAMESPACE_END
321 #endif
helper object to manage setting and generating contour values
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
double * GetValues()
Return a pointer to a list of contour values.
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:120
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate isosurface(s) from volume
vtkIncrementalPointLocator * Locator
vtkMTimeType GetMTime() override
Return this object's modified time.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkMarchingCubes * New()
void CreateDefaultLocator()
Create default locator.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkTypeBool ComputeNormals
vtkTypeBool ComputeScalars
void SetLocator(vtkIncrementalPointLocator *locator)
override the default locator.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
double * GetValues()
Get a pointer to an array of contour values.
vtkTypeBool ComputeGradients
double GetValue(int i)
Get the ith contour value.
vtkContourValues * ContourValues
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
~vtkMarchingCubes() override
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Superclass for algorithms that produce only polydata as output.
@ info
Definition: vtkX3D.h:388
@ value
Definition: vtkX3D.h:232
@ port
Definition: vtkX3D.h:459
@ range
Definition: vtkX3D.h:250
int vtkTypeBool
Definition: vtkABI.h:71
int vtkIdType
Definition: vtkType.h:327
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:282