VTK  9.1.0
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 =========================================================================*/
68 #ifndef vtkMarchingSquares_h
69 #define vtkMarchingSquares_h
70 
71 #include "vtkFiltersCoreModule.h" // For export macro
72 #include "vtkPolyDataAlgorithm.h"
73 
74 #include "vtkContourValues.h" // Passes calls to vtkContourValues
75 
76 class vtkImageData;
78 
79 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
80 {
81 public:
84  void PrintSelf(ostream& os, vtkIndent indent) override;
85 
87 
93  vtkSetVectorMacro(ImageRange, int, 6);
94  vtkGetVectorMacro(ImageRange, int, 6);
95  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
97 
99 
102  void SetValue(int i, double value);
103  double GetValue(int i);
104  double* GetValues();
105  void GetValues(double* contourValues);
106  void SetNumberOfContours(int number);
107  vtkIdType GetNumberOfContours();
108  void GenerateValues(int numContours, double range[2]);
109  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
111 
115  vtkMTimeType GetMTime() override;
116 
118  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
119 
125 
126 protected:
129 
132 
134  int ImageRange[6];
136 
137 private:
138  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
139  void operator=(const vtkMarchingSquares&) = delete;
140 };
141 
146 inline void vtkMarchingSquares::SetValue(int i, double value)
147 {
148  this->ContourValues->SetValue(i, value);
149 }
150 
154 inline double vtkMarchingSquares::GetValue(int i)
155 {
156  return this->ContourValues->GetValue(i);
157 }
158 
164 {
165  return this->ContourValues->GetValues();
166 }
167 
173 inline void vtkMarchingSquares::GetValues(double* contourValues)
174 {
175  this->ContourValues->GetValues(contourValues);
176 }
177 
184 {
185  this->ContourValues->SetNumberOfContours(number);
186 }
187 
192 {
193  return this->ContourValues->GetNumberOfContours();
194 }
195 
200 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
201 {
202  this->ContourValues->GenerateValues(numContours, range);
203 }
204 
209 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
210 {
211  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
212 }
213 
214 #endif
vtkMarchingSquares::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingSquares.h:154
vtkMarchingSquares::SetImageRange
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.
vtkMarchingSquares::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingSquares.h:183
vtkMarchingSquares::vtkMarchingSquares
vtkMarchingSquares()
vtkContourValues::GetValues
double * GetValues()
Return a pointer to a list of contour values.
vtkContourValues::GetNumberOfContours
int GetNumberOfContours()
Return the number of contours in the.
vtkMarchingSquares::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
Definition: vtkMarchingSquares.h:200
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:145
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkMarchingSquares::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingSquares.h:163
vtkMarchingSquares::RequestData
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkPolyDataAlgorithm.h
vtkMarchingSquares
generate isoline(s) from structured points set
Definition: vtkMarchingSquares.h:80
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMarchingSquares::SetLocator
void SetLocator(vtkIncrementalPointLocator *locator)
vtkMarchingSquares::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingSquares.h:133
vtkMarchingSquares::New
static vtkMarchingSquares * New()
vtkMarchingSquares::GetMTime
vtkMTimeType GetMTime() override
Because we delegate to vtkContourValues.
vtkMarchingSquares::~vtkMarchingSquares
~vtkMarchingSquares() override
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:55
vtkMarchingSquares::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingSquares.h:135
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkContourValues::GenerateValues
void GenerateValues(int numContours, double range[2])
Generate numContours equally spaced contour values between specified range.
vtkContourValues::GetValue
double GetValue(int i)
Get the ith contour value.
vtkIncrementalPointLocator
Abstract class in support of both point location and point insertion.
Definition: vtkIncrementalPointLocator.h:52
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkMarchingSquares::GetNumberOfContours
vtkIdType GetNumberOfContours()
Get the number of contours in the list of contour values.
Definition: vtkMarchingSquares.h:191
vtkMarchingSquares::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkMarchingSquares::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkMarchingSquares::CreateDefaultLocator
void CreateDefaultLocator()
Create default locator.
vtkContourValues::SetNumberOfContours
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
vtkMarchingSquares::SetValue
void SetValue(int i, double value)
Methods to set contour values.
Definition: vtkMarchingSquares.h:146
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:151