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_COMPILEPROXYGROUPINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGProxyGroupBase.h"
00062 #include "OSGProxyGroup.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector ProxyGroupBase::EnabledFieldMask =
00068 (TypeTraits<BitVector>::One << ProxyGroupBase::EnabledFieldId);
00069
00070 const OSG::BitVector ProxyGroupBase::UrlFieldMask =
00071 (TypeTraits<BitVector>::One << ProxyGroupBase::UrlFieldId);
00072
00073 const OSG::BitVector ProxyGroupBase::RootFieldMask =
00074 (TypeTraits<BitVector>::One << ProxyGroupBase::RootFieldId);
00075
00076 const OSG::BitVector ProxyGroupBase::StateFieldMask =
00077 (TypeTraits<BitVector>::One << ProxyGroupBase::StateFieldId);
00078
00079 const OSG::BitVector ProxyGroupBase::ConcurrentLoadFieldMask =
00080 (TypeTraits<BitVector>::One << ProxyGroupBase::ConcurrentLoadFieldId);
00081
00082 const OSG::BitVector ProxyGroupBase::VolumeFieldMask =
00083 (TypeTraits<BitVector>::One << ProxyGroupBase::VolumeFieldId);
00084
00085 const OSG::BitVector ProxyGroupBase::IndicesFieldMask =
00086 (TypeTraits<BitVector>::One << ProxyGroupBase::IndicesFieldId);
00087
00088 const OSG::BitVector ProxyGroupBase::TrianglesFieldMask =
00089 (TypeTraits<BitVector>::One << ProxyGroupBase::TrianglesFieldId);
00090
00091 const OSG::BitVector ProxyGroupBase::PositionsFieldMask =
00092 (TypeTraits<BitVector>::One << ProxyGroupBase::PositionsFieldId);
00093
00094 const OSG::BitVector ProxyGroupBase::GeometriesFieldMask =
00095 (TypeTraits<BitVector>::One << ProxyGroupBase::GeometriesFieldId);
00096
00097 const OSG::BitVector ProxyGroupBase::AbsoluteUrlFieldMask =
00098 (TypeTraits<BitVector>::One << ProxyGroupBase::AbsoluteUrlFieldId);
00099
00100 const OSG::BitVector ProxyGroupBase::InlineFieldMask =
00101 (TypeTraits<BitVector>::One << ProxyGroupBase::InlineFieldId);
00102
00103 const OSG::BitVector ProxyGroupBase::MTInfluenceMask =
00104 (Inherited::MTInfluenceMask) |
00105 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00106
00107
00108
00109
00147
00148
00149 FieldDescription *ProxyGroupBase::_desc[] =
00150 {
00151 new FieldDescription(SFBool::getClassType(),
00152 "enabled",
00153 EnabledFieldId, EnabledFieldMask,
00154 false,
00155 (FieldAccessMethod) &ProxyGroupBase::getSFEnabled),
00156 new FieldDescription(SFString::getClassType(),
00157 "url",
00158 UrlFieldId, UrlFieldMask,
00159 false,
00160 (FieldAccessMethod) &ProxyGroupBase::getSFUrl),
00161 new FieldDescription(SFNodePtr::getClassType(),
00162 "root",
00163 RootFieldId, RootFieldMask,
00164 true,
00165 (FieldAccessMethod) &ProxyGroupBase::getSFRoot),
00166 new FieldDescription(SFUInt32::getClassType(),
00167 "state",
00168 StateFieldId, StateFieldMask,
00169 false,
00170 (FieldAccessMethod) &ProxyGroupBase::getSFState),
00171 new FieldDescription(SFBool::getClassType(),
00172 "concurrentLoad",
00173 ConcurrentLoadFieldId, ConcurrentLoadFieldMask,
00174 false,
00175 (FieldAccessMethod) &ProxyGroupBase::getSFConcurrentLoad),
00176 new FieldDescription(SFDynamicVolume::getClassType(),
00177 "volume",
00178 VolumeFieldId, VolumeFieldMask,
00179 false,
00180 (FieldAccessMethod) &ProxyGroupBase::getSFVolume),
00181 new FieldDescription(SFUInt32::getClassType(),
00182 "indices",
00183 IndicesFieldId, IndicesFieldMask,
00184 false,
00185 (FieldAccessMethod) &ProxyGroupBase::getSFIndices),
00186 new FieldDescription(SFUInt32::getClassType(),
00187 "triangles",
00188 TrianglesFieldId, TrianglesFieldMask,
00189 false,
00190 (FieldAccessMethod) &ProxyGroupBase::getSFTriangles),
00191 new FieldDescription(SFUInt32::getClassType(),
00192 "positions",
00193 PositionsFieldId, PositionsFieldMask,
00194 false,
00195 (FieldAccessMethod) &ProxyGroupBase::getSFPositions),
00196 new FieldDescription(SFUInt32::getClassType(),
00197 "geometries",
00198 GeometriesFieldId, GeometriesFieldMask,
00199 false,
00200 (FieldAccessMethod) &ProxyGroupBase::getSFGeometries),
00201 new FieldDescription(SFString::getClassType(),
00202 "absoluteUrl",
00203 AbsoluteUrlFieldId, AbsoluteUrlFieldMask,
00204 true,
00205 (FieldAccessMethod) &ProxyGroupBase::getSFAbsoluteUrl),
00206 new FieldDescription(MFUInt8::getClassType(),
00207 "inline",
00208 InlineFieldId, InlineFieldMask,
00209 false,
00210 (FieldAccessMethod) &ProxyGroupBase::getMFInline)
00211 };
00212
00213
00214 FieldContainerType ProxyGroupBase::_type(
00215 "ProxyGroup",
00216 "Group",
00217 NULL,
00218 (PrototypeCreateF) &ProxyGroupBase::createEmpty,
00219 ProxyGroup::initMethod,
00220 _desc,
00221 sizeof(_desc));
00222
00223
00224
00225
00226
00227 FieldContainerType &ProxyGroupBase::getType(void)
00228 {
00229 return _type;
00230 }
00231
00232 const FieldContainerType &ProxyGroupBase::getType(void) const
00233 {
00234 return _type;
00235 }
00236
00237
00238 FieldContainerPtr ProxyGroupBase::shallowCopy(void) const
00239 {
00240 ProxyGroupPtr returnValue;
00241
00242 newPtr(returnValue, dynamic_cast<const ProxyGroup *>(this));
00243
00244 return returnValue;
00245 }
00246
00247 UInt32 ProxyGroupBase::getContainerSize(void) const
00248 {
00249 return sizeof(ProxyGroup);
00250 }
00251
00252
00253 #if !defined(OSG_FIXED_MFIELDSYNC)
00254 void ProxyGroupBase::executeSync( FieldContainer &other,
00255 const BitVector &whichField)
00256 {
00257 this->executeSyncImpl((ProxyGroupBase *) &other, whichField);
00258 }
00259 #else
00260 void ProxyGroupBase::executeSync( FieldContainer &other,
00261 const BitVector &whichField, const SyncInfo &sInfo )
00262 {
00263 this->executeSyncImpl((ProxyGroupBase *) &other, whichField, sInfo);
00264 }
00265 void ProxyGroupBase::execBeginEdit(const BitVector &whichField,
00266 UInt32 uiAspect,
00267 UInt32 uiContainerSize)
00268 {
00269 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00270 }
00271
00272 void ProxyGroupBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00273 {
00274 Inherited::onDestroyAspect(uiId, uiAspect);
00275
00276 _mfInline.terminateShare(uiAspect, this->getContainerSize());
00277 }
00278 #endif
00279
00280
00281
00282 #ifdef OSG_WIN32_ICL
00283 #pragma warning (disable : 383)
00284 #endif
00285
00286 ProxyGroupBase::ProxyGroupBase(void) :
00287 _sfEnabled (bool(true)),
00288 _sfUrl (),
00289 _sfRoot (NodePtr(NullFC)),
00290 _sfState (UInt32(0)),
00291 _sfConcurrentLoad (bool(true)),
00292 _sfVolume (),
00293 _sfIndices (UInt32(0)),
00294 _sfTriangles (UInt32(0)),
00295 _sfPositions (),
00296 _sfGeometries (),
00297 _sfAbsoluteUrl (),
00298 _mfInline (),
00299 Inherited()
00300 {
00301 }
00302
00303 #ifdef OSG_WIN32_ICL
00304 #pragma warning (default : 383)
00305 #endif
00306
00307 ProxyGroupBase::ProxyGroupBase(const ProxyGroupBase &source) :
00308 _sfEnabled (source._sfEnabled ),
00309 _sfUrl (source._sfUrl ),
00310 _sfRoot (source._sfRoot ),
00311 _sfState (source._sfState ),
00312 _sfConcurrentLoad (source._sfConcurrentLoad ),
00313 _sfVolume (source._sfVolume ),
00314 _sfIndices (source._sfIndices ),
00315 _sfTriangles (source._sfTriangles ),
00316 _sfPositions (source._sfPositions ),
00317 _sfGeometries (source._sfGeometries ),
00318 _sfAbsoluteUrl (source._sfAbsoluteUrl ),
00319 _mfInline (source._mfInline ),
00320 Inherited (source)
00321 {
00322 }
00323
00324
00325
00326 ProxyGroupBase::~ProxyGroupBase(void)
00327 {
00328 }
00329
00330
00331
00332 UInt32 ProxyGroupBase::getBinSize(const BitVector &whichField)
00333 {
00334 UInt32 returnValue = Inherited::getBinSize(whichField);
00335
00336 if(FieldBits::NoField != (EnabledFieldMask & whichField))
00337 {
00338 returnValue += _sfEnabled.getBinSize();
00339 }
00340
00341 if(FieldBits::NoField != (UrlFieldMask & whichField))
00342 {
00343 returnValue += _sfUrl.getBinSize();
00344 }
00345
00346 if(FieldBits::NoField != (RootFieldMask & whichField))
00347 {
00348 returnValue += _sfRoot.getBinSize();
00349 }
00350
00351 if(FieldBits::NoField != (StateFieldMask & whichField))
00352 {
00353 returnValue += _sfState.getBinSize();
00354 }
00355
00356 if(FieldBits::NoField != (ConcurrentLoadFieldMask & whichField))
00357 {
00358 returnValue += _sfConcurrentLoad.getBinSize();
00359 }
00360
00361 if(FieldBits::NoField != (VolumeFieldMask & whichField))
00362 {
00363 returnValue += _sfVolume.getBinSize();
00364 }
00365
00366 if(FieldBits::NoField != (IndicesFieldMask & whichField))
00367 {
00368 returnValue += _sfIndices.getBinSize();
00369 }
00370
00371 if(FieldBits::NoField != (TrianglesFieldMask & whichField))
00372 {
00373 returnValue += _sfTriangles.getBinSize();
00374 }
00375
00376 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00377 {
00378 returnValue += _sfPositions.getBinSize();
00379 }
00380
00381 if(FieldBits::NoField != (GeometriesFieldMask & whichField))
00382 {
00383 returnValue += _sfGeometries.getBinSize();
00384 }
00385
00386 if(FieldBits::NoField != (AbsoluteUrlFieldMask & whichField))
00387 {
00388 returnValue += _sfAbsoluteUrl.getBinSize();
00389 }
00390
00391 if(FieldBits::NoField != (InlineFieldMask & whichField))
00392 {
00393 returnValue += _mfInline.getBinSize();
00394 }
00395
00396
00397 return returnValue;
00398 }
00399
00400 void ProxyGroupBase::copyToBin( BinaryDataHandler &pMem,
00401 const BitVector &whichField)
00402 {
00403 Inherited::copyToBin(pMem, whichField);
00404
00405 if(FieldBits::NoField != (EnabledFieldMask & whichField))
00406 {
00407 _sfEnabled.copyToBin(pMem);
00408 }
00409
00410 if(FieldBits::NoField != (UrlFieldMask & whichField))
00411 {
00412 _sfUrl.copyToBin(pMem);
00413 }
00414
00415 if(FieldBits::NoField != (RootFieldMask & whichField))
00416 {
00417 _sfRoot.copyToBin(pMem);
00418 }
00419
00420 if(FieldBits::NoField != (StateFieldMask & whichField))
00421 {
00422 _sfState.copyToBin(pMem);
00423 }
00424
00425 if(FieldBits::NoField != (ConcurrentLoadFieldMask & whichField))
00426 {
00427 _sfConcurrentLoad.copyToBin(pMem);
00428 }
00429
00430 if(FieldBits::NoField != (VolumeFieldMask & whichField))
00431 {
00432 _sfVolume.copyToBin(pMem);
00433 }
00434
00435 if(FieldBits::NoField != (IndicesFieldMask & whichField))
00436 {
00437 _sfIndices.copyToBin(pMem);
00438 }
00439
00440 if(FieldBits::NoField != (TrianglesFieldMask & whichField))
00441 {
00442 _sfTriangles.copyToBin(pMem);
00443 }
00444
00445 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00446 {
00447 _sfPositions.copyToBin(pMem);
00448 }
00449
00450 if(FieldBits::NoField != (GeometriesFieldMask & whichField))
00451 {
00452 _sfGeometries.copyToBin(pMem);
00453 }
00454
00455 if(FieldBits::NoField != (AbsoluteUrlFieldMask & whichField))
00456 {
00457 _sfAbsoluteUrl.copyToBin(pMem);
00458 }
00459
00460 if(FieldBits::NoField != (InlineFieldMask & whichField))
00461 {
00462 _mfInline.copyToBin(pMem);
00463 }
00464
00465
00466 }
00467
00468 void ProxyGroupBase::copyFromBin( BinaryDataHandler &pMem,
00469 const BitVector &whichField)
00470 {
00471 Inherited::copyFromBin(pMem, whichField);
00472
00473 if(FieldBits::NoField != (EnabledFieldMask & whichField))
00474 {
00475 _sfEnabled.copyFromBin(pMem);
00476 }
00477
00478 if(FieldBits::NoField != (UrlFieldMask & whichField))
00479 {
00480 _sfUrl.copyFromBin(pMem);
00481 }
00482
00483 if(FieldBits::NoField != (RootFieldMask & whichField))
00484 {
00485 _sfRoot.copyFromBin(pMem);
00486 }
00487
00488 if(FieldBits::NoField != (StateFieldMask & whichField))
00489 {
00490 _sfState.copyFromBin(pMem);
00491 }
00492
00493 if(FieldBits::NoField != (ConcurrentLoadFieldMask & whichField))
00494 {
00495 _sfConcurrentLoad.copyFromBin(pMem);
00496 }
00497
00498 if(FieldBits::NoField != (VolumeFieldMask & whichField))
00499 {
00500 _sfVolume.copyFromBin(pMem);
00501 }
00502
00503 if(FieldBits::NoField != (IndicesFieldMask & whichField))
00504 {
00505 _sfIndices.copyFromBin(pMem);
00506 }
00507
00508 if(FieldBits::NoField != (TrianglesFieldMask & whichField))
00509 {
00510 _sfTriangles.copyFromBin(pMem);
00511 }
00512
00513 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00514 {
00515 _sfPositions.copyFromBin(pMem);
00516 }
00517
00518 if(FieldBits::NoField != (GeometriesFieldMask & whichField))
00519 {
00520 _sfGeometries.copyFromBin(pMem);
00521 }
00522
00523 if(FieldBits::NoField != (AbsoluteUrlFieldMask & whichField))
00524 {
00525 _sfAbsoluteUrl.copyFromBin(pMem);
00526 }
00527
00528 if(FieldBits::NoField != (InlineFieldMask & whichField))
00529 {
00530 _mfInline.copyFromBin(pMem);
00531 }
00532
00533
00534 }
00535
00536 #if !defined(OSG_FIXED_MFIELDSYNC)
00537 void ProxyGroupBase::executeSyncImpl( ProxyGroupBase *pOther,
00538 const BitVector &whichField)
00539 {
00540
00541 Inherited::executeSyncImpl(pOther, whichField);
00542
00543 if(FieldBits::NoField != (EnabledFieldMask & whichField))
00544 _sfEnabled.syncWith(pOther->_sfEnabled);
00545
00546 if(FieldBits::NoField != (UrlFieldMask & whichField))
00547 _sfUrl.syncWith(pOther->_sfUrl);
00548
00549 if(FieldBits::NoField != (RootFieldMask & whichField))
00550 _sfRoot.syncWith(pOther->_sfRoot);
00551
00552 if(FieldBits::NoField != (StateFieldMask & whichField))
00553 _sfState.syncWith(pOther->_sfState);
00554
00555 if(FieldBits::NoField != (ConcurrentLoadFieldMask & whichField))
00556 _sfConcurrentLoad.syncWith(pOther->_sfConcurrentLoad);
00557
00558 if(FieldBits::NoField != (VolumeFieldMask & whichField))
00559 _sfVolume.syncWith(pOther->_sfVolume);
00560
00561 if(FieldBits::NoField != (IndicesFieldMask & whichField))
00562 _sfIndices.syncWith(pOther->_sfIndices);
00563
00564 if(FieldBits::NoField != (TrianglesFieldMask & whichField))
00565 _sfTriangles.syncWith(pOther->_sfTriangles);
00566
00567 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00568 _sfPositions.syncWith(pOther->_sfPositions);
00569
00570 if(FieldBits::NoField != (GeometriesFieldMask & whichField))
00571 _sfGeometries.syncWith(pOther->_sfGeometries);
00572
00573 if(FieldBits::NoField != (AbsoluteUrlFieldMask & whichField))
00574 _sfAbsoluteUrl.syncWith(pOther->_sfAbsoluteUrl);
00575
00576 if(FieldBits::NoField != (InlineFieldMask & whichField))
00577 _mfInline.syncWith(pOther->_mfInline);
00578
00579
00580 }
00581 #else
00582 void ProxyGroupBase::executeSyncImpl( ProxyGroupBase *pOther,
00583 const BitVector &whichField,
00584 const SyncInfo &sInfo )
00585 {
00586
00587 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00588
00589 if(FieldBits::NoField != (EnabledFieldMask & whichField))
00590 _sfEnabled.syncWith(pOther->_sfEnabled);
00591
00592 if(FieldBits::NoField != (UrlFieldMask & whichField))
00593 _sfUrl.syncWith(pOther->_sfUrl);
00594
00595 if(FieldBits::NoField != (RootFieldMask & whichField))
00596 _sfRoot.syncWith(pOther->_sfRoot);
00597
00598 if(FieldBits::NoField != (StateFieldMask & whichField))
00599 _sfState.syncWith(pOther->_sfState);
00600
00601 if(FieldBits::NoField != (ConcurrentLoadFieldMask & whichField))
00602 _sfConcurrentLoad.syncWith(pOther->_sfConcurrentLoad);
00603
00604 if(FieldBits::NoField != (VolumeFieldMask & whichField))
00605 _sfVolume.syncWith(pOther->_sfVolume);
00606
00607 if(FieldBits::NoField != (IndicesFieldMask & whichField))
00608 _sfIndices.syncWith(pOther->_sfIndices);
00609
00610 if(FieldBits::NoField != (TrianglesFieldMask & whichField))
00611 _sfTriangles.syncWith(pOther->_sfTriangles);
00612
00613 if(FieldBits::NoField != (PositionsFieldMask & whichField))
00614 _sfPositions.syncWith(pOther->_sfPositions);
00615
00616 if(FieldBits::NoField != (GeometriesFieldMask & whichField))
00617 _sfGeometries.syncWith(pOther->_sfGeometries);
00618
00619 if(FieldBits::NoField != (AbsoluteUrlFieldMask & whichField))
00620 _sfAbsoluteUrl.syncWith(pOther->_sfAbsoluteUrl);
00621
00622
00623 if(FieldBits::NoField != (InlineFieldMask & whichField))
00624 _mfInline.syncWith(pOther->_mfInline, sInfo);
00625
00626
00627 }
00628
00629 void ProxyGroupBase::execBeginEditImpl (const BitVector &whichField,
00630 UInt32 uiAspect,
00631 UInt32 uiContainerSize)
00632 {
00633 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00634
00635 if(FieldBits::NoField != (InlineFieldMask & whichField))
00636 _mfInline.beginEdit(uiAspect, uiContainerSize);
00637
00638 }
00639 #endif
00640
00641
00642
00643 OSG_BEGIN_NAMESPACE
00644
00645 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00646 DataType FieldDataTraits<ProxyGroupPtr>::_type("ProxyGroupPtr", "GroupPtr");
00647 #endif
00648
00649
00650 OSG_END_NAMESPACE
00651
00652
00653
00654
00655
00656 #ifdef OSG_SGI_CC
00657 #pragma set woff 1174
00658 #endif
00659
00660 #ifdef OSG_LINUX_ICC
00661 #pragma warning( disable : 177 )
00662 #endif
00663
00664 namespace
00665 {
00666 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.45 2005/07/20 00:10:14 vossg Exp $";
00667 static Char8 cvsid_hpp [] = OSGPROXYGROUPBASE_HEADER_CVSID;
00668 static Char8 cvsid_inl [] = OSGPROXYGROUPBASE_INLINE_CVSID;
00669
00670 static Char8 cvsid_fields_hpp[] = OSGPROXYGROUPFIELDS_HEADER_CVSID;
00671 }
00672