]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL13966 ScalarMap_ON_GROUP_3_2_0 mergeto_V3_2_0_maintainance_30Nov06
authorenk <enk@opencascade.com>
Fri, 24 Nov 2006 14:38:36 +0000 (14:38 +0000)
committerenk <enk@opencascade.com>
Fri, 24 Nov 2006 14:38:36 +0000 (14:38 +0000)
enk/PRSMERGER: dump python of presentations on groups works wrong

src/VISU_I/VISU_DumpPython.cc

index 6b83971170bdb34e2430f3e934b90c7cdc2dddaf..98e197c8e0b5d24702a30b4e21eb73ba68bba95c 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Mesh_i.hh"
+#include "VISU_PrsMerger_i.hh"
 #include "VISU_ScalarMap_i.hh"
 #include "VISU_IsoSurfaces_i.hh"
 #include "VISU_DeformedShape_i.hh"
@@ -249,7 +250,27 @@ namespace VISU
     return thePrefix;
   }
 
-
+  //===========================================================================
+  std::string
+  PrsMergerToPython(SALOMEDS::SObject_ptr theSObject,
+                   VISU::PrsMerger_i* theServant,
+                   std::ostream& theStr,
+                   std::string& theName,
+                   const std::string& theConstructorName,
+                   const std::string& theArgumentName,
+                   std::string thePrefix)
+  {
+    thePrefix = ScalarMapToPython(theSObject,theServant,theStr,theName,theConstructorName,theArgumentName,thePrefix);
+    string_array_var aGroupNames = theServant->getGroupNames();
+    for(int i=0; i<aGroupNames->length(); i++)
+      {
+       theStr<<thePrefix<<theName<<".AddMeshOnGroup('"
+             <<theServant->GetMeshName()<<"','"
+             <<aGroupNames[i]<<"')"<<endl;
+      }
+    return thePrefix;
+  }
+  
   //===========================================================================
   std::string
   DeformedShapeToPython(SALOMEDS::SObject_ptr theSObject,
@@ -715,6 +736,12 @@ namespace VISU
            return;
           }
           break;
+        case VISU::TPRSMERGER:
+          if(PrsMerger_i* aServant = dynamic_cast<PrsMerger_i*>(GetServant(anObj).in())){
+           thePrefix = PrsMergerToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);
+           theStr<<thePrefix<<"pass"<<endl<<endl;
+          }
+          return;
         case VISU::TSCALARMAP:
           if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(GetServant(anObj).in())){
            thePrefix = ScalarMapToPython(theSObject,aServant,theStr,aName,"ScalarMapOnField",theArgumentName,thePrefix);