VTK  9.0.20200712
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 =========================================================================*/
54 #ifndef vtkMarchingContourFilter_h
55 #define vtkMarchingContourFilter_h
56 
57 #include "vtkFiltersGeneralModule.h" // For export macro
58 #include "vtkPolyDataAlgorithm.h"
59 
60 #include "vtkContourValues.h" // Needed for direct access to ContourValues
61 
63 class vtkScalarTree;
64 
65 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
66 {
67 public:
69  void PrintSelf(ostream& os, vtkIndent indent) override;
70 
75  static vtkMarchingContourFilter* New();
76 
78 
81  void SetValue(int i, double value);
82  double GetValue(int i);
83  double* GetValues();
84  void GetValues(double* contourValues);
85  void SetNumberOfContours(int number);
86  vtkIdType GetNumberOfContours();
87  void GenerateValues(int numContours, double range[2]);
88  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
90 
94  vtkMTimeType GetMTime() override;
95 
97 
103  vtkSetMacro(ComputeNormals, vtkTypeBool);
104  vtkGetMacro(ComputeNormals, vtkTypeBool);
105  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
107 
109 
117  vtkSetMacro(ComputeGradients, vtkTypeBool);
118  vtkGetMacro(ComputeGradients, vtkTypeBool);
119  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
121 
123 
126  vtkSetMacro(ComputeScalars, vtkTypeBool);
127  vtkGetMacro(ComputeScalars, vtkTypeBool);
128  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
130 
132 
135  vtkSetMacro(UseScalarTree, vtkTypeBool);
136  vtkGetMacro(UseScalarTree, vtkTypeBool);
137  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
139 
141 
145  void SetLocator(vtkIncrementalPointLocator* locator);
146  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
148 
153  void CreateDefaultLocator();
154 
155 protected:
157  ~vtkMarchingContourFilter() override;
158 
160  int FillInputPortInformation(int port, vtkInformation* info) override;
161 
169 
170  // special contouring for structured points
171  void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
172  // special contouring for image data
173  void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
174  // default if not structured data
175  void DataSetContour(vtkDataSet* input, vtkPolyData* output);
176 
177 private:
179  void operator=(const vtkMarchingContourFilter&) = delete;
180 };
181 
186 inline void vtkMarchingContourFilter::SetValue(int i, double value)
187 {
188  this->ContourValues->SetValue(i, value);
189 }
190 
195 {
196  return this->ContourValues->GetValue(i);
197 }
198 
204 {
205  return this->ContourValues->GetValues();
206 }
207 
213 inline void vtkMarchingContourFilter::GetValues(double* contourValues)
214 {
215  this->ContourValues->GetValues(contourValues);
216 }
217 
224 {
225  this->ContourValues->SetNumberOfContours(number);
226 }
227 
232 {
233  return this->ContourValues->GetNumberOfContours();
234 }
235 
240 inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
241 {
242  this->ContourValues->GenerateValues(numContours, range);
243 }
244 
250  int numContours, double rangeStart, double rangeEnd)
251 {
252  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
253 }
254 
255 #endif
vtkMarchingContourFilter::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingContourFilter.h:240
vtkMarchingContourFilter::SetValue
void SetValue(int i, double value)
Methods to set / get contour values.
Definition: vtkMarchingContourFilter.h:186
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:194
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkX3D::value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkMarchingContourFilter::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingContourFilter.h:162
vtkMarchingContourFilter::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingContourFilter.h:231
vtkX3D::range
Definition: vtkX3D.h:244
vtkMarchingContourFilter
generate isosurfaces/isolines from scalar values
Definition: vtkMarchingContourFilter.h:65
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm.h
vtkMarchingContourFilter::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingContourFilter.h:223
vtkX3D::port
Definition: vtkX3D.h:453
vtkMarchingContourFilter::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingContourFilter.h:203
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkMarchingContourFilter::ComputeGradients
vtkTypeBool ComputeGradients
Definition: vtkMarchingContourFilter.h:164
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:167
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:51
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMarchingContourFilter::ScalarTree
vtkScalarTree * ScalarTree
Definition: vtkMarchingContourFilter.h:168
vtkContourValues.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
vtkX3D::info
Definition: vtkX3D.h:382
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkMarchingContourFilter::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingContourFilter.h:166
vtkScalarTree
organize data according to scalar values (used to accelerate contouring operations)
Definition: vtkScalarTree.h:54
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkMarchingContourFilter::ComputeScalars
vtkTypeBool ComputeScalars
Definition: vtkMarchingContourFilter.h:165
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMarchingContourFilter::ComputeNormals
vtkTypeBool ComputeNormals
Definition: vtkMarchingContourFilter.h:163
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:285
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41