VTK  9.5.20251211
vtkMarchingSquares.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
58
59#ifndef vtkMarchingSquares_h
60#define vtkMarchingSquares_h
61
62#include "vtkFiltersCoreModule.h" // For export macro
64#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
65
66#include "vtkContourValues.h" // Passes calls to vtkContourValues
67
68VTK_ABI_NAMESPACE_BEGIN
69class vtkImageData;
71
72class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMarchingSquares : public vtkPolyDataAlgorithm
73{
74public:
77 void PrintSelf(ostream& os, vtkIndent indent) override;
78
80
86 vtkSetVectorMacro(ImageRange, int, 6);
87 vtkGetVectorMacro(ImageRange, int, 6);
88 void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
90
92
95 void SetValue(int i, double value);
96 double GetValue(int i);
97 double* GetValues();
98 void GetValues(double* contourValues);
99 void SetNumberOfContours(int number);
101 void GenerateValues(int numContours, double range[2]);
102 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
104
109
112
118
119protected:
122
124 int FillInputPortInformation(int port, vtkInformation* info) override;
125
129
130private:
131 vtkMarchingSquares(const vtkMarchingSquares&) = delete;
132 void operator=(const vtkMarchingSquares&) = delete;
133};
134
139inline void vtkMarchingSquares::SetValue(int i, double value)
140{
141 this->ContourValues->SetValue(i, value);
142}
143
148{
149 return this->ContourValues->GetValue(i);
150}
151
157{
158 return this->ContourValues->GetValues();
159}
160
166inline void vtkMarchingSquares::GetValues(double* contourValues)
167{
168 this->ContourValues->GetValues(contourValues);
169}
170
177{
178 this->ContourValues->SetNumberOfContours(number);
179}
180
185{
186 return this->ContourValues->GetNumberOfContours();
187}
188
193inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
194{
195 this->ContourValues->GenerateValues(numContours, range);
196}
197
202inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
203{
204 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
205}
206
207VTK_ABI_NAMESPACE_END
208#endif
helper object to manage setting and generating contour values
topologically and geometrically regular array of data
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax)
Set/Get the i-j-k index range which define a plane on which to generate contour lines.
vtkIncrementalPointLocator * Locator
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetLocator(vtkIncrementalPointLocator *locator)
double GetValue(int i)
Get the ith contour value.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
double * GetValues()
Get a pointer to an array of contour values.
vtkMTimeType GetMTime() override
Because we delegate to vtkContourValues.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetValue(int i, double value)
Methods to set contour values.
static vtkMarchingSquares * New()
vtkContourValues * ContourValues
void CreateDefaultLocator()
Create default locator.
~vtkMarchingSquares() override
int vtkIdType
Definition vtkType.h:367
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:322
#define VTK_MARSHALAUTO