VTK  9.3.20240328
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
59 #ifndef vtkMarchingSquares_h
60 #define vtkMarchingSquares_h
61 
62 #include "vtkFiltersCoreModule.h" // For export macro
63 #include "vtkPolyDataAlgorithm.h"
64 
65 #include "vtkContourValues.h" // Passes calls to vtkContourValues
66 
67 VTK_ABI_NAMESPACE_BEGIN
68 class vtkImageData;
70 
71 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
72 {
73 public:
76  void PrintSelf(ostream& os, vtkIndent indent) override;
77 
79 
85  vtkSetVectorMacro(ImageRange, int, 6);
86  vtkGetVectorMacro(ImageRange, int, 6);
87  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
89 
91 
94  void SetValue(int i, double value);
95  double GetValue(int i);
96  double* GetValues();
97  void GetValues(double* contourValues);
98  void SetNumberOfContours(int number);
99  vtkIdType GetNumberOfContours();
100  void GenerateValues(int numContours, double range[2]);
101  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
103 
107  vtkMTimeType GetMTime() override;
108 
110  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
111 
117 
118 protected:
121 
124 
126  int ImageRange[6];
128 
129 private:
130  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
131  void operator=(const vtkMarchingSquares&) = delete;
132 };
133 
138 inline void vtkMarchingSquares::SetValue(int i, double value)
139 {
140  this->ContourValues->SetValue(i, value);
141 }
142 
146 inline double vtkMarchingSquares::GetValue(int i)
147 {
148  return this->ContourValues->GetValue(i);
149 }
150 
156 {
157  return this->ContourValues->GetValues();
158 }
159 
165 inline void vtkMarchingSquares::GetValues(double* contourValues)
166 {
167  this->ContourValues->GetValues(contourValues);
168 }
169 
176 {
177  this->ContourValues->SetNumberOfContours(number);
178 }
179 
184 {
185  return this->ContourValues->GetNumberOfContours();
186 }
187 
192 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
193 {
194  this->ContourValues->GenerateValues(numContours, range);
195 }
196 
201 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
202 {
203  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
204 }
205 
206 VTK_ABI_NAMESPACE_END
207 #endif
helper object to manage setting and generating 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.
double * GetValues()
Return a pointer to a list of contour values.
topologically and geometrically regular array of data
Definition: vtkImageData.h:155
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.
generate isoline(s) from structured points set
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.
static vtkMarchingSquares * New()
void SetValue(int i, double value)
Methods to set contour values.
vtkContourValues * ContourValues
void CreateDefaultLocator()
Create default locator.
~vtkMarchingSquares() override
Superclass for algorithms that produce only polydata as output.
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ range
Definition: vtkX3D.h:238
int vtkIdType
Definition: vtkType.h:315
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270