VTK  9.7.1
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
30 #ifndef vtkMarchingSquares_h
31 #define vtkMarchingSquares_h
32 
33 #include "vtkFiltersCoreModule.h" // For export macro
34 #include "vtkPolyDataAlgorithm.h"
35 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
36 
37 #include "vtkContourValues.h" // Passes calls to vtkContourValues
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkImageData;
42 
43 class VTKFILTERSCORE_EXPORT VTK_MARSHALAUTO vtkMarchingSquares : public vtkPolyDataAlgorithm
44 {
45 public:
46  static vtkMarchingSquares* New();
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);
71  vtkIdType GetNumberOfContours();
72  void GenerateValues(int numContours, double range[2]);
73  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
75 
79  vtkMTimeType GetMTime() override;
80 
81  void SetLocator(vtkIncrementalPointLocator* locator);
82  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
83 
88  void CreateDefaultLocator();
89 
90 protected:
92  ~vtkMarchingSquares() override;
93 
96 
98  int ImageRange[6];
100 
101 private:
102  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
103  void operator=(const vtkMarchingSquares&) = delete;
104 };
105 
110 inline void vtkMarchingSquares::SetValue(int i, double value)
111 {
112  this->ContourValues->SetValue(i, value);
113 }
114 
118 inline double vtkMarchingSquares::GetValue(int i)
119 {
120  return this->ContourValues->GetValue(i);
121 }
122 
128 {
129  return this->ContourValues->GetValues();
130 }
131 
137 inline 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 
164 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
165 {
166  this->ContourValues->GenerateValues(numContours, range);
167 }
168 
173 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
174 {
175  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
176 }
177 
178 VTK_ABI_NAMESPACE_END
179 #endif
helper object to manage setting and generating contour values
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:318
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
double GetValue(int i)
Get the ith contour value.
Abstract class in support of both point location and point insertion.
generate isoline(s) from structured points set
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
int vtkIdType
Definition: vtkType.h:363
double GetValue(int i)
Get the ith contour value.
static vtkPolyDataAlgorithm * New()
double * GetValues()
Return a pointer to a list of contour values.
void SetValue(int i, double value)
Methods to set contour values.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues * ContourValues
double * GetValues()
Get a pointer to an array of 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.
#define VTK_MARSHALAUTO
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
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.