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
47 #ifndef vtkMarchingCubes_h
48 #define vtkMarchingCubes_h
49 
50 #include "vtkFiltersCoreModule.h" // For export macro
51 #include "vtkPolyDataAlgorithm.h"
52 
53 #include "vtkContourValues.h" // Needed for direct access to ContourValues
54 
55 VTK_ABI_NAMESPACE_BEGIN
57 
58 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
59 {
60 public:
61  static vtkMarchingCubes* New();
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
65  // Methods to set contour values
66  void SetValue(int i, double value);
67  double GetValue(int i);
68  double* GetValues();
69  void GetValues(double* contourValues);
70  void SetNumberOfContours(int number);
71  vtkIdType GetNumberOfContours();
72  void GenerateValues(int numContours, double range[2]);
73  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
74 
75  // Because we delegate to vtkContourValues
76  vtkMTimeType GetMTime() override;
77 
79 
85  vtkSetMacro(ComputeNormals, vtkTypeBool);
86  vtkGetMacro(ComputeNormals, vtkTypeBool);
87  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
89 
91 
99  vtkSetMacro(ComputeGradients, vtkTypeBool);
100  vtkGetMacro(ComputeGradients, vtkTypeBool);
101  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
103 
105 
108  vtkSetMacro(ComputeScalars, vtkTypeBool);
109  vtkGetMacro(ComputeScalars, vtkTypeBool);
110  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
112 
114 
119  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
121 
127 
128 protected:
130  ~vtkMarchingCubes() override;
131 
134 
140 
141 private:
142  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
143  void operator=(const vtkMarchingCubes&) = delete;
144 };
145 
150 inline void vtkMarchingCubes::SetValue(int i, double value)
151 {
152  this->ContourValues->SetValue(i, value);
153 }
154 
158 inline double vtkMarchingCubes::GetValue(int i)
159 {
160  return this->ContourValues->GetValue(i);
161 }
162 
168 {
169  return this->ContourValues->GetValues();
170 }
171 
177 inline void vtkMarchingCubes::GetValues(double* contourValues)
178 {
179  this->ContourValues->GetValues(contourValues);
180 }
181 
188 {
189  this->ContourValues->SetNumberOfContours(number);
190 }
191 
196 {
197  return this->ContourValues->GetNumberOfContours();
198 }
199 
204 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
205 {
206  this->ContourValues->GenerateValues(numContours, range);
207 }
208 
213 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
214 {
215  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
216 }
217 
218 VTK_ABI_NAMESPACE_END
219 #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:38
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