From: ouv Date: Wed, 2 May 2012 10:55:35 +0000 (+0000) Subject: IPAL22904: TC6.5.0: order of python commands is wrong after dump study X-Git-Tag: V6_5_0b1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46d404fab4bcaba11e1fcef9c0593e594332c3cf;p=modules%2Fgeom.git IPAL22904: TC6.5.0: order of python commands is wrong after dump study --- diff --git a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx index 01cd12806..8577ac995 100644 --- a/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IShapesOperations.cxx @@ -2052,7 +2052,21 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes // Make a Python command anAsciiList.Trunc(anAsciiList.Length() - 1); - GEOM::TPythonDump pd (aMainShape, /*append=*/true); + // IPAL22904: TC6.5.0: order of python commands is wrong after dump study + Handle(TColStd_HSequenceOfTransient) anObjects = new TColStd_HSequenceOfTransient; + for( it = theShapes.begin(); it != theShapes.end(); it++ ) + { + Handle(GEOM_Object) anObj = *it; + if( !anObj.IsNull() ) + anObjects->Append( anObj ); + } + + // Get the function of the latest published object + Handle(GEOM_Function) aFunction = GEOM::GetCreatedLast( anObjects )->GetLastFunction(); + if( aFunction.IsNull() ) // just in case + aFunction = aMainShape; + + GEOM::TPythonDump pd (aFunction, /*append=*/true); pd << "[" << anAsciiList.ToCString() << "] = geompy.GetSharedShapesMulti([";