VTK
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 =========================================================================*/
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 
56 
57 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
58 {
59 public:
60  static vtkMarchingCubes *New();
62  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
64  // Methods to set contour values
65  void SetValue(int i, double value);
66  double GetValue(int i);
67  double *GetValues();
68  void GetValues(double *contourValues);
69  void SetNumberOfContours(int number);
70  int GetNumberOfContours();
71  void GenerateValues(int numContours, double range[2]);
72  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
73 
74  // Because we delegate to vtkContourValues
75  vtkMTimeType GetMTime() override;
76 
78 
84  vtkSetMacro(ComputeNormals,vtkTypeBool);
85  vtkGetMacro(ComputeNormals,vtkTypeBool);
86  vtkBooleanMacro(ComputeNormals,vtkTypeBool);
88 
90 
98  vtkSetMacro(ComputeGradients,vtkTypeBool);
99  vtkGetMacro(ComputeGradients,vtkTypeBool);
100  vtkBooleanMacro(ComputeGradients,vtkTypeBool);
102 
104 
107  vtkSetMacro(ComputeScalars,vtkTypeBool);
108  vtkGetMacro(ComputeScalars,vtkTypeBool);
109  vtkBooleanMacro(ComputeScalars,vtkTypeBool);
111 
113 
117  void SetLocator(vtkIncrementalPointLocator *locator);
118  vtkGetObjectMacro(Locator,vtkIncrementalPointLocator);
120 
125  void CreateDefaultLocator();
126 
127 protected:
129  ~vtkMarchingCubes() override;
130 
132  int FillInputPortInformation(int port, vtkInformation *info) override;
133 
139 private:
140  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
141  void operator=(const vtkMarchingCubes&) = delete;
142 };
143 
148 inline void vtkMarchingCubes::SetValue(int i, double value)
149 {this->ContourValues->SetValue(i,value);}
150 
154 inline double vtkMarchingCubes::GetValue(int i)
155 {return this->ContourValues->GetValue(i);}
156 
162 {return this->ContourValues->GetValues();}
163 
169 inline void vtkMarchingCubes::GetValues(double *contourValues)
170 {this->ContourValues->GetValues(contourValues);}
171 
178 {this->ContourValues->SetNumberOfContours(number);}
179 
184 {return this->ContourValues->GetNumberOfContours();}
185 
190 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
191 {this->ContourValues->GenerateValues(numContours, range);}
192 
197 inline void vtkMarchingCubes::GenerateValues(int numContours, double
198  rangeStart, double rangeEnd)
199 {this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);}
200 
201 #endif
int GetNumberOfContours()
Get the number of contours in the list of contour values.
helper object to manage setting and generating contour values
void SetValue(int i, double value)
Set a particular contour value at contour number i.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkTypeBool ComputeScalars
Abstract class in support of both point location and point insertion.
vtkTypeBool ComputeNormals
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
double GetValue(int i)
Get the ith contour value.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:69
double * GetValues()
Get a pointer to an array of contour values.
double * GetValues()
Return a pointer to a list of contour values.
vtkIncrementalPointLocator * Locator
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:33
generate isosurface(s) from volume
virtual vtkMTimeType GetMTime()
Return this object's modified time.
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.
vtkTypeBool ComputeGradients
double GetValue(int i)
Get the ith contour value.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store zero or more vtkInformation instances.
int GetNumberOfContours()
Return the number of contours in the.
void SetValue(int i, double value)
Set the ith contour value.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourValues * ContourValues