VTK  9.1.0
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 =========================================================================*/
146 #ifndef vtkMarchingCubes_h
147 #define vtkMarchingCubes_h
148 
149 #include "vtkFiltersCoreModule.h" // For export macro
150 #include "vtkPolyDataAlgorithm.h"
151 
152 #include "vtkContourValues.h" // Needed for direct access to ContourValues
153 
155 
156 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
157 {
158 public:
161  void PrintSelf(ostream& os, vtkIndent indent) override;
162 
163  // Methods to set contour values
164  void SetValue(int i, double value);
165  double GetValue(int i);
166  double* GetValues();
167  void GetValues(double* contourValues);
168  void SetNumberOfContours(int number);
169  vtkIdType GetNumberOfContours();
170  void GenerateValues(int numContours, double range[2]);
171  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
172 
173  // Because we delegate to vtkContourValues
174  vtkMTimeType GetMTime() override;
175 
177 
183  vtkSetMacro(ComputeNormals, vtkTypeBool);
184  vtkGetMacro(ComputeNormals, vtkTypeBool);
185  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
187 
189 
197  vtkSetMacro(ComputeGradients, vtkTypeBool);
198  vtkGetMacro(ComputeGradients, vtkTypeBool);
199  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
201 
203 
206  vtkSetMacro(ComputeScalars, vtkTypeBool);
207  vtkGetMacro(ComputeScalars, vtkTypeBool);
208  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
210 
212 
217  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
219 
225 
226 protected:
228  ~vtkMarchingCubes() override;
229 
232 
238 
239 private:
240  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
241  void operator=(const vtkMarchingCubes&) = delete;
242 };
243 
248 inline void vtkMarchingCubes::SetValue(int i, double value)
249 {
250  this->ContourValues->SetValue(i, value);
251 }
252 
256 inline double vtkMarchingCubes::GetValue(int i)
257 {
258  return this->ContourValues->GetValue(i);
259 }
260 
266 {
267  return this->ContourValues->GetValues();
268 }
269 
275 inline void vtkMarchingCubes::GetValues(double* contourValues)
276 {
277  this->ContourValues->GetValues(contourValues);
278 }
279 
286 {
287  this->ContourValues->SetNumberOfContours(number);
288 }
289 
294 {
295  return this->ContourValues->GetNumberOfContours();
296 }
297 
302 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
303 {
304  this->ContourValues->GenerateValues(numContours, range);
305 }
306 
311 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
312 {
313  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
314 }
315 
316 #endif
vtkMarchingCubes::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkMarchingCubes.h:235
vtkMarchingCubes
generate isosurface(s) from volume
Definition: vtkMarchingCubes.h:157
vtkMarchingCubes::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkMarchingCubes::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkMarchingCubes::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingCubes.h:256
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkMarchingCubes::New
static vtkMarchingCubes * New()
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkMarchingCubes::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingCubes.h:233
vtkMarchingCubes::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingCubes.h:285
vtkMarchingCubes::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingCubes.h:237
vtkMarchingCubes::SetValue
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Definition: vtkMarchingCubes.h:248
vtkMarchingCubes::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingCubes.h:302
vtkPolyDataAlgorithm.h
vtkMarchingCubes::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkMarchingCubes.h:234
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMarchingCubes::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:52
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkMarchingCubes::~vtkMarchingCubes
~vtkMarchingCubes() override
vtkMarchingCubes::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkMarchingCubes::vtkMarchingCubes
vtkMarchingCubes()
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkMarchingCubes::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingCubes.h:265
vtkMarchingCubes::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkMarchingCubes.h:236
vtkMarchingCubes::GetMTime
vtkMTimeType GetMTime() override
Return this object's modified time.
vtkMarchingCubes::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingCubes.h:293
vtkMarchingCubes::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
override the default locator.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151