]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To refactor creation ColoredPrs3d
authorapo <apo@opencascade.com>
Thu, 23 Nov 2006 15:14:43 +0000 (15:14 +0000)
committerapo <apo@opencascade.com>
Thu, 23 Nov 2006 15:14:43 +0000 (15:14 +0000)
29 files changed:
idl/VISU_Gen.idl
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Displayer.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/Makefile.in
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3dFactory.cc [new file with mode: 0644]
src/VISU_I/VISU_ColoredPrs3dFactory.hh [new file with mode: 0644]
src/VISU_I/VISU_ColoredPrs3dHolder_i.cc
src/VISU_I/VISU_ColoredPrs3dHolder_i.hh
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_PrsObject_i.cc
src/VISU_I/VISU_PrsObject_i.hh
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Table_i.hh
src/VISU_I/VISU_ViewManager_i.cc
src/VISU_I/VISU_View_i.cc
src/VISU_SWIG/visu_cache.py

index 51da0b6ebace42c81ee8b71348205946edda592a..c6f073d17389f34f215232d6daeb643a455c77b8 100644 (file)
@@ -625,29 +625,27 @@ module VISU {
    * This interface is responsible for memory management of 3d presentations.
    * One cache corresponds to one study.
    */
-  interface ColoredPrs3dCache : PrsObject, SALOME::GenericObj
+  interface ColoredPrs3dCache : RemovableObject, SALOME::GenericObj
   {
-    /*!
-     * This enumeration contains the cache memory modes.
-     */
+    /*! This enumeration contains the cache memory modes. */
     enum MemoryMode {
       MINIMAL, /*!< Minimal memory mode (default behaviour). */
       LIMITED  /*!< Limited memory mode (fixed memory size for presentations). */
     };
 
-    /*!
-     * Sets a memory mode.
-     */
+    /*! Sets a memory mode.*/
     void SetMemoryMode(in MemoryMode theMode);
 
-    /*!
-     * Sets a memory size for limited mode.
-     */
+    /*! Gets a memory mode.*/
+    MemoryMode GetMemoryMode();
+
+    /*! Sets a memory size for limited mode. */
     void SetLimitedMemory(in long theMemorySize);
 
-    /*!
-     * Creates %ColoredPrs3dHolder.
-     */
+    /*! Gets a memory size for limited mode. */
+    long GetLimitedMemory();
+
+    /*! Creates %ColoredPrs3dHolder.*/
     ColoredPrs3dHolder CreateHolder(in VISUType theType,
                                    in ColoredPrs3dHolder::BasicInput theInput);
   };
@@ -1632,7 +1630,7 @@ module VISU {
      */
     ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName,
                               in Entity theEntity, in string theFieldName,
-                              in double theIteration);
+                              in long theIteration);
 
     /*!
      * Creates a Gauss Points presentation.
@@ -1644,7 +1642,7 @@ module VISU {
      */
     GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in double theIteration);
+                                  in long theIteration);
 
     /*!
      * Creates a deformed shape presentation.
@@ -1656,7 +1654,7 @@ module VISU {
      */
     DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName,
                                       in Entity theEntity, in string theFieldName,
-                                      in double theIteration);
+                                      in long theIteration);
 
     /*!
      * Creates a deformed shape presentation.
@@ -1668,7 +1666,7 @@ module VISU {
      */
     ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
                                                             in Entity theEntity, in string theFieldName,
-                                                            in double theIteration);
+                                                            in long theIteration);
 
     /*!
      * Creates a vector presentation.
@@ -1680,7 +1678,7 @@ module VISU {
      */
     Vectors VectorsOnField(in Result theResult, in string theMeshName,
                           in Entity theEntity, in string theFieldName,
-                          in double theIteration);
+                          in long theIteration);
 
     /*!
      * Creates an iso surface presentation.
@@ -1692,7 +1690,7 @@ module VISU {
      */
     IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in double theIteration);
+                                  in long theIteration);
 
     /*!
      * Creates an stream lines presentation.
@@ -1704,7 +1702,7 @@ module VISU {
      */
     StreamLines StreamLinesOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in double theIteration);
+                                  in long theIteration);
 
     /*!
      * Creates a presentation of cut planes.
@@ -1716,7 +1714,7 @@ module VISU {
      */
     CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName,
                               in Entity theEntity, in string theFieldName,
