00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00025 #ifndef __vtkPickFilter_h
00026 #define __vtkPickFilter_h
00027
00028 #include "vtkUnstructuredGridSource.h"
00029
00030 class vtkMultiProcessController;
00031 class vtkIdList;
00032 class vtkIntArray;
00033 class vtkPoints;
00034 class vtkDataSet;
00035 class vtkAppendFilter;
00036
00037 class VTK_EXPORT vtkPickFilter : public vtkUnstructuredGridSource
00038 {
00039 public:
00040 static vtkPickFilter *New();
00041 vtkTypeRevisionMacro(vtkPickFilter,vtkUnstructuredGridSource);
00042 void PrintSelf(ostream& os, vtkIndent indent);
00043
00045
00046 void AddInput(vtkDataSet* input);
00047 void AddInput(vtkDataObject*){vtkErrorMacro("NotDefined");}
00048 vtkDataSet* GetInput(int idx);
00049 void RemoveInput(vtkDataSet* input);
00050 void RemoveInput(vtkDataObject*){vtkErrorMacro("NotDefined");}
00051 void RemoveAllInputs();
00053
00055
00056 vtkSetVector3Macro(WorldPoint,double);
00057 vtkGetVector3Macro(WorldPoint,double);
00059
00061
00063 vtkSetMacro(PickCell,int);
00064 vtkGetMacro(PickCell,int);
00065 vtkBooleanMacro(PickCell,int);
00067
00069
00071 vtkSetMacro(UseIdToPick,int);
00072 vtkGetMacro(UseIdToPick,int);
00073 vtkBooleanMacro(UseIdToPick,int);
00075
00077
00078 vtkSetMacro(Id,vtkIdType);
00079 vtkGetMacro(Id,vtkIdType);
00081
00082
00083
00084
00085 vtkSetStringMacro(GlobalPointIdArrayName);
00086 vtkGetStringMacro(GlobalPointIdArrayName);
00087 vtkSetStringMacro(GlobalCellIdArrayName);
00088 vtkGetStringMacro(GlobalCellIdArrayName);
00089
00092 void SetController(vtkMultiProcessController* controller);
00093
00094 protected:
00095 vtkPickFilter();
00096 ~vtkPickFilter();
00097
00098 void Execute();
00099 void PointExecute();
00100 void CellExecute();
00101 int CompareProcesses(double bestDist2);
00102 void CreateOutput(vtkIdList* regionCellIds);
00103
00104 void IdExecute();
00105 int CellIdExecute(vtkDataSet* input, int inputIdx, vtkAppendFilter* append);
00106 int PointIdExecute(vtkDataSet* input, int inputIdx, vtkAppendFilter* append);
00107
00108
00109 int PickCell;
00110
00111
00112 double WorldPoint[3];
00113
00114 int UseIdToPick;
00115 vtkIdType Id;
00116 char* GlobalPointIdArrayName;
00117 char* GlobalCellIdArrayName;
00118
00119 vtkMultiProcessController* Controller;
00120
00121
00122 vtkIdList* PointMap;
00123
00124 vtkIdList* RegionPointIds;
00125
00126
00127
00128
00129 int BestInputIndex;
00130
00131
00132 vtkIdType InsertIdInPointMap(vtkIdType inId);
00133 void InitializePointMap(vtkIdType numerOfInputPoints);
00134 void DeletePointMap();
00135 int ListContainsId(vtkIdList* ids, vtkIdType id);
00136
00137
00138 vtkIdType FindPointId(double pt[3], vtkDataSet* input);
00139
00140 private:
00141 vtkPickFilter(const vtkPickFilter&);
00142 void operator=(const vtkPickFilter&);
00143 };
00144
00145 #endif
00146
00147