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_COMPILEPOINTCHUNKINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGPointChunkBase.h"
00062 #include "OSGPointChunk.h"
00063
00064 #include <OSGGL.h>
00065 #include <OSGGL.h>
00066 #include <OSGGL.h>
00067
00068 OSG_USING_NAMESPACE
00069
00070 const OSG::BitVector PointChunkBase::SizeFieldMask =
00071 (TypeTraits<BitVector>::One << PointChunkBase::SizeFieldId);
00072
00073 const OSG::BitVector PointChunkBase::SmoothFieldMask =
00074 (TypeTraits<BitVector>::One << PointChunkBase::SmoothFieldId);
00075
00076 const OSG::BitVector PointChunkBase::MinSizeFieldMask =
00077 (TypeTraits<BitVector>::One << PointChunkBase::MinSizeFieldId);
00078
00079 const OSG::BitVector PointChunkBase::MaxSizeFieldMask =
00080 (TypeTraits<BitVector>::One << PointChunkBase::MaxSizeFieldId);
00081
00082 const OSG::BitVector PointChunkBase::ConstantAttenuationFieldMask =
00083 (TypeTraits<BitVector>::One << PointChunkBase::ConstantAttenuationFieldId);
00084
00085 const OSG::BitVector PointChunkBase::LinearAttenuationFieldMask =
00086 (TypeTraits<BitVector>::One << PointChunkBase::LinearAttenuationFieldId);
00087
00088 const OSG::BitVector PointChunkBase::QuadraticAttenuationFieldMask =
00089 (TypeTraits<BitVector>::One << PointChunkBase::QuadraticAttenuationFieldId);
00090
00091 const OSG::BitVector PointChunkBase::FadeThresholdFieldMask =
00092 (TypeTraits<BitVector>::One << PointChunkBase::FadeThresholdFieldId);
00093
00094 const OSG::BitVector PointChunkBase::SpriteFieldMask =
00095 (TypeTraits<BitVector>::One << PointChunkBase::SpriteFieldId);
00096
00097 const OSG::BitVector PointChunkBase::RModeFieldMask =
00098 (TypeTraits<BitVector>::One << PointChunkBase::RModeFieldId);
00099
00100 const OSG::BitVector PointChunkBase::MTInfluenceMask =
00101 (Inherited::MTInfluenceMask) |
00102 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00103
00104
00105
00106
00138
00139
00140 FieldDescription *PointChunkBase::_desc[] =
00141 {
00142 new FieldDescription(SFReal32::getClassType(),
00143 "size",
00144 SizeFieldId, SizeFieldMask,
00145 false,
00146 (FieldAccessMethod) &PointChunkBase::getSFSize),
00147 new FieldDescription(SFBool::getClassType(),
00148 "smooth",
00149 SmoothFieldId, SmoothFieldMask,
00150 false,
00151 (FieldAccessMethod) &PointChunkBase::getSFSmooth),
00152 new FieldDescription(SFReal32::getClassType(),
00153 "minSize",
00154 MinSizeFieldId, MinSizeFieldMask,
00155 false,
00156 (FieldAccessMethod) &PointChunkBase::getSFMinSize),
00157 new FieldDescription(SFReal32::getClassType(),
00158 "maxSize",
00159 MaxSizeFieldId, MaxSizeFieldMask,
00160 false,
00161 (FieldAccessMethod) &PointChunkBase::getSFMaxSize),
00162 new FieldDescription(SFReal32::getClassType(),
00163 "constantAttenuation",
00164 ConstantAttenuationFieldId, ConstantAttenuationFieldMask,
00165 false,
00166 (FieldAccessMethod) &PointChunkBase::getSFConstantAttenuation),
00167 new FieldDescription(SFReal32::getClassType(),
00168 "linearAttenuation",
00169 LinearAttenuationFieldId, LinearAttenuationFieldMask,
00170 false,
00171 (FieldAccessMethod) &PointChunkBase::getSFLinearAttenuation),
00172 new FieldDescription(SFReal32::getClassType(),
00173 "quadraticAttenuation",
00174 QuadraticAttenuationFieldId, QuadraticAttenuationFieldMask,
00175 false,
00176 (FieldAccessMethod) &PointChunkBase::getSFQuadraticAttenuation),
00177 new FieldDescription(SFReal32::getClassType(),
00178 "fadeThreshold",
00179 FadeThresholdFieldId, FadeThresholdFieldMask,
00180 false,
00181 (FieldAccessMethod) &PointChunkBase::getSFFadeThreshold),
00182 new FieldDescription(SFBool::getClassType(),
00183 "sprite",
00184 SpriteFieldId, SpriteFieldMask,
00185 false,
00186 (FieldAccessMethod) &PointChunkBase::getSFSprite),
00187 new FieldDescription(SFGLenum::getClassType(),
00188 "rMode",
00189 RModeFieldId, RModeFieldMask,
00190 false,
00191 (FieldAccessMethod) &PointChunkBase::getSFRMode)
00192 };
00193
00194
00195 FieldContainerType PointChunkBase::_type(
00196 "PointChunk",
00197 "StateChunk",
00198 NULL,
00199 (PrototypeCreateF) &PointChunkBase::createEmpty,
00200 PointChunk::initMethod,
00201 _desc,
00202 sizeof(_desc));
00203
00204
00205
00206
00207
00208 FieldContainerType &PointChunkBase::getType(void)
00209 {
00210 return _type;
00211 }
00212
00213 const FieldContainerType &PointChunkBase::getType(void) const
00214 {
00215 return _type;
00216 }
00217
00218
00219 FieldContainerPtr PointChunkBase::shallowCopy(void) const
00220 {
00221 PointChunkPtr returnValue;
00222
00223 newPtr(returnValue, dynamic_cast<const PointChunk *>(this));
00224
00225 return returnValue;
00226 }
00227
00228 UInt32 PointChunkBase::getContainerSize(void) const
00229 {
00230 return sizeof(PointChunk);
00231 }
00232
00233
00234 #if !defined(OSG_FIXED_MFIELDSYNC)
00235 void PointChunkBase::executeSync( FieldContainer &other,
00236 const BitVector &whichField)
00237 {
00238 this->executeSyncImpl((PointChunkBase *) &other, whichField);
00239 }
00240 #else
00241 void PointChunkBase::executeSync( FieldContainer &other,
00242 const BitVector &whichField, const SyncInfo &sInfo )
00243 {
00244 this->executeSyncImpl((PointChunkBase *) &other, whichField, sInfo);
00245 }
00246 void PointChunkBase::execBeginEdit(const BitVector &whichField,
00247 UInt32 uiAspect,
00248 UInt32 uiContainerSize)
00249 {
00250 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00251 }
00252
00253 void PointChunkBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00254 {
00255 Inherited::onDestroyAspect(uiId, uiAspect);
00256
00257 }
00258 #endif
00259
00260
00261
00262 #ifdef OSG_WIN32_ICL
00263 #pragma warning (disable : 383)
00264 #endif
00265
00266 PointChunkBase::PointChunkBase(void) :
00267 _sfSize (Real32(1)),
00268 _sfSmooth (bool(GL_FALSE)),
00269 _sfMinSize (Real32(-1.f)),
00270 _sfMaxSize (Real32(-1.f)),
00271 _sfConstantAttenuation (Real32(1)),
00272 _sfLinearAttenuation (Real32(0)),
00273 _sfQuadraticAttenuation (Real32(0)),
00274 _sfFadeThreshold (Real32(0.f)),
00275 _sfSprite (bool(GL_FALSE)),
00276 _sfRMode (GLenum(GL_ZERO)),
00277 Inherited()
00278 {
00279 }
00280
00281 #ifdef OSG_WIN32_ICL
00282 #pragma warning (default : 383)
00283 #endif
00284
00285 PointChunkBase::PointChunkBase(const PointChunkBase &source) :
00286 _sfSize (source._sfSize ),
00287 _sfSmooth (source._sfSmooth ),
00288 _sfMinSize (source._sfMinSize ),
00289 _sfMaxSize (source._sfMaxSize ),
00290 _sfConstantAttenuation (source._sfConstantAttenuation ),
00291 _sfLinearAttenuation (source._sfLinearAttenuation ),
00292 _sfQuadraticAttenuation (source._sfQuadraticAttenuation ),
00293 _sfFadeThreshold (source._sfFadeThreshold ),
00294 _sfSprite (source._sfSprite ),
00295 _sfRMode (source._sfRMode ),
00296 Inherited (source)
00297 {
00298 }
00299
00300
00301
00302 PointChunkBase::~PointChunkBase(void)
00303 {
00304 }
00305
00306
00307
00308 UInt32 PointChunkBase::getBinSize(const BitVector &whichField)
00309 {
00310 UInt32 returnValue = Inherited::getBinSize(whichField);
00311
00312 if(FieldBits::NoField != (SizeFieldMask & whichField))
00313 {
00314 returnValue += _sfSize.getBinSize();
00315 }
00316
00317 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00318 {
00319 returnValue += _sfSmooth.getBinSize();
00320 }
00321
00322 if(FieldBits::NoField != (MinSizeFieldMask & whichField))
00323 {
00324 returnValue += _sfMinSize.getBinSize();
00325 }
00326
00327 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
00328 {
00329 returnValue += _sfMaxSize.getBinSize();
00330 }
00331
00332 if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00333 {
00334 returnValue += _sfConstantAttenuation.getBinSize();
00335 }
00336
00337 if(FieldBits::NoField != (LinearAttenuationFieldMask & whichField))
00338 {
00339 returnValue += _sfLinearAttenuation.getBinSize();
00340 }
00341
00342 if(FieldBits::NoField != (QuadraticAttenuationFieldMask & whichField))
00343 {
00344 returnValue += _sfQuadraticAttenuation.getBinSize();
00345 }
00346
00347 if(FieldBits::NoField != (FadeThresholdFieldMask & whichField))
00348 {
00349 returnValue += _sfFadeThreshold.getBinSize();
00350 }
00351
00352 if(FieldBits::NoField != (SpriteFieldMask & whichField))
00353 {
00354 returnValue += _sfSprite.getBinSize();
00355 }
00356
00357 if(FieldBits::NoField != (RModeFieldMask & whichField))
00358 {
00359 returnValue += _sfRMode.getBinSize();
00360 }
00361
00362
00363 return returnValue;
00364 }
00365
00366 void PointChunkBase::copyToBin( BinaryDataHandler &pMem,
00367 const BitVector &whichField)
00368 {
00369 Inherited::copyToBin(pMem, whichField);
00370
00371 if(FieldBits::NoField != (SizeFieldMask & whichField))
00372 {
00373 _sfSize.copyToBin(pMem);
00374 }
00375
00376 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00377 {
00378 _sfSmooth.copyToBin(pMem);
00379 }
00380
00381 if(FieldBits::NoField != (MinSizeFieldMask & whichField))
00382 {
00383 _sfMinSize.copyToBin(pMem);
00384 }
00385
00386 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
00387 {
00388 _sfMaxSize.copyToBin(pMem);
00389 }
00390
00391 if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00392 {
00393 _sfConstantAttenuation.copyToBin(pMem);
00394 }
00395
00396 if(FieldBits::NoField != (LinearAttenuationFieldMask & whichField))
00397 {
00398 _sfLinearAttenuation.copyToBin(pMem);
00399 }
00400
00401 if(FieldBits::NoField != (QuadraticAttenuationFieldMask & whichField))
00402 {
00403 _sfQuadraticAttenuation.copyToBin(pMem);
00404 }
00405
00406 if(FieldBits::NoField != (FadeThresholdFieldMask & whichField))
00407 {
00408 _sfFadeThreshold.copyToBin(pMem);
00409 }
00410
00411 if(FieldBits::NoField != (SpriteFieldMask & whichField))
00412 {
00413 _sfSprite.copyToBin(pMem);
00414 }
00415
00416 if(FieldBits::NoField != (RModeFieldMask & whichField))
00417 {
00418 _sfRMode.copyToBin(pMem);
00419 }
00420
00421
00422 }
00423
00424 void PointChunkBase::copyFromBin( BinaryDataHandler &pMem,
00425 const BitVector &whichField)
00426 {
00427 Inherited::copyFromBin(pMem, whichField);
00428
00429 if(FieldBits::NoField != (SizeFieldMask & whichField))
00430 {
00431 _sfSize.copyFromBin(pMem);
00432 }
00433
00434 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00435 {
00436 _sfSmooth.copyFromBin(pMem);
00437 }
00438
00439 if(FieldBits::NoField != (MinSizeFieldMask & whichField))
00440 {
00441 _sfMinSize.copyFromBin(pMem);
00442 }
00443
00444 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
00445 {
00446 _sfMaxSize.copyFromBin(pMem);
00447 }
00448
00449 if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00450 {
00451 _sfConstantAttenuation.copyFromBin(pMem);
00452 }
00453
00454 if(FieldBits::NoField != (LinearAttenuationFieldMask & whichField))
00455 {
00456 _sfLinearAttenuation.copyFromBin(pMem);
00457 }
00458
00459 if(FieldBits::NoField != (QuadraticAttenuationFieldMask & whichField))
00460 {
00461 _sfQuadraticAttenuation.copyFromBin(pMem);
00462 }
00463
00464 if(FieldBits::NoField != (FadeThresholdFieldMask & whichField))
00465 {
00466 _sfFadeThreshold.copyFromBin(pMem);
00467 }
00468
00469 if(FieldBits::NoField != (SpriteFieldMask & whichField))
00470 {
00471 _sfSprite.copyFromBin(pMem);
00472 }
00473
00474 if(FieldBits::NoField != (RModeFieldMask & whichField))
00475 {
00476 _sfRMode.copyFromBin(pMem);
00477 }
00478
00479
00480 }
00481
00482 #if !defined(OSG_FIXED_MFIELDSYNC)
00483 void PointChunkBase::executeSyncImpl( PointChunkBase *pOther,
00484 const BitVector &whichField)
00485 {
00486
00487 Inherited::executeSyncImpl(pOther, whichField);
00488
00489 if(FieldBits::NoField != (SizeFieldMask & whichField))
00490 _sfSize.syncWith(pOther->_sfSize);
00491
00492 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00493 _sfSmooth.syncWith(pOther->_sfSmooth);
00494
00495 if(FieldBits::NoField != (MinSizeFieldMask & whichField))
00496 _sfMinSize.syncWith(pOther->_sfMinSize);
00497
00498 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
00499 _sfMaxSize.syncWith(pOther->_sfMaxSize);
00500
00501 if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00502 _sfConstantAttenuation.syncWith(pOther->_sfConstantAttenuation);
00503
00504 if(FieldBits::NoField != (LinearAttenuationFieldMask & whichField))
00505 _sfLinearAttenuation.syncWith(pOther->_sfLinearAttenuation);
00506
00507 if(FieldBits::NoField != (QuadraticAttenuationFieldMask & whichField))
00508 _sfQuadraticAttenuation.syncWith(pOther->_sfQuadraticAttenuation);
00509
00510 if(FieldBits::NoField != (FadeThresholdFieldMask & whichField))
00511 _sfFadeThreshold.syncWith(pOther->_sfFadeThreshold);
00512
00513 if(FieldBits::NoField != (SpriteFieldMask & whichField))
00514 _sfSprite.syncWith(pOther->_sfSprite);
00515
00516 if(FieldBits::NoField != (RModeFieldMask & whichField))
00517 _sfRMode.syncWith(pOther->_sfRMode);
00518
00519
00520 }
00521 #else
00522 void PointChunkBase::executeSyncImpl( PointChunkBase *pOther,
00523 const BitVector &whichField,
00524 const SyncInfo &sInfo )
00525 {
00526
00527 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00528
00529 if(FieldBits::NoField != (SizeFieldMask & whichField))
00530 _sfSize.syncWith(pOther->_sfSize);
00531
00532 if(FieldBits::NoField != (SmoothFieldMask & whichField))
00533 _sfSmooth.syncWith(pOther->_sfSmooth);
00534
00535 if(FieldBits::NoField != (MinSizeFieldMask & whichField))
00536 _sfMinSize.syncWith(pOther->_sfMinSize);
00537
00538 if(FieldBits::NoField != (MaxSizeFieldMask & whichField))
00539 _sfMaxSize.syncWith(pOther->_sfMaxSize);
00540
00541 if(FieldBits::NoField != (ConstantAttenuationFieldMask & whichField))
00542 _sfConstantAttenuation.syncWith(pOther->_sfConstantAttenuation);
00543
00544 if(FieldBits::NoField != (LinearAttenuationFieldMask & whichField))
00545 _sfLinearAttenuation.syncWith(pOther->_sfLinearAttenuation);
00546
00547 if(FieldBits::NoField != (QuadraticAttenuationFieldMask & whichField))
00548 _sfQuadraticAttenuation.syncWith(pOther->_sfQuadraticAttenuation);
00549
00550 if(FieldBits::NoField != (FadeThresholdFieldMask & whichField))
00551 _sfFadeThreshold.syncWith(pOther->_sfFadeThreshold);
00552
00553 if(FieldBits::NoField != (SpriteFieldMask & whichField))
00554 _sfSprite.syncWith(pOther->_sfSprite);
00555
00556 if(FieldBits::NoField != (RModeFieldMask & whichField))
00557 _sfRMode.syncWith(pOther->_sfRMode);
00558
00559
00560
00561 }
00562
00563 void PointChunkBase::execBeginEditImpl (const BitVector &whichField,
00564 UInt32 uiAspect,
00565 UInt32 uiContainerSize)
00566 {
00567 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00568
00569 }
00570 #endif
00571
00572
00573
00574 #include <OSGSFieldTypeDef.inl>
00575 #include <OSGMFieldTypeDef.inl>
00576
00577 OSG_BEGIN_NAMESPACE
00578
00579 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00580 DataType FieldDataTraits<PointChunkPtr>::_type("PointChunkPtr", "StateChunkPtr");
00581 #endif
00582
00583 OSG_DLLEXPORT_SFIELD_DEF1(PointChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00584 OSG_DLLEXPORT_MFIELD_DEF1(PointChunkPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00585
00586 OSG_END_NAMESPACE
00587
00588
00589
00590
00591
00592 #ifdef OSG_SGI_CC
00593 #pragma set woff 1174
00594 #endif
00595
00596 #ifdef OSG_LINUX_ICC
00597 #pragma warning( disable : 177 )
00598 #endif
00599
00600 namespace
00601 {
00602 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00603 static Char8 cvsid_hpp [] = OSGPOINTCHUNKBASE_HEADER_CVSID;
00604 static Char8 cvsid_inl [] = OSGPOINTCHUNKBASE_INLINE_CVSID;
00605
00606 static Char8 cvsid_fields_hpp[] = OSGPOINTCHUNKFIELDS_HEADER_CVSID;
00607 }
00608