-                              in double theIteration);
+                              in long theIteration);
 
     /*!
      * Creates a presentation of cut lines.
@@ -1728,7 +1726,7 @@ module VISU {
      */
     CutLines CutLinesOnField(in Result theResult, in string theMeshName,
                             in Entity theEntity, in string theFieldName,
-                            in double theIteration);
+                            in long theIteration);
 
     /*!
      * Creates a Plot3D presentation.
@@ -1740,7 +1738,7 @@ module VISU {
      */
     Plot3D Plot3DOnField(in Result theResult, in string theMeshName,
                         in Entity theEntity, in string theFieldName,
-                        in double theIteration);
+                        in long theIteration);
 
     /*!
      * Creates a table presentation.
index f09b5ddc7fd33c09ed2711d6953ca85dc16ce0ea..a44432db801fc4c494dd8194545912b2ad65287d 100644 (file)
@@ -231,98 +231,118 @@ namespace VISU{
   }
 
 
-  ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, 
-                                            const char* theMeshName, 
-                                            VISU::Entity theEntity, 
-                                            const char* theFieldName, 
-                                            CORBA::Double theIteration)
+  ScalarMap_ptr
+  VISU_Gen_i
+  ::ScalarMapOnField(Result_ptr theResult, 
+                    const char* theMeshName, 
+                    VISU::Entity theEntity,
+                    const char* theFieldName, 
+                    CORBA::Long theIteration)
   {
     return myVisuGen->ScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult, 
-                                                const char* theMeshName, 
-                                                VISU::Entity theEntity, 
-                                                const char* theFieldName, 
-                                                CORBA::Double theIteration)
+  GaussPoints_ptr 
+  VISU_Gen_i
+  ::GaussPointsOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration)
   {
     return myVisuGen->GaussPointsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, 
-                                                    const char* theMeshName, 
-                                                    VISU::Entity theEntity, 
-                                                    const char* theFieldName, 
-                                                    CORBA::Double theIteration)
+  DeformedShape_ptr 
+  VISU_Gen_i
+  ::DeformedShapeOnField(Result_ptr theResult, 
+                        const char* theMeshName, 
+                        VISU::Entity theEntity,
+                        const char* theFieldName, 
+                        CORBA::Long theIteration)
   {
     return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
-  ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
-                                                                          const char* theMeshName, 
-                                                                          VISU::Entity theEntity, 
-                                                                          const char* theFieldName, 
-                                                                          CORBA::Double theIteration)
+  ScalarMapOnDeformedShape_ptr 
+  VISU_Gen_i
+  ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
+                                   const char* theMeshName, 
+                                   VISU::Entity theEntity,
+                                   const char* theFieldName, 
+                                   CORBA::Long theIteration)
   {
     return myVisuGen->ScalarMapOnDeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
-  Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, 
-                                        const char* theMeshName, 
-                                        VISU::Entity theEntity, 
-                                        const char* theFieldName, 
-                                        CORBA::Double theIteration)
+  Vectors_ptr 
+  VISU_Gen_i
+  ::VectorsOnField(Result_ptr theResult, 
+                  const char* theMeshName, 
+                  VISU::Entity theEntity,
+                  const char* theFieldName, 
+                  CORBA::Long theIteration)
   {
     return myVisuGen->VectorsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
-  IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult, 
-                                                const char* theMeshName, 
-                                                VISU::Entity theEntity, 
-                                                const char* theFieldName, 
-                                                CORBA::Double theIteration)
+  IsoSurfaces_ptr 
+  VISU_Gen_i
+  ::IsoSurfacesOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration)
   {
     return myVisuGen->IsoSurfacesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult, 
-                                                const char* theMeshName, 
-                                                VISU::Entity theEntity, 
-                                                const char* theFieldName, 
-                                                CORBA::Double theIteration)
+  StreamLines_ptr 
+  VISU_Gen_i
+  ::StreamLinesOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration)
   {
     return myVisuGen->StreamLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, 
-                                            const char* theMeshName, 
-                                            VISU::Entity theEntity, 
-                                            const char* theFieldName, 
-                                            CORBA::Double theIteration)
+  CutPlanes_ptr 
+  VISU_Gen_i
+  ::CutPlanesOnField(Result_ptr theResult, 
+                    const char* theMeshName, 
+                    VISU::Entity theEntity,
+                    const char* theFieldName, 
+                    CORBA::Long theIteration)
   {
     return myVisuGen->CutPlanesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult, 
-                                          const char* theMeshName, 
-                                          VISU::Entity theEntity, 
-                                          const char* theFieldName, 
-                                          CORBA::Double theIteration)
+  CutLines_ptr 
+  VISU_Gen_i
+  ::CutLinesOnField(Result_ptr theResult, 
+                   const char* theMeshName, 
+                   VISU::Entity theEntity,
+                   const char* theFieldName, 
+                   CORBA::Long theIteration)
   {
     return myVisuGen->CutLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
 
 
-  Plot3D_ptr VISU_Gen_i::Plot3DOnField(Result_ptr theResult, 
-                                      const char* theMeshName, 
-                                      VISU::Entity theEntity, 
-                                      const char* theFieldName, 
-                                      CORBA::Double theIteration)
+  Plot3D_ptr 
+  VISU_Gen_i
+  ::Plot3DOnField(Result_ptr theResult, 
+                 const char* theMeshName, 
+                 VISU::Entity theEntity,
+                 const char* theFieldName, 
+                 CORBA::Long theIteration)
   {
     return myVisuGen->Plot3DOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
   }
index c10bbc80aa60e2215fa2d1c89274c647cf3826d1..d123bd7d6387215d05232f2fd69d186211083233 100644 (file)
@@ -82,34 +82,86 @@ namespace VISU
                                     const char* theGroupName, const char* theNewName);
 
     //Create Presentation Of Results
-    virtual ScalarMap_ptr ScalarMapOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual GaussPoints_ptr GaussPointsOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual DeformedShape_ptr DeformedShapeOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual IsoSurfaces_ptr IsoSurfacesOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual CutPlanes_ptr CutPlanesOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual CutLines_ptr CutLinesOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual StreamLines_ptr StreamLinesOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual Plot3D_ptr Plot3DOnField  (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
-    virtual ScalarMapOnDeformedShape_ptr ScalarMapOnDeformedShapeOnField
-                                      (Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
-                                      const char* theFieldName, CORBA::Double theIteration);
+    virtual 
+    ScalarMap_ptr
+    ScalarMapOnField(Result_ptr theResult, 
+                    const char* theMeshName, 
+                    VISU::Entity theEntity,
+                    const char* theFieldName, 
+                    CORBA::Long theIteration);
+
+    virtual 
+    GaussPoints_ptr 
+    GaussPointsOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration);
+
+    virtual 
+    DeformedShape_ptr
+    DeformedShapeOnField(Result_ptr theResult, 
+                        const char* theMeshName, 
+                        VISU::Entity theEntity,
+                        const char* theFieldName, 
+                        CORBA::Long theIteration);
+
+    virtual 
+    Vectors_ptr
+    VectorsOnField(Result_ptr theResult, 
+                  const char* theMeshName, 
+                  VISU::Entity theEntity,
+                  const char* theFieldName, 
+                  CORBA::Long theIteration);
+
+    virtual
+    IsoSurfaces_ptr
+    IsoSurfacesOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration);
+
+    virtual
+    CutPlanes_ptr
+    CutPlanesOnField(Result_ptr theResult, 
+                    const char* theMeshName, 
+                    VISU::Entity theEntity,
+                    const char* theFieldName, 
+                    CORBA::Long theIteration);
+
+    virtual
+    CutLines_ptr
+    CutLinesOnField(Result_ptr theResult, 
+                   const char* theMeshName, 
+                   VISU::Entity theEntity,
+                   const char* theFieldName, 
+                   CORBA::Long theIteration);
+
+    virtual
+    StreamLines_ptr 
+    StreamLinesOnField(Result_ptr theResult, 
+                      const char* theMeshName, 
+                      VISU::Entity theEntity,
+                      const char* theFieldName, 
+                      CORBA::Long theIteration);
+
+    virtual
+    Plot3D_ptr
+    Plot3DOnField(Result_ptr theResult, 
+                 const char* theMeshName, 
+                 VISU::Entity theEntity,
+                 const char* theFieldName, 
+                 CORBA::Long theIteration);
+
+    virtual
+    ScalarMapOnDeformedShape_ptr
+    ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
+                                   const char* theMeshName, 
+                                   VISU::Entity theEntity,
+                                   const char* theFieldName, 
+                                   CORBA::Long theIteration);
+
     //Create Digital Presentation
     virtual Table_ptr CreateTable(const char* theTableEntry);
     virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
index 17d866219e65b4d443d11d43c5550e29a76d158d..e6bd286038e371ed7d45c7aea2d11ee39e7847c3 100644 (file)
 #include "VisuGUI_TransparencyDlg.h"
 #include "VisuGUI_CacheDlg.h"
 
+#include "VISU_ColoredPrs3dHolder_i.hh"
+
 #include "VISU_ScalarMap_i.hh"
 #include "VisuGUI_ScalarBarDlg.h"
 
@@ -431,7 +433,7 @@ CreateCurves( SalomeApp_Module* theModule,
     return;
 
   _PTR(Study)   aStudy = GetCStudy( GetAppStudy( theModule ) );
-  _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
+  _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry() );
 
   if ( !theCreate && aSObject ) {
     // Remove old Table
@@ -473,7 +475,7 @@ CreateCurves( SalomeApp_Module* theModule,
   }
 
   if ( aCutDlg->isGenerateTable() ) {
-    GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
+    GetVisuGen( theModule )->CreateTable( thePrs->GetEntry().c_str() );
     if ( aCutDlg->isGenerateCurves() ) {
       if ( aSObject ) {
         _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
index 79a50235fd73418dce0e003584741b26b97908f0..9d1ff6b048f60d3b60127ac7b4cc2bc9743452e8 100644 (file)
@@ -210,7 +210,7 @@ SPlot2d_Prs* VisuGUI_Displayer::buildTable( Plot2d_ViewWindow* wnd, VISU::Table_
   if( !study )
     return prs;
 
-  _PTR(SObject) TableSO = study->studyDS()->FindObjectID( t->GetEntry().latin1() );
+  _PTR(SObject) TableSO = study->studyDS()->FindObjectID( t->GetEntry() );
 
   if( !TableSO )
     return prs;
index ebdf2129d4b39566fc69ee54e161056351cfa7d4..acac49e644f48e5f9b8ac5460240f9af2a1b3f37 100644 (file)
 #ifndef VisuGUI_Prs3dTools_HeaderFile
 #define VisuGUI_Prs3dTools_HeaderFile
 
-#include "VISU_Gen_i.hh"
 #include "VisuGUI_ViewTools.h"
 #include "VisuGUI_DialogRunner.h"
+#include "VISU_ColoredPrs3dFactory.hh"
+#include "VISU_ColoredPrs3dCache_i.hh"
 
 #include <vtkRenderer.h>
 
@@ -128,11 +129,22 @@ namespace VISU
                         ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
   {
     VISU::Result_var aResult;
-    if (CheckResult(theModule,theTimeStamp,aResult)){
+    if (CheckResult(theModule, theTimeStamp, aResult)){
       QApplication::setOverrideCursor(Qt::waitCursor);
-      TPrs3d_i* aPrs3d =
-       GetVisuGen(theModule)->template CreatePrs3d<TPrs3d_i>
-       (aResult,theMeshName,theEntity,theFieldName,theTimeId,thePublishInStudyMode);
+      TPrs3d_i* aPrs3d = NULL;
+      if(thePublishInStudyMode == VISU::ColoredPrs3d_i::EPublishUnderTimeStamp)
+       aPrs3d = VISU::CreatePrs3d<TPrs3d_i>(aResult,
+                                            theMeshName,
+                                            theEntity,
+                                            theFieldName,
+                                            theTimeId);
+      else
+       aPrs3d = VISU::CreateHolder2GetDeviceByType<TPrs3d_i>(aResult,
+                                                             theMeshName,
+                                                             theEntity,
+                                                             theFieldName,
+                                                             theTimeId);
+      
       QApplication::restoreOverrideCursor();
       if(aPrs3d)
        return aPrs3d;
index 926bf60801540abfc548eda06c5c8edef696b13e..4aa51ac2315b9ed0949d71c4829ed157b61ae557 100644 (file)
@@ -907,7 +907,7 @@ namespace VISU
     QList<Plot2d_Curve> clist;
     aPlot->getCurves( clist );
     _PTR(Study) aStudy = GetCStudy( GetAppStudy( theModule ) );
-    _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry().latin1() );
+    _PTR(SObject) TableSO = aStudy->FindObjectID( table->GetEntry() );
     if ( TableSO ) {
       _PTR(ChildIterator) Iter = aStudy->NewChildIterator( TableSO );
       for ( ; Iter->More(); Iter->Next() ) {
@@ -921,7 +921,7 @@ namespace VISU
             for ( int i = 0; i < clist.count(); i++ ) {
               tmpCurve = dynamic_cast<SPlot2d_Curve*>( clist.at( i ) );
               if (tmpCurve && tmpCurve->hasIO() &&
-                  !strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
+                  theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
                 plotCurve = tmpCurve;
                 break;
               }
@@ -960,7 +960,7 @@ namespace VISU
     for (int i = 0; i < clist.count(); i++) {
       tmpCurve = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
       if (tmpCurve && tmpCurve->hasIO() &&
-          !strcmp(tmpCurve->getIO()->getEntry(), theCurve->GetEntry())) {
+          theCurve->GetEntry() != tmpCurve->getIO()->getEntry()) {
         plotCurve = tmpCurve;
       } else if (theDisplaying == VISU::eDisplayOnly) {
         aPlot->eraseCurve(clist.at(i));
@@ -1021,7 +1021,7 @@ namespace VISU
         VISU::Curve_i* theCurve = container->GetCurve( k );
         if ( theCurve && theCurve->IsValid() ) {
           SPlot2d_Curve* plotCurve = dynamic_cast<SPlot2d_Curve*>
-            (aView->getCurveByIO(new SALOME_InteractiveObject (theCurve->GetEntry(), "", "")));
+            (aView->getCurveByIO(new SALOME_InteractiveObject(theCurve->GetEntry().c_str(), "", "")));
 
           UpdateCurve( theCurve, aPlot, plotCurve, theDisplaying );
 
index 4f0074bf390c42e6dbc83f29a5734bc3c4b83bdc..4aab6f41e1b2c662fcb2652d70c86d2e46ce61f5 100644 (file)
@@ -57,7 +57,8 @@ LIB_SRC = \
        VISU_DumpPython.cc \
        VISU_ScalarMapOnDeformedShape_i.cc \
        VISU_ColoredPrs3dHolder_i.cc \
-       VISU_ColoredPrs3dCache_i.cc
+       VISU_ColoredPrs3dCache_i.cc \
+       VISU_ColoredPrs3dFactory.cc
 
 LIB_MOC = \
        VISU_TimeAnimation.h
@@ -104,7 +105,8 @@ EXPORT_HEADERS = \
        VISU_TimeAnimation.h \
        VISU_ScalarMapOnDeformedShape_i.hh \
        VISU_ColoredPrs3dHolder_i.hh \
-       VISU_ColoredPrs3dCache_i.hh
+       VISU_ColoredPrs3dCache_i.hh \
+       VISU_ColoredPrs3dFactory.hh
 
 # additionnal information to compil and link file
 CPPFLAGS += \
index dcf5d80d0f6a01764d2f70fbfc98f45631f040f0..cbfb91577ff76846b7c669c218c2040dfb820b72 100644 (file)
@@ -181,14 +181,6 @@ namespace VISU
                 const double theVal);
   };
 
-  //===========================================================================
-  class RemovableObject_i : public virtual POA_VISU::RemovableObject,
-                            public virtual Storable
-  {
-  public:
-    virtual void RemoveFromStudy() = 0;
-  };
-
   //===========================================================================
   const CORBA::Boolean IsMultifile();
   QString GenerateName(const std::string& theFmt, int theId);
index 52670247fc0f74538901174bda045cd4aaba1d11..b8fc76607950de8c79cdf6080503f1bebb82d3df 100644 (file)
 
 #include "VISU_ColoredPrs3dCache_i.hh"
 
-#include "VISU_ColoredPrs3d_i.hh"
 #include "VISU_ColoredPrs3dHolder_i.hh"
-#include "VISU_Gen_i.hh"
-#include "VISU_Result_i.hh"
+#include "VISU_ColoredPrs3dFactory.hh"
 #include "VISU_View_i.hh"
 #include "VISU_ViewManager_i.hh"
 
-#include "VISU_ScalarMap_i.hh"
-#include "VISU_IsoSurfaces_i.hh"
-#include "VISU_DeformedShape_i.hh"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
-#include "VISU_GaussPoints_i.hh"
-#include "VISU_Plot3D_i.hh"
-#include "VISU_CutPlanes_i.hh"
-#include "VISU_CutLines_i.hh"
-#include "VISU_Vectors_i.hh"
-#include "VISU_StreamLines_i.hh"
-
-#include "SUIT_ResourceMgr.h"
-
 #include "VVTK_ViewWindow.h"
-
-using namespace VISU;
-using namespace std;
+#include "SUIT_ResourceMgr.h"
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -58,18 +41,18 @@ static int MYDEBUG = 0;
 #endif
 
 //----------------------------------------------------------------------------
-VISU::ColoredPrs3dCache_i::
-ColoredPrs3dCache_i(SALOMEDS::Study_ptr theStudy):
-  PrsObject_i(theStudy)
+VISU::ColoredPrs3dCache_i
+::ColoredPrs3dCache_i(SALOMEDS::Study_ptr theStudy):
+  RemovableObject_i()
 {
   if(MYDEBUG) MESSAGE("ColoredPrs3dCache_i::ColoredPrs3dCache_i - this = "<<this);
+  SetStudyDocument(theStudy);
 
-  QString aComment;
-  myName = GetFolderName();
+  SetName(GetFolderName());
   CORBA::String_var anIOR = GetID();
   SALOMEDS::SComponent_var aSComponent = VISU::FindOrCreateVisuComponent(theStudy);
   CORBA::String_var aFatherEntry = aSComponent->GetID();
-  CreateAttributes(GetStudyDocument(), aFatherEntry.in(), "", anIOR.in(), myName, "", "", true);
+  CreateAttributes(GetStudyDocument(), aFatherEntry.in(), "", anIOR.in(), GetName(), "", "", true);
 
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
@@ -83,18 +66,29 @@ ColoredPrs3dCache_i(SALOMEDS::Study_ptr theStudy):
 
 
 //----------------------------------------------------------------------------
-VISU::ColoredPrs3dCache_i::
-~ColoredPrs3dCache_i() 
+VISU::ColoredPrs3dCache_i
+::~ColoredPrs3dCache_i() 
 {
   if(MYDEBUG) MESSAGE("ColoredPrs3dCache_i::~ColoredPrs3dCache_i - this = "<<this);
 }
 
 
+//----------------------------------------------------------------------------
+const string VISU::ColoredPrs3dCache_i::myComment = "COLOREDPRS3DCACHE";
+
+const char* 
+VISU::ColoredPrs3dCache_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
+
+
 //----------------------------------------------------------------------------
 int
-VISU::ColoredPrs3dCache_i::
-IsPossible(VISU::VISUType theType,
-          const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::IsPossible(VISU::VISUType theType,
+            const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
   //cout << "VISU::ColoredPrs3dCache_i::IsPossible " << endl;
   VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>( VISU::GetServant(theInput.myResult).in() );
@@ -134,30 +128,38 @@ IsPossible(VISU::VISUType theType,
 
 
 //----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3dCache_i::
-SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode)
+VISU::ColoredPrs3dCache_i*
+VISU::ColoredPrs3dCache_i
+::GetInstance_i(SALOMEDS::Study_ptr theStudy)
 {
-  myMemoryMode = theMode;
-  cout << theMode << endl;
+  std::string aFolderName = VISU::ColoredPrs3dCache_i::GetFolderName();
+  SALOMEDS::SObject_var aSObject = theStudy->FindObject(aFolderName.c_str());
+  if(!CORBA::is_nil(aSObject)){
+    CORBA::Object_var anObject = aSObject->GetObject();
+    VISU::ColoredPrs3dCache_var aCache = VISU::ColoredPrs3dCache::_narrow(anObject);
+    if(!CORBA::is_nil(aCache))
+      return dynamic_cast<VISU::ColoredPrs3dCache_i*>(GetServant(aCache).in());
+  }
+  
+  return new VISU::ColoredPrs3dCache_i(theStudy);
 }
 
 
-//----------------------------------------------------------------------------
-void
-VISU::ColoredPrs3dCache_i::
-SetLimitedMemory(CORBA::Long theMemorySize)
+VISU::ColoredPrs3dCache_ptr
+VISU::ColoredPrs3dCache_i
+::GetInstance(SALOMEDS::Study_ptr theStudy)
 {
-  myLimitedMemory = theMemorySize;
-  cout << theMemorySize << endl;
+  VISU::ColoredPrs3dCache_i* aServant = GetInstance_i(theStudy);
+  VISU::ColoredPrs3dCache_var anObject = aServant->_this();
+  return anObject._retn();
 }
 
 
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3dHolder_ptr
-VISU::ColoredPrs3dCache_i::
-CreateHolder(VISU::VISUType theType,
-            const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::CreateHolder(VISU::VISUType theType,
+              const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
   if(IsPossible(theType, theInput))
   {
@@ -169,14 +171,100 @@ CreateHolder(VISU::VISUType theType,
 }
 
 
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i
+::SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode)
+{
+  myMemoryMode = theMode;
+}
+
+VISU::ColoredPrs3dCache::MemoryMode
+VISU::ColoredPrs3dCache_i
+::GetMemoryMode()
+{ 
+  return myMemoryMode; 
+}
+
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dCache_i
+::SetLimitedMemory(CORBA::Long theMemorySize)
+{
+  myLimitedMemory = theMemorySize;
+}
+
+CORBA::Long
+VISU::ColoredPrs3dCache_i
+::GetLimitedMemory()
+{ 
+  return myLimitedMemory; 
+}
+
+
+void
+VISU::ColoredPrs3dCache_i
+::RemoveFromStudy() 
+{}
+
+std::string
+VISU::ColoredPrs3dCache_i
+::GetFolderName() 
+{ 
+  return "Cache"; 
+}
+
+void
+VISU::ColoredPrs3dCache_i
+::ToStream(std::ostringstream&) 
+{}
+
+VISU::Storable* 
+VISU::ColoredPrs3dCache_i
+::Restore(const Storable::TRestoringMap& theMap)
+{
+  return this;
+}
+
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-CreatePrs(VISU::VISUType theType,
-         VISU::ColoredPrs3dHolder::BasicInput theInput,
-         VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::
+CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+                            VISU::Result_ptr theResult, 
+                            const std::string& theMeshName, 
+                            VISU::Entity theEntity,
+                            const std::string& theFieldName, 
+                            CORBA::Long theIteration)
 {
-  VISU::ColoredPrs3d_i* aPrs3d = Base_i::GetVisuGenImpl()->CreatePrs3d_i(theType, GetStudyDocument());
+  VISU::ColoredPrs3d_i* aColoredPrs3d = NULL;
+  if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+    VISU::ColoredPrs3dHolder::BasicInput anInput;
+    anInput.myResult = VISU::Result::_duplicate(theResult);
+    anInput.myMeshName = theMeshName.c_str();
+    anInput.myEntity = theEntity;
+    anInput.myFieldName = theFieldName.c_str();
+    anInput.myTimeStampNumber = theIteration;
+
+    SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
+    VISU::ColoredPrs3dCache_var aCache = ColoredPrs3dCache_i::GetInstance(aStudy);
+    VISU::ColoredPrs3dHolder_var aHolder = aCache->CreateHolder(theType, anInput);
+
+    VISU::ColoredPrs3d_var aPrs3d = aHolder->GetDevice();
+    aColoredPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
+  }
+  return aColoredPrs3d;
+}
+
+    
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dCache_i
+::CreatePrs(VISU::VISUType theType,
+           VISU::ColoredPrs3dHolder::BasicInput theInput,
+           VISU::ColoredPrs3dHolder_i* theHolder)
+{
+  VISU::ColoredPrs3d_i* aPrs3d = VISU::CreatePrs3d_i(theType, GetStudyDocument());
   aPrs3d->SetHolderEntry( theHolder->GetEntry() );
   aPrs3d->SetResultObject( theInput.myResult );  
   aPrs3d->SetMeshName( theInput.myMeshName );  
@@ -192,9 +280,9 @@ CreatePrs(VISU::VISUType theType,
 
 
 //----------------------------------------------------------------------------
-TLastVisitedPrsList&
-VISU::ColoredPrs3dCache_i::
-GetLastVisitedPrsList(VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::TLastVisitedPrsList&
+VISU::ColoredPrs3dCache_i
+::GetLastVisitedPrsList(VISU::ColoredPrs3dHolder_i* theHolder)
 {
   //cout << "VISU::ColoredPrs3dCache_i::GetLastVisitedPrsList(";
   //cout << theHolder->GetEntry().latin1() << ")" << endl;
@@ -204,8 +292,8 @@ GetLastVisitedPrsList(VISU::ColoredPrs3dHolder_i* theHolder)
 
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
+VISU::ColoredPrs3dCache_i
+::GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
 {
   TLastVisitedPrsList aList = GetLastVisitedPrsList(theHolder);
   if( !aList.empty() )
@@ -217,9 +305,9 @@ GetLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder)
 
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3d_i*
-VISU::ColoredPrs3dCache_i::
-FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
-              const VISU::ColoredPrs3dHolder::BasicInput& theInput)
+VISU::ColoredPrs3dCache_i
+::FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
+                const VISU::ColoredPrs3dHolder::BasicInput& theInput)
 {
   //cout << "VISU::ColoredPrs3dCache_i::FindPrsByInput() ";
   VISU::ColoredPrs3d_i* aPrs3d = NULL;
@@ -249,17 +337,16 @@ FindPrsByInput(TLastVisitedPrsList& theLastVisitedPrsList,
 
 //----------------------------------------------------------------------------
 bool
-VISU::ColoredPrs3dCache_i::
-UpdateLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder,
-                    VISU::ColoredPrs3d_i* thePrs,
-                    const VISU::ColoredPrs3dHolder::BasicInput& theInput,
-                    VISU::View3D_ptr theView3D)
+VISU::ColoredPrs3dCache_i
+::UpdateLastVisitedPrs(VISU::ColoredPrs3dHolder_i* theHolder,
+                      VISU::ColoredPrs3d_i* thePrs,
+                      const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+                      VISU::View3D_ptr theView3D)
 {
   //cout << "VISU::ColoredPrs3dCache_i::UpdateLastVisitedPrs" << endl;
-  VISU::ColoredPrs3d_i* aPrs3d = NULL;
   TLastVisitedPrsList& aLastVisitedPrsList = GetLastVisitedPrsList(theHolder);
-
-  if(aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput))
+  VISU::ColoredPrs3d_i* aPrs3d = FindPrsByInput(aLastVisitedPrsList, theInput);
+  if(aPrs3d)
   {
     aLastVisitedPrsList.pop_front();
   }
index 56a889a8f4d95f88fc5a914d34e465bff24f4459..b4b970c97a786c375cc1e3d509f6f04a3febee27 100644 (file)
@@ -20,7 +20,7 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
-//  File   : VISU_ColoredPrs3dCache_i.hxx
+//  File   : VISU_ColoredPrs3dCache_i.hh
 //  Author : Oleg UVAROV
 //  Module : VISU
 
 
 #include "SALOME_GenericObj_i.hh"
 
+#include "VISU_ColoredPrs3dFactory.hh"
+
 namespace VISU
 {
+  class Result_i;
   class ColoredPrs3d_i;
   class ColoredPrs3dHolder_i;
 
@@ -46,7 +49,7 @@ namespace VISU
    */
   class ColoredPrs3dCache_i : public virtual POA_VISU::ColoredPrs3dCache,
                              public virtual SALOME::GenericObj_i,
