VTK  9.6.1
vtkPolyDataConnectivityFilter.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
40
41#ifndef vtkPolyDataConnectivityFilter_h
42#define vtkPolyDataConnectivityFilter_h
43
44#include "vtkFiltersCoreModule.h" // For export macro
46#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
47
48#define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
49#define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
50#define VTK_EXTRACT_SPECIFIED_REGIONS 3
51#define VTK_EXTRACT_LARGEST_REGION 4
52#define VTK_EXTRACT_ALL_REGIONS 5
53#define VTK_EXTRACT_CLOSEST_POINT_REGION 6
54
55VTK_ABI_NAMESPACE_BEGIN
56class vtkDataArray;
57class vtkIdList;
58class vtkIdTypeArray;
59
62{
63public:
65 void PrintSelf(ostream& os, vtkIndent indent) override;
66
68
72 vtkGetObjectMacro(RegionSizes, vtkIdTypeArray);
74
79
81
90
92
105
107
110 vtkSetVector2Macro(ScalarRange, double);
111 vtkGetVector2Macro(ScalarRange, double);
113
115
118 vtkSetClampMacro(
120 vtkGetMacro(ExtractionMode, int);
139 const char* GetExtractionModeAsString();
141
146
150 void AddSeed(int id);
151
155 void DeleteSeed(int id);
156
161
165 void AddSpecifiedRegion(int id);
166
171
173
177 vtkSetVector3Macro(ClosestPoint, double);
178 vtkGetVectorMacro(ClosestPoint, double, 3);
180
185
187
192 vtkBooleanMacro(ColorRegions, vtkTypeBool);
194
196
205
207
211 vtkGetObjectMacro(VisitedPointIds, vtkIdList);
213
215
220 vtkSetMacro(OutputPointsPrecision, int);
221 vtkGetMacro(OutputPointsPrecision, int);
223
224protected:
227
228 // Usual data generation method
230
231 vtkTypeBool ColorRegions; // boolean turns on/off scalar gen for separate regions
232 int ExtractionMode; // how to extract regions
233 vtkIdList* Seeds; // id's of points or cells used to seed regions
234 vtkIdList* SpecifiedRegionIds; // regions specified for extraction
235 vtkIdTypeArray* RegionSizes; // size (in cells) of each region extracted
236
237 double ClosestPoint[3];
238
241
242 // Does this cell qualify as being scalar connected ?
244
245 double ScalarRange[2];
246
248
249 // used to support algorithm execution
260 std::vector<vtkIdType> Wave;
261 std::vector<vtkIdType> Wave2;
265
268
269private:
271 void operator=(const vtkPolyDataConnectivityFilter&) = delete;
272};
273
278{
280 {
281 return "ExtractPointSeededRegions";
282 }
284 {
285 return "ExtractCellSeededRegions";
286 }
288 {
289 return "ExtractSpecifiedRegions";
290 }
291 else if (this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS)
292 {
293 return "ExtractAllRegions";
294 }
296 {
297 return "ExtractClosestPointRegion";
298 }
299 else
300 {
301 return "ExtractLargestRegion";
302 }
303}
304
305VTK_ABI_NAMESPACE_END
306#endif
list of point or cell ids
Definition vtkIdList.h:24
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
void SetExtractionModeToAllRegions()
Control the extraction of connected surfaces.
void InitializeSpecifiedRegionList()
Initialize list of region ids to extract.
const char * GetExtractionModeAsString()
Return the method of extraction as a string.
void InitializeSeedList()
Initialize list of point ids/cell ids used to seed regions.
~vtkPolyDataConnectivityFilter() override
static vtkPolyDataConnectivityFilter * New()
Construct with default extraction mode to extract largest regions.
void SetExtractionModeToLargestRegion()
Control the extraction of connected surfaces.
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
This is called by the superclass.
void DeleteSpecifiedRegion(int id)
Delete a region id to extract.
virtual void SetExtractionMode(int)
Control the extraction of connected surfaces.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetExtractionModeToClosestPointRegion()
Control the extraction of connected surfaces.
int IsScalarConnected(vtkIdType cellId)
int GetNumberOfExtractedRegions()
Obtain the number of connected regions.
void DeleteSeed(int id)
Delete a seed id (point or cell id).
void AddSpecifiedRegion(int id)
Add a region id to extract.
void SetExtractionModeToPointSeededRegions()
Control the extraction of connected surfaces.
void SetExtractionModeToSpecifiedRegions()
Control the extraction of connected surfaces.
void SetExtractionModeToCellSeededRegions()
Control the extraction of connected surfaces.
void AddSeed(int id)
Add a seed id (point or cell id).
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:72
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
#define VTK_EXTRACT_CLOSEST_POINT_REGION
#define VTK_EXTRACT_POINT_SEEDED_REGIONS
#define VTK_EXTRACT_ALL_REGIONS
#define VTK_EXTRACT_CELL_SEEDED_REGIONS
#define VTK_EXTRACT_SPECIFIED_REGIONS
#define VTK_EXTRACT_LARGEST_REGION
int vtkIdType
Definition vtkType.h:368
#define VTK_MARSHALAUTO