VTK  9.2.5
vtkPolyDataConnectivityFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPolyDataConnectivityFilter.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=========================================================================*/
53#ifndef vtkPolyDataConnectivityFilter_h
54#define vtkPolyDataConnectivityFilter_h
55
56#include "vtkFiltersCoreModule.h" // For export macro
58
59#define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
60#define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
61#define VTK_EXTRACT_SPECIFIED_REGIONS 3
62#define VTK_EXTRACT_LARGEST_REGION 4
63#define VTK_EXTRACT_ALL_REGIONS 5
64#define VTK_EXTRACT_CLOSEST_POINT_REGION 6
65
66class vtkDataArray;
67class vtkIdList;
68class vtkIdTypeArray;
69
70class VTKFILTERSCORE_EXPORT vtkPolyDataConnectivityFilter : public vtkPolyDataAlgorithm
71{
72public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
77
81 vtkGetObjectMacro(RegionSizes, vtkIdTypeArray);
83
88
90
95 vtkSetMacro(ScalarConnectivity, vtkTypeBool);
96 vtkGetMacro(ScalarConnectivity, vtkTypeBool);
97 vtkBooleanMacro(ScalarConnectivity, vtkTypeBool);
99
101
110 vtkSetMacro(FullScalarConnectivity, vtkTypeBool);
111 vtkGetMacro(FullScalarConnectivity, vtkTypeBool);
112 vtkBooleanMacro(FullScalarConnectivity, vtkTypeBool);
114
116
119 vtkSetVector2Macro(ScalarRange, double);
120 vtkGetVector2Macro(ScalarRange, double);
122
124
127 vtkSetClampMacro(
129 vtkGetMacro(ExtractionMode, int);
131 {
132 this->SetExtractionMode(VTK_EXTRACT_POINT_SEEDED_REGIONS);
133 }
135 {
136 this->SetExtractionMode(VTK_EXTRACT_CELL_SEEDED_REGIONS);
137 }
140 {
141 this->SetExtractionMode(VTK_EXTRACT_SPECIFIED_REGIONS);
142 }
144 {
145 this->SetExtractionMode(VTK_EXTRACT_CLOSEST_POINT_REGION);
146 }
147 void SetExtractionModeToAllRegions() { this->SetExtractionMode(VTK_EXTRACT_ALL_REGIONS); }
148 const char* GetExtractionModeAsString();
150
155
159 void AddSeed(int id);
160
164 void DeleteSeed(int id);
165
170
174 void AddSpecifiedRegion(int id);
175
180
182
186 vtkSetVector3Macro(ClosestPoint, double);
187 vtkGetVectorMacro(ClosestPoint, double, 3);
189
194
196
199 vtkSetMacro(ColorRegions, vtkTypeBool);
200 vtkGetMacro(ColorRegions, vtkTypeBool);
201 vtkBooleanMacro(ColorRegions, vtkTypeBool);
203
205
210 vtkSetMacro(MarkVisitedPointIds, vtkTypeBool);
211 vtkGetMacro(MarkVisitedPointIds, vtkTypeBool);
212 vtkBooleanMacro(MarkVisitedPointIds, vtkTypeBool);
214
216
220 vtkGetObjectMacro(VisitedPointIds, vtkIdList);
222
224
229 vtkSetMacro(OutputPointsPrecision, int);
230 vtkGetMacro(OutputPointsPrecision, int);
232
233protected:
236
237 // Usual data generation method
239
240 vtkTypeBool ColorRegions; // boolean turns on/off scalar gen for separate regions
241 int ExtractionMode; // how to extract regions
242 vtkIdList* Seeds; // id's of points or cells used to seed regions
243 vtkIdList* SpecifiedRegionIds; // regions specified for extraction
244 vtkIdTypeArray* RegionSizes; // size (in cells) of each region extracted
245
246 double ClosestPoint[3];
247
250
251 // Does this cell qualify as being scalar connected ?
253
254 double ScalarRange[2];
255
257
258 // used to support algorithm execution
269 std::vector<vtkIdType> Wave;
270 std::vector<vtkIdType> Wave2;
274
277
278private:
280 void operator=(const vtkPolyDataConnectivityFilter&) = delete;
281};
282
287{
289 {
290 return "ExtractPointSeededRegions";
291 }
293 {
294 return "ExtractCellSeededRegions";
295 }
297 {
298 return "ExtractSpecifiedRegions";
299 }
300 else if (this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS)
301 {
302 return "ExtractAllRegions";
303 }
305 {
306 return "ExtractClosestPointRegion";
307 }
308 else
309 {
310 return "ExtractLargestRegion";
311 }
312}
313
314#endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:56
list of point or cell ids
Definition: vtkIdList.h:34
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Superclass for algorithms that produce only polydata as output.
extract polygonal data based on geometric connectivity
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.
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:91
int vtkTypeBool
Definition: vtkABI.h:69
#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
#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
int vtkIdType
Definition: vtkType.h:332