00001 /* 00002 * This file is part of the "Archon" framework. 00003 * (http://files3d.sourceforge.net) 00004 * 00005 * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen. 00006 * 00007 * Permission to use, copy, modify, and distribute this software and 00008 * its documentation under the terms of the GNU General Public License is 00009 * hereby granted. No representations are made about the suitability of 00010 * this software for any purpose. It is provided "as is" without express 00011 * or implied warranty. See the GNU General Public License 00012 * (http://www.gnu.org/copyleft/gpl.html) for more details. 00013 * 00014 * The characters in this file are ISO8859-1 encoded. 00015 * 00016 * The documentation in this file is in "Doxygen" style 00017 * (http://www.doxygen.org). 00018 */ 00019 00020 #ifndef ARCHON_X3D_PROXY_FIELD_TYPE_H 00021 #define ARCHON_X3D_PROXY_FIELD_TYPE_H 00022 00029 #include <string> 00030 #include <vector> 00031 00032 #include <archon/math/rotation.H> 00033 00034 #include <archon/util/ref.H> 00035 #include <archon/util/time.H> 00036 #include <archon/util/image.H> 00037 00038 namespace Archon 00039 { 00040 namespace X3D 00041 { 00042 namespace Proxy 00043 { 00044 using namespace std; 00045 using namespace Math; 00046 using namespace Utilities; 00047 00048 struct SFBool 00049 { 00050 typedef bool Type; 00051 typedef Type ArgType; 00052 static const unsigned index = 0; 00053 }; 00054 00055 struct MFBool 00056 { 00057 typedef SFBool Single; 00058 typedef vector<Single::Type> Type; 00059 typedef const Type &ArgType; 00060 static const unsigned index = 1; 00061 }; 00062 00063 00064 struct SFColor 00065 { 00066 typedef double ElemType; 00067 static const unsigned size = 3; 00068 typedef BasicVector<ElemType, size> Type; 00069 typedef Type ArgType; 00070 static const unsigned index = 2; 00071 }; 00072 00073 struct MFColor 00074 { 00075 typedef SFColor Single; 00076 typedef vector<Single::Type> Type; 00077 typedef const Type &ArgType; 00078 static const unsigned index = 3; 00079 }; 00080 00081 00082 struct SFColorRGBA 00083 { 00084 typedef double ElemType; 00085 static const unsigned size = 4; 00086 typedef BasicVector<ElemType, size> Type; 00087 typedef Type ArgType; 00088 static const unsigned index = 4; 00089 }; 00090 00091 struct MFColorRGBA 00092 { 00093 typedef SFColorRGBA Single; 00094 typedef vector<Single::Type> Type; 00095 typedef const Type &ArgType; 00096 static const unsigned index = 5; 00097 }; 00098 00099 00100 struct SFDouble 00101 { 00102 typedef double Type; 00103 typedef Type ArgType; 00104 static const unsigned index = 6; 00105 }; 00106 00107 struct MFDouble 00108 { 00109 typedef SFDouble Single; 00110 typedef vector<Single::Type> Type; 00111 typedef const Type &ArgType; 00112 static const unsigned index = 7; 00113 }; 00114 00115 00116 struct SFFloat 00117 { 00118 typedef double Type; 00119 typedef Type ArgType; 00120 static const unsigned index = 8; 00121 }; 00122 00123 struct MFFloat 00124 { 00125 typedef SFFloat Single; 00126 typedef vector<Single::Type> Type; 00127 typedef const Type &ArgType; 00128 static const unsigned index = 9; 00129 }; 00130 00131 00132 struct SFImage 00133 { 00134 typedef Image Type; 00135 typedef const Type &ArgType; 00136 static const unsigned index = 10; 00137 }; 00138 00139 struct MFImage 00140 { 00141 typedef SFImage Single; 00142 typedef vector<Single::Type> Type; 00143 typedef const Type &ArgType; 00144 static const unsigned index = 11; 00145 }; 00146 00147 00148 struct SFInt32 00149 { 00150 typedef int Type; 00151 typedef Type ArgType; 00152 static const unsigned index = 12; 00153 }; 00154 00155 struct MFInt32 00156 { 00157 typedef SFInt32 Single; 00158 typedef vector<Single::Type> Type; 00159 typedef const Type &ArgType; 00160 static const unsigned index = 13; 00161 }; 00162 00163 00164 template<typename C> struct SFNode 00165 { 00166 typedef Ref<C> Type; 00167 typedef Type ArgType; 00168 static const unsigned index = 14; 00169 }; 00170 00171 template<typename C> struct MFNode 00172 { 00173 typedef SFNode<C> Single; 00174 typedef vector<typename Single::Type> Type; 00175 typedef const Type &ArgType; 00176 static const unsigned index = 15; 00177 }; 00178 00179 00180 struct SFRotation 00181 { 00182 typedef double ElemType; 00183 static const unsigned size = 4; 00184 typedef Rotation3 Type; 00185 typedef Type ArgType; 00186 static const unsigned index = 16; 00187 }; 00188 00189 struct MFRotation 00190 { 00191 typedef SFRotation Single; 00192 typedef vector<Single::Type> Type; 00193 typedef const Type &ArgType; 00194 static const unsigned index = 17; 00195 }; 00196 00197 00198 struct SFString 00199 { 00200 typedef string Type; 00201 typedef Type ArgType; 00202 static const unsigned index = 18; 00203 }; 00204 00205 struct MFString 00206 { 00207 typedef SFString Single; 00208 typedef vector<Single::Type> Type; 00209 typedef const Type &ArgType; 00210 static const unsigned index = 19; 00211 }; 00212 00213 00214 struct SFTime 00215 { 00216 typedef long ElemType; 00217 static const unsigned size = 2; 00218 typedef Time Type; 00219 typedef Type ArgType; 00220 static const unsigned index = 20; 00221 }; 00222 00223 struct MFTime 00224 { 00225 typedef SFTime Single; 00226 typedef vector<Single::Type> Type; 00227 typedef const Type &ArgType; 00228 static const unsigned index = 21; 00229 }; 00230 00231 00232 struct SFVec2d 00233 { 00234 typedef SFDouble::Type ElemType; 00235 static const unsigned size = 2; 00236 typedef BasicVector<ElemType, size> Type; 00237 typedef Type ArgType; 00238 static const unsigned index = 22; 00239 }; 00240 00241 struct MFVec2d 00242 { 00243 typedef SFVec2d Single; 00244 typedef vector<Single::Type> Type; 00245 typedef const Type &ArgType; 00246 static const unsigned index = 23; 00247 }; 00248 00249 00250 struct SFVec2f 00251 { 00252 typedef SFFloat::Type ElemType; 00253 static const unsigned size = 2; 00254 typedef BasicVector<ElemType, size> Type; 00255 typedef Type ArgType; 00256 static const unsigned index = 24; 00257 }; 00258 00259 struct MFVec2f 00260 { 00261 typedef SFVec2f Single; 00262 typedef vector<Single::Type> Type; 00263 typedef const Type &ArgType; 00264 static const unsigned index = 25; 00265 }; 00266 00267 00268 struct SFVec3d 00269 { 00270 typedef SFDouble::Type ElemType; 00271 static const unsigned size = 3; 00272 typedef BasicVector<ElemType, size> Type; 00273 typedef Type ArgType; 00274 static const unsigned index = 26; 00275 }; 00276 00277 struct MFVec3d 00278 { 00279 typedef SFVec3d Single; 00280 typedef vector<Single::Type> Type; 00281 typedef const Type &ArgType; 00282 static const unsigned index = 27; 00283 }; 00284 00285 00286 struct SFVec3f 00287 { 00288 typedef SFFloat::Type ElemType; 00289 static const unsigned size = 3; 00290 typedef BasicVector<ElemType, size> Type; 00291 typedef Type ArgType; 00292 static const unsigned index = 28; 00293 }; 00294 00295 struct MFVec3f 00296 { 00297 typedef SFVec3f Single; 00298 typedef vector<Single::Type> Type; 00299 typedef const Type &ArgType; 00300 static const unsigned index = 29; 00301 }; 00302 00303 const unsigned fieldTypeIndexRoof = 30; 00304 } 00305 } 00306 } 00307 00308 #endif // ARCHON_X3D_PROXY_FIELD_TYPE_H