Show
Ignore:
Timestamp:
05/05/08 06:39:01 (5 months ago)
Author:
vossg
Message:

changed: base rebuild

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/System/NodeCores/Drawables/Geometry/Base/ES/OSGGeometryBase.cpp

    r1178 r1193  
    326326} 
    327327 
     328SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFTypes          (void) 
     329{ 
     330    editSField(TypesFieldMask); 
     331 
     332    return &_sfTypes; 
     333} 
     334 
    328335//! Get the Geometry::_sfLengths field. 
    329336const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFLengths(void) const 
     
    332339} 
    333340 
     341SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFLengths        (void) 
     342{ 
     343    editSField(LengthsFieldMask); 
     344 
     345    return &_sfLengths; 
     346} 
     347 
    334348//! Get the Geometry::_mfProperties field. 
    335349const MFUnrecChildGeoVectorPropertyPtr *GeometryBase::getMFProperties(void) const 
     
    338352} 
    339353 
     354MFUnrecChildGeoVectorPropertyPtr *GeometryBase::editMFProperties     (void) 
     355{ 
     356    editMField(PropertiesFieldMask, _mfProperties); 
     357 
     358    return &_mfProperties; 
     359} 
     360 
    340361//! Get the Geometry::_mfPropIndices field. 
    341362const MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getMFPropIndices(void) const 
     
    344365} 
    345366 
     367MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editMFPropIndices    (void) 
     368{ 
     369    editMField(PropIndicesFieldMask, _mfPropIndices); 
     370 
     371    return &_mfPropIndices; 
     372} 
     373 
    346374SFInt32 *GeometryBase::editSFClassicGLId(void) 
    347375{ 
     
    388416    editMField(PropertiesFieldMask, _mfProperties); 
    389417 
    390     //addRef(value); 
    391  
    392418    _mfProperties.push_back(value); 
    393  
    394 //    if(value == NullFC) 
    395 //        return; 
    396419} 
    397420 
     
    413436} 
    414437 
    415 void GeometryBase::insertIntoProperties(      UInt32         uiIndex, 
    416                                                    const GeoVectorPropertyPtr value   ) 
     438void GeometryBase::removeFromProperties(UInt32 uiIndex) 
     439
     440    if(uiIndex < _mfProperties.size()) 
     441    { 
     442        editMField(PropertiesFieldMask, _mfProperties); 
     443 
     444        MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
     445 
     446        fieldIt += uiIndex; 
     447 
     448        _mfProperties.erase(fieldIt); 
     449    } 
     450
     451 
     452void GeometryBase::removeFromProperties(const GeoVectorPropertyPtr value) 
     453
     454    Int32 iElemIdx = _mfProperties.findIndex(value); 
     455 
     456    if(iElemIdx != -1) 
     457    { 
     458        editMField(PropertiesFieldMask, _mfProperties); 
     459 
     460        MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
     461 
     462        fieldIt += iElemIdx; 
     463 
     464        _mfProperties.erase(fieldIt); 
     465    } 
     466
     467void GeometryBase::clearProperties(void) 
    417468{ 
    418469    editMField(PropertiesFieldMask, _mfProperties); 
    419470 
    420     MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    421  
    422     //addRef(value); 
    423  
    424     fieldIt += uiIndex; 
    425  
    426     _mfProperties.insert(fieldIt, value); 
    427  
    428 //    if(value == NullFC) 
    429 //        return; 
    430 } 
    431  
    432 void GeometryBase::replaceInProperties(      UInt32         uiIndex, 
    433                                                        const GeoVectorPropertyPtr value   ) 
    434 { 
    435     if(uiIndex >= _mfProperties.size()) 
    436         return; 
    437  
    438     editMField(PropertiesFieldMask, _mfProperties); 
    439  
    440  
    441 //    addRef(value); 
    442 //    subRef(_mfProperties[uiIndex]); 
    443  
    444 //    _mfProperties[uiIndex] = value; 
    445  
    446       _mfProperties.replace(uiIndex, value); 
    447  
    448 //    if(value == NullFC) 
    449 //        return; 
    450 } 
    451  
    452 void GeometryBase::replaceInProperties(const GeoVectorPropertyPtr pOldElem, 
    453                                                         const GeoVectorPropertyPtr pNewElem) 
    454 { 
    455     Int32  elemIdx = _mfProperties.findIndex(pOldElem); 
    456  
    457     if(elemIdx != -1) 
    458     { 
    459         editMField(PropertiesFieldMask, _mfProperties); 
    460  
    461 //        MFGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin(); 
    462  
    463 //        fieldIt += elemIdx; 
    464 //        addRef(pNewElem); 
    465 //        subRef(pOldElem); 
    466  
    467 //        (*fieldIt) = pNewElem; 
    468           _mfProperties.replace(elemIdx, pNewElem); 
    469     } 
    470 } 
    471  
    472 void GeometryBase::removeFromProperties(UInt32 uiIndex) 
    473 { 
    474     if(uiIndex < _mfProperties.size()) 
    475     { 
    476         editMField(PropertiesFieldMask, _mfProperties); 
    477  
    478         MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    479  
    480         fieldIt += uiIndex; 
    481  
    482         //subRef(*fieldIt); 
    483  
    484         _mfProperties.erase(fieldIt); 
    485     } 
    486 } 
    487  
    488 void GeometryBase::removeFromProperties(const GeoVectorPropertyPtr value) 
    489 { 
    490     Int32 iElemIdx = _mfProperties.findIndex(value); 
    491  
    492     if(iElemIdx != -1) 
    493     { 
    494         editMField(PropertiesFieldMask, _mfProperties); 
    495  
    496         MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    497  
    498         fieldIt += iElemIdx; 
    499  
    500         //subRef(*fieldIt); 
    501  
    502         _mfProperties.erase(fieldIt); 
    503     } 
    504 } 
    505 void GeometryBase::clearProperties(void) 
    506 { 
    507     editMField(PropertiesFieldMask, _mfProperties); 
    508  
    509471 
    510472    _mfProperties.clear(); 
     
    515477    editMField(PropIndicesFieldMask, _mfPropIndices); 
    516478 
    517     //addRef(value); 
    518  
    519479    _mfPropIndices.push_back(value); 
    520  
    521 //    if(value == NullFC) 
    522 //        return; 
    523480} 
    524481 
     
    540497} 
    541498 
    542 void GeometryBase::insertIntoPropIndices(      UInt32         uiIndex, 
    543                                                    const GeoIntegralPropertyPtr value   ) 
    544 
    545     editMField(PropIndicesFieldMask, _mfPropIndices); 
    546  
    547     MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    548  
    549     //addRef(value); 
    550  
    551     fieldIt += uiIndex; 
    552  
    553     _mfPropIndices.insert(fieldIt, value); 
    554  
    555 //    if(value == NullFC) 
    556 //        return; 
    557 
    558  
    559 void GeometryBase::replaceInPropIndices(      UInt32         uiIndex, 
    560                                                        const GeoIntegralPropertyPtr value   ) 
    561 
    562     if(uiIndex >= _mfPropIndices.size()) 
    563         return; 
    564  
    565     editMField(PropIndicesFieldMask, _mfPropIndices); 
    566  
    567  
    568 //    addRef(value); 
    569 //    subRef(_mfPropIndices[uiIndex]); 
    570  
    571 //    _mfPropIndices[uiIndex] = value; 
    572  
    573       _mfPropIndices.replace(uiIndex, value); 
    574  
    575 //    if(value == NullFC) 
    576 //        return; 
    577 
    578  
    579 void GeometryBase::replaceInPropIndices(const GeoIntegralPropertyPtr pOldElem, 
    580                                                         const GeoIntegralPropertyPtr pNewElem) 
    581 
    582     Int32  elemIdx = _mfPropIndices.findIndex(pOldElem); 
    583  
    584     if(elemIdx != -1) 
     499void GeometryBase::removeFromPropIndices(UInt32 uiIndex) 
     500
     501    if(uiIndex < _mfPropIndices.size()) 
    585502    { 
    586503        editMField(PropIndicesFieldMask, _mfPropIndices); 
    587504 
    588 //        MFGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin(); 
    589  
    590 //        fieldIt += elemIdx; 
    591 //        addRef(pNewElem); 
    592 //        subRef(pOldElem); 
    593  
    594 //        (*fieldIt) = pNewElem; 
    595           _mfPropIndices.replace(elemIdx, pNewElem); 
    596     } 
    597 
    598  
    599 void GeometryBase::removeFromPropIndices(UInt32 uiIndex) 
    600 
    601     if(uiIndex < _mfPropIndices.size()) 
     505        MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
     506 
     507        fieldIt += uiIndex; 
     508 
     509        _mfPropIndices.erase(fieldIt); 
     510    } 
     511
     512 
     513void GeometryBase::removeFromPropIndices(const GeoIntegralPropertyPtr value) 
     514
     515    Int32 iElemIdx = _mfPropIndices.findIndex(value); 
     516 
     517    if(iElemIdx != -1) 
    602518    { 
    603519        editMField(PropIndicesFieldMask, _mfPropIndices); 
     
    605521        MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    606522 
    607         fieldIt += uiIndex; 
    608  
    609         //subRef(*fieldIt); 
    610  
    611         _mfPropIndices.erase(fieldIt); 
    612     } 
    613 } 
    614  
    615 void GeometryBase::removeFromPropIndices(const GeoIntegralPropertyPtr value) 
    616 { 
    617     Int32 iElemIdx = _mfPropIndices.findIndex(value); 
    618  
    619     if(iElemIdx != -1) 
    620     { 
    621         editMField(PropIndicesFieldMask, _mfPropIndices); 
    622  
    623         MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    624  
    625523        fieldIt += iElemIdx; 
    626  
    627         //subRef(*fieldIt); 
    628524 
    629525        _mfPropIndices.erase(fieldIt); 
     
    993889    if(source != NULL) 
    994890    { 
    995  
    996         this->setTypes(source->getTypes()); 
    997  
    998         this->setLengths(source->getLengths()); 
     891        Geometry *pThis = static_cast<Geometry *>(this); 
     892 
     893        pThis->setTypes(source->getTypes()); 
     894 
     895        pThis->setLengths(source->getLengths()); 
    999896 
    1000897        MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesIt  = 
     
    1005902        while(PropertiesIt != PropertiesEnd) 
    1006903        { 
    1007             this->pushToProperties(*PropertiesIt); 
     904            pThis->pushToProperties(*PropertiesIt); 
    1008905 
    1009906            ++PropertiesIt; 
     
    1017914        while(PropIndicesIt != PropIndicesEnd) 
    1018915        { 
    1019             this->pushToPropIndices(*PropIndicesIt); 
     916            pThis->pushToPropIndices(*PropIndicesIt); 
    1020917 
    1021918            ++PropIndicesIt;