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_COMPILETILECAMERADECORATORINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGTileCameraDecoratorBase.h"
00062 #include "OSGTileCameraDecorator.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector TileCameraDecoratorBase::LeftFieldMask =
00068 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::LeftFieldId);
00069
00070 const OSG::BitVector TileCameraDecoratorBase::RightFieldMask =
00071 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::RightFieldId);
00072
00073 const OSG::BitVector TileCameraDecoratorBase::BottomFieldMask =
00074 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::BottomFieldId);
00075
00076 const OSG::BitVector TileCameraDecoratorBase::TopFieldMask =
00077 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::TopFieldId);
00078
00079 const OSG::BitVector TileCameraDecoratorBase::FullWidthFieldMask =
00080 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::FullWidthFieldId);
00081
00082 const OSG::BitVector TileCameraDecoratorBase::FullHeightFieldMask =
00083 (TypeTraits<BitVector>::One << TileCameraDecoratorBase::FullHeightFieldId);
00084
00085 const OSG::BitVector TileCameraDecoratorBase::MTInfluenceMask =
00086 (Inherited::MTInfluenceMask) |
00087 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00088
00089
00090
00091
00111
00112
00113 FieldDescription *TileCameraDecoratorBase::_desc[] =
00114 {
00115 new FieldDescription(SFReal32::getClassType(),
00116 "left",
00117 LeftFieldId, LeftFieldMask,
00118 false,
00119 (FieldAccessMethod) &TileCameraDecoratorBase::getSFLeft),
00120 new FieldDescription(SFReal32::getClassType(),
00121 "right",
00122 RightFieldId, RightFieldMask,
00123 false,
00124 (FieldAccessMethod) &TileCameraDecoratorBase::getSFRight),
00125 new FieldDescription(SFReal32::getClassType(),
00126 "bottom",
00127 BottomFieldId, BottomFieldMask,
00128 false,
00129 (FieldAccessMethod) &TileCameraDecoratorBase::getSFBottom),
00130 new FieldDescription(SFReal32::getClassType(),
00131 "top",
00132 TopFieldId, TopFieldMask,
00133 true,
00134 (FieldAccessMethod) &TileCameraDecoratorBase::getSFTop),
00135 new FieldDescription(SFUInt32::getClassType(),
00136 "fullWidth",
00137 FullWidthFieldId, FullWidthFieldMask,
00138 false,
00139 (FieldAccessMethod) &TileCameraDecoratorBase::getSFFullWidth),
00140 new FieldDescription(SFUInt32::getClassType(),
00141 "fullHeight",
00142 FullHeightFieldId, FullHeightFieldMask,
00143 true,
00144 (FieldAccessMethod) &TileCameraDecoratorBase::getSFFullHeight)
00145 };
00146
00147
00148 FieldContainerType TileCameraDecoratorBase::_type(
00149 "TileCameraDecorator",
00150 "CameraDecorator",
00151 NULL,
00152 (PrototypeCreateF) &TileCameraDecoratorBase::createEmpty,
00153 TileCameraDecorator::initMethod,
00154 _desc,
00155 sizeof(_desc));
00156
00157
00158
00159
00160
00161 FieldContainerType &TileCameraDecoratorBase::getType(void)
00162 {
00163 return _type;
00164 }
00165
00166 const FieldContainerType &TileCameraDecoratorBase::getType(void) const
00167 {
00168 return _type;
00169 }
00170
00171
00172 FieldContainerPtr TileCameraDecoratorBase::shallowCopy(void) const
00173 {
00174 TileCameraDecoratorPtr returnValue;
00175
00176 newPtr(returnValue, dynamic_cast<const TileCameraDecorator *>(this));
00177
00178 return returnValue;
00179 }
00180
00181 UInt32 TileCameraDecoratorBase::getContainerSize(void) const
00182 {
00183 return sizeof(TileCameraDecorator);
00184 }
00185
00186
00187 #if !defined(OSG_FIXED_MFIELDSYNC)
00188 void TileCameraDecoratorBase::executeSync( FieldContainer &other,
00189 const BitVector &whichField)
00190 {
00191 this->executeSyncImpl((TileCameraDecoratorBase *) &other, whichField);
00192 }
00193 #else
00194 void TileCameraDecoratorBase::executeSync( FieldContainer &other,
00195 const BitVector &whichField, const SyncInfo &sInfo )
00196 {
00197 this->executeSyncImpl((TileCameraDecoratorBase *) &other, whichField, sInfo);
00198 }
00199 void TileCameraDecoratorBase::execBeginEdit(const BitVector &whichField,
00200 UInt32 uiAspect,
00201 UInt32 uiContainerSize)
00202 {
00203 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00204 }
00205
00206 void TileCameraDecoratorBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00207 {
00208 Inherited::onDestroyAspect(uiId, uiAspect);
00209
00210 }
00211 #endif
00212
00213
00214
00215 #ifdef OSG_WIN32_ICL
00216 #pragma warning (disable : 383)
00217 #endif
00218
00219 TileCameraDecoratorBase::TileCameraDecoratorBase(void) :
00220 _sfLeft (Real32(0)),
00221 _sfRight (Real32(1)),
00222 _sfBottom (Real32(0)),
00223 _sfTop (Real32(1)),
00224 _sfFullWidth (UInt32(0)),
00225 _sfFullHeight (UInt32(0)),
00226 Inherited()
00227 {
00228 }
00229
00230 #ifdef OSG_WIN32_ICL
00231 #pragma warning (default : 383)
00232 #endif
00233
00234 TileCameraDecoratorBase::TileCameraDecoratorBase(const TileCameraDecoratorBase &source) :
00235 _sfLeft (source._sfLeft ),
00236 _sfRight (source._sfRight ),
00237 _sfBottom (source._sfBottom ),
00238 _sfTop (source._sfTop ),
00239 _sfFullWidth (source._sfFullWidth ),
00240 _sfFullHeight (source._sfFullHeight ),
00241 Inherited (source)
00242 {
00243 }
00244
00245
00246
00247 TileCameraDecoratorBase::~TileCameraDecoratorBase(void)
00248 {
00249 }
00250
00251
00252
00253 UInt32 TileCameraDecoratorBase::getBinSize(const BitVector &whichField)
00254 {
00255 UInt32 returnValue = Inherited::getBinSize(whichField);
00256
00257 if(FieldBits::NoField != (LeftFieldMask & whichField))
00258 {
00259 returnValue += _sfLeft.getBinSize();
00260 }
00261
00262 if(FieldBits::NoField != (RightFieldMask & whichField))
00263 {
00264 returnValue += _sfRight.getBinSize();
00265 }
00266
00267 if(FieldBits::NoField != (BottomFieldMask & whichField))
00268 {
00269 returnValue += _sfBottom.getBinSize();
00270 }
00271
00272 if(FieldBits::NoField != (TopFieldMask & whichField))
00273 {
00274 returnValue += _sfTop.getBinSize();
00275 }
00276
00277 if(FieldBits::NoField != (FullWidthFieldMask & whichField))
00278 {
00279 returnValue += _sfFullWidth.getBinSize();
00280 }
00281
00282 if(FieldBits::NoField != (FullHeightFieldMask & whichField))
00283 {
00284 returnValue += _sfFullHeight.getBinSize();
00285 }
00286
00287
00288 return returnValue;
00289 }
00290
00291 void TileCameraDecoratorBase::copyToBin( BinaryDataHandler &pMem,
00292 const BitVector &whichField)
00293 {
00294 Inherited::copyToBin(pMem, whichField);
00295
00296 if(FieldBits::NoField != (LeftFieldMask & whichField))
00297 {
00298 _sfLeft.copyToBin(pMem);
00299 }
00300
00301 if(FieldBits::NoField != (RightFieldMask & whichField))
00302 {
00303 _sfRight.copyToBin(pMem);
00304 }
00305
00306 if(FieldBits::NoField != (BottomFieldMask & whichField))
00307 {
00308 _sfBottom.copyToBin(pMem);
00309 }
00310
00311 if(FieldBits::NoField != (TopFieldMask & whichField))
00312 {
00313 _sfTop.copyToBin(pMem);
00314 }
00315
00316 if(FieldBits::NoField != (FullWidthFieldMask & whichField))
00317 {
00318 _sfFullWidth.copyToBin(pMem);
00319 }
00320
00321 if(FieldBits::NoField != (FullHeightFieldMask & whichField))
00322 {
00323 _sfFullHeight.copyToBin(pMem);
00324 }
00325
00326
00327 }
00328
00329 void TileCameraDecoratorBase::copyFromBin( BinaryDataHandler &pMem,
00330 const BitVector &whichField)
00331 {
00332 Inherited::copyFromBin(pMem, whichField);
00333
00334 if(FieldBits::NoField != (LeftFieldMask & whichField))
00335 {
00336 _sfLeft.copyFromBin(pMem);
00337 }
00338
00339 if(FieldBits::NoField != (RightFieldMask & whichField))
00340 {
00341 _sfRight.copyFromBin(pMem);
00342 }
00343
00344 if(FieldBits::NoField != (BottomFieldMask & whichField))
00345 {
00346 _sfBottom.copyFromBin(pMem);
00347 }
00348
00349 if(FieldBits::NoField != (TopFieldMask & whichField))
00350 {
00351 _sfTop.copyFromBin(pMem);
00352 }
00353
00354 if(FieldBits::NoField != (FullWidthFieldMask & whichField))
00355 {
00356 _sfFullWidth.copyFromBin(pMem);
00357 }
00358
00359 if(FieldBits::NoField != (FullHeightFieldMask & whichField))
00360 {
00361 _sfFullHeight.copyFromBin(pMem);
00362 }
00363
00364
00365 }
00366
00367 #if !defined(OSG_FIXED_MFIELDSYNC)
00368 void TileCameraDecoratorBase::executeSyncImpl( TileCameraDecoratorBase *pOther,
00369 const BitVector &whichField)
00370 {
00371
00372 Inherited::executeSyncImpl(pOther, whichField);
00373
00374 if(FieldBits::NoField != (LeftFieldMask & whichField))
00375 _sfLeft.syncWith(pOther->_sfLeft);
00376
00377 if(FieldBits::NoField != (RightFieldMask & whichField))
00378 _sfRight.syncWith(pOther->_sfRight);
00379
00380 if(FieldBits::NoField != (BottomFieldMask & whichField))
00381 _sfBottom.syncWith(pOther->_sfBottom);
00382
00383 if(FieldBits::NoField != (TopFieldMask & whichField))
00384 _sfTop.syncWith(pOther->_sfTop);
00385
00386 if(FieldBits::NoField != (FullWidthFieldMask & whichField))
00387 _sfFullWidth.syncWith(pOther->_sfFullWidth);
00388
00389 if(FieldBits::NoField != (FullHeightFieldMask & whichField))
00390 _sfFullHeight.syncWith(pOther->_sfFullHeight);
00391
00392
00393 }
00394 #else
00395 void TileCameraDecoratorBase::executeSyncImpl( TileCameraDecoratorBase *pOther,
00396 const BitVector &whichField,
00397 const SyncInfo &sInfo )
00398 {
00399
00400 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00401
00402 if(FieldBits::NoField != (LeftFieldMask & whichField))
00403 _sfLeft.syncWith(pOther->_sfLeft);
00404
00405 if(FieldBits::NoField != (RightFieldMask & whichField))
00406 _sfRight.syncWith(pOther->_sfRight);
00407
00408 if(FieldBits::NoField != (BottomFieldMask & whichField))
00409 _sfBottom.syncWith(pOther->_sfBottom);
00410
00411 if(FieldBits::NoField != (TopFieldMask & whichField))
00412 _sfTop.syncWith(pOther->_sfTop);
00413
00414 if(FieldBits::NoField != (FullWidthFieldMask & whichField))
00415 _sfFullWidth.syncWith(pOther->_sfFullWidth);
00416
00417 if(FieldBits::NoField != (FullHeightFieldMask & whichField))
00418 _sfFullHeight.syncWith(pOther->_sfFullHeight);
00419
00420
00421
00422 }
00423
00424 void TileCameraDecoratorBase::execBeginEditImpl (const BitVector &whichField,
00425 UInt32 uiAspect,
00426 UInt32 uiContainerSize)
00427 {
00428 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00429
00430 }
00431 #endif
00432
00433
00434
00435 #include <OSGSFieldTypeDef.inl>
00436 #include <OSGMFieldTypeDef.inl>
00437
00438 OSG_BEGIN_NAMESPACE
00439
00440 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00441 DataType FieldDataTraits<TileCameraDecoratorPtr>::_type("TileCameraDecoratorPtr", "CameraDecoratorPtr");
00442 #endif
00443
00444 OSG_DLLEXPORT_SFIELD_DEF1(TileCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00445 OSG_DLLEXPORT_MFIELD_DEF1(TileCameraDecoratorPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00446
00447 OSG_END_NAMESPACE
00448
00449
00450
00451
00452
00453 #ifdef OSG_SGI_CC
00454 #pragma set woff 1174
00455 #endif
00456
00457 #ifdef OSG_LINUX_ICC
00458 #pragma warning( disable : 177 )
00459 #endif
00460
00461 namespace
00462 {
00463 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00464 static Char8 cvsid_hpp [] = OSGTILECAMERADECORATORBASE_HEADER_CVSID;
00465 static Char8 cvsid_inl [] = OSGTILECAMERADECORATORBASE_INLINE_CVSID;
00466
00467 static Char8 cvsid_fields_hpp[] = OSGTILECAMERADECORATORFIELDS_HEADER_CVSID;
00468 }
00469