VTK
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 =========================================================================*/
52 #ifndef vtkPolyDataConnectivityFilter_h
53 #define vtkPolyDataConnectivityFilter_h
54 
55 #include "vtkFiltersCoreModule.h" // For export macro
56 #include "vtkPolyDataAlgorithm.h"
57 
58 #define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
59 #define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
60 #define VTK_EXTRACT_SPECIFIED_REGIONS 3
61 #define VTK_EXTRACT_LARGEST_REGION 4
62 #define VTK_EXTRACT_ALL_REGIONS 5
63 #define VTK_EXTRACT_CLOSEST_POINT_REGION 6
64 
65 class vtkDataArray;
66 class vtkIdList;
67 class vtkIdTypeArray;
68 
70 {
71 public:
73  void PrintSelf(ostream& os, vtkIndent indent);
74 
76 
77  vtkGetObjectMacro(RegionSizes,vtkIdTypeArray);
79 
82 
84 
87  vtkSetMacro(ScalarConnectivity,int);
88  vtkGetMacro(ScalarConnectivity,int);
89  vtkBooleanMacro(ScalarConnectivity,int);
91 
93 
100  vtkSetMacro(FullScalarConnectivity,int);
101  vtkGetMacro(FullScalarConnectivity,int);
102  vtkBooleanMacro(FullScalarConnectivity,int);
104 
106 
108  vtkSetVector2Macro(ScalarRange,double);
109  vtkGetVector2Macro(ScalarRange,double);
111 
113 
114  vtkSetClampMacro(ExtractionMode,int,
117  vtkGetMacro(ExtractionMode,int);
119  {this->SetExtractionMode(VTK_EXTRACT_POINT_SEEDED_REGIONS);};
121  {this->SetExtractionMode(VTK_EXTRACT_CELL_SEEDED_REGIONS);};
123  {this->SetExtractionMode(VTK_EXTRACT_LARGEST_REGION);};
125  {this->SetExtractionMode(VTK_EXTRACT_SPECIFIED_REGIONS);};
127  {this->SetExtractionMode(VTK_EXTRACT_CLOSEST_POINT_REGION);};
129  {this->SetExtractionMode(VTK_EXTRACT_ALL_REGIONS);};
130  const char *GetExtractionModeAsString();
132 
134  void InitializeSeedList();
135 
137  void AddSeed(int id);
138 
140  void DeleteSeed(int id);
141 
143  void InitializeSpecifiedRegionList();
144 
146  void AddSpecifiedRegion(int id);
147 
149  void DeleteSpecifiedRegion(int id);
150 
152 
154  vtkSetVector3Macro(ClosestPoint,double);
155  vtkGetVectorMacro(ClosestPoint,double,3);
157 
159  int GetNumberOfExtractedRegions();
160 
162 
163  vtkSetMacro(ColorRegions,int);
164  vtkGetMacro(ColorRegions,int);
165  vtkBooleanMacro(ColorRegions,int);
167 
169 
171  vtkSetMacro( MarkVisitedPointIds, int );
172  vtkGetMacro( MarkVisitedPointIds, int );
173  vtkBooleanMacro( MarkVisitedPointIds, int );
175 
177 
179  vtkGetObjectMacro( VisitedPointIds, vtkIdList );
181 
183 
186  vtkSetMacro(OutputPointsPrecision,int);
187  vtkGetMacro(OutputPointsPrecision,int);
189 
190 protected:
193 
194  // Usual data generation method
196 
197  int ColorRegions; //boolean turns on/off scalar gen for separate regions
198  int ExtractionMode; //how to extract regions
199  vtkIdList *Seeds; //id's of points or cells used to seed regions
200  vtkIdList *SpecifiedRegionIds; //regions specified for extraction
201  vtkIdTypeArray *RegionSizes; //size (in cells) of each region extracted
202 
203  double ClosestPoint[3];
204 
207 
208  // Does this cell qualify as being scalar connected ?
209  int IsScalarConnected( vtkIdType cellId );
210 
211  double ScalarRange[2];
212 
213  void TraverseAndMark();
214 
215  // used to support algorithm execution
226  std::vector<vtkIdType> Wave;
227  std::vector<vtkIdType> Wave2;
231 
234 
235 private:
237  void operator=(const vtkPolyDataConnectivityFilter&); // Not implemented.
238 };
239 
241 
243 {
245  {
246  return "ExtractPointSeededRegions";
247  }
249  {
250  return "ExtractCellSeededRegions";
251  }
252  else if ( this->ExtractionMode == VTK_EXTRACT_SPECIFIED_REGIONS )
253  {
254  return "ExtractSpecifiedRegions";
255  }
256  else if ( this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS )
257  {
258  return "ExtractAllRegions";
259  }
261  {
262  return "ExtractClosestPointRegion";
263  }
264  else
265  {
266  return "ExtractLargestRegion";
267  }
268 }
270 
271 
272 #endif
Store vtkAlgorithm input/output information.
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
#define VTKFILTERSCORE_EXPORT
#define VTK_EXTRACT_CLOSEST_POINT_REGION
#define VTK_EXTRACT_POINT_SEEDED_REGIONS
dynamic, self-adjusting array of vtkIdType
int vtkIdType
Definition: vtkType.h:247
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
static vtkPolyDataAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent)
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:38
extract polygonal data based on geometric connectivity
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
#define VTK_EXTRACT_LARGEST_REGION
#define VTK_EXTRACT_CELL_SEEDED_REGIONS
Store zero or more vtkInformation instances.
#define VTK_EXTRACT_ALL_REGIONS
#define VTK_EXTRACT_SPECIFIED_REGIONS