VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkConvertSelection.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*---------------------------------------------------------------------------- 00016 Copyright (c) Sandia Corporation 00017 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 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 00094 static vtkSelection* ToIndexSelection( 00095 vtkSelection* input, 00096 vtkDataObject* data); 00097 static vtkSelection* ToGlobalIdSelection( 00098 vtkSelection* input, 00099 vtkDataObject* data); 00100 static vtkSelection* ToPedigreeIdSelection( 00101 vtkSelection* input, 00102 vtkDataObject* data); 00103 static vtkSelection* ToValueSelection( 00104 vtkSelection* input, 00105 vtkDataObject* data, 00106 const char* arrayName); 00107 static vtkSelection* ToValueSelection( 00108 vtkSelection* input, 00109 vtkDataObject* data, 00110 vtkStringArray* arrayNames); 00112 00114 00117 static void GetSelectedItems( 00118 vtkSelection* input, 00119 vtkDataObject* data, 00120 int fieldType, 00121 vtkIdTypeArray* indices); 00123 00125 00127 static void GetSelectedVertices( 00128 vtkSelection* input, 00129 vtkGraph* data, 00130 vtkIdTypeArray* indices); 00131 static void GetSelectedEdges( 00132 vtkSelection* input, 00133 vtkGraph* data, 00134 vtkIdTypeArray* indices); 00135 static void GetSelectedPoints( 00136 vtkSelection* input, 00137 vtkDataSet* data, 00138 vtkIdTypeArray* indices); 00139 static void GetSelectedCells( 00140 vtkSelection* input, 00141 vtkDataSet* data, 00142 vtkIdTypeArray* indices); 00143 static void GetSelectedRows( 00144 vtkSelection* input, 00145 vtkTable* data, 00146 vtkIdTypeArray* indices); 00148 00150 00152 static vtkSelection* ToSelectionType( 00153 vtkSelection* input, 00154 vtkDataObject* data, 00155 int type, 00156 vtkStringArray* arrayNames = 0); 00158 protected: 00159 vtkConvertSelection(); 00160 ~vtkConvertSelection(); 00161 00162 virtual int RequestData( 00163 vtkInformation *, 00164 vtkInformationVector **, 00165 vtkInformationVector *); 00166 00167 int Convert( 00168 vtkSelection* input, 00169 vtkDataObject* data, 00170 vtkSelection* output); 00171 00172 int ConvertCompositeDataSet( 00173 vtkSelection* input, 00174 vtkCompositeDataSet* data, 00175 vtkSelection* output); 00176 00177 int ConvertToIndexSelection( 00178 vtkSelectionNode* input, 00179 vtkDataSet* data, 00180 vtkSelectionNode* output); 00181 00182 int SelectTableFromTable( 00183 vtkTable* selTable, 00184 vtkTable* dataTable, 00185 vtkIdTypeArray* indices); 00186 00187 int ConvertToBlockSelection( 00188 vtkSelection* input, vtkCompositeDataSet* data, vtkSelection* output); 00189 00190 virtual int FillInputPortInformation( 00191 int port, vtkInformation* info); 00192 00193 int OutputType; 00194 int InputFieldType; 00195 vtkStringArray* ArrayNames; 00196 00197 private: 00198 vtkConvertSelection(const vtkConvertSelection&); // Not implemented. 00199 void operator=(const vtkConvertSelection&); // Not implemented. 00200 }; 00201 00202 #endif