]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
IPAL22904: TC6.5.0: order of python commands is wrong after dump study
authorouv <ouv@opencascade.com>
Wed, 2 May 2012 10:55:35 +0000 (10:55 +0000)
committerouv <ouv@opencascade.com>
Wed, 2 May 2012 10:55:35 +0000 (10:55 +0000)
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx

index 01cd1280606b7177c1db0cd495c265684bbf9d27..8577ac995a8aa058c1fec557dea92268abbb6fb1 100644 (file)
@@ -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([";