VTK  9.2.6
vtkMarchingContourFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMarchingContourFilter.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 =========================================================================*/
66 #ifndef vtkMarchingContourFilter_h
67 #define vtkMarchingContourFilter_h
68 
69 #include "vtkFiltersGeneralModule.h" // For export macro
70 #include "vtkPolyDataAlgorithm.h"
71 
72 #include "vtkContourValues.h" // Needed for direct access to ContourValues
73 
75 class vtkScalarTree;
76 
77 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
78 {
79 public:
81  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
88 
90 
93  void SetValue(int i, double value);
94  double GetValue(int i);
95  double* GetValues();
96  void GetValues(double* contourValues);
97  void SetNumberOfContours(int number);
98  vtkIdType GetNumberOfContours();
99  void GenerateValues(int numContours, double range[2]);
100  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
102 
106  vtkMTimeType GetMTime() override;
107 
109 
115  vtkSetMacro(ComputeNormals, vtkTypeBool);
116  vtkGetMacro(ComputeNormals, vtkTypeBool);
117  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
119 
121 
129  vtkSetMacro(ComputeGradients, vtkTypeBool);
130  vtkGetMacro(ComputeGradients, vtkTypeBool);
131  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
133 
135 
138  vtkSetMacro(ComputeScalars, vtkTypeBool);
139  vtkGetMacro(ComputeScalars, vtkTypeBool);
140  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
142 
144 
147  vtkSetMacro(UseScalarTree, vtkTypeBool);
148  vtkGetMacro(UseScalarTree, vtkTypeBool);
149  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
151 
153 
158  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
160 
166 
167 protected:
170 
173 
181 
182  // special contouring for structured points
183  void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
184  // special contouring for image data
185  void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
186  // default if not structured data
187  void DataSetContour(vtkDataSet* input, vtkPolyData* output);
188 
189 private:
191  void operator=(const vtkMarchingContourFilter&) = delete;
192 };
193 
198 inline void vtkMarchingContourFilter::SetValue(int i, double value)
199 {
200  this->ContourValues->SetValue(i, value);
201 }
202 
207 {
208  return this->ContourValues->GetValue(i);
209 }
210 
216 {
217  return this->ContourValues->GetValues();
218 }
219 
225 inline void vtkMarchingContourFilter::GetValues(double* contourValues)
226 {
227  this->ContourValues->GetValues(contourValues);
228 }
229 
236 {
237  this->ContourValues->SetNumberOfContours(number);
238 }
239 
244 {
245  return this->ContourValues->GetNumberOfContours();
246 }
247 
252 inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
253 {
254  this->ContourValues->GenerateValues(numContours, range);
255 }
256 
262  int numContours, double rangeStart, double rangeEnd)
263 {
264  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
265 }
266 
267 #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 to specify dataset behavior
Definition: vtkDataSet.h:72
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:49
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
generate isosurfaces/isolines from scalar values
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkIncrementalPointLocator * Locator
void CreateDefaultLocator()
Create default locator.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
~vtkMarchingContourFilter() override
static vtkMarchingContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
double GetValue(int i)
Get the ith contour value.
void SetValue(int i, double value)
Methods to set / get contour values.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
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.
void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output)
void DataSetContour(vtkDataSet *input, vtkPolyData *output)
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:100
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
@ 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