From 9fa65460e9a374520c7cb62a9618d5518e47081c Mon Sep 17 00:00:00 2001 From: ptv Date: Tue, 13 Jan 2009 13:04:50 +0000 Subject: [PATCH] fix bug with algorithm and his hypothesis in case of new created study (not imported from python script) --- src/SMESH_I/SMESH_2smeshpy.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 91332d7ed..46997e201 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1368,6 +1368,8 @@ bool _pyHypothesis::Addition2Creation( const Handle(_pyCommand)& theCmd, algo = theGen->FindAlgo( myGeom, theMesh, this ); if ( algo.IsNull() ) return false; + // attach hypothesis creation command to be after algo creation command + // because it can be new created instance of algorithm algo->GetCreationCmd()->AddDependantCmd( theCmd ); } myIsWrapped = true; @@ -1386,10 +1388,10 @@ bool _pyHypothesis::Addition2Creation( const Handle(_pyCommand)& theCmd, } // set a new creation command GetCreationCmd()->Clear(); - // set dependance between creation and addition to mesh - // SetCreationCmd( theCmd ); - GetCreationCmd()->AddDependantCmd( theCmd ); - + // replace creation command by wrapped instance + // please note, that hypothesis attaches to algo creation command (see upper) + SetCreationCmd( theCmd ); + // clear commands setting arg values list < Handle(_pyCommand) >::iterator argCmd = myArgCommands.begin(); -- 2.39.2