-                             public virtual PrsObject_i
+                             public virtual RemovableObject_i
   {
     ColoredPrs3dCache_i();
     ColoredPrs3dCache_i(const ColoredPrs3dCache_i&);
@@ -60,51 +63,69 @@ namespace VISU
     ~ColoredPrs3dCache_i();
 
     //----------------------------------------------------------------------------
-    /*!
-     * Sets a memory mode.
-     */
-    void
-    SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode);
-
-    /*!
-     * Sets a memory size for limited mode.
-     */
-    void
-    SetLimitedMemory(CORBA::Long theMemorySize);
-
-    /*!
-     * Creates ColoredPrs3dHolder.
-     */
+    /*! Creates ColoredPrs3dHolder */
+    virtual
     VISU::ColoredPrs3dHolder_ptr
     CreateHolder(VISU::VISUType theType,
                 const VISU::ColoredPrs3dHolder::BasicInput& theInput);
 
     //----------------------------------------------------------------------------
+    //! Sets a memory mode.
+    virtual
+    void
+    SetMemoryMode(VISU::ColoredPrs3dCache::MemoryMode theMode);
+
+    virtual
     VISU::ColoredPrs3dCache::MemoryMode
-    GetMemoryMode() const { return myMemoryMode; }
+    GetMemoryMode();
+
+    //----------------------------------------------------------------------------
+    //! Sets a memory size for limited mode.
+    virtual
+    void
+    SetLimitedMemory(CORBA::Long theMemorySize);
 
-    long
-    GetLimitedMemory() const { return myLimitedMemory; }
+    virtual
+    CORBA::Long
+    GetLimitedMemory();
 
+    //----------------------------------------------------------------------------
     virtual 
     VISU::VISUType 
-    GetType() { return VISU::TCOLOREDPRS3DCACHE; }
+    GetType() 
+    {
+      return VISU::TCOLOREDPRS3DCACHE; 
+    }
 
     virtual
     void
-    RemoveFromStudy() {}
+    RemoveFromStudy();
+
+    static
+    std::string
+    GetFolderName();
 
     virtual
-    void
-    ToStream(std::ostringstream&) {}
+    const char* 
+    GetComment() const;
 
     virtual
-    const char*
-    GetComment() const { return NULL; }
+    void
+    ToStream(std::ostringstream&);
+
+    virtual 
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
+
+    //----------------------------------------------------------------------------
+    //! Finds or creates instance of the ColoredPrs3dCache in the given SALOMEDS::Study
+    static
+    VISU::ColoredPrs3dCache_i*
+    GetInstance_i(SALOMEDS::Study_ptr theStudy);
 
     static
-    const std::string
-    GetFolderName() { return "Cache"; }
+    VISU::ColoredPrs3dCache_ptr
+    GetInstance(SALOMEDS::Study_ptr theStudy);
 
     VISU::ColoredPrs3d_i*
     CreatePrs(VISU::VISUType theType,
@@ -133,11 +154,46 @@ namespace VISU
                   const VISU::ColoredPrs3dHolder::BasicInput& theInput);
 
   private:
+    CORBA::Long myLimitedMemory;
     VISU::ColoredPrs3dCache::MemoryMode myMemoryMode;
-    long                                myLimitedMemory;
 
-    TColoredPrs3dHolderMap              myHolderMap; 
+    TColoredPrs3dHolderMap myHolderMap; 
+
+    static const std::string myComment;
   };
+
+  //----------------------------------------------------------------------------
+  //! Creates ColoredPrs3dHolder by enumeration value and gets its first device
+  ColoredPrs3d_i*
+  CreateHolder2GetDeviceByEnum(VISU::VISUType theType,
+                              VISU::Result_ptr theResult, 
+                              const std::string& theMeshName, 
+                              VISU::Entity theEntity,
+                              const std::string& theFieldName, 
+                              CORBA::Long theIteration);
+    
+  
+  //----------------------------------------------------------------------------
+  //! Creates ColoredPrs3dHolder by type and gets its first device
+  template<class TColoredPrs3d_i> 
+  TColoredPrs3d_i*
+  CreateHolder2GetDeviceByType(VISU::Result_ptr theResult, 
+                              const std::string& theMeshName, 
+                              VISU::Entity theEntity,
+                              const std::string& theFieldName, 
+                              CORBA::Long theIteration)
+  {
+    typedef typename TL::TColoredType2Enum<TColoredPrs3d_i>::TResult TEnum;
+    VISU::VISUType aColoredPrs3dType = VISU::VISUType(TEnum::value);
+    ColoredPrs3d_i* aColoredPrs3d = CreateHolder2GetDeviceByEnum(aColoredPrs3dType,
+                                                                theResult, 
+                                                                theMeshName, 
+                                                                theEntity,
+                                                                theFieldName, 
+                                                                theIteration);
+    return dynamic_cast<TColoredPrs3d_i*>(aColoredPrs3d);
+  }
+    
 }
 
 #endif
diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.cc b/src/VISU_I/VISU_ColoredPrs3dFactory.cc
new file mode 100644 (file)
index 0000000..3fda8c5
--- /dev/null
@@ -0,0 +1,126 @@
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//  File   : VISU_ColoredPrs3dCache_i.cc
+//  Author : Oleg UVAROV
+//  Module : VISU
+
+#include "VISU_ColoredPrs3dFactory.hh"
+
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+#define NO_CAS_CATCH
+#endif
+
+#include <Standard_Failure.hxx>
+
+#ifdef NO_CAS_CATCH
+#include <Standard_ErrorHandler.hxx>
+#else
+#include "CASCatch.hxx"
+#endif
+
+#ifdef _DEBUG_
+//static int MYDEBUG = 0;
+//#define _DEXCEPT_
+#else
+//static int MYDEBUG = 0;
+#endif
+
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  bool
+  CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+                   const std::string& theMeshName, 
+                   VISU::Entity theEntity,
+                   const std::string& theFieldName, 
+                   CORBA::Long theIteration)
+  {
+#ifndef _DEXCEPT_
+#ifdef NO_CAS_CATCH
+    try{
+      OCC_CATCH_SIGNALS;
+#else
+      CASCatch_TRY{
+       try{
+#endif
+#endif
+         if(theColoredPrs3d->Create(theMeshName, theEntity, theFieldName, theIteration))
+           return true;
+#ifndef _DEXCEPT_
+#ifdef NO_CAS_CATCH
+       }catch(Standard_Failure) {
+         Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+         INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+       }catch(std::exception& exc){
+         INFOS("Follow exception was occured :\n"<<exc.what());
+       }catch(...){
+         INFOS("Unknown exception was occured!");
+       }
+#else
+      }catch(std::exception& exc){
+       INFOS("Follow exception was occured :\n"<<exc.what());
+      }catch(...){
+       INFOS("Unknown exception was occured!");
+      }
+    }CASCatch_CATCH(Standard_Failure){
+      Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
+      INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
+    }
+#endif
+#endif
+    return false;
+  }
+
+
+  //----------------------------------------------------------------------------
+  VISU::ColoredPrs3d_i*
+  CreatePrs3d_i(VISUType theType,
+               SALOMEDS::Study_ptr theStudy)
+  {
+    switch(theType){
+    case TSCALARMAP:
+      return VISU::CreatePrs3dByEnum<TSCALARMAP>(theStudy);
+    case TGAUSSPOINTS:
+      return VISU::CreatePrs3dByEnum<TGAUSSPOINTS>(theStudy);
+    case TDEFORMEDSHAPE:
+      return VISU::CreatePrs3dByEnum<TDEFORMEDSHAPE>(theStudy);
+    case TSCALARMAPONDEFORMEDSHAPE:
+      return VISU::CreatePrs3dByEnum<TSCALARMAPONDEFORMEDSHAPE>(theStudy);
+    case TISOSURFACE:
+      return VISU::CreatePrs3dByEnum<TISOSURFACE>(theStudy);
+    case TSTREAMLINES:
+      return VISU::CreatePrs3dByEnum<TSTREAMLINES>(theStudy);
+    case TPLOT3D:
+      return VISU::CreatePrs3dByEnum<TPLOT3D>(theStudy);
+    case TCUTPLANES:
+      return VISU::CreatePrs3dByEnum<TCUTPLANES>(theStudy);
+    case TCUTLINES:
+      return VISU::CreatePrs3dByEnum<TCUTLINES>(theStudy);
+    case TVECTORS:
+      return VISU::CreatePrs3dByEnum<TVECTORS>(theStudy);
+    }
+    return NULL;
+  }
+  //----------------------------------------------------------------------------
+}
diff --git a/src/VISU_I/VISU_ColoredPrs3dFactory.hh b/src/VISU_I/VISU_ColoredPrs3dFactory.hh
new file mode 100644 (file)
index 0000000..7dff775
--- /dev/null
@@ -0,0 +1,245 @@
+//  VISU OBJECT : interactive object for VISU entities implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//  File   : VISU_ColoredPrs3dCache_i.hh
+//  Author : Oleg UVAROV
+//  Module : VISU
+
+#ifndef VISU_ColoredPrs3dFactory_HeaderFile
+#define VISU_ColoredPrs3dFactory_HeaderFile
+
+#include "SALOMEconfig.h"
+#include CORBA_SERVER_HEADER(VISU_Gen)
+#include CORBA_SERVER_HEADER(SALOMEDS)
+
+#include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_Plot3D_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_StreamLines_i.hh"
+#include "VISU_Vectors_i.hh"
+#include "VISU_CutLines_i.hh"
+#include "VISU_CutPlanes_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_Result_i.hh"
+
+namespace VISU
+{
+  namespace TL
+  {
+    //----------------------------------------------------------------------------
+    template <class T, class U>
+    struct TList
+    {
+      typedef T THead;
+      typedef U TTail;
+    };
+    
+    template <int v>
+    struct TInt2Type
+    {
+      enum { value = v };
+    };
+
+    struct TNullType {};
+    
+    //----------------------------------------------------------------------------
+    typedef TList<ScalarMapOnDeformedShape_i,
+                 TList<DeformedShape_i,
+                       TList<StreamLines_i,
+                             TList<GaussPoints_i,
+                                   TList<ScalarMap_i,
+                                         TList<IsoSurfaces_i,
+                                               TList<CutPlanes_i,
+                                                     TList<CutLines_i,
+                                                           TList<Vectors_i,
+                                                                 TList<Plot3D_i, 
+                                                                       TNullType> > > > > > > > > >
+    TColoredPrs3dTypeList;
+    
+
+    typedef TList<TInt2Type<TSCALARMAPONDEFORMEDSHAPE>,
+                 TList<TInt2Type<TDEFORMEDSHAPE>, 
+                       TList<TInt2Type<TSTREAMLINES>,
+                             TList<TInt2Type<TGAUSSPOINTS>,
+                                   TList<TInt2Type<TSCALARMAP>,
+                                         TList<TInt2Type<TISOSURFACE>,
+                                               TList<TInt2Type<TCUTPLANES>,
+                                                     TList<TInt2Type<TCUTLINES>,
+                                                           TList<TInt2Type<TVECTORS>,
+                                                                 TList<TInt2Type<TPLOT3D>, 
+                                                                       TNullType> > > > > > > > > >
+    TColoredPrs3dEnumList;
+    
+
+    //----------------------------------------------------------------------------
+    template <class TypeList, unsigned int index> 
+    struct TTypeAt;
+
+    template <class THead, class TTail>
+    struct TTypeAt<TList<THead, TTail>, 0>
+    {
+      typedef THead TResult;
+    };
+
+
+    template <class THead, class TTail, unsigned int index>
+    struct TTypeAt<TList<THead, TTail>, index>
+    {
+      typedef typename TTypeAt<TTail, index - 1>::TResult TResult;
+    };
+
+    //----------------------------------------------------------------------------
+    template <class TypeList, class T> 
+    struct TIndexOf;
+
+    template <class T>
+    struct TIndexOf<TNullType, T>
+    {
+      enum { value = -1 };
+    };
+
+    template <class T, class TTail>
+    struct TIndexOf<TList<T, TTail>, T>
+    {
+      enum { value = 0 };
+    };
+
+    template <class THead, class TTail, class T>
+    struct TIndexOf<TList<THead, TTail>, T>
+    {
+    private:
+      enum { temp = TIndexOf<TTail, T>::value };
+    public:
+      enum { value = temp == -1? -1 : 1 + temp };
+    };
+
+    //----------------------------------------------------------------------------
+    template <unsigned int type_enum>
+    struct TColoredEnum2Type
+    {
+      typedef typename TTypeAt<TColoredPrs3dTypeList, TIndexOf<TColoredPrs3dEnumList, TInt2Type<type_enum> >::value >::TResult TResult;
+    };
+    
+    //----------------------------------------------------------------------------
+    template <class T>
+    struct TColoredType2Enum
+    {
+      typedef typename TTypeAt<TColoredPrs3dEnumList, TIndexOf<TColoredPrs3dTypeList, T>::value >::TResult TResult;
+    };
+
+  }
+
+  //----------------------------------------------------------------------------
+  template<typename TPrs3d_i> 
+  ColoredPrs3d_i*
+  CreatePrs3dByType(SALOMEDS::Study_ptr theStudy)
+  {
+    if(!theStudy->GetProperties()->IsLocked()){
+      typedef typename TPrs3d_i::TInterface TPrs3d;
+      if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
+       return aPresent;
+      }
+    }
+    return NULL;
+  }
+
+
+  //----------------------------------------------------------------------------
+  template<unsigned int type_enum> 
+  ColoredPrs3d_i*
+  CreatePrs3dByEnum(SALOMEDS::Study_ptr theStudy)
+  {
+    typedef typename TL::TColoredEnum2Type<type_enum>::TResult TColoredPrs3d;
+    return CreatePrs3dByType<TColoredPrs3d>(theStudy);
+  };
+
+
+  //----------------------------------------------------------------------------
+  ColoredPrs3d_i*
+  CreatePrs3d_i(VISUType theType,
+               SALOMEDS::Study_ptr theStudy);
+  
+  
+  //----------------------------------------------------------------------------
+  bool
+  CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
+                   const std::string& theMeshName, 
+                   VISU::Entity theEntity,
+                   const std::string& theFieldName, 
+                   CORBA::Long theIteration);
+
+
+  //----------------------------------------------------------------------------
+  //Create 3D collored Presentation Of Different Types
+  template<typename TPrs3d_i> TPrs3d_i*
+  CreatePrs3d(Result_ptr theResult, 
+             const std::string& theMeshName, 
+             VISU::Entity theEntity,
+             const std::string& theFieldName, 
+             CORBA::Long theIteration)
+  {
+    typedef typename TPrs3d_i::TInterface TPrs3d;
+    typename TPrs3d::_var_type aPrs3d;
+
+    if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+      SALOMEDS::Study_var aStudy = aResult->GetStudyDocument();
+      if(aStudy->GetProperties()->IsLocked()) 
+       return NULL;
+    
+      if(TPrs3d_i::IsPossible(aResult, theMeshName, theEntity, theFieldName, theIteration)){
+       TPrs3d_i* aPresent = new TPrs3d_i(aResult);
+       
+       if(CreatColoredPrs3d(aPresent, theMeshName, theEntity, theFieldName, theIteration))
+         return aPresent;
+       
+       aPresent->_remove_ref();
+      }
+    }
+    return NULL;
+  }
+
+
+  //----------------------------------------------------------------------------
+  template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
+  Prs3dOnField(Result_ptr theResult, 
+              const std::string& theMeshName, 
+              VISU::Entity theEntity,
+              const std::string& theFieldName, 
+              CORBA::Long theIteration)
+  {
+    typedef typename TPrs3d_i::TInterface TPrs3d;
+    typename TPrs3d::_var_type aPrs3d;
+    if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,
+                                               theMeshName,
+                                               theEntity,
+                                               theFieldName,
+                                               theIteration))
+      return aPrs3d->_this();
+    return TPrs3d::_nil();
+  }
+  //----------------------------------------------------------------------------
+}
+
+#endif
index 0e295ddbc59569cfc7de9d35b83f8fc18e14de0d..1bb4f028986570feee478c73da80608d998ac35f 100644 (file)
@@ -43,19 +43,29 @@ int VISU::ColoredPrs3dHolder_i::myNbHolders = 0;
 
 //---------------------------------------------------------------
 QString 
-VISU::ColoredPrs3dHolder_i::
-GenerateName() 
+VISU::ColoredPrs3dHolder_i
+::GenerateName() 
 { 
   return VISU::GenerateName("Holder",myNbHolders++);
 }
 
 //----------------------------------------------------------------------------
-VISU::ColoredPrs3dHolder_i::
-ColoredPrs3dHolder_i(VISU::VISUType theType,
-                    VISU::ColoredPrs3dHolder::BasicInput theInput,
-                    VISU::ColoredPrs3dCache_i& theCache) :
+const string VISU::ColoredPrs3dHolder_i::myComment = "COLOREDPRS3DHOLDER";
+
+const char* 
+VISU::ColoredPrs3dHolder_i
+::GetComment() const 
+{ 
+  return myComment.c_str();
+}
+
+
+//----------------------------------------------------------------------------
+VISU::ColoredPrs3dHolder_i
+::ColoredPrs3dHolder_i(VISU::VISUType theType,
+                      VISU::ColoredPrs3dHolder::BasicInput theInput,
+                      VISU::ColoredPrs3dCache_i& theCache) :
   PrsObject_i(theCache.GetStudyDocument()),
-  myPrsType(theType),
   myCache(theCache)
 {
   if(MYDEBUG) MESSAGE("ColoredPrs3dHolder_i::ColoredPrs3dHolder_i - this = "<<this);
@@ -76,17 +86,17 @@ ColoredPrs3dHolder_i(VISU::VISUType theType,
   }
 
   QString aComment;
-  myName = GenerateName().latin1();
+  SetName(GenerateName().latin1());
   CORBA::String_var anIOR = GetID();
   std::string aFatherEntry = theCache.GetEntry();
   aComment = QString("myComment=") + aType;
-  CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), myName, "", aComment, true);
+  CreateAttributes(GetStudyDocument(), aFatherEntry, "", anIOR.in(), GetName(), "", aComment, true);
 }
 
 
 //----------------------------------------------------------------------------
-VISU::ColoredPrs3dHolder_i::
-~ColoredPrs3dHolder_i() 
+VISU::ColoredPrs3dHolder_i
+::~ColoredPrs3dHolder_i() 
 {
   if(MYDEBUG) MESSAGE("ColoredPrs3dHolder_i::~ColoredPrs3dHolder_i - this = "<<this);
 }
@@ -94,31 +104,36 @@ VISU::ColoredPrs3dHolder_i::
 
 //----------------------------------------------------------------------------
 CORBA::Boolean 
-VISU::ColoredPrs3dHolder_i::
-Apply(VISU::ColoredPrs3d_ptr thePrs3d,
-      const VISU::ColoredPrs3dHolder::BasicInput& theInput,
-      VISU::View3D_ptr theView3D)
+VISU::ColoredPrs3dHolder_i
+::Apply(VISU::ColoredPrs3d_ptr thePrs3d,
+       const VISU::ColoredPrs3dHolder::BasicInput& theInput,
+       VISU::View3D_ptr theView3D)
 {
   VISU::ColoredPrs3d_i* aPrs3d = dynamic_cast<VISU::ColoredPrs3d_i*>( VISU::GetServant(thePrs3d).in() );
   return myCache.UpdateLastVisitedPrs(this, aPrs3d, theInput, theView3D);
 }
 
 //----------------------------------------------------------------------------
-VISU::ColoredPrs3d_ptr
-VISU::ColoredPrs3dHolder_i::
-GetDevice()
+VISU::ColoredPrs3d_i*
+VISU::ColoredPrs3dHolder_i
+::GetPrs3dDevice()
 {
-  if(VISU::ColoredPrs3d_i* aPrs3d = myCache.GetLastVisitedPrs(this))
-    return aPrs3d->_this();
+  return myCache.GetLastVisitedPrs(this);
+}
+
 
-  return VISU::ColoredPrs3d::_nil();
+VISU::ColoredPrs3d_ptr
+VISU::ColoredPrs3dHolder_i
+::GetDevice()
+{
+  return GetPrs3dDevice()->_this();
 }
 
 
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3d::TimeStampsRange*
-VISU::ColoredPrs3dHolder_i::
-GetTimeStampsRange()
+VISU::ColoredPrs3dHolder_i
+::GetTimeStampsRange()
 {
   if( VISU::ColoredPrs3d_ptr aDevice = GetDevice() )
     return aDevice->GetTimeStampsRange();
@@ -129,8 +144,8 @@ GetTimeStampsRange()
 
 //----------------------------------------------------------------------------
 VISU::ColoredPrs3dHolder::BasicInput*
-VISU::ColoredPrs3dHolder_i::
-GetBasicInput()
+VISU::ColoredPrs3dHolder_i
+::GetBasicInput()
 {
   if( VISU::ColoredPrs3d_ptr aDevice = GetDevice() )
   {
@@ -141,3 +156,33 @@ GetBasicInput()
 
   return NULL;
 }
+
+
+//----------------------------------------------------------------------------
+VISU::VISUType
+VISU::ColoredPrs3dHolder_i
+::GetPrsType()
+{
+  return GetPrs3dDevice()->GetType();
+}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dHolder_i
+::RemoveFromStudy() 
+{}
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3dHolder_i
+::ToStream(std::ostringstream&) 
+{}
+
+//----------------------------------------------------------------------------
+VISU::Storable* 
+VISU::ColoredPrs3dHolder_i
+::Restore(const Storable::TRestoringMap& theMap)
+{
+  return this;
+}
+
index 673cb758c738303d74b96802d1e3da1ba5d1e6df..204924c9e9f62bb95c10d468529532783c8bfa1a 100644 (file)
@@ -59,62 +59,70 @@ namespace VISU
     ~ColoredPrs3dHolder_i();
 
     //----------------------------------------------------------------------------
-    /*! Apply input parameters to last visited presentation in the cache.
-     */
+    //! Apply input parameters to last visited presentation in the cache.
     virtual
     CORBA::Boolean 
     Apply(VISU::ColoredPrs3d_ptr thePrs3d,
          const VISU::ColoredPrs3dHolder::BasicInput& theInput,
          VISU::View3D_ptr theView3D);
 
-    /*! Gets the last visited presentation in the cache.
-     */
+    //----------------------------------------------------------------------------
+    //! Gets the last visited presentation in the cache.
+    VISU::ColoredPrs3d_i*
+    GetPrs3dDevice();
+
+    //! Gets the last visited presentation in the cache.
     virtual
     VISU::ColoredPrs3d_ptr
     GetDevice();
 
-    /*! Gets TimeStampsRange information from the last visited presentation.
-     */
+    //----------------------------------------------------------------------------
+    //! Gets TimeStampsRange information from the last visited presentation.
     virtual
     VISU::ColoredPrs3d::TimeStampsRange*
     GetTimeStampsRange();
 
-    /*! Gats input parameters of the last visited presentation.
-     */
+    //! Gats input parameters of the last visited presentation.
     VISU::ColoredPrs3dHolder::BasicInput*
     GetBasicInput();
 
     //----------------------------------------------------------------------------
     virtual 
     VISU::VISUType 
-    GetType() { return VISU::TCOLOREDPRS3DHOLDER; }
+    GetType() 
+    { 
+      return VISU::TCOLOREDPRS3DHOLDER; 
+    }
+
+    VISU::VISUType
+    GetPrsType();
 
+    //----------------------------------------------------------------------------
     virtual
     void
-    RemoveFromStudy() {}
+    RemoveFromStudy();
+
+    virtual
+    const char*
+    GetComment() const;
 
     virtual
     void
-    ToStream(std::ostringstream&) {}
+    ToStream(std::ostringstream&);
+
+    virtual 
+    Storable* 
+    Restore(const Storable::TRestoringMap& theMap);
 
     virtual
     QString 
     GenerateName();
 
-    virtual
-    const char*
-    GetComment() const { return NULL; }
-
     //----------------------------------------------------------------------------
-    VISU::VISUType
-    GetPrsType() const { return myPrsType; }
-
   private:
-    VISU::VISUType               myPrsType;
-
-    VISU::ColoredPrs3dCache_i&   myCache;
-
-    static int                   myNbHolders;
+    VISU::ColoredPrs3dCache_i& myCache;
+    static const std::string myComment;
+    static int myNbHolders;
   };
 }
 
