VTK  9.2.6
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 
158 
159 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
160 {
161 public:
164  void PrintSelf(ostream& os, vtkIndent indent) override;
165 
166  // Methods to set contour values
167  void SetValue(int i, double value);
168  double GetValue(int i);
169  double* GetValues();
170  void GetValues(double* contourValues);
171  void SetNumberOfContours(int number);
172  vtkIdType GetNumberOfContours();
173  void GenerateValues(int numContours, double range[2]);
174  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
175 
176  // Because we delegate to vtkContourValues
177  vtkMTimeType GetMTime() override;
178 
180 
186  vtkSetMacro(ComputeNormals, vtkTypeBool);
187  vtkGetMacro(ComputeNormals, vtkTypeBool);
188  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
190 
192 
200  vtkSetMacro(ComputeGradients, vtkTypeBool);
201  vtkGetMacro(ComputeGradients, vtkTypeBool);
202  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
204 
206 
209  vtkSetMacro(ComputeScalars, vtkTypeBool);
210  vtkGetMacro(ComputeScalars, vtkTypeBool);
211  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
213 
215 
220  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
222 
228 
229 protected:
231  ~vtkMarchingCubes() override;
232 
235 
241 
242 private:
243  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
244  void operator=(const vtkMarchingCubes&) = delete;
245 };
246 
251 inline void vtkMarchingCubes::SetValue(int i, double value)
252 {
253  this->ContourValues->SetValue(i, value);
254 }
255 
259 inline double vtkMarchingCubes::GetValue(int i)
260 {
261  return this->ContourValues->GetValue(i);
262 }
263 
269 {
270  return this->ContourValues->GetValues();
271 }
272 
278 inline void vtkMarchingCubes::GetValues(double* contourValues)
279 {
280  this->ContourValues->GetValues(contourValues);
281 }
282 
289 {
290  this->ContourValues->SetNumberOfContours(number);
291 }
292 
297 {
298  return this->ContourValues->GetNumberOfContours();
299 }
300 
305 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
306 {
307  this->ContourValues->GenerateValues(numContours, range);
308 }
309 
314 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
315 {
316  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
317 }
318 
319 #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:119
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:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287