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_BEGIN_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 reinterpret_cast<FieldAccessMethod>(&ColorBufferViewportBase::editSFRed)),
00112 new FieldDescription(SFBool::getClassType(),
00113 "blue",
00114 BlueFieldId, BlueFieldMask,
00115 false,
00116 reinterpret_cast<FieldAccessMethod>(&ColorBufferViewportBase::editSFBlue)),
00117 new FieldDescription(SFBool::getClassType(),
00118 "green",
00119 GreenFieldId, GreenFieldMask,
00120 false,
00121 reinterpret_cast<FieldAccessMethod>(&ColorBufferViewportBase::editSFGreen)),
00122 new FieldDescription(SFBool::getClassType(),
00123 "alpha",
00124 AlphaFieldId, AlphaFieldMask,
00125 false,
00126 reinterpret_cast<FieldAccessMethod>(&ColorBufferViewportBase::editSFAlpha))
00127 };
00128
00129
00130 FieldContainerType ColorBufferViewportBase::_type(
00131 "ColorBufferViewport",
00132 "Viewport",
00133 NULL,
00134 reinterpret_cast<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(static_cast<ColorBufferViewportBase *>(&other),
00174 whichField);
00175 }
00176 #else
00177 void ColorBufferViewportBase::executeSync( FieldContainer &other,
00178 const BitVector &whichField, const SyncInfo &sInfo )
00179 {
00180 this->executeSyncImpl((ColorBufferViewportBase *) &other, whichField, sInfo);
00181 }
00182 void ColorBufferViewportBase::execBeginEdit(const BitVector &whichField,
00183 UInt32 uiAspect,
00184 UInt32 uiContainerSize)
00185 {
00186 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00187 }
00188
00189 void ColorBufferViewportBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00190 {
00191 Inherited::onDestroyAspect(uiId, uiAspect);
00192
00193 }
00194 #endif
00195
00196
00197
00198 #ifdef OSG_WIN32_ICL
00199 #pragma warning (disable : 383)
00200 #endif
00201
00202 ColorBufferViewportBase::ColorBufferViewportBase(void) :
00203 _sfRed (bool(GL_TRUE)),
00204 _sfBlue (bool(GL_TRUE)),
00205 _sfGreen (bool(GL_TRUE)),
00206 _sfAlpha (bool(GL_TRUE)),
00207 Inherited()
00208 {
00209 }
00210
00211 #ifdef OSG_WIN32_ICL
00212 #pragma warning (default : 383)
00213 #endif
00214
00215 ColorBufferViewportBase::ColorBufferViewportBase(const ColorBufferViewportBase &source) :
00216 _sfRed (source._sfRed ),
00217 _sfBlue (source._sfBlue ),
00218 _sfGreen (source._sfGreen ),
00219 _sfAlpha (source._sfAlpha ),
00220 Inherited (source)
00221 {
00222 }
00223
00224
00225
00226 ColorBufferViewportBase::~ColorBufferViewportBase(void)
00227 {
00228 }
00229
00230
00231
00232 UInt32 ColorBufferViewportBase::getBinSize(const BitVector &whichField)
00233 {
00234 UInt32 returnValue = Inherited::getBinSize(whichField);
00235
00236 if(FieldBits::NoField != (RedFieldMask & whichField))
00237 {
00238 returnValue += _sfRed.getBinSize();
00239 }
00240
00241 if(FieldBits::NoField != (BlueFieldMask & whichField))
00242 {
00243 returnValue += _sfBlue.getBinSize();
00244 }
00245
00246 if(FieldBits::NoField != (GreenFieldMask & whichField))
00247 {
00248 returnValue += _sfGreen.getBinSize();
00249 }
00250
00251 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00252 {
00253 returnValue += _sfAlpha.getBinSize();
00254 }
00255
00256
00257 return returnValue;
00258 }
00259
00260 void ColorBufferViewportBase::copyToBin( BinaryDataHandler &pMem,
00261 const BitVector &whichField)
00262 {
00263 Inherited::copyToBin(pMem, whichField);
00264
00265 if(FieldBits::NoField != (RedFieldMask & whichField))
00266 {
00267 _sfRed.copyToBin(pMem);
00268 }
00269
00270 if(FieldBits::NoField != (BlueFieldMask & whichField))
00271 {
00272 _sfBlue.copyToBin(pMem);
00273 }
00274
00275 if(FieldBits::NoField != (GreenFieldMask & whichField))
00276 {
00277 _sfGreen.copyToBin(pMem);
00278 }
00279
00280 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00281 {
00282 _sfAlpha.copyToBin(pMem);
00283 }
00284
00285
00286 }
00287
00288 void ColorBufferViewportBase::copyFromBin( BinaryDataHandler &pMem,
00289 const BitVector &whichField)
00290 {
00291 Inherited::copyFromBin(pMem, whichField);
00292
00293 if(FieldBits::NoField != (RedFieldMask & whichField))
00294 {
00295 _sfRed.copyFromBin(pMem);
00296 }
00297
00298 if(FieldBits::NoField != (BlueFieldMask & whichField))
00299 {
00300 _sfBlue.copyFromBin(pMem);
00301 }
00302
00303 if(FieldBits::NoField != (GreenFieldMask & whichField))
00304 {
00305 _sfGreen.copyFromBin(pMem);
00306 }
00307
00308 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00309 {
00310 _sfAlpha.copyFromBin(pMem);
00311 }
00312
00313
00314 }
00315
00316 #if !defined(OSG_FIXED_MFIELDSYNC)
00317 void ColorBufferViewportBase::executeSyncImpl( ColorBufferViewportBase *pOther,
00318 const BitVector &whichField)
00319 {
00320
00321 Inherited::executeSyncImpl(pOther, whichField);
00322
00323 if(FieldBits::NoField != (RedFieldMask & whichField))
00324 _sfRed.syncWith(pOther->_sfRed);
00325
00326 if(FieldBits::NoField != (BlueFieldMask & whichField))
00327 _sfBlue.syncWith(pOther->_sfBlue);
00328
00329 if(FieldBits::NoField != (GreenFieldMask & whichField))
00330 _sfGreen.syncWith(pOther->_sfGreen);
00331
00332 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00333 _sfAlpha.syncWith(pOther->_sfAlpha);
00334
00335
00336 }
00337 #else
00338 void ColorBufferViewportBase::executeSyncImpl( ColorBufferViewportBase *pOther,
00339 const BitVector &whichField,
00340 const SyncInfo &sInfo )
00341 {
00342
00343 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00344
00345 if(FieldBits::NoField != (RedFieldMask & whichField))
00346 _sfRed.syncWith(pOther->_sfRed);
00347
00348 if(FieldBits::NoField != (BlueFieldMask & whichField))
00349 _sfBlue.syncWith(pOther->_sfBlue);
00350
00351 if(FieldBits::NoField != (GreenFieldMask & whichField))
00352 _sfGreen.syncWith(pOther->_sfGreen);
00353
00354 if(FieldBits::NoField != (AlphaFieldMask & whichField))
00355 _sfAlpha.syncWith(pOther->_sfAlpha);
00356
00357
00358
00359 }
00360
00361 void ColorBufferViewportBase::execBeginEditImpl (const BitVector &whichField,
00362 UInt32 uiAspect,
00363 UInt32 uiContainerSize)
00364 {
00365 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00366
00367 }
00368 #endif
00369
00370
00371
00372 OSG_END_NAMESPACE
00373
00374 #include <OSGSFieldTypeDef.inl>
00375 #include <OSGMFieldTypeDef.inl>
00376
00377 OSG_BEGIN_NAMESPACE
00378
00379 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00380 DataType FieldDataTraits<ColorBufferViewportPtr>::_type("ColorBufferViewportPtr", "ViewportPtr");
00381 #endif
00382
00383 OSG_DLLEXPORT_SFIELD_DEF1(ColorBufferViewportPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00384 OSG_DLLEXPORT_MFIELD_DEF1(ColorBufferViewportPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00385
00386
00387
00388
00389
00390 #ifdef OSG_SGI_CC
00391 #pragma set woff 1174
00392 #endif
00393
00394 #ifdef OSG_LINUX_ICC
00395 #pragma warning( disable : 177 )
00396 #endif
00397
00398 namespace
00399 {
00400 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.49 2008/06/09 07:30:44 vossg Exp $";
00401 static Char8 cvsid_hpp [] = OSGCOLORBUFFERVIEWPORTBASE_HEADER_CVSID;
00402 static Char8 cvsid_inl [] = OSGCOLORBUFFERVIEWPORTBASE_INLINE_CVSID;
00403
00404 static Char8 cvsid_fields_hpp[] = OSGCOLORBUFFERVIEWPORTFIELDS_HEADER_CVSID;
00405 }
00406
00407 OSG_END_NAMESPACE
00408