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