vtkPolyDataConnectivityFilter.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00059 #ifndef __vtkPolyDataConnectivityFilter_h
00060 #define __vtkPolyDataConnectivityFilter_h
00061
00062 #include "vtkPolyDataToPolyDataFilter.h"
00063
00064 #define VTK_EXTRACT_POINT_SEEDED_REGIONS 1
00065 #define VTK_EXTRACT_CELL_SEEDED_REGIONS 2
00066 #define VTK_EXTRACT_SPECIFIED_REGIONS 3
00067 #define VTK_EXTRACT_LARGEST_REGION 4
00068 #define VTK_EXTRACT_ALL_REGIONS 5
00069 #define VTK_EXTRACT_CLOSEST_POINT_REGION 6
00070
00071 class vtkDataArray;
00072 class vtkIdList;
00073 class vtkIdTypeArray;
00074
00075 class VTK_GRAPHICS_EXPORT vtkPolyDataConnectivityFilter : public vtkPolyDataToPolyDataFilter
00076 {
00077 public:
00078 vtkTypeRevisionMacro(vtkPolyDataConnectivityFilter,vtkPolyDataToPolyDataFilter);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00082 static vtkPolyDataConnectivityFilter *New();
00083
00085
00088 vtkSetMacro(ScalarConnectivity,int);
00089 vtkGetMacro(ScalarConnectivity,int);
00090 vtkBooleanMacro(ScalarConnectivity,int);
00092
00094
00096 vtkSetVectorMacro(ScalarRange,double,2);
00097 vtkGetVectorMacro(ScalarRange,double,2);
00099
00101
00102 vtkSetClampMacro(ExtractionMode,int,
00103 VTK_EXTRACT_POINT_SEEDED_REGIONS,
00104 VTK_EXTRACT_CLOSEST_POINT_REGION);
00105 vtkGetMacro(ExtractionMode,int);
00106 void SetExtractionModeToPointSeededRegions()
00107 {this->SetExtractionMode(VTK_EXTRACT_POINT_SEEDED_REGIONS);};
00108 void SetExtractionModeToCellSeededRegions()
00109 {this->SetExtractionMode(VTK_EXTRACT_CELL_SEEDED_REGIONS);};
00110 void SetExtractionModeToLargestRegion()
00111 {this->SetExtractionMode(VTK_EXTRACT_LARGEST_REGION);};
00112 void SetExtractionModeToSpecifiedRegions()
00113 {this->SetExtractionMode(VTK_EXTRACT_SPECIFIED_REGIONS);};
00114 void SetExtractionModeToClosestPointRegion()
00115 {this->SetExtractionMode(VTK_EXTRACT_CLOSEST_POINT_REGION);};
00116 void SetExtractionModeToAllRegions()
00117 {this->SetExtractionMode(VTK_EXTRACT_ALL_REGIONS);};
00118 const char *GetExtractionModeAsString();
00120
00122 void InitializeSeedList();
00123
00125 void AddSeed(int id);
00126
00128 void DeleteSeed(int id);
00129
00131 void InitializeSpecifiedRegionList();
00132
00134 void AddSpecifiedRegion(int id);
00135
00137 void DeleteSpecifiedRegion(int id);
00138
00140
00142 vtkSetVector3Macro(ClosestPoint,double);
00143 vtkGetVectorMacro(ClosestPoint,double,3);
00145
00147 int GetNumberOfExtractedRegions();
00148
00150
00151 vtkSetMacro(ColorRegions,int);
00152 vtkGetMacro(ColorRegions,int);
00153 vtkBooleanMacro(ColorRegions,int);
00155
00156 protected:
00157 vtkPolyDataConnectivityFilter();
00158 ~vtkPolyDataConnectivityFilter();
00159
00160
00161 void Execute();
00162
00163 int ColorRegions;
00164 int ExtractionMode;
00165 vtkIdList *Seeds;
00166 vtkIdList *SpecifiedRegionIds;
00167 vtkIdTypeArray *RegionSizes;
00168
00169 double ClosestPoint[3];
00170
00171 int ScalarConnectivity;
00172 double ScalarRange[2];
00173
00174 void TraverseAndMark();
00175
00176 private:
00177
00178 vtkDataArray *CellScalars;
00179 vtkIdList *NeighborCellPointIds;
00180 int *Visited;
00181 vtkIdType *PointMap;
00182 vtkDataArray *NewScalars;
00183 int RegionNumber;
00184 vtkIdType PointNumber;
00185 vtkIdType NumCellsInRegion;
00186 vtkDataArray *InScalars;
00187 vtkPolyData *Mesh;
00188 vtkIdList *Wave;
00189 vtkIdList *Wave2;
00190 vtkIdList *PointIds;
00191 vtkIdList *CellIds;
00192 private:
00193 vtkPolyDataConnectivityFilter(const vtkPolyDataConnectivityFilter&);
00194 void operator=(const vtkPolyDataConnectivityFilter&);
00195 };
00196
00198 inline const char *vtkPolyDataConnectivityFilter::GetExtractionModeAsString(void)
00199 {
00200 if ( this->ExtractionMode == VTK_EXTRACT_POINT_SEEDED_REGIONS )
00201 {
00202 return "ExtractPointSeededRegions";
00203 }
00204 else if ( this->ExtractionMode == VTK_EXTRACT_CELL_SEEDED_REGIONS )
00205 {
00206 return "ExtractCellSeededRegions";
00207 }
00208 else if ( this->ExtractionMode == VTK_EXTRACT_SPECIFIED_REGIONS )
00209 {
00210 return "ExtractSpecifiedRegions";
00211 }
00212 else if ( this->ExtractionMode == VTK_EXTRACT_ALL_REGIONS )
00213 {
00214 return "ExtractAllRegions";
00215 }
00216 else if ( this->ExtractionMode == VTK_EXTRACT_CLOSEST_POINT_REGION )
00217 {
00218 return "ExtractClosestPointRegion";
00219 }
00220 else
00221 {
00222 return "ExtractLargestRegion";
00223 }
00224 }
00225
00226
00227 #endif