]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0021672: [CEA 565] Dump Study from script
authoreap <eap@opencascade.com>
Wed, 20 Jun 2012 09:39:13 +0000 (09:39 +0000)
committereap <eap@opencascade.com>
Wed, 20 Jun 2012 09:39:13 +0000 (09:39 +0000)
    Avoid repeated SubShape...() command

src/GEOM/GEOM_Engine.cxx

index 40ac1d97c5bc11517a595be18d1e3ac3f348ac4b..cc284959899b3c6d8c5b285dbfd65abf269ba376 100644 (file)
@@ -219,7 +219,7 @@ void GEOM_Engine::SetEngine(GEOM_Engine* theEngine) { TheEngine = theEngine; }
 GEOM_Engine::GEOM_Engine()
 {
   TFunction_DriverTable::Get()->AddDriver(GEOM_Object::GetSubShapeID(), new GEOM_SubShapeDriver());
-
+  
   _OCAFApp = new GEOM_Application();
   _UndoLimit = 10;
 }
@@ -671,7 +671,15 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
         continue;
       // add function description before dump
       if (!aCurScript.IsEmpty())
+      {
+        if ( aFunction->GetDriverGUID() == GEOM_Object::GetSubShapeID() )
+          // avoid repeated SubShape...() command at the end
+          if (aFuncScript.Location( aCurScript,
+                                    aFuncScript.Length() - aCurScript.Length(),
+                                    aFuncScript.Length()))
+              continue;
         aFuncScript += aCurScript;
+      }
       if (isDumpCollected ) {
         // Replace entries by the names
         ReplaceEntriesByNames( aFuncScript, aEntry2ObjData, isPublished,