From 9a55aad5baecc367244bea15905641496d36e1af Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 11 Jan 2012 09:50:28 +0000 Subject: [PATCH] 0021439: EDF 2004 GEOM, SMESH: Dump of study gives bad geom group and stops with NameError exception fix _pyGen::FindObject() to restore the lost wrapping of hyp creation --- src/SMESH_I/SMESH_2smeshpy.cxx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 2437efbd3..20d18e144 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -243,7 +243,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand MESSAGE ( "## COM " << myNbCommands << ": "<< aCommand->GetString() ); #endif - _pyID objID = aCommand->GetObject(); + const _pyID& objID = aCommand->GetObject(); if ( objID.IsEmpty() ) return aCommand; @@ -251,7 +251,8 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand // Find an object to process theCommand // SMESH_Gen method? - if ( objID == this->GetID() || objID == SMESH_2smeshpy::GenName()) { + if ( objID == this->GetID() || objID == SMESH_2smeshpy::GenName()) + { this->Process( aCommand ); return aCommand; } @@ -831,8 +832,22 @@ void _pyGen::AddObject( Handle(_pyObject)& theObj ) Handle(_pyObject) _pyGen::FindObject( const _pyID& theObjID ) const { - std::map< _pyID, Handle(_pyObject) >::const_iterator id_obj = myObjects.find( theObjID ); - return ( id_obj == myObjects.end() ) ? Handle(_pyObject)() : id_obj->second; + { + map< _pyID, Handle(_pyObject) >::const_iterator id_obj = myObjects.find( theObjID ); + if ( id_obj != myObjects.end() ) + return id_obj->second; + } + { + map< _pyID, Handle(_pyMesh) >::const_iterator id_obj = myMeshes.find( theObjID ); + if ( id_obj != myMeshes.end() ) + return id_obj->second; + } + { + map< _pyID, Handle(_pyMeshEditor) >::const_iterator id_obj = myMeshEditors.find( theObjID ); + if ( id_obj != myMeshEditors.end() ) + return id_obj->second; + } + return Handle(_pyObject)(); } //================================================================================ -- 2.30.2