VTK  9.3.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 
36 #include "vtkContourValues.h" // Passes calls to vtkContourValues
37 
38 VTK_ABI_NAMESPACE_BEGIN
39 class vtkImageData;
41 
42 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
43 {
44 public:
45  static vtkMarchingSquares* New();
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
56  vtkSetVectorMacro(ImageRange, int, 6);
57  vtkGetVectorMacro(ImageRange, int, 6);
58  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
60 
62 
65  void SetValue(int i, double value);
66  double GetValue(int i);
67  double* GetValues();
68  void GetValues(double* contourValues);
69  void SetNumberOfContours(int number);
70  vtkIdType GetNumberOfContours();
71  void GenerateValues(int numContours, double range[2]);
72  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
74 
78  vtkMTimeType GetMTime() override;
79 
80  void SetLocator(vtkIncrementalPointLocator* locator);
81  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
82 
87  void CreateDefaultLocator();
88 
89 protected:
91  ~vtkMarchingSquares() override;
92 
95 
97  int ImageRange[6];
99 
100 private:
101  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
102  void operator=(const vtkMarchingSquares&) = delete;
103 };
104 
109 inline void vtkMarchingSquares::SetValue(int i, double value)
110 {
111  this->ContourValues->SetValue(i, value);
112 }
113 
117 inline double vtkMarchingSquares::GetValue(int i)
118 {
119  return this->ContourValues->GetValue(i);
120 }
121 
127 {
128  return this->ContourValues->GetValues();
129 }
130 
136 inline void vtkMarchingSquares::GetValues(double* contourValues)
137 {
138  this->ContourValues->GetValues(contourValues);
139 }
140 
147 {
148  this->ContourValues->SetNumberOfContours(number);
149 }
150 
155 {
156  return this->ContourValues->GetNumberOfContours();
157 }
158 
163 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
164 {
165  this->ContourValues->GenerateValues(numContours, range);
166 }
167 
172 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
173 {
174  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
175 }
176 
177 VTK_ABI_NAMESPACE_END
178 #endif
helper object to manage setting and generating contour values
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
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:315
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:42
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.
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.