]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
iplemented method getPythonDump
authorsrn <srn@opencascade.com>
Tue, 7 Feb 2006 11:57:11 +0000 (11:57 +0000)
committersrn <srn@opencascade.com>
Tue, 7 Feb 2006 11:57:11 +0000 (11:57 +0000)
src/SalomeApp/SalomeApp_Study.cxx

index 4233e598ab48e3a13c3e1c105b6fee93d2d58c71..80b9a15c860289f4e9bf48125469ab81c1221269 100644 (file)
@@ -853,6 +853,39 @@ QString SalomeApp_Study::getVisulDump(int savePoint)
 {
   _PTR(AttributeParameter) ap = studyDS()->GetCommonParameters("Interface Applicative", savePoint);
   SALOMEDS_IParameters ip(ap);
+
+  /*
+  char buffer[127];
+  sprintf(buffer,"%d", savePoint);
+  QString sp(buffer);
+  */
+
   ip.setDumpPython(true); //Enable DumpPython of visual parameters for modules.
-  return "";
+  QString dump("");
+
+  dump += "import iparameters\n";
+  dump += "ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters(\"Interface Applicative\", 1))\n\n";
+  
+  
+  vector<string> v = ip.getProperties();
+  if(v.size() > 0) {
+    dump += "#Set up visual properties:\n";
+    for(int i = 0; i<v.size(); i++) {
+      string prp = ip.getProperty(v[i]);
+      dump += "ipar.setProperty(\""+v[i]+"\", \""+prp+"\")\n";
+    }
+  }
+
+  v = ip.getLists();
+  if(v.size() > 0) {
+    dump += "#Set up lists:\n";
+    for(int i = 0; i<v.size(); i++) {
+      vector<string> lst = ip.getValues(v[i]);
+      dump += "# fill list "+v[i]+"\n";
+      for(int j = 0; j < lst.size(); j++)
+       dump += "ipar.append(\""+v[i]+"\", \""+lst[j]+"\")\n";
+    }
+  }
+
+  return dump;
 }