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 =========================================================================*/
50 #ifndef vtkMarchingCubes_h
51 #define vtkMarchingCubes_h
52 
53 #include "vtkFiltersCoreModule.h" // For export macro
54 #include "vtkPolyDataAlgorithm.h"
55 
56 #include "vtkContourValues.h" // Needed for direct access to ContourValues
57 
59 
60 class VTKFILTERSCORE_EXPORT vtkMarchingCubes : public vtkPolyDataAlgorithm
61 {
62 public:
63  static vtkMarchingCubes* New();
65  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
67  // Methods to set contour values
68  void SetValue(int i, double value);
69  double GetValue(int i);
70  double* GetValues();
71  void GetValues(double* contourValues);
72  void SetNumberOfContours(int number);
73  vtkIdType GetNumberOfContours();
74  void GenerateValues(int numContours, double range[2]);
75  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
76 
77  // Because we delegate to vtkContourValues
78  vtkMTimeType GetMTime() override;
79 
81 
87  vtkSetMacro(ComputeNormals, vtkTypeBool);
88  vtkGetMacro(ComputeNormals, vtkTypeBool);
89  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
91 
93 
101  vtkSetMacro(ComputeGradients, vtkTypeBool);
102  vtkGetMacro(ComputeGradients, vtkTypeBool);
103  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
105 
107 
110  vtkSetMacro(ComputeScalars, vtkTypeBool);
111  vtkGetMacro(ComputeScalars, vtkTypeBool);
112  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
114 
116 
120  void SetLocator(vtkIncrementalPointLocator* locator);
121  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
123 
128  void CreateDefaultLocator();
129 
130 protected:
132  ~vtkMarchingCubes() override;
133 
135  int FillInputPortInformation(int port, vtkInformation* info) override;
136 
142 
143 private:
144  vtkMarchingCubes(const vtkMarchingCubes&) = delete;
145  void operator=(const vtkMarchingCubes&) = delete;
146 };
147 
152 inline void vtkMarchingCubes::SetValue(int i, double value)
153 {
154  this->ContourValues->SetValue(i, value);
155 }
156 
160 inline double vtkMarchingCubes::GetValue(int i)
161 {
162  return this->ContourValues->GetValue(i);
163 }
164 
170 {
171  return this->ContourValues->GetValues();
172 }
173 
179 inline void vtkMarchingCubes::GetValues(double* contourValues)
180 {
181  this->ContourValues->GetValues(contourValues);
182 }
183 
190 {
191  this->ContourValues->SetNumberOfContours(number);
192 }
193 
198 {
199  return this->ContourValues->GetNumberOfContours();
200 }
201 
206 inline void vtkMarchingCubes::GenerateValues(int numContours, double range[2])
207 {
208  this->ContourValues->GenerateValues(numContours, range);
209 }
210 
215 inline void vtkMarchingCubes::GenerateValues(int numContours, double rangeStart, double rangeEnd)
216 {
217  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
218 }
219 
220 #endif
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:287
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.
int vtkIdType
Definition: vtkType.h:332
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:39
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.
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.
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