00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00080 #ifndef __vtkSelectPolyData_h
00081 #define __vtkSelectPolyData_h
00082
00083 #include "vtkPolyDataAlgorithm.h"
00084
00085 #define VTK_INSIDE_SMALLEST_REGION 0
00086 #define VTK_INSIDE_LARGEST_REGION 1
00087 #define VTK_INSIDE_CLOSEST_POINT_REGION 2
00088
00089 class vtkCharArray;
00090 class vtkPoints;
00091 class vtkIdList;
00092
00093 class VTK_GRAPHICS_EXPORT vtkSelectPolyData : public vtkPolyDataAlgorithm
00094 {
00095 public:
00099 static vtkSelectPolyData *New();
00100
00101 vtkTypeMacro(vtkSelectPolyData,vtkPolyDataAlgorithm);
00102 void PrintSelf(ostream& os, vtkIndent indent);
00103
00105
00110 vtkSetMacro(GenerateSelectionScalars,int);
00111 vtkGetMacro(GenerateSelectionScalars,int);
00112 vtkBooleanMacro(GenerateSelectionScalars,int);
00114
00116
00118 vtkSetMacro(InsideOut,int);
00119 vtkGetMacro(InsideOut,int);
00120 vtkBooleanMacro(InsideOut,int);
00122
00124
00126 virtual void SetLoop(vtkPoints*);
00127 vtkGetObjectMacro(Loop,vtkPoints);
00129
00131
00132 vtkSetClampMacro(SelectionMode,int,
00133 VTK_INSIDE_SMALLEST_REGION,VTK_INSIDE_CLOSEST_POINT_REGION);
00134 vtkGetMacro(SelectionMode,int);
00135 void SetSelectionModeToSmallestRegion()
00136 {this->SetSelectionMode(VTK_INSIDE_SMALLEST_REGION);};
00137 void SetSelectionModeToLargestRegion()
00138 {this->SetSelectionMode(VTK_INSIDE_LARGEST_REGION);};
00139 void SetSelectionModeToClosestPointRegion()
00140 {this->SetSelectionMode(VTK_INSIDE_CLOSEST_POINT_REGION);};
00141 const char *GetSelectionModeAsString();
00143
00145
00147 vtkSetMacro(GenerateUnselectedOutput,int);
00148 vtkGetMacro(GenerateUnselectedOutput,int);
00149 vtkBooleanMacro(GenerateUnselectedOutput,int);
00151
00154 vtkPolyData *GetUnselectedOutput();
00155
00157 vtkPolyData *GetSelectionEdges();
00158
00159
00160 unsigned long int GetMTime();
00161
00162 protected:
00163 vtkSelectPolyData();
00164 ~vtkSelectPolyData();
00165
00166 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
00167
00168 int GenerateSelectionScalars;
00169 int InsideOut;
00170 vtkPoints *Loop;
00171 int SelectionMode;
00172 double ClosestPoint[3];
00173 int GenerateUnselectedOutput;
00174
00175 private:
00176 vtkPolyData *Mesh;
00177 void GetPointNeighbors (vtkIdType ptId, vtkIdList *nei);
00178 private:
00179 vtkSelectPolyData(const vtkSelectPolyData&);
00180 void operator=(const vtkSelectPolyData&);
00181 };
00182
00184 inline const char *vtkSelectPolyData::GetSelectionModeAsString(void)
00185 {
00186 if ( this->SelectionMode == VTK_INSIDE_SMALLEST_REGION )
00187 {
00188 return "InsideSmallestRegion";
00189 }
00190 else if ( this->SelectionMode == VTK_INSIDE_LARGEST_REGION )
00191 {
00192 return "InsideLargestRegion";
00193 }
00194 else
00195 {
00196 return "InsideClosestPointRegion";
00197 }
00198 }
00199
00200 #endif
00201
00202