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