index 1f380d471ea0b8ba83847764b57d6f82a82ba60a..a8380e9fa948cdb563ff8b0bf65ed75d5249fd88 100644 (file)
@@ -357,11 +357,20 @@ VISU::ColoredPrs3d_i
   return aBasicInput;
 }
 
-QString
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::SetHolderEntry(const std::string& theEntry)
+{
+  myHolderEntry = theEntry; 
+}
+
+std::string
 VISU::ColoredPrs3d_i
 ::GetEntry()
 {
-  if( !myHolderEntry.isEmpty() )
+  if(myHolderEntry != "")
     return myHolderEntry;
 
   return TSuperClass::GetEntry();
@@ -1106,7 +1115,7 @@ VISU::ColoredPrs3d_i
   try{
 #endif
     QString aComment;
-    myName = "NoName";
+    SetName("NoName");
     if(theBuildMode == ECreateNew || theBuildMode == ESameAs){
       if(!IsRangeFixed()) 
        SetSourceRange();
@@ -1114,7 +1123,7 @@ VISU::ColoredPrs3d_i
        SetTitle(GetCFieldName().c_str());
     }
     if(myPublishInStudyMode == EPublishUnderTimeStamp){
-      myName = GenerateName().latin1();
+      SetName(GenerateName().latin1());
       aComment.sprintf("myComment=TIMESTAMP;myType=%d;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
                       VISU::TTIMESTAMP,
                       GetCMeshName().c_str(),
@@ -1139,13 +1148,13 @@ VISU::ColoredPrs3d_i
                       anEntry,
                       aRefFatherEntry,
                       anIOR.in(),
-                      myName,
+                      GetName(),
                       "",
                       aComment.latin1(),
                       true);
       SetSObject(GetStudyDocument()->FindObjectIOR(anIOR));
     }else if(myPublishInStudyMode == EPublishIndependently){
-      myName = GenerateName().latin1();
+      SetName(GenerateName().latin1());
       CORBA::String_var anIOR = GetID();
       std::string aFatherEntry = VISU::FindOrCreate3DPresentationsFolder(GetStudyDocument());
       aComment.sprintf("myComment=%s",
@@ -1154,7 +1163,7 @@ VISU::ColoredPrs3d_i
                       aFatherEntry,
                       "",
                       anIOR.in(),
-                      myName,
+                      GetName(),
                       "",
                       aComment.latin1(),
                       true);
index 16c3d76f806ed2a80807be594378309c695ed3b2..0204fe4a5c5ed029c6c2e31a46a097166ec3b609 100644 (file)
@@ -226,11 +226,12 @@ namespace VISU
 
     virtual
     void
-    SetHolderEntry( const QString& theEntry ) { myHolderEntry = theEntry; }
+    SetHolderEntry(const std::string& theEntry);
 
     virtual
-    QString
+    std::string
     GetEntry();
+
     //----------------------------------------------------------------------------
   public:
     /*!
@@ -439,7 +440,7 @@ namespace VISU
     PField myField;
     EPublishInStudyMode myPublishInStudyMode;
 
-    QString myHolderEntry;
+    std::string myHolderEntry;
 
     std::string myTitle;
     std::string myScalarBarTitle;
index bf48e73e2447a5cacdaa74f1fdb5f8d773434613..36079e800cc36b2db0b71586e729f286efb97129 100644 (file)
 
 #include "VISU_Prs3d_i.hh"
 #include "VISU_Mesh_i.hh"
-#include "VISU_ScalarMap_i.hh"
-#include "VISU_IsoSurfaces_i.hh"
-#include "VISU_DeformedShape_i.hh"
-#include "VISU_CutPlanes_i.hh"
-#include "VISU_CutLines_i.hh"
-#include "VISU_Vectors_i.hh"
-#include "VISU_StreamLines_i.hh"
-#include "VISU_GaussPoints_i.hh"
-#include "VISU_Plot3D_i.hh"
 #include "VISU_Table_i.hh"
 #include "VISU_TimeAnimation.h"
-#include "VISU_ScalarMapOnDeformedShape_i.hh"
 
+#include "VISU_ColoredPrs3dFactory.hh"
 #include "VISU_ColoredPrs3dCache_i.hh"
 #include "VISU_ColoredPrs3dHolder_i.hh"
 
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_SequenceOfAsciiString.hxx>
 
-// STL Includes
-#include <strstream>
-
 #include "Utils_ExceptHandlers.hxx"
+UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
 
-#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
-#define NO_CAS_CATCH
-#endif
-
-#include <Standard_Failure.hxx>
-
-#ifdef NO_CAS_CATCH
-#include <Standard_ErrorHandler.hxx>
-#else
-#include "CASCatch.hxx"
-#endif
+// STL Includes
+#include <strstream>
 
 using namespace std;
 
@@ -108,19 +88,18 @@ static QFileInfo aFileInfo;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
-//#define _DEXCEPT_
 #else
 static int MYDEBUG = 0;
 #endif
 
-UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
-
-extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB,
-                                     PortableServer::POA_ptr thePOA,
-                                     SALOME_NamingService* theNamingService,
-                                     QMutex* theMutex)
+extern "C" 
+VISU::VISU_Gen_ptr
+GetImpl(CORBA::ORB_ptr theORB,
+       PortableServer::POA_ptr thePOA,
+       SALOME_NamingService* theNamingService,
+       QMutex* theMutex)
 {
-  if(MYDEBUG) MESSAGE("extern \"C\" GetImpl");
+  if(MYDEBUG) MESSAGE("extern 'C' GetImpl");
   VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex);
   //return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
   return aVISU_Gen->_this();
@@ -128,13 +107,15 @@ extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB,
 
 namespace VISU
 {
+  //----------------------------------------------------------------------------
   static string VisuTmpDir;
 
   static CORBA::Boolean myIsMultiFile;
   const CORBA::Boolean IsMultifile() { return myIsMultiFile;}
 
-  //===========================================================================
-  _PTR(SComponent) ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument)
+  //----------------------------------------------------------------------------
+  _PTR(SComponent) 
+  ClientFindOrCreateVisuComponent (_PTR(Study) theStudyDocument)
   {
     _PTR(SComponent) aSComponent = theStudyDocument->FindComponent("VISU");
     if (!aSComponent) {
@@ -169,7 +150,11 @@ namespace VISU
     return aSComponent;
   }
 
-  SALOMEDS::SComponent_var FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument){
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::SComponent_var 
+  FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument)
+  {
     SALOMEDS::SComponent_var aSComponent = theStudyDocument->FindComponent("VISU");
     if (aSComponent->_is_nil()) {
       SALOMEDS::StudyBuilder_var aStudyBuilder = theStudyDocument->NewBuilder();
@@ -202,7 +187,11 @@ namespace VISU
     return aSComponent;
   }
 
-  void RegistryStorable() {
+
+  //----------------------------------------------------------------------------
+  void
+  RegistryStorable() 
+  {
     Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
     Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
     Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
@@ -221,10 +210,10 @@ namespace VISU
   }
 
 
-  //===========================================================================
-  VISU_Gen_i::
-  VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
-            SALOME_NamingService* theNamingService, QMutex* theMutex) :
+  //----------------------------------------------------------------------------
+  VISU_Gen_i
+  ::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
+              SALOME_NamingService* theNamingService, QMutex* theMutex) :
     Engines_Component_i()
   {
     if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
@@ -249,96 +238,29 @@ namespace VISU
   }
 
 
-  ColoredPrs3d_i*
-  VISU_Gen_i::
-  CreatePrs3d_i(VISUType theType,
-               SALOMEDS::Study_ptr theStudy)
-  {
-    switch(theType){
-    case TSCALARMAP:
-      return VISU::CreatePrs3d_i<ScalarMap_i>(theStudy);
-    case TGAUSSPOINTS:
-      return VISU::CreatePrs3d_i<GaussPoints_i>(theStudy);
-    case TDEFORMEDSHAPE:
-      return VISU::CreatePrs3d_i<DeformedShape_i>(theStudy);
-    case TSCALARMAPONDEFORMEDSHAPE:
-      return VISU::CreatePrs3d_i<ScalarMapOnDeformedShape_i>(theStudy);
-    case TISOSURFACE:
-      return VISU::CreatePrs3d_i<IsoSurfaces_i>(theStudy);
-    case TSTREAMLINES:
-      return VISU::CreatePrs3d_i<StreamLines_i>(theStudy);
-    case TPLOT3D:
-      return VISU::CreatePrs3d_i<Plot3D_i>(theStudy);
-    case TCUTPLANES:
-      return VISU::CreatePrs3d_i<CutPlanes_i>(theStudy);
-    case TCUTLINES:
-      return VISU::CreatePrs3d_i<CutLines_i>(theStudy);
-    case TVECTORS:
-      return VISU::CreatePrs3d_i<Vectors_i>(theStudy);
-    }
-    return NULL;
-  }
-
-
+  //----------------------------------------------------------------------------
   Prs3d_ptr
-  VISU_Gen_i::
-  CreatePrs3d(VISUType theType,
-             SALOMEDS::Study_ptr theStudy)
+  VISU_Gen_i
+  ::CreatePrs3d(VISUType theType,
+               SALOMEDS::Study_ptr theStudy)
   {
-    if(ColoredPrs3d_i* aPrs3d = CreatePrs3d_i(theType, theStudy))
+    if(ColoredPrs3d_i* aPrs3d = VISU::CreatePrs3d_i(theType, theStudy))
       return aPrs3d->_this();
     return Prs3d::_nil();
   }
 
 
-  bool
-  CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
-                   const std::string& theMeshName, 
-                   VISU::Entity theEntity,
-                   const std::string& theFieldName, 
-                   CORBA::Double theIteration)
+  //----------------------------------------------------------------------------
+  VISU_Gen_i
+  ::~VISU_Gen_i()
   {
-#ifndef _DEXCEPT_
-#ifdef NO_CAS_CATCH
-    try{
-      OCC_CATCH_SIGNALS;
-#else
-    CASCatch_TRY{
-      try{
-#endif
-#endif
-       if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration)))
-         return true;
-#ifndef _DEXCEPT_
-#ifdef NO_CAS_CATCH
-      }catch(Standard_Failure) {
-       Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-       INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
-      }catch(std::exception& exc){
-       INFOS("Follow exception was occured :\n"<<exc.what());
-      }catch(...){
-       INFOS("Unknown exception was occured!");
-      }
-#else
-      }catch(std::exception& exc){
-       INFOS("Follow exception was occured :\n"<<exc.what());
-      }catch(...){
-       INFOS("Unknown exception was occured!");
-      }
-    }CASCatch_CATCH(Standard_Failure){
-      Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
-      INFOS("Follow signal was occured :\n"<<aFail->GetMessageString());
-    }
-#endif
-#endif
-    return false;
-  }
-
-  VISU_Gen_i::~VISU_Gen_i(){
     if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
   }
 
-  void CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
+
+  //----------------------------------------------------------------------------
+  void
+  CorrectSObjectType(SALOMEDS::SObject_ptr theSObject)
   {
     SALOMEDS::GenericAttribute_var anAttr;
     if ( theSObject->FindAttribute(anAttr, "AttributeComment") ) {
@@ -397,11 +319,14 @@ namespace VISU
     }
   }
 
-  //===========================================================================
-  CORBA::Boolean VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
-                                 const SALOMEDS::TMPFile & theStream,
-                                 const char* theURL,
-                                 bool isMultiFile)
+
+  //----------------------------------------------------------------------------
+  CORBA::Boolean 
+  VISU_Gen_i
+  ::Load(SALOMEDS::SComponent_ptr theComponent,
+        const SALOMEDS::TMPFile & theStream,
+        const char* theURL,
+        bool isMultiFile)
   {
     Mutex mt(myMutex);
     SALOMEDS::Study_var aStudy = theComponent->GetStudy();
@@ -422,18 +347,26 @@ namespace VISU
     return true;
   }
 
-  CORBA::Boolean VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
-                                      const SALOMEDS::TMPFile & theStream,
-                                      const char* theURL,
-                                      bool isMultiFile)
+
+  //----------------------------------------------------------------------------
+  CORBA::Boolean 
+  VISU_Gen_i
+  ::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
+             const SALOMEDS::TMPFile & theStream,
+             const char* theURL,
+             bool isMultiFile)
   {
     return Load(theComponent, theStream, theURL, isMultiFile);
   }
 
-  char* VISU_Gen_i::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
-                                          const char* aLocalPersistentID,
-                                          CORBA::Boolean isMultiFile,
-                                          CORBA::Boolean isASCII)
+
+  //----------------------------------------------------------------------------
+  char* 
+  VISU_Gen_i
+  ::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
+                          const char* aLocalPersistentID,
+                          CORBA::Boolean isMultiFile,
+                          CORBA::Boolean isASCII)
   {
     CORBA::String_var aString("");
     if(strcmp(aLocalPersistentID,"") != 0) {
@@ -445,10 +378,13 @@ namespace VISU
     return aString._retn();
   }
 
-  //===========================================================================
-  SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
-                                     const char* theURL,
-                                     bool theIsMultiFile)
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::TMPFile* 
+  VISU_Gen_i
+  ::Save(SALOMEDS::SComponent_ptr theComponent,
+        const char* theURL,
+        bool theIsMultiFile)
   {
     Mutex mt(myMutex);
     string aTmpDir = theURL;
@@ -514,9 +450,13 @@ namespace VISU
     return aStreamFile._retn();
   }
 
-  SALOMEDS::TMPFile* VISU_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
-                                          const char* theURL,
-                                          bool isMultiFile)
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::TMPFile* 
+  VISU_Gen_i
+  ::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
+             const char* theURL,
+             bool isMultiFile)
   {
     Mutex mt(myMutex);
     string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
@@ -570,10 +510,14 @@ namespace VISU
     return aStreamFile._retn();
   }
 
-  char* VISU_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
-                                          const char* IORString,
-                                          CORBA::Boolean isMultiFile,
-                                          CORBA::Boolean isASCII)
+
+  //----------------------------------------------------------------------------
+  char* 
+  VISU_Gen_i
+  ::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
+                          const char* IORString,
+                          CORBA::Boolean isMultiFile,
+                          CORBA::Boolean isASCII)
   {
     CORBA::String_var aString(IORString);
     if(strcmp(IORString,"") != 0){
@@ -590,11 +534,20 @@ namespace VISU
     return aString._retn();
   }
 
-  char* VISU_Gen_i::GetID(){
+
+  //----------------------------------------------------------------------------
+  char* 
+  VISU_Gen_i
+  ::GetID()
+  {
     return Base_i::GetID();
   }
 
-  void VISU_Gen_i::SetCurrentStudy (SALOMEDS::Study_ptr theStudy)
+
+  //----------------------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::SetCurrentStudy(SALOMEDS::Study_ptr theStudy)
   {
     class TEvent: public SALOME_Event {
       std::string myStudyName;
@@ -645,17 +598,32 @@ namespace VISU
     }
   }
 
-  SALOMEDS::Study_ptr VISU_Gen_i::GetCurrentStudy(){
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::Study_ptr 
+  VISU_Gen_i
+  ::GetCurrentStudy()
+  {
     return SALOMEDS::Study::_duplicate(myStudyDocument);
   }
 
-  ViewManager_ptr VISU_Gen_i::GetViewManager(){
+
+  //----------------------------------------------------------------------------
+  ViewManager_ptr 
+  VISU_Gen_i
+  ::GetViewManager()
+  {
     Mutex mt(myMutex);
     ViewManager_i * aViewManager = new ViewManager_i(myStudyDocument);
     return ViewManager::_duplicate(aViewManager->_this());
   }
 
-  SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName){
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::SObject_ptr 
+  VISU_Gen_i
+  ::ImportTables(const char* theFileName)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return SALOMEDS::SObject::_nil();
     Mutex mt(myMutex);
@@ -663,13 +631,22 @@ namespace VISU
     return aRes._retn();
   }
 
-  CORBA::Boolean VISU_Gen_i::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
-                                              const char* theFileName)
+
+  //----------------------------------------------------------------------------
+  CORBA::Boolean 
+  VISU_Gen_i
+  ::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
+                     const char* theFileName)
   {
     return VISU::ExportTableToFile(theTable, theFileName);
   }
 
-  Result_ptr VISU_Gen_i::ImportFile(const char* theFileName){
+
+  //----------------------------------------------------------------------------
+  Result_ptr
+  VISU_Gen_i
+  ::ImportFile(const char* theFileName)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
     Mutex mt(myMutex);
@@ -685,7 +662,12 @@ namespace VISU
     }
   }
 
-  Result_ptr VISU_Gen_i::CreateResult(const char* theFileName){
+
+  //----------------------------------------------------------------------------
+  Result_ptr
+  VISU_Gen_i
+  ::CreateResult(const char* theFileName)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
     Mutex mt(myMutex);
@@ -702,7 +684,12 @@ namespace VISU
     }
   }
 
-  Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){
+
+  //----------------------------------------------------------------------------
+  Result_ptr
+  VISU_Gen_i
+  ::CopyAndImportFile(const char* theFileName)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
     Mutex mt(myMutex);
@@ -716,7 +703,11 @@ namespace VISU
     return aResult._retn();
   }
 
-  Result_ptr VISU_Gen_i::ImportMed (SALOMEDS::SObject_ptr theMedSObject)
+
+  //----------------------------------------------------------------------------
+  Result_ptr
+  VISU_Gen_i
+  ::ImportMed(SALOMEDS::SObject_ptr theMedSObject)
   {
     if (myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
@@ -732,7 +723,11 @@ namespace VISU
     }
   }
 
-  Result_ptr VISU_Gen_i::ImportMedField (SALOME_MED::FIELD_ptr theField)
+
+  //----------------------------------------------------------------------------
+  Result_ptr
+  VISU_Gen_i
+  ::ImportMedField (SALOME_MED::FIELD_ptr theField)
   {
     if (myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
@@ -748,11 +743,13 @@ namespace VISU
     }
   }
 
-  void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult,
-                                    string     theMeshName,
-                                    int        theEntity,      // -1 for group indication
-                                    string     theSubMeshName, // Family or Group name
-                                    string     theNewName)
+  void
+  VISU_Gen_i
+  ::RenameMeshInStudy(Result_ptr theResult,
+                     const std::string& theMeshName,
+                     int theEntity, // -1 for group indication
+                     const std::string& theSubMeshName, // Family or Group name
+                     const std::string& theNewName)
   {
     if (myStudyDocument->GetProperties()->IsLocked()) return;
     Mutex mt(myMutex);
@@ -802,34 +799,50 @@ namespace VISU
     aStudyBuilder->CommitCommand();
   }
 
-  void VISU_Gen_i::RenameEntityInStudy(Result_ptr   theResult,
-                                      const char*  theMeshName,
-                                      VISU::Entity theEntity,
-                                      const char*  theNewName)
+
+  //----------------------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::RenameEntityInStudy(Result_ptr   theResult,
+                       const char*  theMeshName,
+                       VISU::Entity theEntity,
+                       const char*  theNewName)
   {
     RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName);
   }
 
-  void VISU_Gen_i::RenameFamilyInStudy(Result_ptr   theResult,
-                                      const char*  theMeshName,
-                                      VISU::Entity theEntity,
-                                      const char*  theFamilyName,
-                                      const char*  theNewName)
+
+  //----------------------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::RenameFamilyInStudy(Result_ptr   theResult,
+                       const char*  theMeshName,
+                       VISU::Entity theEntity,
+                       const char*  theFamilyName,
+                       const char*  theNewName)
   {
     RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName);
   }
 
-  void VISU_Gen_i::RenameGroupInStudy(Result_ptr  theResult,
-                                     const char*  theMeshName,
-                                     const char* theGroupName,
-                                     const char* theNewName)
+
+  //----------------------------------------------------------------------------
+  void 
+  VISU_Gen_i
+  ::RenameGroupInStudy(Result_ptr  theResult,
+                      const char*  theMeshName,
+                      const char* theGroupName,
+                      const char* theNewName)
   {
     RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName);
   }
 
-  Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult,
-                                   const char* theMeshName,
-                                   VISU::Entity theEntity)
+
+  //----------------------------------------------------------------------------
+  Mesh_ptr
+  VISU_Gen_i
+  ::MeshOnEntity(Result_ptr theResult,
+                const char* theMeshName,
+                VISU::Entity theEntity)
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Mesh::_nil();
@@ -845,10 +858,14 @@ namespace VISU
     return VISU::Mesh::_nil();
   }
 
-  Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult,
-                                         const char* theMeshName,
-                                         VISU::Entity theEntity,
-                                         const char* theFamilyName)
+
+  //----------------------------------------------------------------------------
+  Mesh_ptr 
+  VISU_Gen_i
+  ::FamilyMeshOnEntity(Result_ptr theResult,
+                      const char* theMeshName,
+                      VISU::Entity theEntity,
+                      const char* theFamilyName)
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Mesh::_nil();
@@ -864,9 +881,13 @@ namespace VISU
     return VISU::Mesh::_nil();
   }
 
-  Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult,
-                                const char* theMeshName,
-                                const char* theGroupName)
+
+  //----------------------------------------------------------------------------
+  Mesh_ptr
+  VISU_Gen_i
+  ::GroupMesh(Result_ptr theResult,
+             const char* theMeshName,
+             const char* theGroupName)
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Mesh::_nil();
@@ -882,20 +903,32 @@ namespace VISU
     return VISU::Mesh::_nil();
   }
 
-  ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult,
-                                            const char* theMeshName,
-                                            VISU::Entity theEntity,
-                                            const char* theFieldName,
-                                            CORBA::Double theIteration)
+
+  //----------------------------------------------------------------------------
+  ScalarMap_ptr 
+  VISU_Gen_i
+  ::ScalarMapOnField(Result_ptr theResult,
+                    const char* theMeshName,
+                    VISU::Entity theEntity,
+                    const char* theFieldName,
+                    CORBA::Long theIteration)
   {
-    return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
+    return Prs3dOnField<VISU::ScalarMap_i>(theResult,
+                                          theMeshName,
+                                          theEntity,
+                                          theFieldName,
+                                          theIteration)._retn();
   }
 
-  GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult,
-                                                const char* theMeshName,
-                                                VISU::Entity theEntity,
-                                                const char* theFieldName,
-                                                CORBA::Double theIteration)
+
+  //----------------------------------------------------------------------------
+  GaussPoints_ptr
+  VISU_Gen_i
+  ::GaussPointsOnField(Result_ptr theResult,
+                      const char* theMeshName,
+                      VISU::Entity theEntity,
+                      const char* theFieldName,
+                      CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::GaussPoints_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -904,7 +937,7 @@ namespace VISU
                                                     const char* theMeshName,
                                                     VISU::Entity theEntity,
                                                     const char* theFieldName,
-                                                    CORBA::Double theIteration)
+                                                    CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::DeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -913,7 +946,7 @@ namespace VISU
                                                                           const char* theMeshName,
                                                                           VISU::Entity theEntity,
                                                                           const char* theFieldName,
-                                                                          CORBA::Double theIteration)
+                                                                          CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::ScalarMapOnDeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -922,7 +955,7 @@ namespace VISU
                                         const char* theMeshName,
                                         VISU::Entity theEntity,
                                         const char* theFieldName,
-                                        CORBA::Double theIteration)
+                                        CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::Vectors_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -931,7 +964,7 @@ namespace VISU
                                                 const char* theMeshName,
                                                 VISU::Entity theEntity,
                                                 const char* theFieldName,
-                                                CORBA::Double theIteration)
+                                                CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -940,7 +973,7 @@ namespace VISU
                                                 const char* theMeshName,
                                                 VISU::Entity theEntity,
                                                 const char* theFieldName,
-                                                CORBA::Double theIteration)
+                                                CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -949,7 +982,7 @@ namespace VISU
                                       const char* theMeshName,
                                       VISU::Entity theEntity,
                                       const char* theFieldName,
-                                      CORBA::Double theIteration)
+                                      CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::Plot3D_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -958,7 +991,7 @@ namespace VISU
                                             const char* theMeshName,
                                             VISU::Entity theEntity,
                                             const char* theFieldName,
-                                            CORBA::Double theIteration)
+                                            CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::CutPlanes_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -967,7 +1000,7 @@ namespace VISU
                                           const char* theMeshName,
                                           VISU::Entity theEntity,
                                           const char* theFieldName,
-                                          CORBA::Double theIteration)
+                                          CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
@@ -1168,7 +1201,6 @@ namespace VISU
     // Assign an ID = 1 the the type VISU::Result
     theObjectID = 1;
 
-
     SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU");
     return aStreamFile._retn();
   }
@@ -1237,45 +1269,10 @@ namespace VISU
     return aResultSO._retn();
   }
 
-  VISU::ColoredPrs3d_i*
-  VISU_Gen_i::
-  CreateHolder(VISU::VISUType theType,
-              Result_i* theResult, 
-              const std::string& theMeshName, 
-              VISU::Entity theEntity,
-              const std::string& theFieldName, 
-              CORBA::Double theIteration)
-  {
-    VISU::ColoredPrs3dHolder::BasicInput anInput;
-    anInput.myResult = theResult->_this();
-    anInput.myMeshName = theMeshName.c_str();
-    anInput.myEntity = theEntity;
-    anInput.myFieldName = theFieldName.c_str();
-    anInput.myTimeStampNumber = theIteration;
-
-    SALOMEDS::Study_var aStudy = GetCurrentStudy();
-    VISU::ColoredPrs3dCache_ptr aCache = GetColoredPrs3dCache(aStudy);
-    VISU::ColoredPrs3dHolder_ptr aHolder = aCache->CreateHolder(theType,anInput);
-
-    VISU::ColoredPrs3d_ptr aPrs3d = aHolder->GetDevice();
-    VISU::ColoredPrs3d_i* aPrs3d_i = dynamic_cast<VISU::ColoredPrs3d_i*>(GetServant(aPrs3d).in());
-
-    return aPrs3d_i;
-  }
-
   VISU::ColoredPrs3dCache_ptr
   VISU_Gen_i::
   GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
   {
-    SALOMEDS::SObject_var aSObject = theStudy->FindObject(VISU::ColoredPrs3dCache_i::GetFolderName().c_str());
-    if(!CORBA::is_nil(aSObject))
-    {
-      CORBA::Object_var anObject = aSObject->GetObject();
-      VISU::ColoredPrs3dCache_var aCache = VISU::ColoredPrs3dCache::_narrow(anObject);
-      if(!CORBA::is_nil(aCache))
-       return aCache._retn();
-    }
-
-    return (new VISU::ColoredPrs3dCache_i(theStudy))->_this();
+    return ColoredPrs3dCache_i::GetInstance(theStudy);
   }
 }
index a1f971089322650ab582f95b40a51d5ca42d295c..3b8280b11a3d2237bce18758fa59e703db290f1f 100644 (file)
 
 namespace VISU
 {
-  class Result_i;
-  class ColoredPrs3d_i;
-  class ColoredPrs3dCache_i;
-  class ColoredPrs3dHolder_i;
-
-  bool
-  CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
-                   const std::string& theMeshName, 
-                   VISU::Entity theEntity,
-                   const std::string& theFieldName, 
-                   CORBA::Double theIteration);
-
-  template<typename TPrs3d_i> 
-  ColoredPrs3d_i*
-  CreatePrs3d_i(SALOMEDS::Study_ptr theStudy)
-  {
-    if(!theStudy->GetProperties()->IsLocked()){
-      typedef typename TPrs3d_i::TInterface TPrs3d;
-      if(TPrs3d_i* aPresent = new TPrs3d_i(NULL,ColoredPrs3d_i::EPublishIndependently)){
-       return aPresent;
-      }
-    }
-    return NULL;
-  }
-
+  //----------------------------------------------------------------------------
   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
                     public virtual ::Engines_Component_i,
                     public virtual Base_i
@@ -71,7 +47,9 @@ namespace VISU
               PortableServer::POA_ptr thePOA,
               SALOME_NamingService* theNamingService,
               QMutex* theMutex);
-    virtual ~VISU_Gen_i();
+
+    virtual 
+    ~VISU_Gen_i();
 
     virtual 
     char* 
@@ -103,7 +81,7 @@ namespace VISU
                      const char* theFileName );
 
     //Create Result
-    virtual 
+    virtual
     Result_ptr
     ImportFile(const char* theFileName);
 
@@ -126,11 +104,11 @@ namespace VISU
 
     //Rename Presentation Of Submeshes
     void
-    RenameMeshInStudy(Result_ptr  theResult,
-                     std::string theMeshName,
-                     int         theEntity,      // -1 for group indication
-                     std::string theSubMeshName, // Family or Group name
-                     std::string theNewName);
+    RenameMeshInStudy(Result_ptr theResult,
+                     const std::string& theMeshName,
+                     int theEntity, // -1 for group indication
+                     const std::string& theSubMeshName, // Family or Group name
+                     const std::string& theNewName);
     virtual
     void
     RenameEntityInStudy(Result_ptr   theResult,
@@ -171,78 +149,17 @@ namespace VISU
              const char* theMeshName, 
              const char* theGroupName);
 
-    ColoredPrs3d_i*
-    CreatePrs3d_i(VISUType theType,
-                 SALOMEDS::Study_ptr theStudy);
-
     Prs3d_ptr
     CreatePrs3d(VISUType theType,
                SALOMEDS::Study_ptr theStudy);
 
-    ColoredPrs3d_i*
-    CreateHolder(VISU::VISUType theType,
-                Result_i* theResult, 
-                const std::string& theMeshName, 
-                VISU::Entity theEntity,
-                const std::string& theFieldName, 
-                CORBA::Double theIteration);
-
-    //Create 3D collored Presentation Of Different Types
-    template<typename TPrs3d_i> TPrs3d_i*
-    CreatePrs3d(Result_ptr theResult, 
-               const std::string& theMeshName, 
-               VISU::Entity theEntity,
-               const std::string& theFieldName, 
-               CORBA::Double theIteration,
-               ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode = ColoredPrs3d_i::EPublishUnderTimeStamp)
-    {
-      if(myStudyDocument->GetProperties()->IsLocked()) 
-       return NULL;
-
-      typedef typename TPrs3d_i::TInterface TPrs3d;
-      typename TPrs3d::_var_type aPrs3d;
-      Mutex mt(myMutex);
-      if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
-       if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){
-         TPrs3d_i* aPresent = new TPrs3d_i(aResult,thePublishInStudyMode);
-
-         if( thePublishInStudyMode != ColoredPrs3d_i::EPublishUnderTimeStamp )
-         {
-           ColoredPrs3d_i* aPrs3d = 
-             CreateHolder(aPresent->GetType(),aResult,theMeshName,theEntity,theFieldName,theIteration);
-
-           return dynamic_cast<TPrs3d_i*>(aPrs3d);
-         }
-
-         if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
-           return aPresent;
-         aPresent->_remove_ref();
-       }
-      }
-      return NULL;
-    }
-
-    template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
-    Prs3dOnField(Result_ptr theResult, 
-                const std::string& theMeshName, 
-                VISU::Entity theEntity,
-                const std::string& theFieldName, 
-                CORBA::Double theIteration)
-    {
-      typedef typename TPrs3d_i::TInterface TPrs3d;
-      typename TPrs3d::_var_type aPrs3d;
-      if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration))
-       return aPrs3d->_this();
-      return TPrs3d::_nil();
-    }
-
     virtual
     ScalarMap_ptr
     ScalarMapOnField(Result_ptr theResult,
                     const char* theMeshName, 
                     VISU::Entity theEntity,
                     const char* theFieldName, 
-                    CORBA::Double theIteration);
+                    CORBA::Long theIteration);
 
     virtual
     GaussPoints_ptr
@@ -250,7 +167,7 @@ namespace VISU
                       const char* theMeshName, 
                       VISU::Entity theEntity,
                       const char* theFieldName, 
-                      CORBA::Double theIteration);
+                      CORBA::Long theIteration);
 
     virtual
     DeformedShape_ptr
@@ -258,7 +175,7 @@ namespace VISU
                         const char* theMeshName, 
                         VISU::Entity theEntity,
                         const char* theFieldName, 
-                        CORBA::Double theIteration);
+                        CORBA::Long theIteration);
 
     virtual
     ScalarMapOnDeformedShape_ptr
@@ -266,14 +183,14 @@ namespace VISU
                                    const char* theMeshName, 
                                    VISU::Entity theEntity,
                                    const char* theFieldName, 
-                                   CORBA::Double theIteration);
+                                   CORBA::Long theIteration);
     virtual
     Vectors_ptr
     VectorsOnField(Result_ptr theResult,
                   const char* theMeshName, 
                   VISU::Entity theEntity,
                   const char* theFieldName, 
-                  CORBA::Double theIteration);
+                  CORBA::Long theIteration);
 
     virtual
     IsoSurfaces_ptr
@@ -281,7 +198,7 @@ namespace VISU
                       const char* theMeshName, 
                       VISU::Entity theEntity,
                       const char* theFieldName, 
-                      CORBA::Double theIteration);
+                      CORBA::Long theIteration);
 
     virtual
     CutPlanes_ptr
@@ -289,7 +206,7 @@ namespace VISU
                     const char* theMeshName, 
                     VISU::Entity theEntity,
                     const char* theFieldName, 
-                    CORBA::Double theIteration);
+                    CORBA::Long theIteration);
 
     virtual
     CutLines_ptr
@@ -297,7 +214,7 @@ namespace VISU
                    const char* theMeshName, 
                    VISU::Entity theEntity,
                    const char* theFieldName, 
-                   CORBA::Double theIteration);
+                   CORBA::Long theIteration);
 
     virtual
     StreamLines_ptr
@@ -305,7 +222,7 @@ namespace VISU
                       const char* theMeshName, 
                       VISU::Entity theEntity,
                       const char* theFieldName, 
-                      CORBA::Double theIteration);
+                      CORBA::Long theIteration);
 
     virtual
     Plot3D_ptr
@@ -313,7 +230,7 @@ namespace VISU
                  const char* theMeshName, 
                  VISU::Entity theEntity,
                  const char* theFieldName, 
-                 CORBA::Double theIteration);
+                 CORBA::Long theIteration);
 
     //Create Digital Presentation
     virtual 
index 7d924cffb47652a26c45c8a3bf8e4c178c92db6f..cb3790c5b1362bac2e5a837e30aa1843efc4b980 100644 (file)
@@ -272,7 +272,7 @@ VISU::Mesh_i
       myPresentType =  VISU::PresentationType(VISU::GetResourceMgr()->integerValue("VISU" , "mesh_represent", 2));
       if(myEntity == VISU::NODE_ENTITY)
        myPresentType = VISU::POINT;
-      myName = GenerateName().latin1();
+      SetName(GenerateName().latin1());
       myCellColor.R = 0.0;  myCellColor.G = myCellColor.B = 1.0;
       myNodeColor.R = myNodeColor.G = 1.0;  myNodeColor.B = 1.0;
       myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
index 1f13d04f5ce1ed2feac053f01c8b2fd4744bd6de..8eef43a245262ab591e808684e8db76c3b4bf521 100644 (file)
@@ -222,7 +222,7 @@ VISU::Storable*
 VISU::Prs3d_i
 ::Restore(const Storable::TRestoringMap& theMap)
 {
-  myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+  SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
   myOffset[0] = VISU::Storable::FindValue(theMap,"myOffset[0]").toFloat();
   myOffset[1] = VISU::Storable::FindValue(theMap,"myOffset[1]").toFloat();
   myOffset[2] = VISU::Storable::FindValue(theMap,"myOffset[2]").toFloat();
@@ -234,7 +234,7 @@ void
 VISU::Prs3d_i
 ::ToStream(std::ostringstream& theStr)
 {
-  Storable::DataToStream( theStr, "myName",   myName.c_str() );
+  Storable::DataToStream( theStr, "myName",   GetName().c_str() );
   Storable::DataToStream( theStr, "myOffset[0]", myOffset[0] );
   Storable::DataToStream( theStr, "myOffset[1]", myOffset[1] );
   Storable::DataToStream( theStr, "myOffset[2]", myOffset[2] );
@@ -377,7 +377,7 @@ VISU::Prs3d_i::
 GetIO()
 {
   if( myIO.IsNull() )
-    myIO = new SALOME_InteractiveObject(GetEntry(),"VISU",GetName());
+    myIO = new SALOME_InteractiveObject(GetEntry().c_str(), "VISU", GetName().c_str());
 
   return myIO;
 }
index 8ce68939ebe6a1c38a2d3266714da9a2cea1a9ac..497050cc0cf13a59ab1c321fd284f54f53be306b 100644 (file)
@@ -33,29 +33,28 @@ static int MYDEBUG = 0;
 #endif
 
 //---------------------------------------------------------------
-VISU::PrsObject_i
-::PrsObject_i(SALOMEDS::Study_ptr theStudy): 
-  myStudy(SALOMEDS::Study::_duplicate(theStudy)) 
+VISU::RemovableObject_i
+::RemovableObject_i()
 {
-  if(MYDEBUG) MESSAGE("PrsObject_i::PrsObject_i - this = "<<this);
+  if(MYDEBUG) MESSAGE("RemovableObject_i::RemovableObject_i - this = "<<this);
 }
 
 
 //---------------------------------------------------------------
-VISU::PrsObject_i
-::~PrsObject_i() 
+VISU::RemovableObject_i
+::~RemovableObject_i() 
 {
-  if(MYDEBUG) MESSAGE("PrsObject_i::~PrsObject_i - this = "<<this);
+  if(MYDEBUG) MESSAGE("RemovableObject_i::~RemovableObject_i - this = "<<this);
 }
 
 
 //---------------------------------------------------------------
 void
-VISU::PrsObject_i
+VISU::RemovableObject_i
 ::SetName(const std::string& theName)
 {
   myName = theName;
-  SALOMEDS::SObject_var aSObject = myStudy->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(GetEntry().c_str());
   if(!aSObject->_is_nil()){
     SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
     SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
@@ -66,17 +65,17 @@ VISU::PrsObject_i
 
 
 //---------------------------------------------------------------
-const char* 
-VISU::PrsObject_i
+const std::string&
+VISU::RemovableObject_i
 ::GetName() const 
 { 
-  return myName.c_str();
+  return myName;
 }
 
 
 //---------------------------------------------------------------
 const SALOMEDS::Study_var& 
-VISU::PrsObject_i
+VISU::RemovableObject_i
 ::GetStudyDocument() const 
 { 
   return myStudy;
@@ -85,7 +84,7 @@ VISU::PrsObject_i
 
 //---------------------------------------------------------------
 void
-VISU::PrsObject_i
+VISU::RemovableObject_i
 ::SetStudyDocument(SALOMEDS::Study_ptr theStudy) 
 { 
   myStudy = SALOMEDS::Study::_duplicate(theStudy);
@@ -93,16 +92,26 @@ VISU::PrsObject_i
 
 
 //---------------------------------------------------------------
-QString 
-VISU::PrsObject_i
+std::string 
+VISU::RemovableObject_i
 ::GetEntry() 
 { 
   CORBA::String_var anIOR = GetID();
   SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in());
-  CORBA::String_var anEntry;
+  CORBA::String_var anEntry("");
   if(!CORBA::is_nil(aSObject.in()))
     anEntry = aSObject->GetID();
   else
     MESSAGE("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
   return anEntry.in();
 }
+
+
+//---------------------------------------------------------------
+VISU::PrsObject_i
+::PrsObject_i(SALOMEDS::Study_ptr theStudy)
+{
+  SetStudyDocument(theStudy);
+}
+
+
index 781c6eb1a0f33f992c9455c2e80661416841cf75..eb4a3b07b1f27566600d90ae3aa3a33e15f88179 100644 (file)
 
 namespace VISU
 {
-  class PrsObject_i : public virtual POA_VISU::PrsObject,
-                      public virtual RemovableObject_i
+  //----------------------------------------------------------------------------
+  class RemovableObject_i : public virtual POA_VISU::RemovableObject,
+                            public virtual Storable
   {
-    PrsObject_i(const PrsObject_i&);
-    SALOMEDS::Study_var myStudy;
-
   public:
-    PrsObject_i(SALOMEDS::Study_ptr theStudy = SALOMEDS::Study::_nil());
+    typedef Storable TSuperClass;
 
     virtual 
-    ~PrsObject_i();
+    ~RemovableObject_i();
 
-  protected:
-    void
-    SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+    const SALOMEDS::Study_var& 
+    GetStudyDocument() const;
 
-    std::string myName;
+    virtual
+    std::string
+    GetEntry();
 
-  public:
     virtual 
-    const char* 
+    const std::string&
     GetName() const;
 
     virtual 
     void
     SetName(const std::string& theName);
 
-    const SALOMEDS::Study_var& 
-    GetStudyDocument() const;
+  protected:
+    RemovableObject_i();
 
-    virtual
-    QString
-    GetEntry();
+    void
+    SetStudyDocument(SALOMEDS::Study_ptr theStudy);
+
+  private:
+    std::string myName;
+    SALOMEDS::Study_var myStudy;
+
+    RemovableObject_i(const RemovableObject_i&);
+  };
+
+
+  //----------------------------------------------------------------------------
+  class PrsObject_i : public virtual POA_VISU::PrsObject,
+                      public virtual RemovableObject_i
+  {
+    PrsObject_i(const PrsObject_i&);
+    SALOMEDS::Study_var myStudy;
+
+  public:
+    typedef RemovableObject_i TSuperClass;
+
+    PrsObject_i(SALOMEDS::Study_ptr theStudy);
   };
 }
 
index b04fc0d5c85809b58eb3c68fabcb807562159daf..e60c748d209d4bbcd1f8aebbd660790de8292cc0 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef __VISU_RESULT_I_H__
 #define __VISU_RESULT_I_H__
 
-#include "VISUConfig.hh"
+#include "VISU_PrsObject_i.hh"
 #include "VISU_BoostSignals.h"
 #include "SALOME_GenericObj_i.hh"
 
index 77bd7333f27aa16a26b9e3e46a52e0b6e4b2f66b..6e2ad6cb00930dae1ce1d411aa1ada48401c67b9 100644 (file)
@@ -130,10 +130,10 @@ CORBA::Long VISU::Table_i::GetNbColumns()
 VISU::Storable* VISU::Table_i::Create()
 {
   // generate name ...
-  myName = GetTableTitle();
+  SetName(GetTableTitle());
 
   // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
-  if ( myName == "" )
+  if ( GetName() == "" )
     if ( !mySObj->_is_nil() ) {
       CutLines_i* pCutLines = NULL;
       CORBA::Object_var anObj = SObjectToObject(mySObj);
@@ -143,11 +143,11 @@ VISU::Storable* VISU::Table_i::Create()
            pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
        }
       if (!pCutLines)
-       if (mySObj->GetName()) myName = mySObj->GetName();
+       if (mySObj->GetName()) SetName(mySObj->GetName());
     }
 
-  if ( myName == "" )
-    myName = GenerateName();
+  if ( GetName() == "" )
+    SetName(GenerateName());
   // ... and build the object
   return Build( false );
 }
@@ -223,7 +223,7 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
 VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
 {
   if(MYDEBUG) MESSAGE(GetComment());
-  myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+  SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
   myTitle = VISU::Storable::FindValue(theMap,"myTitle").latin1();
   myOrientation = ( VISU::Table::Orientation )( VISU::Storable::FindValue(theMap,"myOrientation").toInt() );
   mySObj = SALOMEDS::SObject::_duplicate(SO);
@@ -234,7 +234,7 @@ VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, S
 */
 void VISU::Table_i::ToStream( std::ostringstream& theStr )
 {
-  Storable::DataToStream( theStr, "myName",        myName.c_str() );
+  Storable::DataToStream( theStr, "myName",        GetName().c_str() );
   Storable::DataToStream( theStr, "myTitle",       myTitle.c_str() );
   Storable::DataToStream( theStr, "myOrientation", myOrientation );
 }
@@ -354,9 +354,9 @@ VISU::Curve_i::~Curve_i()
 VISU::Storable* VISU::Curve_i::Create()
 {
   // generate name ...
-  myName = GetVerTitle();
-  if ( myName == "" )
-    myName = GenerateName();
+  SetName(GetVerTitle());
+  if ( GetName() == "" )
+    SetName(GenerateName());
   // ... and build the object
   return Build( false );
 }
@@ -659,9 +659,10 @@ SPlot2d_Curve* VISU::Curve_i::CreatePresentation()
   SALOMEDS::Color color = GetColor();
   crv->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
   crv->setAutoAssign( IsAuto() );
-  crv->setIO(new SALOME_InteractiveObject(mySObj->GetID(),"VISU",GetName()));
+  CORBA::String_var aString = mySObj->GetID();
+  crv->setIO(new SALOME_InteractiveObject(aString.in(), "VISU", GetName().c_str()));
   if ( myTable )
-    crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(),"VISU",myTable->GetName()));
+    crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry(), "VISU", myTable->GetName().c_str()));
   return crv;
 }
 /*!
@@ -671,7 +672,7 @@ VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, S
 {
   if(MYDEBUG) MESSAGE(GetComment());
   mySObj = SALOMEDS::SObject::_duplicate(theSO);
-  myName = VISU::Storable::FindValue(theMap,"myName").latin1();
+  SetName(VISU::Storable::FindValue(theMap,"myName").latin1());
   myHRow = VISU::Storable::FindValue(theMap,"myHRow").toInt();
   myVRow = VISU::Storable::FindValue(theMap,"myVRow").toInt();
   bool ok = false;
@@ -692,7 +693,7 @@ VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, S
 */
 void VISU::Curve_i::ToStream( std::ostringstream& theStr )
 {
-  Storable::DataToStream( theStr, "myName",      myName.c_str() );
+  Storable::DataToStream( theStr, "myName",      GetName().c_str() );
   Storable::DataToStream( theStr, "myHRow",      myHRow );
   Storable::DataToStream( theStr, "myVRow",      myVRow );
   Storable::DataToStream( theStr, "myZRow",      myZRow );
@@ -792,7 +793,7 @@ void VISU::Container_i::AddCurve( Curve_ptr theCurve )
 {
   if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
   if ( mySO->_is_nil() )
     return;
   PortableServer::POA_ptr aPOA = GetPOA();
@@ -815,7 +816,7 @@ void VISU::Container_i::RemoveCurve( Curve_ptr theCurve )
 {
   if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
   if ( mySO->_is_nil() )
     return;
   PortableServer::POA_ptr aPOA = GetPOA();
@@ -852,7 +853,7 @@ void VISU::Container_i::Clear()
 {
   if ( GetStudyDocument()->_is_nil() )
     return;
-  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
   if ( mySO->_is_nil() )
     return;
   QStringList toDelete;
@@ -873,7 +874,7 @@ void VISU::Container_i::Clear()
 VISU::Storable* VISU::Container_i::Create()
 {
   // generate name ...
-  myName = GenerateName();
+  SetName(GenerateName());
   // ... and build the object
   return Build( false );
 }
@@ -908,7 +909,7 @@ void VISU::Container_i::Update()
   if ( GetStudyDocument()->_is_nil() )
     return;
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
-  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry() );
+  SALOMEDS::SObject_var mySO = GetStudyDocument()->FindObjectID( GetEntry().c_str() );
   SALOMEDS::GenericAttribute_var anAttr;
   if ( !mySO->_is_nil() ) {
     QStringList toDelete;
@@ -988,7 +989,7 @@ VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMa
 {
   if(MYDEBUG) MESSAGE(GetComment());
   mySObj = SALOMEDS::SObject::_duplicate(SO);
-  myName = VISU::Storable::FindValue( theMap, "myName" ).latin1();
+  SetName(VISU::Storable::FindValue( theMap, "myName" ).latin1());
   QString val = VISU::Storable::FindValue( theMap, "myCurves" );
   myCurves = QStringList::split( QString( "*" ), val, false );
   return Build( true );
@@ -998,7 +999,7 @@ VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMa
 */
 void VISU::Container_i::ToStream( std::ostringstream& theStr )
 {
-  Storable::DataToStream( theStr, "myName",   myName.c_str() );
+  Storable::DataToStream( theStr, "myName",   GetName().c_str() );
   Storable::DataToStream( theStr, "myCurves", myCurves.join( QString( "*" ) ) );
 //  theStr<<" myName "<<myName;
 //  theStr<<" myCurves "<<myCurves.join( QString( "*" ) ).latin1()<<"* ";
index ec13b30bc61309aec2693e101489bd8a902ff6d2..75f4d0bd48d90167e30a719859c6dabda90529f6 100644 (file)
@@ -47,7 +47,7 @@ namespace VISU{
     virtual VISU::VISUType GetType() { return VISU::TTABLE;};
 
     virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
-    virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
+    virtual char* GetTitle() { return CORBA::string_dup( GetName().c_str() ); }
 
     virtual void SetOrientation( VISU::Table::Orientation theOrientation ) { myOrientation = theOrientation; }
     virtual VISU::Table::Orientation GetOrientation() { return myOrientation; }
@@ -97,7 +97,7 @@ namespace VISU{
     virtual VISU::VISUType GetType() { return VISU::TCURVE;};
 
     virtual void SetTitle( const char* theTitle ) { SetName( theTitle ); }
-    virtual char* GetTitle() { return CORBA::string_dup( GetName() ); }
+    virtual char* GetTitle() { return CORBA::string_dup( GetName().c_str() ); }
 
     virtual void SetColor( const SALOMEDS::Color& theColor ) { myColor = theColor; myAuto = false; }
     virtual SALOMEDS::Color GetColor() { return myColor; }
index 45cc509b8fc3a6463e5181d1c0c31cac413af0c4..b0fe1cee93b388a09e294381c48129d9213f60f3 100644 (file)
@@ -340,7 +340,7 @@ namespace VISU {
        for (int i = 0; i < clist.count(); i++) {
          SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
          if (aSPlot2dC->hasIO() &&
-             !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+             theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
            if(MYDEBUG) MESSAGE("UpdatePlot2d - erasing : curve - " << aSPlot2dC);
            theView->eraseCurve(aSPlot2dC);
          }
@@ -352,7 +352,7 @@ namespace VISU {
        for (int i = 0; i < clist.count(); i++) {
          SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
          if (aSPlot2dC->hasIO() &&
-             !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+             theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
            if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying : curve - " << aSPlot2dC);
            aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
            aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
@@ -401,7 +401,7 @@ namespace VISU {
        for (int i = 0; i < clist.count(); i++) {
          SPlot2d_Curve* aSPlot2dC = dynamic_cast<SPlot2d_Curve*>(clist.at(i));
          if (aSPlot2dC->hasIO() &&
-             !strcmp(aSPlot2dC->getIO()->getEntry(), theCurve->GetEntry())) {
+             theCurve->GetEntry() != aSPlot2dC->getIO()->getEntry()) {
            if(MYDEBUG) MESSAGE("UpdatePlot2d - displaying only : curve - " << aSPlot2dC);
            aSPlot2dC->setHorTitle( theCurve->GetHorTitle().c_str() );
            aSPlot2dC->setVerTitle( theCurve->GetVerTitle().c_str() );
@@ -530,7 +530,7 @@ namespace VISU {
              for (int i = 0; i < clist.count(); i++) {
                 if (SPlot2d_Curve* cu = dynamic_cast<SPlot2d_Curve*>(clist.at(i))) {
                  if (cu->hasIO() &&
-                     strcmp(cu->getIO()->getEntry(), myPrs->GetEntry()) == 0) {
+                     myPrs->GetEntry() == cu->getIO()->getEntry()) {
                    vf->eraseCurve(cu);
                  }
                }
index 1553fe8d3d871fa0c8dceab4494fb6f48dedbe05..ef63c4c93e25bc0788ad60465531ed2805a558b4 100644 (file)
@@ -1286,7 +1286,7 @@ namespace VISU {
           }
         }
         if (!aCStudy) return;
-       _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry().latin1());
+       _PTR(SObject) TableSO = aCStudy->FindObjectID(aTable->GetEntry());
        if (TableSO) {
          _PTR(ChildIterator) Iter = aCStudy->NewChildIterator(TableSO);
          for (; Iter->More(); Iter->Next()) {
index cc90e55d30c9f2b48588a99c0ced8b34872c6c5c..9f8268bd7e32eb3e5cd6340be2876fc377020f8e 100644 (file)
@@ -60,7 +60,7 @@ PRS3D_TYPE_LIST.append(VISU.TSCALARMAPONDEFORMEDSHAPE)
 
 #---------------------------------------------------------------
 aMedFile = "TimeStamps.med"
-aMedFile = "ResOK_0000.med"
+#aMedFile = "ResOK_0000.med"
 aMedFile = os.getenv('DATA_DIR') + '/MedFiles/' + aMedFile
 aResult = myVisu.ImportFile(aMedFile)
 
@@ -75,10 +75,12 @@ aViewManager = myVisu.GetViewManager();
 
 WalkTroughTimeStamps(VISU.TSCALARMAP, anInput, aViewManager)
 
-for aVISUType in PRS3D_TYPE_LIST:
-  WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
-  pass
+#for aVISUType in PRS3D_TYPE_LIST:
+#  WalkTroughTimeStamps(aVISUType, anInput, aViewManager)
+#  pass
+#
+#anInput.myEntity = VISU.CELL;
+#anInput.myFieldName = "pression";
+#WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
 
-anInput.myEntity = VISU.CELL;
-anInput.myFieldName = "pression";
-WalkTroughTimeStamps(VISU.TGAUSSPOINTS, anInput, aViewManager)
+#execfile('/data/apo/a.py')
\ No newline at end of file