00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #include <stdlib.h>
00040 #include <stdio.h>
00041
00042 #include "OSGConfig.h"
00043
00044 OSG_BEGIN_NAMESPACE
00045
00046
00047
00048
00049 template<> inline
00050 Vec2f GeoProperty<GeoTexCoords1fPropertyDesc>::getValue(const UInt32 index)
00051 {
00052 return Vec2f(_field[index], 0.f);
00053 }
00054
00055 template<> inline
00056 Vec2f GeoProperty<GeoTexCoords1fPropertyDesc>::getValue(
00057 const UInt32 index) const
00058 {
00059 return Vec2f(_field[index], 0.f);
00060 }
00061
00062 template<> inline
00063 void GeoProperty<GeoTexCoords1fPropertyDesc>::getValue(
00064 Vec2f &res,
00065 const UInt32 index)
00066 {
00067 res.setValues(_field[index], 0.f);
00068 }
00069
00070 template<> inline
00071 void GeoProperty<GeoTexCoords1fPropertyDesc>::getValue(
00072 Vec2f &res,
00073 const UInt32 index) const
00074 {
00075 res.setValues(_field[index], 0.f);
00076 }
00077
00078 template<>
00079 inline void
00080 GeoProperty<GeoTexCoords1fPropertyDesc>::setValue( const Vec2f & val,
00081 const UInt32 index )
00082 {
00083 _field[index] = val[0];
00084 }
00085
00086 template<>
00087 inline void
00088 GeoProperty<GeoTexCoords1fPropertyDesc>::addValue( const Vec2f & val )
00089 {
00090 _field.push_back(val[0]);
00091 }
00092
00093 template <> inline
00094 bool GeoProperty<GeoTexCoords1fPropertyDesc>::insertValue(const Vec2f & val,
00095 const UInt32 index)
00096 {
00097 if(_field.size() < index)
00098 {
00099 return false;
00100 }
00101 else if(_field.size() == index)
00102 {
00103 addValue(val);
00104 return true;
00105 }
00106 else
00107 {
00108 _field.insert(_field.begin() + index, val[0]);
00109 return true;
00110 }
00111 }
00112
00113
00114
00115
00116 template<> inline
00117 Vec2f GeoProperty<GeoTexCoords3fPropertyDesc>::getValue(const UInt32 index)
00118 {
00119 return Vec2f(_field[index][0], _field[index][1]);
00120 }
00121
00122 template<> inline
00123 Vec2f GeoProperty<GeoTexCoords3fPropertyDesc>::getValue(
00124 const UInt32 index) const
00125 {
00126 return Vec2f(_field[index][0], _field[index][1]);
00127 }
00128
00129 template<> inline
00130 void GeoProperty<GeoTexCoords3fPropertyDesc>::getValue(
00131 Vec2f &res,
00132 const UInt32 index)
00133 {
00134 res.setValues(_field[index][0], _field[index][1]);
00135 }
00136
00137 template<> inline
00138 void GeoProperty<GeoTexCoords3fPropertyDesc>::getValue(
00139 Vec2f &res,
00140 const UInt32 index) const
00141 {
00142 res.setValues(_field[index][0],
00143 _field[index][1]);
00144 }
00145
00146 template<>
00147 inline void
00148 GeoProperty<GeoTexCoords3fPropertyDesc>::setValue( const Vec2f & val,
00149 const UInt32 index )
00150 {
00151 _field[index].setValues(val[0], val[1], 0.f);
00152 }
00153
00154 template<>
00155 inline void
00156 GeoProperty<GeoTexCoords3fPropertyDesc>::addValue( const Vec2f & val )
00157 {
00158 _field.push_back(Vec3f( val[0], val[1], 0));
00159 }
00160
00161 template <> inline
00162 bool GeoProperty<GeoTexCoords3fPropertyDesc>::insertValue(const Vec2f & val,
00163 const UInt32 index)
00164 {
00165 if(_field.size() < index)
00166 {
00167 return false;
00168 }
00169 else if(_field.size() == index)
00170 {
00171 addValue(val);
00172 return true;
00173 }
00174 else
00175 {
00176 _field.insert(_field.begin() + index, Vec3f(val[0], val[1], 0));
00177 return true;
00178 }
00179 }
00180
00181
00182
00183
00184 template<> inline
00185 Vec2f GeoProperty<GeoTexCoords4fPropertyDesc>::getValue(const UInt32 index)
00186 {
00187 return Vec2f(_field[index][0], _field[index][1]);
00188 }
00189
00190 template<> inline
00191 Vec2f GeoProperty<GeoTexCoords4fPropertyDesc>::getValue(
00192 const UInt32 index) const
00193 {
00194 return Vec2f(_field[index][0], _field[index][1]);
00195 }
00196
00197 template<> inline
00198 void GeoProperty<GeoTexCoords4fPropertyDesc>::getValue(
00199 Vec2f &res,
00200 const UInt32 index)
00201 {
00202 res.setValues(_field[index][0], _field[index][1]);
00203 }
00204
00205 template<> inline
00206 void GeoProperty<GeoTexCoords4fPropertyDesc>::getValue(
00207 Vec2f &res,
00208 const UInt32 index) const
00209 {
00210 res.setValues(_field[index][0], _field[index][1]);
00211 }
00212
00213 template<>
00214 inline void
00215 GeoProperty<GeoTexCoords4fPropertyDesc>::setValue( const Vec2f & val,
00216 const UInt32 index )
00217 {
00218 _field[index].setValues(val[0], val[1], 0.f, 0.f);
00219 }
00220
00221 template<>
00222 inline void
00223 GeoProperty<GeoTexCoords4fPropertyDesc>::addValue( const Vec2f & val )
00224 {
00225 _field.push_back(Vec4f( val[0], val[1], 0.f, 0.f));
00226 }
00227
00228 template <> inline
00229 bool GeoProperty<GeoTexCoords4fPropertyDesc>::insertValue(const Vec2f & val,
00230 const UInt32 index)
00231 {
00232 if(_field.size() < index)
00233 {
00234 return false;
00235 }
00236 else if(_field.size() == index)
00237 {
00238 addValue(val);
00239 return true;
00240 }
00241 else
00242 {
00243 _field.insert(_field.begin() + index, Vec4f(val[0], val[1], 0.f, 0.f));
00244 return true;
00245 }
00246 }
00247
00248
00249
00250
00251 template <> inline
00252 Vec2f GeoProperty<GeoTexCoords1dPropertyDesc>::getValue(const UInt32 index)
00253 {
00254 return Vec2f(Real32(_field[index]), 0.f);
00255 }
00256
00257 template <> inline
00258 Vec2f GeoProperty<GeoTexCoords1dPropertyDesc>::getValue(
00259 const UInt32 index) const
00260 {
00261 return Vec2f(Real32(_field[index]), 0.f);
00262 }
00263
00264 template <> inline
00265 void GeoProperty<GeoTexCoords1dPropertyDesc>::getValue(
00266 Vec2f &res,
00267 const UInt32 index)
00268 {
00269 res.setValues(Real32(_field[index]), 0.f);
00270 }
00271
00272 template <> inline
00273 void GeoProperty<GeoTexCoords1dPropertyDesc>::getValue(
00274 Vec2f &res,
00275 const UInt32 index) const
00276 {
00277 res.setValues(Real32(_field[index]), 0.f);
00278 }
00279
00280 template<>
00281 inline void
00282 GeoProperty<GeoTexCoords1dPropertyDesc>::setValue( const Vec2f & val,
00283 const UInt32 index )
00284 {
00285 _field[index] = val[0];
00286 }
00287
00288 template<>
00289 inline void
00290 GeoProperty<GeoTexCoords1dPropertyDesc>::addValue( const Vec2f & val )
00291 {
00292 _field.push_back(val[0]);
00293 }
00294
00295 template <> inline
00296 bool GeoProperty<GeoTexCoords1dPropertyDesc>::insertValue(const Vec2f & val,
00297 const UInt32 index)
00298 {
00299 if(_field.size() < index)
00300 {
00301 return false;
00302 }
00303 else if(_field.size() == index)
00304 {
00305 addValue(val);
00306 return true;
00307 }
00308 else
00309 {
00310 _field.insert(_field.begin() + index, val[0]);
00311 return true;
00312 }
00313 }
00314
00315
00316
00317 template<> inline
00318 Vec2f GeoProperty<GeoTexCoords2dPropertyDesc>::getValue(const UInt32 index)
00319 {
00320 return Vec2f(Real32(_field[index][0]),
00321 Real32(_field[index][1]));
00322 }
00323
00324 template<> inline
00325 Vec2f GeoProperty<GeoTexCoords2dPropertyDesc>::getValue(
00326 const UInt32 index) const
00327 {
00328 return Vec2f(Real32(_field[index][0]),
00329 Real32(_field[index][1]));
00330 }
00331
00332 template<> inline
00333 void GeoProperty<GeoTexCoords2dPropertyDesc>::getValue(
00334 Vec2f &res,
00335 const UInt32 index)
00336 {
00337 res.setValues(Real32(_field[index][0]),
00338 Real32(_field[index][1]));
00339 }
00340
00341 template<> inline
00342 void GeoProperty<GeoTexCoords2dPropertyDesc>::getValue(
00343 Vec2f &res,
00344 const UInt32 index) const
00345 {
00346 res.setValues(Real32(_field[index][0]),
00347 Real32(_field[index][1]));
00348 }
00349
00350 template<>
00351 inline void
00352 GeoProperty<GeoTexCoords2dPropertyDesc>::setValue( const Vec2f & val,
00353 const UInt32 index )
00354 {
00355 _field[index].setValues(val[0], val[1]);
00356 }
00357
00358 template<>
00359 inline void
00360 GeoProperty<GeoTexCoords2dPropertyDesc>::addValue( const Vec2f & val )
00361 {
00362 _field.push_back(Vec2d( val[0], val[1]));
00363 }
00364
00365 template <> inline
00366 bool GeoProperty<GeoTexCoords2dPropertyDesc>::insertValue(const Vec2f & val,
00367 const UInt32 index)
00368 {
00369 if(_field.size() < index)
00370 {
00371 return false;
00372 }
00373 else if(_field.size() == index)
00374 {
00375 addValue(val);
00376 return true;
00377 }
00378 else
00379 {
00380 _field.insert(_field.begin() + index, Vec2d(val[0], val[1]));
00381 return true;
00382 }
00383 }
00384
00385
00386
00387 template<> inline
00388 Vec2f GeoProperty<GeoTexCoords3dPropertyDesc>::getValue(const UInt32 index)
00389 {
00390 return Vec2f(Real32(_field[index][0]),
00391 Real32(_field[index][1]));
00392 }
00393
00394 template<> inline
00395 Vec2f GeoProperty<GeoTexCoords3dPropertyDesc>::getValue(
00396 const UInt32 index) const
00397 {
00398 return Vec2f(Real32(_field[index][0]),
00399 Real32(_field[index][1]));
00400 }
00401
00402 template<> inline
00403 void GeoProperty<GeoTexCoords3dPropertyDesc>::getValue(
00404 Vec2f &res,
00405 const UInt32 index)
00406 {
00407 res.setValues(Real32(_field[index][0]),
00408 Real32(_field[index][1]));
00409 }
00410
00411 template<> inline
00412 void GeoProperty<GeoTexCoords3dPropertyDesc>::getValue(
00413 Vec2f &res,
00414 const UInt32 index) const
00415 {
00416 res.setValues(Real32(_field[index][0]),
00417 Real32(_field[index][1]));
00418 }
00419
00420 template<>
00421 inline void
00422 GeoProperty<GeoTexCoords3dPropertyDesc>::setValue( const Vec2f & val,
00423 const UInt32 index )
00424 {
00425 _field[index].setValues(val[0], val[1], 0.f);
00426 }
00427
00428 template<>
00429 inline void
00430 GeoProperty<GeoTexCoords3dPropertyDesc>::addValue( const Vec2f & val )
00431 {
00432 _field.push_back(Vec3d( val[0], val[1], 0));
00433 }
00434
00435 template <> inline
00436 bool GeoProperty<GeoTexCoords3dPropertyDesc>::insertValue(const Vec2f & val,
00437 const UInt32 index)
00438 {
00439 if(_field.size() < index)
00440 {
00441 return false;
00442 }
00443 else if(_field.size() == index)
00444 {
00445 addValue(val);
00446 return true;
00447 }
00448 else
00449 {
00450 _field.insert(_field.begin() + index, Vec3d(val[0], val[1], 0));
00451 return true;
00452 }
00453 }
00454
00455
00456
00457 template<> inline
00458 Vec2f GeoProperty<GeoTexCoords4dPropertyDesc>::getValue(const UInt32 index)
00459 {
00460 return Vec2f(Real32(_field[index][0]),
00461 Real32(_field[index][1]));
00462 }
00463
00464 template<> inline
00465 Vec2f GeoProperty<GeoTexCoords4dPropertyDesc>::getValue(
00466 const UInt32 index) const
00467 {
00468 return Vec2f(Real32(_field[index][0]),
00469 Real32(_field[index][1]));
00470 }
00471
00472 template<> inline
00473 void GeoProperty<GeoTexCoords4dPropertyDesc>::getValue(
00474 Vec2f &res,
00475 const UInt32 index)
00476 {
00477 res.setValues(Real32(_field[index][0]),
00478 Real32(_field[index][1]));
00479 }
00480
00481 template<> inline
00482 void GeoProperty<GeoTexCoords4dPropertyDesc>::getValue(
00483 Vec2f &res,
00484 const UInt32 index) const
00485 {
00486 res.setValues(Real32(_field[index][0]),
00487 Real32(_field[index][1]));
00488 }
00489
00490 template<>
00491 inline void
00492 GeoProperty<GeoTexCoords4dPropertyDesc>::setValue( const Vec2f & val,
00493 const UInt32 index )
00494 {
00495 _field[index].setValues(val[0], val[1], 0.f, 0.f);
00496 }
00497
00498 template<>
00499 inline void
00500 GeoProperty<GeoTexCoords4dPropertyDesc>::addValue( const Vec2f & val )
00501 {
00502 _field.push_back(Vec4d( val[0], val[1], 0.f, 0.f));
00503 }
00504
00505 template <> inline
00506 bool GeoProperty<GeoTexCoords4dPropertyDesc>::insertValue(const Vec2f & val,
00507 const UInt32 index)
00508 {
00509 if(_field.size() < index)
00510 {
00511 return false;
00512 }
00513 else if(_field.size() == index)
00514 {
00515 addValue(val);
00516 return true;
00517 }
00518 else
00519 {
00520 _field.insert(_field.begin() + index, Vec4d(val[0], val[1], 0.f, 0.f));
00521 return true;
00522 }
00523 }
00524
00525 OSG_END_NAMESPACE