From: akl Date: Mon, 2 Jun 2014 13:30:05 +0000 (+0400) Subject: Correct checking objects. X-Git-Tag: V7_5_0a1~50^2~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d2cf8fc7f2a74179cedb626f7463da23534142da;p=modules%2Fgeom.git Correct checking objects. --- diff --git a/src/GEOM_I/GEOM_Gen_i.cc b/src/GEOM_I/GEOM_Gen_i.cc index a12db0011..f6c82c869 100755 --- a/src/GEOM_I/GEOM_Gen_i.cc +++ b/src/GEOM_I/GEOM_Gen_i.cc @@ -3055,6 +3055,8 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy, for ( int i = 0; i < theObjectIORs.length(); i++ ) { ior = theObjectIORs[i].in(); GEOM::GEOM_BaseObject_var anObj = GetObject( theStudy->StudyId(), ior.c_str() ); + if ( anObj->_is_nil() ) + continue; GEOMUtils::LevelsList upLevelList; getUpwardDependency( anObj, upLevelList ); GEOMUtils::LevelsList downLevelList; @@ -3073,6 +3075,7 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy, SALOMEDS::TMPFile_var aStream = new SALOMEDS::TMPFile(aBufferSize, aBufferSize, anOctetBuf, 1); + //std::cout << "AKL: end of get" << endl; return aStream._retn(); } @@ -3107,12 +3110,15 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo, } GEOM::ListOfGBO_var depList = gbo->GetDependency(); for( int j = 0; j < depList->length(); j++ ) { + if ( depList[j]->_is_nil() ) + continue; if ( level > 0 ) { anIORs.push_back( depList[j]->GetEntry() ); //std::cout << "AKL: add link ior: " << depList[j]->GetEntry() << endl; } //std::cout << "AKL: <<<<<<<< start next step: " << endl; - if ( !depList[j]->IsSame( gbo ) ) { + //if ( !depList[j]->IsSame( gbo ) ) { + if ( !depList[j]->_is_equivalent( gbo ) ) { getUpwardDependency(depList[j], upLevelList, level+1); } //std::cout << "AKL: end next step >>>>>>>> : " << endl; @@ -3185,8 +3191,11 @@ void GEOM_Gen_i::getDownwardDependency( SALOMEDS::Study_ptr theStudy, //cout << "check " << aGoIOR << endl; for( int i = 0; i < depList->length(); i++ ) { + if ( depList[i]->_is_nil() ) + continue; //cout << "depends on " << depList[i]->GetEntry() << endl; - if ( depList[i]->IsSame( gbo ) ) { + //if ( depList[i]->IsSame( gbo ) ) { + if ( depList[i]->_is_equivalent( gbo ) ) { //cout << " the same! " << endl; //if ( level > 0 ) { GEOMUtils::NodeLinks anIORs; @@ -3205,7 +3214,8 @@ void GEOM_Gen_i::getDownwardDependency( SALOMEDS::Study_ptr theStudy, aLevelMap.insert( std::pair(aGoIOR, anIORs) ); downLevelList[level] = aLevelMap; //} - if ( !depList[i]->IsSame( geomObj ) ) { + //if ( !depList[i]->IsSame( geomObj ) ) { + if ( !depList[i]->_is_equivalent( geomObj ) ) { //cout << " go on! " << endl; getDownwardDependency(theStudy, geomObj, downLevelList, level+1); }