]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for the bug IPAL22821: Plot2D and gauss points are not shown after loading export... V6_main_20111207 V6_main_20111208 V6_main_20111212
authorana <ana@opencascade.com>
Tue, 6 Dec 2011 15:14:16 +0000 (15:14 +0000)
committerana <ana@opencascade.com>
Tue, 6 Dec 2011 15:14:16 +0000 (15:14 +0000)
src/VISU_I/VISU_DumpPython.cc
src/VISU_SWIG/visu.py

index e0a7b42eafeaec49c680a9cd01f82c086ce68776..f83b35e5c8373783fe96973255ad3a5ddd2f796f 100644 (file)
@@ -2427,6 +2427,33 @@ namespace VISU
                                 aStr,
                                 aPrefix);
     
+  if (theIsPublished)
+  {
+    SALOMEDS::AttributeParameter_var ap = aStudy->GetModuleParameters("Interface Applicative", "Post-Pro", -1);
+       if(!CORBA::is_nil(ap)) {
+      std::map<std::string,std::string>::iterator it = aEntry2NameMap.begin();
+      for( ;it != aEntry2NameMap.end(); it++ ) {
+        //1. Encode entry
+        if ( ((*it).first).length() < 7 ) continue;
+           std::string tail( (*it).first, 6, ((*it).first).length()-1 );
+           std::string newEntry(ComponentDataType());
+           newEntry+=("_"+tail);
+       
+           CORBA::String_var anEntry = CORBA::string_dup(newEntry.c_str());
+
+        if( ap->IsSet(anEntry, 6) ) { //6 Means string array, see SALOMEDS_Attributes.idl AttributeParameter interface
+             std::string idCommand = std::string("visu.getObjectID(") + (*it).second + std::string(")");
+             SALOMEDS::StringSeq_var aSeq= ap->GetStrArray(anEntry);
+             int oldLenght = aSeq->length();   
+             aSeq->length(oldLenght+2);
+             aSeq[oldLenght] = CORBA::string_dup("_PT_OBJECT_ID_");
+             aSeq[oldLenght + 1] = CORBA::string_dup(idCommand.c_str());
+             ap->SetStrArray( anEntry, aSeq );
+           }
+         }
+       }
+  }
+    
     
     //Output the script that sets up the visul parameters.
     if(theIsPublished) {
index cb462c01c9882befc3bdd6f4b4a67d405160fc41..dbbaf05d73e96dfbdfaa0853403217976fa98698 100644 (file)
@@ -38,6 +38,7 @@ import SALOME_ModuleCatalog
 from omniORB import CORBA
 from string import *
 from time import sleep
+from salome import ObjectToID
 
 myORB = None
 myNamingService = None
@@ -127,6 +128,17 @@ def IntToEntity(theInt) :
         return VISU.FACE;
     else :
         return VISU.CELL;
+
+def getObjectID(obj):
+   ID = ""
+   entry = ObjectToID(obj)
+   if entry is not None:
+       lst = entry.split(":")
+       if len(entry) > 6:
+               ID = entry[6:]            
+               return "VISU_" + ID
+       return ID
+
         
 def HasValue(theList, theValue) :
     try :