00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00107 #ifndef __vtkSelectPolyData_h
00108 #define __vtkSelectPolyData_h
00109
00110 #include "vtkPolyDataToPolyDataFilter.h"
00111
00112 #define VTK_INSIDE_SMALLEST_REGION 0
00113 #define VTK_INSIDE_LARGEST_REGION 1
00114 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00115
00116 class vtkCharArray;
00117
00118 class VTK_EXPORT vtkSelectPolyData : public vtkPolyDataToPolyDataFilter
00119 {
00120 public:
00124 static vtkSelectPolyData *New();
00125
00126 vtkTypeMacro(vtkSelectPolyData,vtkPolyDataToPolyDataFilter);
00127 void PrintSelf(ostream& os, vtkIndent indent);
00128
00134 vtkSetMacro(GenerateSelectionScalars,int);
00135 vtkGetMacro(GenerateSelectionScalars,int);
00136 vtkBooleanMacro(GenerateSelectionScalars,int);
00137
00140 vtkSetMacro(InsideOut,int);
00141 vtkGetMacro(InsideOut,int);
00142 vtkBooleanMacro(InsideOut,int);
00143
00146 vtkSetObjectMacro(Loop,vtkPoints);
00147 vtkGetObjectMacro(Loop,vtkPoints);
00148
00150 vtkSetClampMacro(SelectionMode,int,
00151 VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00152 vtkGetMacro(SelectionMode,int);
00153 void SetSelectionModeToSmallestRegion()
00154 {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00155 void SetSelectionModeToLargestRegion()
00156 {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00157 void SetSelectionModeToClosestPointRegion()
00158 {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00159 const char *GetSelectionModeAsString();
00160
00163 vtkSetMacro(GenerateUnselectedOutput,int);
00164 vtkGetMacro(GenerateUnselectedOutput,int);
00165 vtkBooleanMacro(GenerateUnselectedOutput,int);
00166
00169 vtkPolyData *GetUnselectedOutput() {return this->UnselectedOutput;};
00170
00172 vtkPolyData *GetSelectionEdges() {return this->SelectionEdges;};
00173
00174
00175 unsigned long int GetMTime();
00176
00178 void UnRegister(vtkObject *o);
00179
00181 virtual int InRegisterLoop(vtkObject *);
00182
00183 protected:
00184 vtkSelectPolyData();
00185 ~vtkSelectPolyData();
00186 vtkSelectPolyData(const vtkSelectPolyData&) {};
00187 void operator=(const vtkSelectPolyData&) {};
00188
00189 void Execute();
00190
00191 int GenerateSelectionScalars;
00192 int InsideOut;
00193 vtkPoints *Loop;
00194 int SelectionMode;
00195 float ClosestPoint[3];
00196 int GenerateUnselectedOutput;
00197 vtkPolyData *UnselectedOutput;
00198 vtkPolyData *SelectionEdges;
00199
00200 private:
00201 vtkPolyData *Mesh;
00202 void GetPointNeighbors (int ptId, vtkIdList *nei);
00203
00204 };
00205
00207 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
00208 {
00209 if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
00210 {
00211 return "InsideSmallestRegion";
00212 }
00213 else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
00214 {
00215 return "InsideLargestRegion";
00216 }
00217 else
00218 {
00219 return "InsideClosestPointRegion";
00220 }
00221 }
00222
00223 #endif
00224
00225