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