VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkArrayMap.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 =========================================================================*/ 00038 #ifndef __vtkArrayMap_h 00039 #define __vtkArrayMap_h 00040 00041 #include "vtkPassInputTypeAlgorithm.h" 00042 00043 class vtkMapType; 00044 class vtkVariant; 00045 00046 class VTK_INFOVIS_EXPORT vtkArrayMap : public vtkPassInputTypeAlgorithm 00047 { 00048 public: 00049 vtkTypeRevisionMacro(vtkArrayMap,vtkPassInputTypeAlgorithm); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00052 static vtkArrayMap *New(); 00053 00055 00057 vtkSetMacro(FieldType, int); 00058 vtkGetMacro(FieldType, int); 00060 00062 00065 vtkSetMacro(PassArray, int); 00066 vtkGetMacro(PassArray, int); 00067 vtkBooleanMacro(PassArray, int); 00069 00071 00074 vtkSetMacro(FillValue, double); 00075 vtkGetMacro(FillValue, double); 00077 00079 00081 vtkSetStringMacro(InputArrayName); 00082 vtkGetStringMacro(InputArrayName); 00084 00086 00087 vtkSetStringMacro(OutputArrayName); 00088 vtkGetStringMacro(OutputArrayName); 00090 00092 00094 vtkGetMacro(OutputArrayType, int); 00095 vtkSetMacro(OutputArrayType, int); 00097 00101 void AddToMap(vtkVariant from, vtkVariant to); 00102 //ETX 00103 void AddToMap(int from, int to); 00104 void AddToMap(int from, char *to); 00105 void AddToMap(char *from, int to); 00106 void AddToMap(char *from, char *to); 00107 00109 void ClearMap(); 00110 00112 int GetMapSize(); 00113 00114 //BTX 00115 // Always keep NUM_ATTRIBUTE_LOCS as the last entry 00116 enum FieldType 00117 { 00118 POINT_DATA=0, 00119 CELL_DATA=1, 00120 VERTEX_DATA=2, 00121 EDGE_DATA=3, 00122 NUM_ATTRIBUTE_LOCS 00123 }; 00124 //ETX 00125 00126 protected: 00127 00128 vtkArrayMap(); 00129 virtual ~vtkArrayMap(); 00130 00131 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00132 int FillInputPortInformation(int, vtkInformation *); 00133 00134 char* InputArrayName; 00135 char* OutputArrayName; 00136 int OutputArrayType; 00137 int FieldType; 00138 int MapType; 00139 int PassArray; 00140 double FillValue; 00141 00142 // PIMPL idiom to hide map implementation. 00143 vtkMapType *Map; 00144 00145 private: 00146 vtkArrayMap(const vtkArrayMap&); // Not implemented. 00147 void operator=(const vtkArrayMap&); // Not implemented. 00148 }; 00149 00150 #endif