VTK  9.2.5
vtkMarchingSquares.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMarchingSquares.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
71 #ifndef vtkMarchingSquares_h
72 #define vtkMarchingSquares_h
73 
74 #include "vtkFiltersCoreModule.h" // For export macro
75 #include "vtkPolyDataAlgorithm.h"
76 
77 #include "vtkContourValues.h" // Passes calls to vtkContourValues
78 
79 class vtkImageData;
81 
82 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
83 {
84 public:
87  void PrintSelf(ostream& os, vtkIndent indent) override;
88 
90 
96  vtkSetVectorMacro(ImageRange, int, 6);
97  vtkGetVectorMacro(ImageRange, int, 6);
98  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
100 
102 
105  void SetValue(int i, double value);
106  double GetValue(int i);
107  double* GetValues();
108  void GetValues(double* contourValues);
109  void SetNumberOfContours(int number);
110  vtkIdType GetNumberOfContours();
111  void GenerateValues(int numContours, double range[2]);
112  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
114 
118  vtkMTimeType GetMTime() override;
119 
121  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
122 
128 
129 protected:
132 
135 
137  int ImageRange[6];
139 
140 private:
141  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
142  void operator=(const vtkMarchingSquares&) = delete;
143 };
144 
149 inline void vtkMarchingSquares::SetValue(int i, double value)
150 {
151  this->ContourValues->SetValue(i, value);
152 }
153 
157 inline double vtkMarchingSquares::GetValue(int i)
158 {
159  return this->ContourValues->GetValue(i);
160 }
161 
167 {
168  return this->ContourValues->GetValues();
169 }
170 
176 inline void vtkMarchingSquares::GetValues(double* contourValues)
177 {
178  this->ContourValues->GetValues(contourValues);
179 }
180 
187 {
188  this->ContourValues->SetNumberOfContours(number);
189 }
190 
195 {
196  return this->ContourValues->GetNumberOfContours();
197 }
198 
203 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
204 {
205  this->ContourValues->GenerateValues(numContours, range);
206 }
207 
212 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
213 {
214  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
215 }
216 
217 #endif
helper object to manage setting and generating contour values
int GetNumberOfContours()
Return the number of contours in the.
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
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:163
Abstract class in support of both point location and point insertion.
a simple class to control print indentation
Definition: vtkIndent.h:119
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:382
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ range
Definition: vtkX3D.h:244
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287