VTK  9.3.20240418
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
147 #ifndef vtkMarchingCubes_h
148 #define vtkMarchingCubes_h
149 
150 #include "vtkFiltersCoreModule.h" // For export macro
151 #include "vtkPolyDataAlgorithm.h"
152 
153 #include "vtkContourValues.h" // Needed for direct access to ContourValues
154 
155 VTK_ABI_NAMESPACE_BEGIN
157 
158 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
159 {
160 public:
163  void PrintSelf(ostream& os, vtkIndent indent) override;
164 
165  // Methods to set contour values
166  void SetValue(int i, double value);
167  double GetValue(int i);
168  double* GetValues();
169  void GetValues(double* contourValues);
170  void SetNumberOfContours(int number);
171  vtkIdType GetNumberOfContours();
172  void GenerateValues(int numContours, double range[2]);
173  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
174 
175  // Because we delegate to vtkContourValues
176  vtkMTimeType GetMTime() override;
177 
179 
185  vtkSetMacro(ComputeNormals, vtkTypeBool);
186  vtkGetMacro(ComputeNormals, vtkTypeBool);
187  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
189 
191 
199  vtkSetMacro(ComputeGradients, vtkTypeBool);
200  vtkGetMacro(ComputeGradients, vtkTypeBool);
201  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
203 
205 
208  vtkSetMacro(ComputeScalars, vtkTypeBool);
209  vtkGetMacro(ComputeScalars, vtkTypeBool);
210  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
212 
214 
219  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
221 
227 
228 protected:
230  ~vtkMarchingCubes() override;
231 
234 
240 
241 private:
242  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
243  void operator=(const vtkMarchingCubes&) = delete;
244 };
245 
250 inline void vtkMarchingCubes::SetValue(int i, double value)
251 {
252  this->ContourValues->SetValue(i, value);
253 }
254 
258 inline double vtkMarchingCubes::GetValue(int i)
259 {
260  return this->ContourValues->GetValue(i);
261 }
262 
268 {
269  return this->ContourValues->GetValues();
270 }
271 
277 inline void vtkMarchingCubes::GetValues(double* contourValues)
278 {
279  this->ContourValues->GetValues(contourValues);
280 }
281 
288 {
289  this->ContourValues->SetNumberOfContours(number);
290 }
291 
296 {
297  return this->ContourValues->GetNumberOfContours();
298 }
299 
304 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
305 {
306  this->ContourValues->GenerateValues(numContours, range);
307 }
308 
313 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
314 {
315  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
316 }
317 
318 VTK_ABI_NAMESPACE_END
319 #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:108
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