Fix case of only one link - self-depending link.

This commit is contained in:
akl 2014-06-06 12:42:57 +04:00
parent 178a0726fb
commit 9d9a825049

View File

@ -3122,10 +3122,8 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
anEntries.push_back( aDepEntry ); anEntries.push_back( aDepEntry );
} }
// get dependencies recursively // get dependencies recursively
if ( !depList[j]->_is_equivalent( gbo ) /*avoid self-recursion*/ ) {
getUpwardDependency(depList[j], upLevelList, passedEntries, level+1); getUpwardDependency(depList[j], upLevelList, passedEntries, level+1);
} }
}
if ( level > 0 ) { if ( level > 0 ) {
aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGboEntry, anEntries) ); aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGboEntry, anEntries) );
upLevelList[level-1] = aLevelMap; upLevelList[level-1] = aLevelMap;
@ -3191,9 +3189,7 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGoEntry, anEntries) ); aLevelMap.insert( std::pair<std::string, GEOMUtils::NodeLinks>(aGoEntry, anEntries) );
downLevelList[level] = aLevelMap; downLevelList[level] = aLevelMap;
// get dependencies of the current object recursively // get dependencies of the current object recursively
if ( !depList[i]->_is_equivalent( geomObj ) ) { // avoid self-recursion
getDownwardDependency(geomObj, downLevelList, passedEntries, level+1); getDownwardDependency(geomObj, downLevelList, passedEntries, level+1);
}
break; break;
} }
} }