VTK  9.3.1
vtkMarchingContourFilter.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
45 #ifndef vtkMarchingContourFilter_h
46 #define vtkMarchingContourFilter_h
47 
48 #include "vtkFiltersGeneralModule.h" // For export macro
49 #include "vtkPolyDataAlgorithm.h"
50 
51 #include "vtkContourValues.h" // Needed for direct access to ContourValues
52 
53 VTK_ABI_NAMESPACE_BEGIN
55 class vtkScalarTree;
56 
57 class VTKFILTERSGENERAL_EXPORT vtkMarchingContourFilter : public vtkPolyDataAlgorithm
58 {
59 public:
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
67  static vtkMarchingContourFilter* New();
68 
70 
73  void SetValue(int i, double value);
74  double GetValue(int i);
75  double* GetValues();
76  void GetValues(double* contourValues);
77  void SetNumberOfContours(int number);
78  vtkIdType GetNumberOfContours();
79  void GenerateValues(int numContours, double range[2]);
80  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
82 
86  vtkMTimeType GetMTime() override;
87 
89 
95  vtkSetMacro(ComputeNormals, vtkTypeBool);
96  vtkGetMacro(ComputeNormals, vtkTypeBool);
97  vtkBooleanMacro(ComputeNormals, vtkTypeBool);
99 
101 
109  vtkSetMacro(ComputeGradients, vtkTypeBool);
110  vtkGetMacro(ComputeGradients, vtkTypeBool);
111  vtkBooleanMacro(ComputeGradients, vtkTypeBool);
113 
115 
118  vtkSetMacro(ComputeScalars, vtkTypeBool);
119  vtkGetMacro(ComputeScalars, vtkTypeBool);
120  vtkBooleanMacro(ComputeScalars, vtkTypeBool);
122 
124 
127  vtkSetMacro(UseScalarTree, vtkTypeBool);
128  vtkGetMacro(UseScalarTree, vtkTypeBool);
129  vtkBooleanMacro(UseScalarTree, vtkTypeBool);
131 
133 
137  void SetLocator(vtkIncrementalPointLocator* locator);
138  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
140 
145  void CreateDefaultLocator();
146 
147 protected:
149  ~vtkMarchingContourFilter() override;
150 
152  int FillInputPortInformation(int port, vtkInformation* info) override;
153 
161 
162  // special contouring for structured points
163  void StructuredPointsContour(int dim, vtkDataSet* input, vtkPolyData* output);
164  // special contouring for image data
165  void ImageContour(int dim, vtkDataSet* input, vtkPolyData* output);
166  // default if not structured data
167  void DataSetContour(vtkDataSet* input, vtkPolyData* output);
168 
169 private:
171  void operator=(const vtkMarchingContourFilter&) = delete;
172 };
173 
178 inline void vtkMarchingContourFilter::SetValue(int i, double value)
179 {
180  this->ContourValues->SetValue(i, value);
181 }
182 
187 {
188  return this->ContourValues->GetValue(i);
189 }
190 
196 {
197  return this->ContourValues->GetValues();
198 }
199 
205 inline void vtkMarchingContourFilter::GetValues(double* contourValues)
206 {
207  this->ContourValues->GetValues(contourValues);
208 }
209 
216 {
217  this->ContourValues->SetNumberOfContours(number);
218 }
219 
224 {
225  return this->ContourValues->GetNumberOfContours();
226 }
227 
232 inline void vtkMarchingContourFilter::GenerateValues(int numContours, double range[2])
233 {
234  this->ContourValues->GenerateValues(numContours, range);
235 }
236 
242  int numContours, double rangeStart, double rangeEnd)
243 {
244  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
245 }
246 
247 VTK_ABI_NAMESPACE_END
248 #endif
helper object to manage setting and generating contour values
double GetValue(int i)
Get the ith contour value.
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
vtkIncrementalPointLocator * Locator
abstract class to specify dataset behavior
Definition: vtkDataSet.h:52
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
Abstract class in support of both point location and point insertion.
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.
int vtkIdType
Definition: vtkType.h:315
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
double GetValue(int i)
Get the ith contour value.
double * GetValues()
Get a pointer to an array of contour values.
static vtkPolyDataAlgorithm * New()
int vtkTypeBool
Definition: vtkABI.h:64
double * GetValues()
Return a pointer to a list of contour values.
Superclass for algorithms that produce only polydata as output.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual vtkMTimeType GetMTime()
Return this object's modified time.
generate isosurfaces/isolines from scalar values
organize data according to scalar values (used to accelerate contouring operations) ...
Definition: vtkScalarTree.h:43
void SetValue(int i, double value)
Methods to set / get contour values.
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.
void SetNumberOfContours(int number)
Set the number of contours to place into the list.