VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkMapArrayValues.h 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 __vtkMapArrayValues_h 00039 #define __vtkMapArrayValues_h 00040 00041 #include "vtkPassInputTypeAlgorithm.h" 00042 00043 class vtkMapType; 00044 class vtkVariant; 00045 00046 class VTK_RENDERING_EXPORT vtkMapArrayValues : public vtkPassInputTypeAlgorithm 00047 { 00048 public: 00049 vtkTypeMacro(vtkMapArrayValues,vtkPassInputTypeAlgorithm); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00052 static vtkMapArrayValues *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 00099 00102 void AddToMap(vtkVariant from, vtkVariant to); 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); 00108 00110 void ClearMap(); 00111 00113 int GetMapSize(); 00114 00115 //BTX 00116 // Always keep NUM_ATTRIBUTE_LOCS as the last entry 00117 enum FieldType 00118 { 00119 POINT_DATA=0, 00120 CELL_DATA=1, 00121 VERTEX_DATA=2, 00122 EDGE_DATA=3, 00123 ROW_DATA=4, 00124 NUM_ATTRIBUTE_LOCS 00125 }; 00126 //ETX 00127 00128 protected: 00129 00130 vtkMapArrayValues(); 00131 virtual ~vtkMapArrayValues(); 00132 00133 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00134 int FillInputPortInformation(int, vtkInformation *); 00135 00136 char* InputArrayName; 00137 char* OutputArrayName; 00138 int OutputArrayType; 00139 int FieldType; 00140 int MapType; 00141 int PassArray; 00142 double FillValue; 00143 00144 // PIMPL idiom to hide map implementation. 00145 vtkMapType *Map; 00146 00147 private: 00148 vtkMapArrayValues(const vtkMapArrayValues&); // Not implemented. 00149 void operator=(const vtkMapArrayValues&); // Not implemented. 00150 }; 00151 00152 #endif