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
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #define OSG_COMPILEPROJECTIONCAMERADECORATORINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGProjectionCameraDecoratorBase.h"
00062 #include "OSGProjectionCameraDecorator.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector ProjectionCameraDecoratorBase::UserFieldMask =
00068 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::UserFieldId);
00069
00070 const OSG::BitVector ProjectionCameraDecoratorBase::SurfaceFieldMask =
00071 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::SurfaceFieldId);
00072
00073 const OSG::BitVector ProjectionCameraDecoratorBase::LeftFieldMask =
00074 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::LeftFieldId);
00075
00076 const OSG::BitVector ProjectionCameraDecoratorBase::BottomFieldMask =
00077 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::BottomFieldId);
00078
00079 const OSG::BitVector ProjectionCameraDecoratorBase::NormalFieldMask =
00080 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::NormalFieldId);
00081
00082 const OSG::BitVector ProjectionCameraDecoratorBase::WidthFieldMask =
00083 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::WidthFieldId);
00084
00085 const OSG::BitVector ProjectionCameraDecoratorBase::HeightFieldMask =
00086 (TypeTraits<BitVector>::One << ProjectionCameraDecoratorBase::HeightFieldId);
00087
00088 const OSG::BitVector ProjectionCameraDecoratorBase::MTInfluenceMask =
00089 (Inherited::MTInfluenceMask) |
00090 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00091
00092
00093
00094
00117
00118
00119 FieldDescription *ProjectionCameraDecoratorBase::_desc[] =
00120 {
00121 new FieldDescription(SFNodePtr::getClassType(),
00122 "user",
00123 UserFieldId, UserFieldMask,
00124 false,
00125 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFUser),
00126 new FieldDescription(MFPnt3f::getClassType(),
00127 "surface",
00128 SurfaceFieldId, SurfaceFieldMask,
00129 false,
00130 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getMFSurface),
00131 new FieldDescription(SFPlane::getClassType(),
00132 "left",
00133 LeftFieldId, LeftFieldMask,
00134 true,
00135 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFLeft),
00136 new FieldDescription(SFPlane::getClassType(),
00137 "bottom",
00138 BottomFieldId, BottomFieldMask,
00139 true,
00140 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFBottom),
00141 new FieldDescription(SFPlane::getClassType(),
00142 "normal",
00143 NormalFieldId, NormalFieldMask,
00144 true,
00145 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFNormal),
00146 new FieldDescription(SFReal32::getClassType(),
00147 "width",
00148 WidthFieldId, WidthFieldMask,
00149 true,
00150 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFWidth),
00151 new FieldDescription(SFReal32::getClassType(),
00152 "height",
00153 HeightFieldId, HeightFieldMask,
00154 true,
00155 (FieldAccessMethod) &ProjectionCameraDecoratorBase::getSFHeight)
00156 };
00157
00158
00159 FieldContainerType ProjectionCameraDecoratorBase::_type(
00160 "ProjectionCameraDecorator",
00161 "StereoCameraDecorator",
00162 NULL,
00163 (PrototypeCreateF) &ProjectionCameraDecoratorBase::createEmpty,
00164 ProjectionCameraDecorator::initMethod,
00165 _desc,
00166 sizeof(_desc));
00167
00168
00169
00170
00171
00172 FieldContainerType &ProjectionCameraDecoratorBase::getType(void)
00173 {
00174 return _type;
00175 }
00176
00177 const FieldContainerType &ProjectionCameraDecoratorBase::getType(void) const
00178 {
00179 return _type;
00180 }
00181
00182
00183 FieldContainerPtr ProjectionCameraDecoratorBase::shallowCopy(void) const
00184 {
00185 ProjectionCameraDecoratorPtr returnValue;
00186
00187 newPtr(returnValue, dynamic_cast<const ProjectionCameraDecorator *>(this));
00188
00189 return returnValue;
00190 }
00191
00192 UInt32 ProjectionCameraDecoratorBase::getContainerSize(void) const
00193 {
00194 return sizeof(ProjectionCameraDecorator);
00195 }
00196
00197
00198 #if !defined(OSG_FIXED_MFIELDSYNC)
00199 void ProjectionCameraDecoratorBase::executeSync( FieldContainer &other,
00200 const BitVector &whichField)
00201 {
00202 this->executeSyncImpl((ProjectionCameraDecoratorBase *) &other, whichField);
00203 }
00204 #else
00205 void ProjectionCameraDecoratorBase::executeSync( FieldContainer &other,
00206 const BitVector &whichField, const SyncInfo &sInfo )
00207 {
00208 this->executeSyncImpl((ProjectionCameraDecoratorBase *) &other, whichField, sInfo);
00209 }
00210 void ProjectionCameraDecoratorBase::execBeginEdit(const BitVector &whichField,
00211 UInt32 uiAspect,
00212 UInt32 uiContainerSize)
00213 {
00214 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00215 }
00216
00217 void ProjectionCameraDecoratorBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00218 {
00219 Inherited::onDestroyAspect(uiId, uiAspect);
00220
00221 _mfSurface.terminateShare(uiAspect, this->getContainerSize());
00222 }
00223 #endif
00224
00225
00226
00227 #ifdef OSG_WIN32_ICL
00228 #pragma warning (disable : 383)
00229 #endif
00230
00231 ProjectionCameraDecoratorBase::ProjectionCameraDecoratorBase(void) :
00232 _sfUser (),
00233 _mfSurface (),
00234 _sfLeft (),
00235 _sfBottom (),
00236 _sfNormal (),
00237 _sfWidth (),
00238 _sfHeight (),
00239 Inherited()
00240 {
00241 }
00242
00243 #ifdef OSG_WIN32_ICL
00244 #pragma warning (default : 383)
00245 #endif
00246
00247 ProjectionCameraDecoratorBase::ProjectionCameraDecoratorBase(const ProjectionCameraDecoratorBase &source) :
00248 _sfUser (source._sfUser ),
00249 _mfSurface (source._mfSurface ),
00250 _sfLeft (source._sfLeft ),
00251 _sfBottom (source._sfBottom ),
00252 _sfNormal (source._sfNormal ),
00253 _sfWidth (source._sfWidth ),
00254 _sfHeight (source._sfHeight ),
00255 Inherited (source)
00256 {
00257 }
00258
00259
00260
00261 ProjectionCameraDecoratorBase::~ProjectionCameraDecoratorBase(void)
00262 {
00263 }
00264
00265
00266
00267 UInt32 ProjectionCameraDecoratorBase::getBinSize(const BitVector &whichField)
00268 {
00269 UInt32 returnValue = Inherited::getBinSize(whichField);
00270
00271 if(FieldBits::NoField != (UserFieldMask & whichField))
00272 {
00273 returnValue += _sfUser.getBinSize();
00274 }
00275
00276 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00277 {
00278 returnValue += _mfSurface.getBinSize();
00279 }
00280
00281 if(FieldBits::NoField != (LeftFieldMask & whichField))
00282 {
00283 returnValue += _sfLeft.getBinSize();
00284 }
00285
00286 if(FieldBits::NoField != (BottomFieldMask & whichField))
00287 {
00288 returnValue += _sfBottom.getBinSize();
00289 }
00290
00291 if(FieldBits::NoField != (NormalFieldMask & whichField))
00292 {
00293 returnValue += _sfNormal.getBinSize();
00294 }
00295
00296 if(FieldBits::NoField != (WidthFieldMask & whichField))
00297 {
00298 returnValue += _sfWidth.getBinSize();
00299 }
00300
00301 if(FieldBits::NoField != (HeightFieldMask & whichField))
00302 {
00303 returnValue += _sfHeight.getBinSize();
00304 }
00305
00306
00307 return returnValue;
00308 }
00309
00310 void ProjectionCameraDecoratorBase::copyToBin( BinaryDataHandler &pMem,
00311 const BitVector &whichField)
00312 {
00313 Inherited::copyToBin(pMem, whichField);
00314
00315 if(FieldBits::NoField != (UserFieldMask & whichField))
00316 {
00317 _sfUser.copyToBin(pMem);
00318 }
00319
00320 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00321 {
00322 _mfSurface.copyToBin(pMem);
00323 }
00324
00325 if(FieldBits::NoField != (LeftFieldMask & whichField))
00326 {
00327 _sfLeft.copyToBin(pMem);
00328 }
00329
00330 if(FieldBits::NoField != (BottomFieldMask & whichField))
00331 {
00332 _sfBottom.copyToBin(pMem);
00333 }
00334
00335 if(FieldBits::NoField != (NormalFieldMask & whichField))
00336 {
00337 _sfNormal.copyToBin(pMem);
00338 }
00339
00340 if(FieldBits::NoField != (WidthFieldMask & whichField))
00341 {
00342 _sfWidth.copyToBin(pMem);
00343 }
00344
00345 if(FieldBits::NoField != (HeightFieldMask & whichField))
00346 {
00347 _sfHeight.copyToBin(pMem);
00348 }
00349
00350
00351 }
00352
00353 void ProjectionCameraDecoratorBase::copyFromBin( BinaryDataHandler &pMem,
00354 const BitVector &whichField)
00355 {
00356 Inherited::copyFromBin(pMem, whichField);
00357
00358 if(FieldBits::NoField != (UserFieldMask & whichField))
00359 {
00360 _sfUser.copyFromBin(pMem);
00361 }
00362
00363 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00364 {
00365 _mfSurface.copyFromBin(pMem);
00366 }
00367
00368 if(FieldBits::NoField != (LeftFieldMask & whichField))
00369 {
00370 _sfLeft.copyFromBin(pMem);
00371 }
00372
00373 if(FieldBits::NoField != (BottomFieldMask & whichField))
00374 {
00375 _sfBottom.copyFromBin(pMem);
00376 }
00377
00378 if(FieldBits::NoField != (NormalFieldMask & whichField))
00379 {
00380 _sfNormal.copyFromBin(pMem);
00381 }
00382
00383 if(FieldBits::NoField != (WidthFieldMask & whichField))
00384 {
00385 _sfWidth.copyFromBin(pMem);
00386 }
00387
00388 if(FieldBits::NoField != (HeightFieldMask & whichField))
00389 {
00390 _sfHeight.copyFromBin(pMem);
00391 }
00392
00393
00394 }
00395
00396 #if !defined(OSG_FIXED_MFIELDSYNC)
00397 void ProjectionCameraDecoratorBase::executeSyncImpl( ProjectionCameraDecoratorBase *pOther,
00398 const BitVector &whichField)
00399 {
00400
00401 Inherited::executeSyncImpl(pOther, whichField);
00402
00403 if(FieldBits::NoField != (UserFieldMask & whichField))
00404 _sfUser.syncWith(pOther->_sfUser);
00405
00406 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00407 _mfSurface.syncWith(pOther->_mfSurface);
00408
00409 if(FieldBits::NoField != (LeftFieldMask & whichField))
00410 _sfLeft.syncWith(pOther->_sfLeft);
00411
00412 if(FieldBits::NoField != (BottomFieldMask & whichField))
00413 _sfBottom.syncWith(pOther->_sfBottom);
00414
00415 if(FieldBits::NoField != (NormalFieldMask & whichField))
00416 _sfNormal.syncWith(pOther->_sfNormal);
00417
00418 if(FieldBits::NoField != (WidthFieldMask & whichField))
00419 _sfWidth.syncWith(pOther->_sfWidth);
00420
00421 if(FieldBits::NoField != (HeightFieldMask & whichField))
00422 _sfHeight.syncWith(pOther->_sfHeight);
00423
00424
00425 }
00426 #else
00427 void ProjectionCameraDecoratorBase::executeSyncImpl( ProjectionCameraDecoratorBase *pOther,
00428 const BitVector &whichField,
00429 const SyncInfo &sInfo )
00430 {
00431
00432 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00433
00434 if(FieldBits::NoField != (UserFieldMask & whichField))
00435 _sfUser.syncWith(pOther->_sfUser);
00436
00437 if(FieldBits::NoField != (LeftFieldMask & whichField))
00438 _sfLeft.syncWith(pOther->_sfLeft);
00439
00440 if(FieldBits::NoField != (BottomFieldMask & whichField))
00441 _sfBottom.syncWith(pOther->_sfBottom);
00442
00443 if(FieldBits::NoField != (NormalFieldMask & whichField))
00444 _sfNormal.syncWith(pOther->_sfNormal);
00445
00446 if(FieldBits::NoField != (WidthFieldMask & whichField))
00447 _sfWidth.syncWith(pOther->_sfWidth);
00448
00449 if(FieldBits::NoField != (HeightFieldMask & whichField))
00450 _sfHeight.syncWith(pOther->_sfHeight);
00451
00452
00453 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00454 _mfSurface.syncWith(pOther->_mfSurface, sInfo);
00455
00456
00457 }
00458
00459 void ProjectionCameraDecoratorBase::execBeginEditImpl (const BitVector &whichField,
00460 UInt32 uiAspect,
00461 UInt32 uiContainerSize)
00462 {
00463 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00464
00465 if(FieldBits::NoField != (SurfaceFieldMask & whichField))
00466 _mfSurface.beginEdit(uiAspect, uiContainerSize);
00467
00468 }
00469 #endif
00470
00471
00472
00473 #include <OSGSFieldTypeDef.inl>
00474 #include <OSGMFieldTypeDef.inl>
00475
00476 OSG_BEGIN_NAMESPACE
00477
00478 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00479 DataType FieldDataTraits<ProjectionCameraDecoratorPtr>::_type("ProjectionCameraDecoratorPtr", "StereoCameraDecoratorPtr");
00480 #endif
00481
00482 OSG_DLLEXPORT_SFIELD_DEF1(ProjectionCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00483 OSG_DLLEXPORT_MFIELD_DEF1(ProjectionCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00484
00485 OSG_END_NAMESPACE
00486
00487
00488
00489
00490
00491 #ifdef OSG_SGI_CC
00492 #pragma set woff 1174
00493 #endif
00494
00495 #ifdef OSG_LINUX_ICC
00496 #pragma warning( disable : 177 )
00497 #endif
00498
00499 namespace
00500 {
00501 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00502 static Char8 cvsid_hpp [] = OSGPROJECTIONCAMERADECORATORBASE_HEADER_CVSID;
00503 static Char8 cvsid_inl [] = OSGPROJECTIONCAMERADECORATORBASE_INLINE_CVSID;
00504
00505 static Char8 cvsid_fields_hpp[] = OSGPROJECTIONCAMERADECORATORFIELDS_HEADER_CVSID;
00506 }
00507