VTK  9.2.6
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 =========================================================================*/
42 #ifndef vtkMarchingSquares_h
43 #define vtkMarchingSquares_h
44 
45 #include "vtkFiltersCoreModule.h" // For export macro
46 #include "vtkPolyDataAlgorithm.h"
47 
48 #include "vtkContourValues.h" // Passes calls to vtkContourValues
49 
50 class vtkImageData;
52 
53 class VTKFILTERSCORE_EXPORT vtkMarchingSquares : public vtkPolyDataAlgorithm
54 {
55 public:
56  static vtkMarchingSquares* New();
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
67  vtkSetVectorMacro(ImageRange, int, 6);
68  vtkGetVectorMacro(ImageRange, int, 6);
69  void SetImageRange(int imin, int imax, int jmin, int jmax, int kmin, int kmax);
71 
73 
76  void SetValue(int i, double value);
77  double GetValue(int i);
78  double* GetValues();
79  void GetValues(double* contourValues);
80  void SetNumberOfContours(int number);
81  vtkIdType GetNumberOfContours();
82  void GenerateValues(int numContours, double range[2]);
83  void GenerateValues(int numContours, double rangeStart, double rangeEnd);
85 
89  vtkMTimeType GetMTime() override;
90 
91  void SetLocator(vtkIncrementalPointLocator* locator);
92  vtkGetObjectMacro(Locator, vtkIncrementalPointLocator);
93 
98  void CreateDefaultLocator();
99 
100 protected:
102  ~vtkMarchingSquares() override;
103 
105  int FillInputPortInformation(int port, vtkInformation* info) override;
106 
108  int ImageRange[6];
110 
111 private:
112  vtkMarchingSquares(const vtkMarchingSquares&) = delete;
113  void operator=(const vtkMarchingSquares&) = delete;
114 };
115 
120 inline void vtkMarchingSquares::SetValue(int i, double value)
121 {
122  this->ContourValues->SetValue(i, value);
123 }
124 
128 inline double vtkMarchingSquares::GetValue(int i)
129 {
130  return this->ContourValues->GetValue(i);
131 }
132 
138 {
139  return this->ContourValues->GetValues();
140 }
141 
147 inline void vtkMarchingSquares::GetValues(double* contourValues)
148 {
149  this->ContourValues->GetValues(contourValues);
150 }
151 
158 {
159  this->ContourValues->SetNumberOfContours(number);
160 }
161 
166 {
167  return this->ContourValues->GetNumberOfContours();
168 }
169 
174 inline void vtkMarchingSquares::GenerateValues(int numContours, double range[2])
175 {
176  this->ContourValues->GenerateValues(numContours, range);
177 }
178 
183 inline void vtkMarchingSquares::GenerateValues(int numContours, double rangeStart, double rangeEnd)
184 {
185  this->ContourValues->GenerateValues(numContours, rangeStart, rangeEnd);
186 }
187 
188 #endif
helper object to manage setting and generating contour values
vtkIncrementalPointLocator * Locator
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
This is called by the superclass.
void SetNumberOfContours(const int number)
Set the number of contours to place into the list.
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:332
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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.