]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix on Bug12140
authorapo <apo@opencascade.com>
Tue, 18 Apr 2006 08:35:31 +0000 (08:35 +0000)
committerapo <apo@opencascade.com>
Tue, 18 Apr 2006 08:35:31 +0000 (08:35 +0000)
   Not sufficient resoring GUI state

src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_Result_i.cc

index d85247b98d5f0e4333b470a2bf133450a31f66a2..cb2d5b52dcfc3c839c0548ed5ad563f4001b0c39 100644 (file)
@@ -55,7 +55,8 @@
 
 using namespace std;
 
-namespace VISU{
+namespace VISU
+{
   static std::string PREFIX("  ");
 
   typedef std::map<std::string,std::string> TName2EntryMap;
@@ -530,14 +531,28 @@ namespace VISU{
            if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
              switch(anId){
              case Result_i::eImportFile:
-               theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+               //theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
+               theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
+
+               theStr<<thePrefix<<aName<<".SetBuildGroups("<<
+                 aServant->IsGroupsDone()<<")"<<
+                 endl;
+
+               theStr<<thePrefix<<aName<<".SetBuildFields("<<
+                 aServant->IsFieldsDone()<<","<<
+                 aServant->IsMinMaxDone()<<")"<<
+                 endl;
+
+               theStr<<thePrefix<<aName<<".Build(0,1)"<<endl;
+
+               theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
                break;
              case Result_i::eCopyAndImportFile:
                theStr<<thePrefix<<aName<<" = aVisu.CopyAndImportFile('"<<aFileName<<"')"<<endl;
+               theStr<<thePrefix<<"if "<<aName<<":"<<endl;
                break;
              }
 
-             theStr<<thePrefix<<"if "<<aName<<":"<<endl;
              thePrefix += PREFIX;
 
              theArgumentName = aName;
index 60cb15c822fc3282fdf29da47f872319f8970592..0ce2588c47f94a4268defc693d9abb2128c9d873 100644 (file)
@@ -432,28 +432,26 @@ namespace VISU
                         aComment.latin1(),
                         true);
 
-      if(!theIsAtOnce){
-       if(theIsBuildGroups){
-         aMesh->myGroupsEntry =
-           CreateAttributes(theStudy,
-                            aMesh->myEntry,
-                            "",
-                            "",
-                            "",
-                            true);
-       }
+      if(theIsBuildGroups){
+       aMesh->myGroupsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          "",
+                          "",
+                          "",
+                          true);
+      }
        
-       if(theIsBuildFields){
-         aMesh->myFieldsEntry =
-           CreateAttributes(theStudy,
-                            aMesh->myEntry,
-                            "",
-                            "",
-                            "",
-                            true);
-       }
+      if(theIsBuildFields){
+       aMesh->myFieldsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          "",
+                          "",
+                          "",
+                          true);
       }
-
+      
       //Import entities
       TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
@@ -558,20 +556,11 @@ namespace VISU
        aComment.sprintf("myComment=GROUPS;myMeshName=%s",
                         aMeshName.c_str());
 
-       if(theIsAtOnce)
-         aMesh->myGroupsEntry =
-           CreateAttributes(theStudy,
-                            aMesh->myEntry,
-                            "",
-                            "Groups",
-                            aComment.latin1(),
-                            true);
-       else
-         UpdateAttributes(theStudy,
-                          aMesh->myGroupsEntry,
-                          "",
-                          "Groups",
-                          aComment.latin1());
+       UpdateAttributes(theStudy,
+                        aMesh->myGroupsEntry,
+                        "",
+                        "Groups",
+                        aComment.latin1());
 
        TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
        for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
@@ -649,20 +638,11 @@ namespace VISU
            aComment.sprintf("myComment=FIELDS;myMeshName=%s",
                             aMeshName.c_str());
 
-           if(theIsAtOnce)
-             aMesh->myFieldsEntry =
-               CreateAttributes(theStudy,
-                                aMesh->myEntry,
-                                "",
-                                "Fields",
-                                aComment.latin1(),
-                                true);
-           else
-             UpdateAttributes(theStudy,
-                              aMesh->myFieldsEntry,
-                              "",
-                              "Fields",
-                              aComment.latin1());
+           UpdateAttributes(theStudy,
+                            aMesh->myFieldsEntry,
+                            "",
+                            "Fields",
+                            aComment.latin1());
 
            anIsFieldsEntryUpdated = true;
          }