VTK  9.2.6
vtkSurfaceNets2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSurfaceNets2D.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=========================================================================*/
119#ifndef vtkSurfaceNets2D_h
120#define vtkSurfaceNets2D_h
121
122#include "vtkConstrainedSmoothingFilter.h" // Perform mesh smoothing
123#include "vtkContourValues.h" // Needed for direct access to ContourValues
124#include "vtkFiltersCoreModule.h" // For export macro
125#include "vtkPolyData.h" // To support data caching
126#include "vtkPolyDataAlgorithm.h"
127
128class vtkImageData;
129
130class VTKFILTERSCORE_EXPORT vtkSurfaceNets2D : public vtkPolyDataAlgorithm
131{
132public:
134
139 void PrintSelf(ostream& os, vtkIndent indent) override;
141
147
149
159 void SetValue(int i, double value) { this->Labels->SetValue(i, value); }
160 void SetLabel(int i, double value) { this->Labels->SetValue(i, value); }
162
164
167 double GetValue(int i) { return this->Labels->GetValue(i); }
168 double GetLabel(int i) { return this->Labels->GetValue(i); }
170
172
176 double* GetValues() { return this->Labels->GetValues(); }
177 double* GetLabels() { return this->Labels->GetValues(); }
179
181
186 void GetValues(double* contourValues) { this->Labels->GetValues(contourValues); }
187 void GetLabels(double* contourValues) { this->Labels->GetValues(contourValues); }
189
191
198 void SetNumberOfLabels(int number) { this->Labels->SetNumberOfContours(number); }
199 void SetNumberOfContours(int number) { this->Labels->SetNumberOfContours(number); }
201
203
206 vtkIdType GetNumberOfLabels() { return this->Labels->GetNumberOfContours(); }
207 vtkIdType GetNumberOfContours() { return this->Labels->GetNumberOfContours(); }
209
211
215 void GenerateLabels(int numLabels, double range[2])
216 {
217 this->Labels->GenerateValues(numLabels, range);
218 }
219 void GenerateValues(int numContours, double range[2])
220 {
221 this->Labels->GenerateValues(numContours, range);
222 }
223 void GenerateLabels(int numLabels, double rangeStart, double rangeEnd)
224 {
225 this->Labels->GenerateValues(numLabels, rangeStart, rangeEnd);
226 }
227 void GenerateValues(int numContours, double rangeStart, double rangeEnd)
228 {
229 this->Labels->GenerateValues(numContours, rangeStart, rangeEnd);
230 }
232
234
242 vtkSetMacro(ComputeScalars, bool);
243 vtkGetMacro(ComputeScalars, bool);
244 vtkBooleanMacro(ComputeScalars, bool);
246
248
258 vtkSetMacro(BackgroundLabel, double);
259 vtkGetMacro(BackgroundLabel, double);
261
263
267 vtkSetMacro(ArrayComponent, int);
268 vtkGetMacro(ArrayComponent, int);
270
272
277 vtkSetMacro(Smoothing, bool);
278 vtkGetMacro(Smoothing, bool);
279 vtkBooleanMacro(Smoothing, bool);
281
283
292
294
304 vtkSetMacro(DataCaching, bool);
305 vtkGetMacro(DataCaching, bool);
306 vtkBooleanMacro(DataCaching, bool);
308
309protected:
311 ~vtkSurfaceNets2D() override = default;
312
314 int FillInputPortInformation(int port, vtkInformation* info) override;
315
320
323
324 // Support data caching of the extracted surface nets. This is used to
325 // avoid repeated surface extraction when only smoothing filter
326 // parameters are modified.
333
334private:
335 vtkSurfaceNets2D(const vtkSurfaceNets2D&) = delete;
336 void operator=(const vtkSurfaceNets2D&) = delete;
337};
338
339#endif
object to represent cell connectivity
adjust point positions using constrained smoothing
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:85
Hold a reference to a vtkObjectBase instance.
generate smoothed constours from segmented 2D image data (i.e., "label maps")
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, printing, and type information.
void GenerateLabels(int numLabels, double rangeStart, double rangeEnd)
Generate numLabels equally spaced labels between the specified range.
void SetNumberOfLabels(int number)
Set the number of labels to place into the list.
vtkMTimeType GetMTime() override
The modified time is also a function of the label values and the smoothing filter.
vtkSmartPointer< vtkConstrainedSmoothingFilter > Smoother
vtkSmartPointer< vtkContourValues > Labels
vtkSmartPointer< vtkPolyData > GeometryCache
void GetValues(double *contourValues)
Fill a supplied list with label values.
vtkTimeStamp SmoothingTime
void GenerateValues(int numContours, double range[2])
Generate numLabels equally spaced labels between the specified range.
void SetLabel(int i, double value)
Set a particular label value at label number i.
vtkGetSmartPointerMacro(Smoother, vtkConstrainedSmoothingFilter)
Get the instance of vtkConstrainedSmoothingFilter used to smooth the extracted surface net.
double * GetLabels()
Get a pointer to an array of labels.
~vtkSurfaceNets2D() override=default
double GetLabel(int i)
Get the ith label value.
double GetValue(int i)
Get the ith label value.
void GenerateLabels(int numLabels, double range[2])
Generate numLabels equally spaced labels between the specified range.
void SetNumberOfContours(int number)
Set the number of labels to place into the list.
void GetLabels(double *contourValues)
Fill a supplied list with label values.
double * GetValues()
Get a pointer to an array of labels.
static vtkSurfaceNets2D * New()
Standard methods for instantiation, printing, and type information.
void CacheData(vtkPolyData *pd, vtkCellArray *ca)
void GenerateValues(int numContours, double rangeStart, double rangeEnd)
Generate numLabels equally spaced labels between the specified range.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
vtkIdType GetNumberOfLabels()
Get the number of labels in the list of label values.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
vtkIdType GetNumberOfContours()
Get the number of labels in the list of label values.
vtkSmartPointer< vtkCellArray > StencilsCache
void SetValue(int i, double value)
Set a particular label value at label number i.
record modification and/or execution time
int vtkIdType
Definition vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:287