VTK  9.0.1
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 =========================================================================*/
39 #ifndef vtkMarchingSquares_h
40 #define vtkMarchingSquares_h
41 
42 #include "vtkFiltersCoreModule.h" // For export macro
43 #include "vtkPolyDataAlgorithm.h"
44 
45 #include "vtkContourValues.h" // Passes calls to vtkContourValues
46 
47 class vtkImageData;
49 
50 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
51 {
52 public:
53  static vtkMarchingSquares* New();
55  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
58 
64  vtkSetVectorMacro(ImageRange, int, 6);
65  vtkGetVectorMacro(ImageRange, int, 6);
66  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
68 
70 
73  void SetValue(int i, double value);
74  double GetValue(int i);
75  double* GetValues();
76  void GetValues(double* contourValues);
77  void SetNumberOfContours(int number);
78  vtkIdType GetNumberOfContours();
79  void GenerateValues(int numContours, double range[2]);
80  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
82 
86  vtkMTimeType GetMTime() override;
87 
88  void SetLocator(vtkIncrementalPointLocator* locator);
89  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
90 
95  void CreateDefaultLocator();
96 
97 protected:
99  ~vtkMarchingSquares() override;
100 
102  int FillInputPortInformation(int port, vtkInformation* info) override;
103 
105  int ImageRange[6];
107 
108 private:
109  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
110  void operator=(const vtkMarchingSquares&) = delete;
111 };
112 
117 inline void vtkMarchingSquares::SetValue(int i, double value)
118 {
119  this->ContourValues->SetValue(i, value);
120 }
121 
125 inline double vtkMarchingSquares::GetValue(int i)
126 {
127  return this->ContourValues->GetValue(i);
128 }
129 
135 {
136  return this->ContourValues->GetValues();
137 }
138 
144 inline void vtkMarchingSquares::GetValues(double* contourValues)
145 {
146  this->ContourValues->GetValues(contourValues);
147 }
148 
155 {
156  this->ContourValues->SetNumberOfContours(number);
157 }
158 
163 {
164  return this->ContourValues->GetNumberOfContours();
165 }
166 
171 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
172 {
173  this->ContourValues->GenerateValues(numContours, range);
174 }
175 
180 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
181 {
182  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
183 }
184 
185 #endif
vtkMarchingSquares::GetValue
double GetValue(int i)
Get the ith contour value.
Definition: vtkMarchingSquares.h:125
vtkMarchingSquares::SetNumberOfContours
void SetNumberOfContours(int number)
Set the number of contours to place into the list.
Definition: vtkMarchingSquares.h:154
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:171
vtkX3D::value
@ value
Definition: vtkX3D.h:226
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkX3D::range
@ range
Definition: vtkX3D.h:244
vtkMarchingSquares::GetValues
double * GetValues()
Get a pointer to an array of contour values.
Definition: vtkMarchingSquares.h:134
vtkPolyDataAlgorithm::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm.h
vtkMarchingSquares
generate isoline(s) from structured points set
Definition: vtkMarchingSquares.h:50
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkMarchingSquares::ContourValues
vtkContourValues * ContourValues
Definition: vtkMarchingSquares.h:104
vtkPolyDataAlgorithm::RequestData
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkContourValues
helper object to manage setting and generating contour values
Definition: vtkContourValues.h:35
vtkMarchingSquares::Locator
vtkIncrementalPointLocator * Locator
Definition: vtkMarchingSquares.h:106
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:51
vtkContourValues::SetValue
void SetValue(int i, double value)
Set the ith contour value.
vtkPolyDataAlgorithm::FillInputPortInformation
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkContourValues.h
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:73
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:162
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:117
vtkPolyDataAlgorithm::New
static vtkPolyDataAlgorithm * New()
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41