VTK  9.1.0
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 =========================================================================*/
73 #ifndef vtkMarchingContourFilter_h
74 #define vtkMarchingContourFilter_h
75 
76 #include "vtkFiltersGeneralModule.h" // For export macro
77 #include "vtkPolyDataAlgorithm.h"
78 
79 #include "vtkContourValues.h" // Needed for direct access to ContourValues
80 
82 class vtkScalarTree;
83 
84 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
85 {
86 public:
88  void PrintSelf(ostream& os, vtkIndent indent) override;
89 
95 
97 
100  void SetValue(int i, double value);
101  double GetValue(int i);
102  double* GetValues();
103  void GetValues(double* contourValues);
104  void SetNumberOfContours(int number);
105  vtkIdType GetNumberOfContours();
106  void GenerateValues(int numContours, double range[2]);
107  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
109 
113  vtkMTimeType GetMTime() override;
114 
116 
122  vtkSetMacro(ComputeNormals, vtkTypeBool);
123  vtkGetMacro(ComputeNormals, vtkTypeBool);
124  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
126 
128 
136  vtkSetMacro(ComputeGradients, vtkTypeBool);
137  vtkGetMacro(ComputeGradients, vtkTypeBool);
138  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
140 
142 
145  vtkSetMacro(ComputeScalars, vtkTypeBool);
146  vtkGetMacro(ComputeScalars, vtkTypeBool);
147  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
149 
151 
154  vtkSetMacro(UseScalarTree, vtkTypeBool);
155  vtkGetMacro(UseScalarTree, vtkTypeBool);
156  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
158 
160 
165  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
167 
173 
174 protected:
177 
180 
188 
189  // special contouring for structured points
190  void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
191  // special contouring for image data
192  void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
193  // default if not structured data
194  void DataSetContour(vtkDataSet* input, vtkPolyData* output);
195 
196 private:
198  void operator=(const vtkMarchingContourFilter&) = delete;
199 };
200 
205 inline void vtkMarchingContourFilter::SetValue(int i, double value)
206 {
207  this->ContourValues->SetValue(i, value);
208 }
209 
214 {
215  return this->ContourValues->GetValue(i);
216 }
217 
223 {
224  return this->ContourValues->GetValues();
225 }
226 
232 inline void vtkMarchingContourFilter::GetValues(double* contourValues)
233 {
234  this->ContourValues->GetValues(contourValues);
235 }
236 
243 {
244  this->ContourValues->SetNumberOfContours(number);
245 }
246 
251 {
252  return this->ContourValues->GetNumberOfContours();
253 }
254 
259 inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
260 {
261  this->ContourValues->GenerateValues(numContours, range);
262 }
263 
269  int numContours, double rangeStart, double rangeEnd)
270 {
271  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
272 }
273 
274 #endif
vtkMarchingContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingContourFilter.h:259
vtkMarchingContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkMarchingContourFilter.h:205
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkMarchingContourFilter::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingContourFilter.h:213
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkMarchingContourFilter::StructuredPointsContour
void StructuredPointsContour(int dim, vtkDataSet *input, vtkPolyData *output)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkMarchingContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingContourFilter.h:181
vtkMarchingContourFilter::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingContourFilter.h:250
vtkMarchingContourFilter::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkMarchingContourFilter::vtkMarchingContourFilter
vtkMarchingContourFilter()
vtkMarchingContourFilter::~vtkMarchingContourFilter
~vtkMarchingContourFilter() override
vtkMarchingContourFilter::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
Set / get a spatial locator for merging points.
vtkMarchingContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkMarchingContourFilter.h:85
vtkMarchingContourFilter::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyDataAlgorithm.h
vtkMarchingContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingContourFilter.h:242
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMarchingContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingContourFilter.h:222
vtkMarchingContourFilter::GetMTime
vtkMTimeType GetMTime() override
Modified GetMTime Because we delegate to vtkContourValues.
vtkMarchingContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkMarchingContourFilter.h:183
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkMarchingContourFilter::New
static vtkMarchingContourFilter * New()
Construct object with initial range (0,1) and single contour value of 0.0.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkMarchingContourFilter::DataSetContour
void DataSetContour(vtkDataSet *input, vtkPolyData *output)
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkMarchingContourFilter::UseScalarTree
vtkTypeBool UseScalarTree
Definition: vtkMarchingContourFilter.h:186
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.
vtkMarchingContourFilter::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkMarchingContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkMarchingContourFilter.h:187
vtkContourValues.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkMarchingContourFilter::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkMarchingContourFilter::ImageContour
void ImageContour(int dim, vtkDataSet *input, vtkPolyData *output)
vtkMarchingContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingContourFilter.h:185
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:55
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkMarchingContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkMarchingContourFilter.h:184
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkMarchingContourFilter::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkMarchingContourFilter.h:182
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151