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=========================================================================*/
149#ifndef vtkPolyDataConnectivityFilter_h
150#define vtkPolyDataConnectivityFilter_h
151
152#include "vtkFiltersCoreModule.h" // For export macro
153#include "vtkPolyDataAlgorithm.h"
154
155#define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
156#define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
157#define VTK_EXTRACT_SPECIFIED_REGIONS 3
158#define VTK_EXTRACT_LARGEST_REGION 4
159#define VTK_EXTRACT_ALL_REGIONS 5
160#define VTK_EXTRACT_CLOSEST_POINT_REGION 6
161
162class vtkDataArray;
163class vtkIdList;
164class vtkIdTypeArray;
165
166class VTKFILTERSCORE_EXPORT vtkPolyDataConnectivityFilter : public vtkPolyDataAlgorithm
167{
168public:
170 void PrintSelf(ostream& os, vtkIndent indent) override;
171
173
177 vtkGetObjectMacro(RegionSizes, vtkIdTypeArray);
179
184
186
191 vtkSetMacro(ScalarConnectivity, vtkTypeBool);
192 vtkGetMacro(ScalarConnectivity, vtkTypeBool);
193 vtkBooleanMacro(ScalarConnectivity, vtkTypeBool);
195
197
206 vtkSetMacro(FullScalarConnectivity, vtkTypeBool);
207 vtkGetMacro(FullScalarConnectivity, vtkTypeBool);
208 vtkBooleanMacro(FullScalarConnectivity, vtkTypeBool);
210
212
215 vtkSetVector2Macro(ScalarRange, double);
216 vtkGetVector2Macro(ScalarRange, double);
218
220
223 vtkSetClampMacro(
225 vtkGetMacro(ExtractionMode, int);
227 {
228 this->SetExtractionMode(VTK_EXTRACT_POINT_SEEDED_REGIONS);
229 }
231 {
232 this->SetExtractionMode(VTK_EXTRACT_CELL_SEEDED_REGIONS);
233 }
236 {
237 this->SetExtractionMode(VTK_EXTRACT_SPECIFIED_REGIONS);
238 }
240 {
241 this->SetExtractionMode(VTK_EXTRACT_CLOSEST_POINT_REGION);
242 }
243 void SetExtractionModeToAllRegions() { this->SetExtractionMode(VTK_EXTRACT_ALL_REGIONS); }
244 const char* GetExtractionModeAsString();
246
251
255 void AddSeed(int id);
256
260 void DeleteSeed(int id);
261
266
270 void AddSpecifiedRegion(int id);
271
276
278
282 vtkSetVector3Macro(ClosestPoint, double);
283 vtkGetVectorMacro(ClosestPoint, double, 3);
285
290
292
295 vtkSetMacro(ColorRegions, vtkTypeBool);
296 vtkGetMacro(ColorRegions, vtkTypeBool);
297 vtkBooleanMacro(ColorRegions, vtkTypeBool);
299
301
306 vtkSetMacro(MarkVisitedPointIds, vtkTypeBool);
307 vtkGetMacro(MarkVisitedPointIds, vtkTypeBool);
308 vtkBooleanMacro(MarkVisitedPointIds, vtkTypeBool);
310
312
316 vtkGetObjectMacro(VisitedPointIds, vtkIdList);
318
320
325 vtkSetMacro(OutputPointsPrecision, int);
326 vtkGetMacro(OutputPointsPrecision, int);
328
329protected:
332
333 // Usual data generation method
335
336 vtkTypeBool ColorRegions; // boolean turns on/off scalar gen for separate regions
337 int ExtractionMode; // how to extract regions
338 vtkIdList* Seeds; // id's of points or cells used to seed regions
339 vtkIdList* SpecifiedRegionIds; // regions specified for extraction
340 vtkIdTypeArray* RegionSizes; // size (in cells) of each region extracted
341
342 double ClosestPoint[3];
343
346
347 // Does this cell qualify as being scalar connected ?
349
350 double ScalarRange[2];
351
353
354 // used to support algorithm execution
365 std::vector<vtkIdType> Wave;
366 std::vector<vtkIdType> Wave2;
370
373
374private:
376 void operator=(const vtkPolyDataConnectivityFilter&) = delete;
377};
378
383{
385 {
386 return "ExtractPointSeededRegions";
387 }
389 {
390 return "ExtractCellSeededRegions";
391 }
393 {
394 return "ExtractSpecifiedRegions";
395 }
396 else if (this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS)
397 {
398 return "ExtractAllRegions";
399 }
401 {
402 return "ExtractClosestPointRegion";
403 }
404 else
405 {
406 return "ExtractLargestRegion";
407 }
408}
409
410#endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:159
list of point or cell ids
Definition: vtkIdList.h:140
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition: vtkIndent.h:113
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:195
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