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

changed: base rebuild

Files:

Legend:

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

    r1185 r1193  
    275275    "        category=\"childpointer\"\n" 
    276276    "        childParentType=\"FieldContainer\"\n" 
    277     "        checkNilPtr=\"false\"\n" 
    278277    "        linkParentField=\"Parents\"\n" 
    279278    "\t>\n" 
     
    289288    "        category=\"childpointer\"\n" 
    290289    "        childParentType=\"FieldContainer\"\n" 
    291     "        checkNilPtr=\"false\"\n" 
    292290    "        linkParentField=\"Parents\"\n" 
    293291    "\t>\n" 
     
    357355} 
    358356 
     357SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFTypes          (void) 
     358{ 
     359    editSField(TypesFieldMask); 
     360 
     361    return &_sfTypes; 
     362} 
     363 
    359364//! Get the Geometry::_sfLengths field. 
    360365const SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getSFLengths(void) const 
     
    363368} 
    364369 
     370SFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editSFLengths        (void) 
     371{ 
     372    editSField(LengthsFieldMask); 
     373 
     374    return &_sfLengths; 
     375} 
     376 
    365377//! Get the Geometry::_mfProperties field. 
    366378const MFUnrecChildGeoVectorPropertyPtr *GeometryBase::getMFProperties(void) const 
     
    369381} 
    370382 
     383MFUnrecChildGeoVectorPropertyPtr *GeometryBase::editMFProperties     (void) 
     384{ 
     385    editMField(PropertiesFieldMask, _mfProperties); 
     386 
     387    return &_mfProperties; 
     388} 
     389 
    371390//! Get the Geometry::_mfPropIndices field. 
    372391const MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::getMFPropIndices(void) const 
     
    375394} 
    376395 
     396MFUnrecChildGeoIntegralPropertyPtr *GeometryBase::editMFPropIndices    (void) 
     397{ 
     398    editMField(PropIndicesFieldMask, _mfPropIndices); 
     399 
     400    return &_mfPropIndices; 
     401} 
     402 
    377403SFBool *GeometryBase::editSFDlistCache(void) 
    378404{ 
     
    438464    editMField(PropertiesFieldMask, _mfProperties); 
    439465 
    440     //addRef(value); 
    441  
    442466    _mfProperties.push_back(value); 
    443  
    444 //    if(value == NullFC) 
    445 //        return; 
    446467} 
    447468 
     
    463484} 
    464485 
    465 void GeometryBase::insertIntoProperties(      UInt32         uiIndex, 
    466                                                    const GeoVectorPropertyPtr value   ) 
     486void GeometryBase::removeFromProperties(UInt32 uiIndex) 
     487
     488    if(uiIndex < _mfProperties.size()) 
     489    { 
     490        editMField(PropertiesFieldMask, _mfProperties); 
     491 
     492        MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
     493 
     494        fieldIt += uiIndex; 
     495 
     496        _mfProperties.erase(fieldIt); 
     497    } 
     498
     499 
     500void GeometryBase::removeFromProperties(const GeoVectorPropertyPtr value) 
     501
     502    Int32 iElemIdx = _mfProperties.findIndex(value); 
     503 
     504    if(iElemIdx != -1) 
     505    { 
     506        editMField(PropertiesFieldMask, _mfProperties); 
     507 
     508        MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
     509 
     510        fieldIt += iElemIdx; 
     511 
     512        _mfProperties.erase(fieldIt); 
     513    } 
     514
     515void GeometryBase::clearProperties(void) 
    467516{ 
    468517    editMField(PropertiesFieldMask, _mfProperties); 
    469518 
    470     MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    471  
    472     //addRef(value); 
    473  
    474     fieldIt += uiIndex; 
    475  
    476     _mfProperties.insert(fieldIt, value); 
    477  
    478 //    if(value == NullFC) 
    479 //        return; 
    480 } 
    481  
    482 void GeometryBase::replaceInProperties(      UInt32         uiIndex, 
    483                                                        const GeoVectorPropertyPtr value   ) 
    484 { 
    485     if(uiIndex >= _mfProperties.size()) 
    486         return; 
    487  
    488     editMField(PropertiesFieldMask, _mfProperties); 
    489  
    490  
    491 //    addRef(value); 
    492 //    subRef(_mfProperties[uiIndex]); 
    493  
    494 //    _mfProperties[uiIndex] = value; 
    495  
    496       _mfProperties.replace(uiIndex, value); 
    497  
    498 //    if(value == NullFC) 
    499 //        return; 
    500 } 
    501  
    502 void GeometryBase::replaceInProperties(const GeoVectorPropertyPtr pOldElem, 
    503                                                         const GeoVectorPropertyPtr pNewElem) 
    504 { 
    505     Int32  elemIdx = _mfProperties.findIndex(pOldElem); 
    506  
    507     if(elemIdx != -1) 
    508     { 
    509         editMField(PropertiesFieldMask, _mfProperties); 
    510  
    511 //        MFGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin(); 
    512  
    513 //        fieldIt += elemIdx; 
    514 //        addRef(pNewElem); 
    515 //        subRef(pOldElem); 
    516  
    517 //        (*fieldIt) = pNewElem; 
    518           _mfProperties.replace(elemIdx, pNewElem); 
    519     } 
    520 } 
    521  
    522 void GeometryBase::removeFromProperties(UInt32 uiIndex) 
    523 { 
    524     if(uiIndex < _mfProperties.size()) 
    525     { 
    526         editMField(PropertiesFieldMask, _mfProperties); 
    527  
    528         MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    529  
    530         fieldIt += uiIndex; 
    531  
    532         //subRef(*fieldIt); 
    533  
    534         _mfProperties.erase(fieldIt); 
    535     } 
    536 } 
    537  
    538 void GeometryBase::removeFromProperties(const GeoVectorPropertyPtr value) 
    539 { 
    540     Int32 iElemIdx = _mfProperties.findIndex(value); 
    541  
    542     if(iElemIdx != -1) 
    543     { 
    544         editMField(PropertiesFieldMask, _mfProperties); 
    545  
    546         MFUnrecChildGeoVectorPropertyPtr::iterator fieldIt = _mfProperties.begin_nc(); 
    547  
    548         fieldIt += iElemIdx; 
    549  
    550         //subRef(*fieldIt); 
    551  
    552         _mfProperties.erase(fieldIt); 
    553     } 
    554 } 
    555 void GeometryBase::clearProperties(void) 
    556 { 
    557     editMField(PropertiesFieldMask, _mfProperties); 
    558  
    559519 
    560520    _mfProperties.clear(); 
     
    565525    editMField(PropIndicesFieldMask, _mfPropIndices); 
    566526 
    567     //addRef(value); 
    568  
    569527    _mfPropIndices.push_back(value); 
    570  
    571 //    if(value == NullFC) 
    572 //        return; 
    573528} 
    574529 
     
    590545} 
    591546 
    592 void GeometryBase::insertIntoPropIndices(      UInt32         uiIndex, 
    593                                                    const GeoIntegralPropertyPtr value   ) 
    594 
    595     editMField(PropIndicesFieldMask, _mfPropIndices); 
    596  
    597     MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    598  
    599     //addRef(value); 
    600  
    601     fieldIt += uiIndex; 
    602  
    603     _mfPropIndices.insert(fieldIt, value); 
    604  
    605 //    if(value == NullFC) 
    606 //        return; 
    607 
    608  
    609 void GeometryBase::replaceInPropIndices(      UInt32         uiIndex, 
    610                                                        const GeoIntegralPropertyPtr value   ) 
    611 
    612     if(uiIndex >= _mfPropIndices.size()) 
    613         return; 
    614  
    615     editMField(PropIndicesFieldMask, _mfPropIndices); 
    616  
    617  
    618 //    addRef(value); 
    619 //    subRef(_mfPropIndices[uiIndex]); 
    620  
    621 //    _mfPropIndices[uiIndex] = value; 
    622  
    623       _mfPropIndices.replace(uiIndex, value); 
    624  
    625 //    if(value == NullFC) 
    626 //        return; 
    627 
    628  
    629 void GeometryBase::replaceInPropIndices(const GeoIntegralPropertyPtr pOldElem, 
    630                                                         const GeoIntegralPropertyPtr pNewElem) 
    631 
    632     Int32  elemIdx = _mfPropIndices.findIndex(pOldElem); 
    633  
    634     if(elemIdx != -1) 
     547void GeometryBase::removeFromPropIndices(UInt32 uiIndex) 
     548
     549    if(uiIndex < _mfPropIndices.size()) 
    635550    { 
    636551        editMField(PropIndicesFieldMask, _mfPropIndices); 
    637552 
    638 //        MFGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin(); 
    639  
    640 //        fieldIt += elemIdx; 
    641 //        addRef(pNewElem); 
    642 //        subRef(pOldElem); 
    643  
    644 //        (*fieldIt) = pNewElem; 
    645           _mfPropIndices.replace(elemIdx, pNewElem); 
    646     } 
    647 
    648  
    649 void GeometryBase::removeFromPropIndices(UInt32 uiIndex) 
    650 
    651     if(uiIndex < _mfPropIndices.size()) 
     553        MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
     554 
     555        fieldIt += uiIndex; 
     556 
     557        _mfPropIndices.erase(fieldIt); 
     558    } 
     559
     560 
     561void GeometryBase::removeFromPropIndices(const GeoIntegralPropertyPtr value) 
     562
     563    Int32 iElemIdx = _mfPropIndices.findIndex(value); 
     564 
     565    if(iElemIdx != -1) 
    652566    { 
    653567        editMField(PropIndicesFieldMask, _mfPropIndices); 
     
    655569        MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    656570 
    657         fieldIt += uiIndex; 
    658  
    659         //subRef(*fieldIt); 
    660  
    661         _mfPropIndices.erase(fieldIt); 
    662     } 
    663 } 
    664  
    665 void GeometryBase::removeFromPropIndices(const GeoIntegralPropertyPtr value) 
    666 { 
    667     Int32 iElemIdx = _mfPropIndices.findIndex(value); 
    668  
    669     if(iElemIdx != -1) 
    670     { 
    671         editMField(PropIndicesFieldMask, _mfPropIndices); 
    672  
    673         MFUnrecChildGeoIntegralPropertyPtr::iterator fieldIt = _mfPropIndices.begin_nc(); 
    674  
    675571        fieldIt += iElemIdx; 
    676  
    677         //subRef(*fieldIt); 
    678572 
    679573        _mfPropIndices.erase(fieldIt); 
     
    1057951    if(source != NULL) 
    1058952    { 
    1059  
    1060         this->setTypes(source->getTypes()); 
    1061  
    1062         this->setLengths(source->getLengths()); 
     953        Geometry *pThis = static_cast<Geometry *>(this); 
     954 
     955        pThis->setTypes(source->getTypes()); 
     956 
     957        pThis->setLengths(source->getLengths()); 
    1063958 
    1064959        MFUnrecChildGeoVectorPropertyPtr::const_iterator PropertiesIt  = 
     
    1069964        while(PropertiesIt != PropertiesEnd) 
    1070965        { 
    1071             this->pushToProperties(*PropertiesIt); 
     966            pThis->pushToProperties(*PropertiesIt); 
    1072967 
    1073968            ++PropertiesIt; 
     
    1081976        while(PropIndicesIt != PropIndicesEnd) 
    1082977        { 
    1083             this->pushToPropIndices(*PropIndicesIt); 
     978            pThis->pushToPropIndices(*PropIndicesIt); 
    1084979 
    1085980            ++PropIndicesIt;