Show
Ignore:
Timestamp:
01/24/08 15:11:54 (1 year ago)
Author:
cneumann
Message:

fixed: aspect sync for child/parent fields

missing editSField/editMField calls

added: simple test program for MT

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/FieldContainer/Node/OSGNode.inl

    r1039 r1041  
    3939OSG_BEGIN_NAMESPACE 
    4040 
     41//! access the type of the class 
     42inline OSG::FieldContainerType & 
     43Node::getClassType(void) 
     44{ 
     45    return _type; 
     46} 
     47 
     48//! access the numerical type of the class 
     49inline OSG::UInt32 
     50Node::getClassTypeId(void) 
     51{ 
     52    return _type.getId(); 
     53} 
     54 
     55inline OSG::UInt16 
     56Node::getClassGroupId(void) 
     57{ 
     58    return _type.getGroupId(); 
     59} 
     60 
     61/*-------------------------------------------------------------------------*/ 
     62/* Field SFVolume                                                          */ 
     63 
     64inline SFDynamicVolume * 
     65Node::editSFVolume(bool update) 
     66{ 
     67    if(update == true) 
     68    { 
     69        updateVolume(); 
     70    } 
     71    else 
     72    { 
     73        editSField(VolumeFieldMask); 
     74    } 
     75 
     76    return &_sfVolume; 
     77} 
     78 
     79inline SFDynamicVolume const * 
     80Node::getSFVolume(bool update) 
     81{ 
     82    if(update == true) 
     83    { 
     84        updateVolume(); 
     85    } 
     86     
     87    return &_sfVolume; 
     88} 
     89 
     90#ifdef OSG_1_GET_COMPAT 
     91inline SFDynamicVolume * 
     92Node::getSFVolume(bool update) 
     93{ 
     94    return this->editSFVolume(); 
     95} 
     96#endif 
     97 
     98inline DynamicVolume & 
     99Node::editVolume(bool update) 
     100{ 
     101    if(update == true) 
     102    { 
     103        updateVolume(); 
     104    } 
     105    else 
     106    { 
     107        editSField(VolumeFieldMask); 
     108    } 
     109 
     110    return _sfVolume.getValue(); 
     111} 
     112 
     113inline DynamicVolume const & 
     114Node::getVolume(bool update) 
     115{ 
     116    if(update == true) 
     117    { 
     118        updateVolume(); 
     119    } 
     120     
     121    return _sfVolume.getValue(); 
     122} 
     123#ifdef OSG_1_GET_COMPAT 
     124inline DynamicVolume & 
     125Node::getVolume(bool update) 
     126{ 
     127    return this->editVolume(update); 
     128} 
     129#endif 
     130 
     131inline void 
     132Node::setVolume( 
     133    SFDynamicVolume::ArgumentType value) 
     134{ 
     135    editSField(VolumeFieldMask); 
     136 
     137    _sfVolume.setValue(value); 
     138} 
     139 
     140/*-------------------------------------------------------------------------*/ 
     141/* Field SFTravMask                                                        */ 
     142 
     143inline SFUInt32 * 
     144Node::editSFTravMask(void) 
     145{ 
     146    editSField(TravMaskFieldMask); 
     147 
     148    return &_sfTravMask; 
     149} 
     150 
     151inline SFUInt32 const * 
     152Node::getSFTravMask (void) const 
     153{ 
     154    return &_sfTravMask; 
     155} 
     156 
     157#ifdef OSG_1_GET_COMPAT 
     158inline SFUInt32 * 
     159Node::getSFTravMask (void) 
     160{ 
     161    return this->editSFTravMask(); 
     162} 
     163#endif 
     164 
     165inline UInt32 & 
     166Node::editTravMask(void) 
     167{ 
     168    editSField(TravMaskFieldMask); 
     169 
     170    return _sfTravMask.getValue(); 
     171} 
     172 
     173inline UInt32 const & 
     174Node::getTravMask (void) const 
     175{ 
     176    return _sfTravMask.getValue(); 
     177} 
     178#ifdef OSG_1_GET_COMPAT 
     179inline UInt32 & 
     180Node::getTravMask (void) 
     181{ 
     182    return this->editTravMask(); 
     183} 
     184#endif 
     185 
     186inline void 
     187Node::setTravMask( 
     188    SFUInt32::ArgumentType value) 
     189{ 
     190    editSField(TravMaskFieldMask); 
     191 
     192    _sfTravMask.setValue(value); 
     193} 
     194 
     195#ifdef OSG_1_COMPAT 
     196inline bool 
     197    Node::getActive(void) const 
     198{ 
     199    return getTravMask() == TypeTraits<UInt32>::getMax(); 
     200} 
     201 
     202inline void 
     203    Node::setActive(bool val) 
     204{ 
     205    editSField(TravMaskFieldMask); 
     206 
     207    _sfTravMask.setValue(val ? TypeTraits<UInt32>::getMax()        : 
     208                               TypeTraits<UInt32>::getZeroElement() ); 
     209} 
     210 
     211inline void 
     212    Node::setOcclusionMask(UInt8 val) 
     213{ 
     214    _occlusionMask = val; 
     215} 
     216 
     217inline UInt8 
     218    Node::getOcclusionMask(void) const 
     219{ 
     220    return _occlusionMask; 
     221} 
     222#endif 
     223 
     224/*-------------------------------------------------------------------------*/ 
     225/* Field SFParent                                                          */ 
     226 
     227inline SFNodeParentPtr const * 
     228Node::getSFParent(void) const 
     229{ 
     230    return &_sfParent; 
     231} 
     232 
     233inline SFNodeParentPtr::const_reference 
     234Node::getParent(void) const 
     235{ 
     236    return _sfParent.getValue(); 
     237} 
     238 
     239/*-------------------------------------------------------------------------*/ 
     240/* Field SFCore                                                            */ 
     241 
     242inline SFNodeCoreChildPtr * 
     243Node::editSFCore(void) 
     244{ 
     245    editSField(CoreFieldMask); 
     246 
     247    return &_sfCore; 
     248} 
     249 
     250inline SFNodeCoreChildPtr const * 
     251Node::getSFCore(void) const 
     252{ 
     253    return &_sfCore; 
     254} 
     255 
     256inline SFNodeCoreChildPtr::reference 
     257Node::editCore(void) 
     258{ 
     259    editSField(CoreFieldMask); 
     260 
     261    return _sfCore.editValue(); 
     262} 
     263 
     264inline SFNodeCoreChildPtr::const_reference 
     265Node::getCore(void) const 
     266{ 
     267    return _sfCore.getValue(); 
     268} 
     269     
     270inline void 
     271Node::setCore(SFNodeCoreChildPtr::ArgumentType value) 
     272{ 
     273    editSField(CoreFieldMask); 
     274 
     275    _sfCore.setValue(value); 
     276} 
     277 
     278     
     279/*-------------------------------------------------------------------------*/ 
     280/* Field MFChildren                                        (Pointer field) */ 
     281 
     282inline MFNodeChildPtr * 
     283Node::editMFChildren(void) 
     284{ 
     285    editMField(ChildrenFieldMask, _mfChildren); 
     286     
     287    return &_mfChildren; 
     288} 
     289 
     290inline MFNodeChildPtr const * 
     291Node::getMFChildren(void) const 
     292{ 
     293    return &_mfChildren; 
     294} 
     295 
     296inline MFNodeChildPtr & 
     297Node::editChildren(void) 
     298{ 
     299    editMField(ChildrenFieldMask, _mfChildren); 
     300 
     301    return _mfChildren; 
     302} 
     303 
     304inline MFNodeChildPtr const & 
     305Node::getChildren(void) const 
     306{ 
     307    return _mfChildren; 
     308} 
     309 
     310inline MFNodeChildPtr::reference 
     311Node::editChildren(UInt32 const index) 
     312{ 
     313    editMField(ChildrenFieldMask, _mfChildren); 
     314 
     315    return _mfChildren[index]; 
     316} 
     317 
     318inline MFNodeChildPtr::const_reference 
     319Node::getChildren(UInt32 const index) const 
     320{ 
     321    return _mfChildren[index]; 
     322} 
     323 
     324 
     325#ifdef OSG_MT_CPTR_ASPECT 
     326inline 
     327void Node::execSync (Node *pFrom, 
     328                                  ConstFieldMaskArg  whichField, 
     329                                  AspectOffsetStore &oOffsets, 
     330                                  ConstFieldMaskArg  syncMode, 
     331                                  UInt32 const       uiSyncInfo) 
     332{ 
     333    Inherited::execSync(pFrom, whichField, oOffsets, syncMode, uiSyncInfo); 
     334 
     335    if(FieldBits::NoField != (VolumeFieldMask & whichField)) 
     336        _sfVolume.syncWith(pFrom->_sfVolume); 
     337 
     338    if(FieldBits::NoField != (TravMaskFieldMask & whichField)) 
     339        _sfTravMask.syncWith(pFrom->_sfTravMask); 
     340 
     341    if(FieldBits::NoField != (ParentFieldMask & whichField)) 
     342        _sfParent.syncWith(pFrom->_sfParent); 
     343 
     344    if(FieldBits::NoField != (ChildrenFieldMask & whichField)) 
     345        _mfChildren.syncWith(pFrom->_mfChildren, 
     346                                syncMode, 
     347                                uiSyncInfo, 
     348                                oOffsets); 
     349 
     350    if(FieldBits::NoField != (CoreFieldMask & whichField)) 
     351        _sfCore.syncWith(pFrom->_sfCore); 
     352} 
     353#endif 
     354 
     355 
     356inline Char8 const * 
     357Node::getClassname(void) 
     358{ 
     359    return "Node"; 
     360} 
     361 
     362 
     363 
     364 
     365 
     366 
     367 
     368 
     369 
     370 
     371 
     372 
     373 
     374 
     375#if 0 
     376 
     377 
    41378OSG_FIELD_CONTAINER_INL_DEF(Node) 
    42  
    43 inline 
    44 NodeCorePtr Node::getCore(void) 
    45 { 
    46     return _sfCore.getValue(); 
    47 } 
    48  
    49 inline 
    50 NodeCorePtr Node::getCore(void) const 
    51 { 
    52     return _sfCore.getValue(); 
    53 } 
    54379 
    55380inline 
     
    202527} 
    203528 
     529#endif 
     530 
    204531template <class CoreT> 
    205532inline NodeTransitPtr