VTK  9.1.0
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=========================================================================*/
59#ifndef vtkPolyDataConnectivityFilter_h
60#define vtkPolyDataConnectivityFilter_h
61
62#include "vtkFiltersCoreModule.h" // For export macro
64
65#define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
66#define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
67#define VTK_EXTRACT_SPECIFIED_REGIONS 3
68#define VTK_EXTRACT_LARGEST_REGION 4
69#define VTK_EXTRACT_ALL_REGIONS 5
70#define VTK_EXTRACT_CLOSEST_POINT_REGION 6
71
72class vtkDataArray;
73class vtkIdList;
74class vtkIdTypeArray;
75
76class VTKFILTERSCORE_EXPORT vtkPolyDataConnectivityFilter : public vtkPolyDataAlgorithm
77{
78public:
80 void PrintSelf(ostream& os, vtkIndent indent) override;
81
83
87 vtkGetObjectMacro(RegionSizes, vtkIdTypeArray);
89
94
96
101 vtkSetMacro(ScalarConnectivity, vtkTypeBool);
102 vtkGetMacro(ScalarConnectivity, vtkTypeBool);
103 vtkBooleanMacro(ScalarConnectivity, vtkTypeBool);
105
107
116 vtkSetMacro(FullScalarConnectivity, vtkTypeBool);
117 vtkGetMacro(FullScalarConnectivity, vtkTypeBool);
118 vtkBooleanMacro(FullScalarConnectivity, vtkTypeBool);
120
122
125 vtkSetVector2Macro(ScalarRange, double);
126 vtkGetVector2Macro(ScalarRange, double);
128
130
133 vtkSetClampMacro(
135 vtkGetMacro(ExtractionMode, int);
137 {
138 this->SetExtractionMode(VTK_EXTRACT_POINT_SEEDED_REGIONS);
139 }
141 {
142 this->SetExtractionMode(VTK_EXTRACT_CELL_SEEDED_REGIONS);
143 }
146 {
147 this->SetExtractionMode(VTK_EXTRACT_SPECIFIED_REGIONS);
148 }
150 {
151 this->SetExtractionMode(VTK_EXTRACT_CLOSEST_POINT_REGION);
152 }
153 void SetExtractionModeToAllRegions() { this->SetExtractionMode(VTK_EXTRACT_ALL_REGIONS); }
154 const char* GetExtractionModeAsString();
156
161
165 void AddSeed(int id);
166
170 void DeleteSeed(int id);
171
176
180 void AddSpecifiedRegion(int id);
181
186
188
192 vtkSetVector3Macro(ClosestPoint, double);
193 vtkGetVectorMacro(ClosestPoint, double, 3);
195
200
202
205 vtkSetMacro(ColorRegions, vtkTypeBool);
206 vtkGetMacro(ColorRegions, vtkTypeBool);
207 vtkBooleanMacro(ColorRegions, vtkTypeBool);
209
211
216 vtkSetMacro(MarkVisitedPointIds, vtkTypeBool);
217 vtkGetMacro(MarkVisitedPointIds, vtkTypeBool);
218 vtkBooleanMacro(MarkVisitedPointIds, vtkTypeBool);
220
222
226 vtkGetObjectMacro(VisitedPointIds, vtkIdList);
228
230
235 vtkSetMacro(OutputPointsPrecision, int);
236 vtkGetMacro(OutputPointsPrecision, int);
238
239protected:
242
243 // Usual data generation method
245
246 vtkTypeBool ColorRegions; // boolean turns on/off scalar gen for separate regions
247 int ExtractionMode; // how to extract regions
248 vtkIdList* Seeds; // id's of points or cells used to seed regions
249 vtkIdList* SpecifiedRegionIds; // regions specified for extraction
250 vtkIdTypeArray* RegionSizes; // size (in cells) of each region extracted
251
252 double ClosestPoint[3];
253
256
257 // Does this cell qualify as being scalar connected ?
259
260 double ScalarRange[2];
261
263
264 // used to support algorithm execution
275 std::vector<vtkIdType> Wave;
276 std::vector<vtkIdType> Wave2;
280
283
284private:
286 void operator=(const vtkPolyDataConnectivityFilter&) = delete;
287};
288
293{
295 {
296 return "ExtractPointSeededRegions";
297 }
299 {
300 return "ExtractCellSeededRegions";
301 }
303 {
304 return "ExtractSpecifiedRegions";
305 }
306 else if (this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS)
307 {
308 return "ExtractAllRegions";
309 }
311 {
312 return "ExtractClosestPointRegion";
313 }
314 else
315 {
316 return "ExtractLargestRegion";
317 }
318}
319
320#endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:59
list of point or cell ids
Definition: vtkIdList.h:40
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:43
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:95
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
int vtkIdType
Definition: vtkType.h:332