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_COMPILESOLIDBACKGROUNDINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGSolidBackgroundBase.h"
00062 #include "OSGSolidBackground.h"
00063
00064
00065 OSG_BEGIN_NAMESPACE
00066
00067 const OSG::BitVector SolidBackgroundBase::ColorFieldMask =
00068 (TypeTraits<BitVector>::One << SolidBackgroundBase::ColorFieldId);
00069
00070 const OSG::BitVector SolidBackgroundBase::ClearStencilBitFieldMask =
00071 (TypeTraits<BitVector>::One << SolidBackgroundBase::ClearStencilBitFieldId);
00072
00073 const OSG::BitVector SolidBackgroundBase::AlphaFieldMask =
00074 (TypeTraits<BitVector>::One << SolidBackgroundBase::AlphaFieldId);
00075
00076 const OSG::BitVector SolidBackgroundBase::DepthFieldMask =
00077 (TypeTraits<BitVector>::One << SolidBackgroundBase::DepthFieldId);
00078
00079 const OSG::BitVector SolidBackgroundBase::MTInfluenceMask =
00080 (Inherited::MTInfluenceMask) |
00081 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00082
00083
00084
00085
00099
00100
00101 FieldDescription *SolidBackgroundBase::_desc[] =
00102 {
00103 new FieldDescription(SFColor3f::getClassType(),
00104 "color",
00105 ColorFieldId, ColorFieldMask,
00106 false,
00107 (FieldAccessMethod) &SolidBackgroundBase::getSFColor),
00108 new FieldDescription(SFInt32::getClassType(),
00109 "clearStencilBit",
00110 ClearStencilBitFieldId, ClearStencilBitFieldMask,
00111 false,
00112 (FieldAccessMethod) &SolidBackgroundBase::getSFClearStencilBit),
00113 new FieldDescription(SFReal32::getClassType(),
00114 "alpha",
00115 AlphaFieldId, AlphaFieldMask,
00116 false,
00117 (FieldAccessMethod) &SolidBackgroundBase::getSFAlpha),
00118 new FieldDescription(SFReal32::getClassType(),
00119 "depth",
00120 DepthFieldId, DepthFieldMask,
00121 false,
00122 (FieldAccessMethod) &SolidBackgroundBase::getSFDepth)
00123 };
00124
00125
00126 FieldContainerType SolidBackgroundBase::_type(
00127 "SolidBackground",
00128 "Background",
00129 NULL,
00130 (PrototypeCreateF) &SolidBackgroundBase::createEmpty,
00131 SolidBackground::initMethod,
00132 _desc,
00133 sizeof(_desc));
00134
00135
00136
00137
00138
00139 FieldContainerType &SolidBackgroundBase::getType(void)
00140 {
00141 return _type;
00142 }
00143
00144 const FieldContainerType &SolidBackgroundBase::getType(void) const
00145 {
00146 return _type;
00147 }
00148
00149
00150 FieldContainerPtr SolidBackgroundBase::shallowCopy(void) const
00151 {
00152 SolidBackgroundPtr returnValue;
00153
00154 newPtr(returnValue, dynamic_cast<const SolidBackground *>(this));
00155
00156 return returnValue;
00157 }
00158
00159 UInt32 SolidBackgroundBase::getContainerSize(void) const
00160 {
00161 return sizeof(SolidBackground);
00162 }
00163
00164
00165 #if !defined(OSG_FIXED_MFIELDSYNC)
00166 void SolidBackgroundBase::executeSync( FieldContainer &other,
00167 const BitVector &whichField)
00168 {
00169 this->executeSyncImpl((SolidBackgroundBase *) &other, whichField);
00170 }
00171 #else
00172 void SolidBackgroundBase::executeSync( FieldContainer &other,
00173 const BitVector &whichField, const SyncInfo &sInfo )
00174 {
00175 this->executeSyncImpl((SolidBackgroundBase *) &other, whichField, sInfo);
00176 }
00177 void SolidBackgroundBase::execBeginEdit(const BitVector &whichField,
00178 UInt32 uiAspect,
00179 UInt32 uiContainerSize)
00180 {
00181 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00182 }
00183
00184 void SolidBackgroundBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00185 {
00186 Inherited::onDestroyAspect(uiId, uiAspect);
00187
00188 }
00189 #endif
00190
00191
00192
00193 #ifdef OSG_WIN32_ICL
00194 #pragma warning (disable : 383)
00195 #endif
00196
00197 SolidBackgroundBase::SolidBackgroundBase(void) :
00198 _sfColor (Color3f(0,0,0)),
00199 _sfClearStencilBit (Int32(-1)),
00200 _sfAlpha (Real32(1.f)),
00201 _sfDepth (Real32(1.f)),
00202 Inherited()
00203 {
00204 }
00205
00206 #ifdef OSG_WIN32_ICL
00207 #pragma warning (default : 383)
00208 #endif
00209
00210 SolidBackgroundBase::SolidBackgroundBase(const SolidBackgroundBase &source) :
00211 _sfColor (source._sfColor ),
00212 _sfClearStencilBit (source._sfClearStencilBit ),
00213 _sfAlpha (source._sfAlpha ),
00214 _sfDepth (source._sfDepth ),
00215 Inherited (source)
00216 {
00217 }
00218
00219
00220
00221 SolidBackgroundBase::~SolidBackgroundBase(void)
00222 {
00223 }
00224
00225
00226
00227 UInt32 SolidBackgroundBase::getBinSize(const BitVector &whichField)
00228 {
00229 UInt32 returnValue = Inherited::getBinSize(whichField);
00230
00231 if(FieldBits::NoField != (ColorFieldMask & whichField))
00232 {
00233 returnValue += _sfColor.getBinSize();
00234 }
00235
00236 if(FieldBits::NoField != (ClearStencilBitFieldMask & whichField))
00237 {
00238 returnValue += _sfClearStencilBit.getBinSize();
00239 }
00240
00241 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00242 {
00243 returnValue += _sfAlpha.getBinSize();
00244 }
00245
00246 if(FieldBits::NoField != (DepthFieldMask & whichField))
00247 {
00248 returnValue += _sfDepth.getBinSize();
00249 }
00250
00251
00252 return returnValue;
00253 }
00254
00255 void SolidBackgroundBase::copyToBin( BinaryDataHandler &pMem,
00256 const BitVector &whichField)
00257 {
00258 Inherited::copyToBin(pMem, whichField);
00259
00260 if(FieldBits::NoField != (ColorFieldMask & whichField))
00261 {
00262 _sfColor.copyToBin(pMem);
00263 }
00264
00265 if(FieldBits::NoField != (ClearStencilBitFieldMask & whichField))
00266 {
00267 _sfClearStencilBit.copyToBin(pMem);
00268 }
00269
00270 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00271 {
00272 _sfAlpha.copyToBin(pMem);
00273 }
00274
00275 if(FieldBits::NoField != (DepthFieldMask & whichField))
00276 {
00277 _sfDepth.copyToBin(pMem);
00278 }
00279
00280
00281 }
00282
00283 void SolidBackgroundBase::copyFromBin( BinaryDataHandler &pMem,
00284 const BitVector &whichField)
00285 {
00286 Inherited::copyFromBin(pMem, whichField);
00287
00288 if(FieldBits::NoField != (ColorFieldMask & whichField))
00289 {
00290 _sfColor.copyFromBin(pMem);
00291 }
00292
00293 if(FieldBits::NoField != (ClearStencilBitFieldMask & whichField))
00294 {
00295 _sfClearStencilBit.copyFromBin(pMem);
00296 }
00297
00298 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00299 {
00300 _sfAlpha.copyFromBin(pMem);
00301 }
00302
00303 if(FieldBits::NoField != (DepthFieldMask & whichField))
00304 {
00305 _sfDepth.copyFromBin(pMem);
00306 }
00307
00308
00309 }
00310
00311 #if !defined(OSG_FIXED_MFIELDSYNC)
00312 void SolidBackgroundBase::executeSyncImpl( SolidBackgroundBase *pOther,
00313 const BitVector &whichField)
00314 {
00315
00316 Inherited::executeSyncImpl(pOther, whichField);
00317
00318 if(FieldBits::NoField != (ColorFieldMask & whichField))
00319 _sfColor.syncWith(pOther->_sfColor);
00320
00321 if(FieldBits::NoField != (ClearStencilBitFieldMask & whichField))
00322 _sfClearStencilBit.syncWith(pOther->_sfClearStencilBit);
00323
00324 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00325 _sfAlpha.syncWith(pOther->_sfAlpha);
00326
00327 if(FieldBits::NoField != (DepthFieldMask & whichField))
00328 _sfDepth.syncWith(pOther->_sfDepth);
00329
00330
00331 }
00332 #else
00333 void SolidBackgroundBase::executeSyncImpl( SolidBackgroundBase *pOther,
00334 const BitVector &whichField,
00335 const SyncInfo &sInfo )
00336 {
00337
00338 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00339
00340 if(FieldBits::NoField != (ColorFieldMask & whichField))
00341 _sfColor.syncWith(pOther->_sfColor);
00342
00343 if(FieldBits::NoField != (ClearStencilBitFieldMask & whichField))
00344 _sfClearStencilBit.syncWith(pOther->_sfClearStencilBit);
00345
00346 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00347 _sfAlpha.syncWith(pOther->_sfAlpha);
00348
00349 if(FieldBits::NoField != (DepthFieldMask & whichField))
00350 _sfDepth.syncWith(pOther->_sfDepth);
00351
00352
00353
00354 }
00355
00356 void SolidBackgroundBase::execBeginEditImpl (const BitVector &whichField,
00357 UInt32 uiAspect,
00358 UInt32 uiContainerSize)
00359 {
00360 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00361
00362 }
00363 #endif
00364
00365
00366
00367 OSG_END_NAMESPACE
00368
00369 #include <OSGSFieldTypeDef.inl>
00370
00371 OSG_BEGIN_NAMESPACE
00372
00373 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00374 DataType FieldDataTraits<SolidBackgroundPtr>::_type("SolidBackgroundPtr", "BackgroundPtr");
00375 #endif
00376
00377 OSG_DLLEXPORT_SFIELD_DEF1(SolidBackgroundPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00378
00379
00380
00381
00382
00383 #ifdef OSG_SGI_CC
00384 #pragma set woff 1174
00385 #endif
00386
00387 #ifdef OSG_LINUX_ICC
00388 #pragma warning( disable : 177 )
00389 #endif
00390
00391 namespace
00392 {
00393 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.47 2006/03/17 17:03:19 pdaehne Exp $";
00394 static Char8 cvsid_hpp [] = OSGSOLIDBACKGROUNDBASE_HEADER_CVSID;
00395 static Char8 cvsid_inl [] = OSGSOLIDBACKGROUNDBASE_INLINE_CVSID;
00396
00397 static Char8 cvsid_fields_hpp[] = OSGSOLIDBACKGROUNDFIELDS_HEADER_CVSID;
00398 }
00399
00400 OSG_END_NAMESPACE
00401