From 2d1f6f1ea0914062cbc764f23d096aaa7159a33b Mon Sep 17 00:00:00 2001 From: srn Date: Wed, 8 Feb 2006 14:36:58 +0000 Subject: [PATCH] added a support for visual state dumping --- src/VISU_I/VISU_DumpPython.cc | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/VISU_I/VISU_DumpPython.cc b/src/VISU_I/VISU_DumpPython.cc index 91b8ef80..27f59c24 100644 --- a/src/VISU_I/VISU_DumpPython.cc +++ b/src/VISU_I/VISU_DumpPython.cc @@ -49,6 +49,10 @@ #include #include +#include +#include +#include + //#define COUT using namespace std; @@ -1170,6 +1174,41 @@ namespace VISU{ VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix); VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix); + + + _PTR(Study) study(new SALOMEDS_Study(aStudy)); + int savePoint = SALOMEDS_IParameters::getLastSavePoint(study, "Interface Applicative"); + if(savePoint > 0) { + SALOMEDS_IParameters ip = SALOMEDS_IParameters(study->GetCommonParameters("Interface Applicative", savePoint)); + if(ip.isDumpPython()) { + ip = SALOMEDS_IParameters(study->GetModuleParameters("Interface Applicative", "Post-Pro", savePoint)); + + aStr << aPrefix << "import iparameters" << endl; + aStr << aPrefix << "ipar = iparameters.IParameters(salome.myStudy.GetModuleParameters(\"Interface Applicative\", 1))\n\n"; + + + vector v = ip.getProperties(); + if(v.size() > 0) { + aStr << aPrefix << "#Set up visual properties:\n"; + for(int i = 0; i 0) { + aStr << aPrefix << "#Set up lists:\n"; + for(int i = 0; i lst = ip.getValues(v[i]); + aStr << aPrefix << "# fill list " << v[i] << "\n"; + for(int j = 0; j < lst.size(); j++) + aStr << aPrefix << "ipar.append(\"" << v[i] << "\", \"" << lst[j] << "\")\n"; + } + } + } + } + aStr<