VTK  9.3.0
vtkMarchingCubes.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
38 #ifndef vtkMarchingCubes_h
39 #define vtkMarchingCubes_h
40 
41 #include "vtkFiltersCoreModule.h" // For export macro
42 #include "vtkPolyDataAlgorithm.h"
43 
44 #include "vtkContourValues.h" // Needed for direct access to ContourValues
45 
46 VTK_ABI_NAMESPACE_BEGIN
48 
49 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
50 {
51 public:
52  static vtkMarchingCubes* New();
54  void PrintSelf(ostream& os, vtkIndent indent) 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  vtkIdType 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() override;
68 
70 
76  vtkSetMacro(ComputeNormals, vtkTypeBool);
77  vtkGetMacro(ComputeNormals, vtkTypeBool);
78  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
80 
82 
90  vtkSetMacro(ComputeGradients, vtkTypeBool);
91  vtkGetMacro(ComputeGradients, vtkTypeBool);
92  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
94 
96 
99  vtkSetMacro(ComputeScalars, vtkTypeBool);
100  vtkGetMacro(ComputeScalars, vtkTypeBool);
101  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
103 
105 
110  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
112 
118 
119 protected:
121  ~vtkMarchingCubes() override;
122 
125 
131 
132 private:
133  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
134  void operator=(const vtkMarchingCubes&) = delete;
135 };
136 
141 inline void vtkMarchingCubes::SetValue(int i, double value)
142 {
143  this->ContourValues->SetValue(i, value);
144 }
145 
149 inline double vtkMarchingCubes::GetValue(int i)
150 {
151  return this->ContourValues->GetValue(i);
152 }
153 
159 {
160  return this->ContourValues->GetValues();
161 }
162 
168 inline void vtkMarchingCubes::GetValues(double* contourValues)
169 {
170  this->ContourValues->GetValues(contourValues);
171 }
172 
179 {
180  this->ContourValues->SetNumberOfContours(number);
181 }
182 
187 {
188  return this->ContourValues->GetNumberOfContours();
189 }
190 
195 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
196 {
197  this->ContourValues->GenerateValues(numContours, range);
198 }
199 
204 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
205 {
206  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
207 }
208 
209 VTK_ABI_NAMESPACE_END
210 #endif
helper object to manage setting and generating contour values
int GetNumberOfContours()
Return the number of contours in the.
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.
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:29
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:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270