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_COMPILEIMAGEFOREGROUNDINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGImageForegroundBase.h"
00062 #include "OSGImageForeground.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector ImageForegroundBase::ImagesFieldMask =
00068 (TypeTraits<BitVector>::One << ImageForegroundBase::ImagesFieldId);
00069
00070 const OSG::BitVector ImageForegroundBase::PositionsFieldMask =
00071 (TypeTraits<BitVector>::One << ImageForegroundBase::PositionsFieldId);
00072
00073 const OSG::BitVector ImageForegroundBase::MTInfluenceMask =
00074 (Inherited::MTInfluenceMask) |
00075 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00076
00077
00078
00079
00087
00088
00089 FieldDescription *ImageForegroundBase::_desc[] =
00090 {
00091 new FieldDescription(MFImagePtr::getClassType(),
00092 "images",
00093 ImagesFieldId, ImagesFieldMask,
00094 false,
00095 (FieldAccessMethod) &ImageForegroundBase::getMFImages),
00096 new FieldDescription(MFPnt2f::getClassType(),
00097 "positions",
00098 PositionsFieldId, PositionsFieldMask,
00099 false,
00100 (FieldAccessMethod) &ImageForegroundBase::getMFPositions)
00101 };
00102
00103
00104 FieldContainerType ImageForegroundBase::_type(
00105 "ImageForeground",
00106 "Foreground",
00107 NULL,
00108 (PrototypeCreateF) &ImageForegroundBase::createEmpty,
00109 ImageForeground::initMethod,
00110 _desc,
00111 sizeof(_desc));
00112
00113
00114
00115
00116
00117 FieldContainerType &ImageForegroundBase::getType(void)
00118 {
00119 return _type;
00120 }
00121
00122 const FieldContainerType &ImageForegroundBase::getType(void) const
00123 {
00124 return _type;
00125 }
00126
00127
00128 FieldContainerPtr ImageForegroundBase::shallowCopy(void) const
00129 {
00130 ImageForegroundPtr returnValue;
00131
00132 newPtr(returnValue, dynamic_cast<const ImageForeground *>(this));
00133
00134 return returnValue;
00135 }
00136
00137 UInt32 ImageForegroundBase::getContainerSize(void) const
00138 {
00139 return sizeof(ImageForeground);
00140 }
00141
00142
00143 #if !defined(OSG_FIXED_MFIELDSYNC)
00144 void ImageForegroundBase::executeSync( FieldContainer &other,
00145 const BitVector &whichField)
00146 {
00147 this->executeSyncImpl((ImageForegroundBase *) &other, whichField);
00148 }
00149 #else
00150 void ImageForegroundBase::executeSync( FieldContainer &other,
00151 const BitVector &whichField, const SyncInfo &sInfo )
00152 {
00153 this->executeSyncImpl((ImageForegroundBase *) &other, whichField, sInfo);
00154 }
00155 void ImageForegroundBase::execBeginEdit(const BitVector &whichField,
00156 UInt32 uiAspect,
00157 UInt32 uiContainerSize)
00158 {
00159 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00160 }
00161
00162 void ImageForegroundBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00163 {
00164 Inherited::onDestroyAspect(uiId, uiAspect);
00165
00166 _mfImages.terminateShare(uiAspect, this->getContainerSize());
00167 _mfPositions.terminateShare(uiAspect, this->getContainerSize());
00168 }
00169 #endif
00170
00171
00172
00173 #ifdef OSG_WIN32_ICL
00174 #pragma warning (disable : 383)
00175 #endif
00176
00177 ImageForegroundBase::ImageForegroundBase(void) :
00178 _mfImages (),
00179 _mfPositions (),
00180 Inherited()
00181 {
00182 }
00183
00184 #ifdef OSG_WIN32_ICL
00185 #pragma warning (default : 383)
00186 #endif
00187
00188 ImageForegroundBase::ImageForegroundBase(const ImageForegroundBase &source) :
00189 _mfImages (source._mfImages ),
00190 _mfPositions (source._mfPositions ),
00191 Inherited (source)
00192 {
00193 }
00194
00195
00196
00197 ImageForegroundBase::~ImageForegroundBase(void)
00198 {
00199 }
00200
00201
00202
00203 UInt32 ImageForegroundBase::getBinSize(const BitVector &whichField)
00204 {
00205 UInt32 returnValue = Inherited::getBinSize(whichField);
00206
00207 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00208 {
00209 returnValue += _mfImages.getBinSize();
00210 }
00211
00212 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00213 {
00214 returnValue += _mfPositions.getBinSize();
00215 }
00216
00217
00218 return returnValue;
00219 }
00220
00221 void ImageForegroundBase::copyToBin( BinaryDataHandler &pMem,
00222 const BitVector &whichField)
00223 {
00224 Inherited::copyToBin(pMem, whichField);
00225
00226 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00227 {
00228 _mfImages.copyToBin(pMem);
00229 }
00230
00231 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00232 {
00233 _mfPositions.copyToBin(pMem);
00234 }
00235
00236
00237 }
00238
00239 void ImageForegroundBase::copyFromBin( BinaryDataHandler &pMem,
00240 const BitVector &whichField)
00241 {
00242 Inherited::copyFromBin(pMem, whichField);
00243
00244 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00245 {
00246 _mfImages.copyFromBin(pMem);
00247 }
00248
00249 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00250 {
00251 _mfPositions.copyFromBin(pMem);
00252 }
00253
00254
00255 }
00256
00257 #if !defined(OSG_FIXED_MFIELDSYNC)
00258 void ImageForegroundBase::executeSyncImpl( ImageForegroundBase *pOther,
00259 const BitVector &whichField)
00260 {
00261
00262 Inherited::executeSyncImpl(pOther, whichField);
00263
00264 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00265 _mfImages.syncWith(pOther->_mfImages);
00266
00267 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00268 _mfPositions.syncWith(pOther->_mfPositions);
00269
00270
00271 }
00272 #else
00273 void ImageForegroundBase::executeSyncImpl( ImageForegroundBase *pOther,
00274 const BitVector &whichField,
00275 const SyncInfo &sInfo )
00276 {
00277
00278 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00279
00280
00281 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00282 _mfImages.syncWith(pOther->_mfImages, sInfo);
00283
00284 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00285 _mfPositions.syncWith(pOther->_mfPositions, sInfo);
00286
00287
00288 }
00289
00290 void ImageForegroundBase::execBeginEditImpl (const BitVector &whichField,
00291 UInt32 uiAspect,
00292 UInt32 uiContainerSize)
00293 {
00294 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00295
00296 if(FieldBits::NoField != (ImagesFieldMask & whichField))
00297 _mfImages.beginEdit(uiAspect, uiContainerSize);
00298
00299 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00300 _mfPositions.beginEdit(uiAspect, uiContainerSize);
00301
00302 }
00303 #endif
00304
00305
00306
00307 #include <OSGSFieldTypeDef.inl>
00308 #include <OSGMFieldTypeDef.inl>
00309
00310 OSG_BEGIN_NAMESPACE
00311
00312 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00313 DataType FieldDataTraits<ImageForegroundPtr>::_type("ImageForegroundPtr", "ForegroundPtr");
00314 #endif
00315
00316 OSG_DLLEXPORT_SFIELD_DEF1(ImageForegroundPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00317 OSG_DLLEXPORT_MFIELD_DEF1(ImageForegroundPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00318
00319 OSG_END_NAMESPACE
00320
00321
00322
00323
00324
00325 #ifdef OSG_SGI_CC
00326 #pragma set woff 1174
00327 #endif
00328
00329 #ifdef OSG_LINUX_ICC
00330 #pragma warning( disable : 177 )
00331 #endif
00332
00333 namespace
00334 {
00335 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00336 static Char8 cvsid_hpp [] = OSGIMAGEFOREGROUNDBASE_HEADER_CVSID;
00337 static Char8 cvsid_inl [] = OSGIMAGEFOREGROUNDBASE_INLINE_CVSID;
00338
00339 static Char8 cvsid_fields_hpp[] = OSGIMAGEFOREGROUNDFIELDS_HEADER_CVSID;
00340 }
00341