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 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 ROW_DATA=4, 00123 NUM_ATTRIBUTE_LOCS 00124 }; 00125 //ETX 00126 00127 protected: 00128 00129 vtkMapArrayValues(); 00130 virtual ~vtkMapArrayValues(); 00131 00132 int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *); 00133 int FillInputPortInformation(int, vtkInformation *); 00134 00135 char* InputArrayName; 00136 char* OutputArrayName; 00137 int OutputArrayType; 00138 int FieldType; 00139 int MapType; 00140 int PassArray; 00141 double FillValue; 00142 00143 // PIMPL idiom to hide map implementation. 00144 vtkMapType *Map; 00145 00146 private: 00147 vtkMapArrayValues(const vtkMapArrayValues&); // Not implemented. 00148 void operator=(const vtkMapArrayValues&); // Not implemented. 00149 }; 00150 00151 #endif