00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00036 #ifndef __vtkConvertSelection_h
00037 #define __vtkConvertSelection_h
00038
00039 #include "vtkSelectionAlgorithm.h"
00040
00041 class vtkIdTypeArray;
00042 class vtkSelection;
00043 class vtkStringArray;
00044 class vtkCompositeDataSet;
00045
00046 class VTK_GRAPHICS_EXPORT vtkConvertSelection : public vtkSelectionAlgorithm
00047 {
00048 public:
00049 static vtkConvertSelection *New();
00050 vtkTypeRevisionMacro(vtkConvertSelection, vtkSelectionAlgorithm);
00051 void PrintSelf(ostream& os, vtkIndent indent);
00052
00055 void SetDataObjectConnection(vtkAlgorithmOutput* in);
00056
00058
00060 vtkSetMacro(OutputType, int);
00061 vtkGetMacro(OutputType, int);
00063
00065
00066 virtual void SetArrayName(const char*);
00067 virtual const char* GetArrayName();
00069
00071
00072 virtual void SetArrayNames(vtkStringArray*);
00073 vtkGetObjectMacro(ArrayNames, vtkStringArray);
00075
00077
00080 static vtkSelection* ToIndexSelection(
00081 vtkSelection* input,
00082 vtkDataObject* data);
00083 static vtkSelection* ToGlobalIdSelection(
00084 vtkSelection* input,
00085 vtkDataObject* data);
00086 static vtkSelection* ToPedigreeIdSelection(
00087 vtkSelection* input,
00088 vtkDataObject* data);
00089 static vtkSelection* ToValueSelection(
00090 vtkSelection* input,
00091 vtkDataObject* data,
00092 const char* arrayName);
00093 static vtkSelection* ToValueSelection(
00094 vtkSelection* input,
00095 vtkDataObject* data,
00096 vtkStringArray* arrayNames);
00098
00100
00102 static vtkSelection* ToSelectionType(
00103 vtkSelection* input,
00104 vtkDataObject* data,
00105 int type,
00106 vtkStringArray* arrayNames = 0);
00108 protected:
00109 vtkConvertSelection();
00110 ~vtkConvertSelection();
00111
00112 virtual int RequestData(
00113 vtkInformation *,
00114 vtkInformationVector **,
00115 vtkInformationVector *);
00116
00117 int Convert(
00118 vtkSelection* input,
00119 vtkDataObject* data,
00120 vtkSelection* output);
00121
00122 int ConvertCompositeDataSet(
00123 vtkSelection* input,
00124 vtkCompositeDataSet* data,
00125 vtkSelection* output);
00126
00127 int ConvertToIndexSelection(
00128 vtkSelection* input,
00129 vtkDataSet* data,
00130 vtkSelection* output);
00131
00132 int SelectTableFromTable(
00133 vtkTable* selTable,
00134 vtkTable* dataTable,
00135 vtkIdTypeArray* indices);
00136
00137 int ConvertToBlockSelection(
00138 vtkSelection* input, vtkCompositeDataSet* data, vtkSelection* output);
00139
00140 virtual int FillInputPortInformation(
00141 int port, vtkInformation* info);
00142
00143 int OutputType;
00144 vtkStringArray* ArrayNames;
00145
00146 private:
00147 vtkConvertSelection(const vtkConvertSelection&);
00148 void operator=(const vtkConvertSelection&);
00149 };
00150
00151 #endif