]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for Bug IPAL15173
authorapo <apo@opencascade.com>
Thu, 17 May 2007 07:05:39 +0000 (07:05 +0000)
committerapo <apo@opencascade.com>
Thu, 17 May 2007 07:05:39 +0000 (07:05 +0000)
 - IOLS.3D Cache Sysytem item in Object Browser does not save when Dump Study.
(restored the lost code)

src/VISU_I/VISU_DumpPython.cc

index 49736c11ef65b951dd8b25fb3e6087811e83b5fe..30742d9d014c785618f7e711c0c6239f259b1d7e 100644 (file)
@@ -41,6 +41,8 @@
 #include "VISU_Table_i.hh"
 #include "VISU_GaussPoints_i.hh"
 #include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_ColoredPrs3dCache_i.hh"
+#include "VISU_ColoredPrs3dHolder_i.hh"
 
 #include "utilities.h"
 
@@ -59,6 +61,8 @@ namespace VISU
 {
   static std::string PREFIX("  ");
 
+  static std::string aResultName;
+
   typedef std::map<std::string,std::string> TName2EntryMap;
   typedef std::map<std::string,std::string> TEntry2NameMap;
 
@@ -534,6 +538,7 @@ namespace VISU
         switch(aType){
         case VISU::TRESULT:
           if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+           aResultName = aName;
            std::string aFileName = aServant->GetFileName();
            Result_i::ECreationId anId = aServant->GetCreationId();
            if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
@@ -1111,6 +1116,36 @@ namespace VISU
            }
           }
           return;
+        case VISU::TCOLOREDPRS3DCACHE:
+          if(ColoredPrs3dCache_i* aServant = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(anObj).in())){
+           theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
+           TColoredPrs3dHolderMap aHolderMap = aServant->GetHolderMap();
+           TColoredPrs3dHolderMap::const_iterator aHolderIter = aHolderMap.begin();
+           TColoredPrs3dHolderMap::const_iterator aHolderIterEnd = aHolderMap.end();
+           for(; aHolderIter != aHolderIterEnd; aHolderIter++){
+             const TLastVisitedPrsList& aPrsList = aHolderIter->second;
+             if(TPrs3dPtr aPrs3d = aPrsList.front())
+             {
+               ColoredPrs3dHolder::BasicInput_var anInput = aPrs3d->GetBasicInput();
+
+               std::string anEntity;
+               switch(anInput->myEntity){
+                 case VISU::NODE : anEntity = "VISU.NODE"; break;
+                 case VISU::EDGE : anEntity = "VISU.EDGE"; break;
+                 case VISU::FACE : anEntity = "VISU.FACE"; break;
+                 case VISU::CELL : anEntity = "VISU.CELL"; break;
+               }
+
+               theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<aResultName<<",'"<<
+                 anInput->myMeshName<<"',"<<anEntity<<",'"<<
+                 anInput->myFieldName<<"',"<<anInput->myTimeStampNumber<<")"<<endl;
+
+               std::string aType = aPrs3d->GetComment();
+               theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aType<<",anInput)"<<endl<<endl;
+             }
+           }
+          }
+          return;
        }
       }
     } else { /*if(!CORBA::is_nil(anObj))*/