VTK  9.7.0
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
29
30#ifndef vtkMarchingSquares_h
31#define vtkMarchingSquares_h
32
33#include "vtkFiltersCoreModule.h" // For export macro
35#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36
37#include "vtkContourValues.h" // Passes calls to vtkContourValues
38
39VTK_ABI_NAMESPACE_BEGIN
40class vtkImageData;
42
43class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMarchingSquares : public vtkPolyDataAlgorithm
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
57 vtkSetVectorMacro(ImageRange, int, 6);
58 vtkGetVectorMacro(ImageRange, int, 6);
59 void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
61
63
66 void SetValue(int i, double value);
67 double GetValue(int i);
68 double* GetValues();
69 void GetValues(double* contourValues);
70 void SetNumberOfContours(int number);
72 void GenerateValues(int numContours, double range[2]);
73 void GenerateValues(int numContours, double rangeStart, double rangeEnd);
75
80
83
89
90protected:
93
95 int FillInputPortInformation(int port, vtkInformation* info) override;
96
98 int ImageRange[6];
100
101private:
102 vtkMarchingSquares(const vtkMarchingSquares&) = delete;
103 void operator=(const vtkMarchingSquares&) = delete;
104};
105
110inline void vtkMarchingSquares::SetValue(int i, double value)
111{
112 this->ContourValues->SetValue(i, value);
113}
114
119{
120 return this->ContourValues->GetValue(i);
121}
122
128{
129 return this->ContourValues->GetValues();
130}
131
137inline void vtkMarchingSquares::GetValues(double* contourValues)
138{
139 this->ContourValues->GetValues(contourValues);
140}
141
148{
149 this->ContourValues->SetNumberOfContours(number);
150}
151
156{
157 return this->ContourValues->GetNumberOfContours();
158}
159
164inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
165{
166 this->ContourValues->GenerateValues(numContours, range);
167}
168
173inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
174{
175 this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
176}
177
178VTK_ABI_NAMESPACE_END
179#endif
helper object to manage setting and generating contour values
double * GetValues()
Return a pointer to a list of contour values.
int GetNumberOfContours()
Return the number of contours in the.
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.
void SetValue(int i, double value)
Set the ith contour value.
double GetValue(int i)
Get the ith contour value.
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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
int FillInputPortInformation(int port, vtkInformation *info) override
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:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
#define VTK_MARSHALAUTO