00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00038 #ifndef __vtkConvertSelection_h
00039 #define __vtkConvertSelection_h
00040
00041 #include "vtkSelectionAlgorithm.h"
00042
00043 class vtkCompositeDataSet;
00044 class vtkGraph;
00045 class vtkIdTypeArray;
00046 class vtkSelection;
00047 class vtkSelectionNode;
00048 class vtkStringArray;
00049 class vtkTable;
00050
00051 class VTK_GRAPHICS_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
00052 {
00053 public:
00054 static vtkConvertSelection *New();
00055 vtkTypeRevisionMacro(vtkConvertSelection, vtkSelectionAlgorithm);
00056 void PrintSelf(ostream& os, vtkIndent indent);
00057
00060 void SetDataObjectConnection(vtkAlgorithmOutput* in);
00061
00063
00067 vtkSetMacro(InputFieldType, int);
00068 vtkGetMacro(InputFieldType, int);
00070
00072
00074 vtkSetMacro(OutputType, int);
00075 vtkGetMacro(OutputType, int);
00077
00079
00080 virtual void SetArrayName(const char*);
00081 virtual const char* GetArrayName();
00083
00085
00086 virtual void SetArrayNames(vtkStringArray*);
00087 vtkGetObjectMacro(ArrayNames, vtkStringArray);
00089
00091
00092 void AddArrayName(const char*);
00093 void ClearArrayNames();
00095
00097
00099 vtkSetMacro(MatchAnyValues, bool);
00100 vtkGetMacro(MatchAnyValues, bool);
00101 vtkBooleanMacro(MatchAnyValues, bool);
00103
00105
00108 static vtkSelection* ToIndexSelection(
00109 vtkSelection* input,
00110 vtkDataObject* data);
00111 static vtkSelection* ToGlobalIdSelection(
00112 vtkSelection* input,
00113 vtkDataObject* data);
00114 static vtkSelection* ToPedigreeIdSelection(
00115 vtkSelection* input,
00116 vtkDataObject* data);
00117 static vtkSelection* ToValueSelection(
00118 vtkSelection* input,
00119 vtkDataObject* data,
00120 const char* arrayName);
00121 static vtkSelection* ToValueSelection(
00122 vtkSelection* input,
00123 vtkDataObject* data,
00124 vtkStringArray* arrayNames);
00126
00128
00131 static void GetSelectedItems(
00132 vtkSelection* input,
00133 vtkDataObject* data,
00134 int fieldType,
00135 vtkIdTypeArray* indices);
00137
00139
00141 static void GetSelectedVertices(
00142 vtkSelection* input,
00143 vtkGraph* data,
00144 vtkIdTypeArray* indices);
00145 static void GetSelectedEdges(
00146 vtkSelection* input,
00147 vtkGraph* data,
00148 vtkIdTypeArray* indices);
00149 static void GetSelectedPoints(
00150 vtkSelection* input,
00151 vtkDataSet* data,
00152 vtkIdTypeArray* indices);
00153 static void GetSelectedCells(
00154 vtkSelection* input,
00155 vtkDataSet* data,
00156 vtkIdTypeArray* indices);
00157 static void GetSelectedRows(
00158 vtkSelection* input,
00159 vtkTable* data,
00160 vtkIdTypeArray* indices);
00162
00164
00166 static vtkSelection* ToSelectionType(
00167 vtkSelection* input,
00168 vtkDataObject* data,
00169 int type,
00170 vtkStringArray* arrayNames = 0,
00171 int inputFieldType = -1);
00173
00174 protected:
00175 vtkConvertSelection();
00176 ~vtkConvertSelection();
00177
00178 virtual int RequestData(
00179 vtkInformation *,
00180 vtkInformationVector **,
00181 vtkInformationVector *);
00182
00183 int Convert(
00184 vtkSelection* input,
00185 vtkDataObject* data,
00186 vtkSelection* output);
00187
00188 int ConvertCompositeDataSet(
00189 vtkSelection* input,
00190 vtkCompositeDataSet* data,
00191 vtkSelection* output);
00192
00193 int ConvertToIndexSelection(
00194 vtkSelectionNode* input,
00195 vtkDataSet* data,
00196 vtkSelectionNode* output);
00197
00198 int SelectTableFromTable(
00199 vtkTable* selTable,
00200 vtkTable* dataTable,
00201 vtkIdTypeArray* indices);
00202
00203 int ConvertToBlockSelection(
00204 vtkSelection* input, vtkCompositeDataSet* data, vtkSelection* output);
00205
00206 virtual int FillInputPortInformation(
00207 int port, vtkInformation* info);
00208
00209 int OutputType;
00210 int InputFieldType;
00211 vtkStringArray* ArrayNames;
00212 bool MatchAnyValues;
00213
00214 private:
00215 vtkConvertSelection(const vtkConvertSelection&);
00216 void operator=(const vtkConvertSelection&);
00217 };
00218
00219 #endif