]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Join modifications from BR_MULTIPR_INDUS mergefrom_BR_MULTIPR_INDUS_30Aug07 mergefrom_V3_2_0_maintainance_31Aug2007
authorjfa <jfa@opencascade.com>
Thu, 30 Aug 2007 12:01:23 +0000 (12:01 +0000)
committerjfa <jfa@opencascade.com>
Thu, 30 Aug 2007 12:01:23 +0000 (12:01 +0000)
87 files changed:
idl/VISU_Gen.idl
src/CONVERTOR/VISU_Convertor.cxx
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_ColoredPL.hxx
src/PIPELINE/VISU_CutLinesPL.hxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.hxx
src/PIPELINE/VISU_DeformedShapePL.cxx
src/PIPELINE/VISU_DeformedShapePL.hxx
src/PIPELINE/VISU_GaussPointsPL.cxx
src/PIPELINE/VISU_GaussPointsPL.hxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_IsoSurfacesPL.hxx
src/PIPELINE/VISU_MapperHolder.cxx
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_Plot3DPL.hxx
src/PIPELINE/VISU_ScalarMapPL.cxx
src/PIPELINE/VISU_ScalarMapPL.hxx
src/PIPELINE/VISU_StreamLinesPL.cxx
src/PIPELINE/VISU_StreamLinesPL.hxx
src/PIPELINE/VISU_VectorsPL.cxx
src/PIPELINE/VISU_VectorsPL.hxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutLinesDlg.h
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.h
src/VISUGUI/VisuGUI_DeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.cxx
src/VISUGUI/VisuGUI_GaussPointsDlg.h
src/VISUGUI/VisuGUI_InputPane.cxx
src/VISUGUI/VisuGUI_InputPane.h
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_Plot3DDlg.cxx
src/VISUGUI/VisuGUI_PopupTools.cxx
src/VISUGUI/VisuGUI_PopupTools.h
src/VISUGUI/VisuGUI_ScalarBarDlg.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISUGUI/VisuGUI_StreamLinesDlg.cxx
src/VISUGUI/VisuGUI_VectorsDlg.cxx
src/VISU_I/Makefile.am
src/VISU_I/SALOME_GenericObjPointer.hh
src/VISU_I/VISUConfig.cc
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh
src/VISU_I/VISU_ColoredPrs3dFactory.hh
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_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DumpPython.cc
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
src/VISU_I/VISU_MultiResult_i.cc [new file with mode: 0644]
src/VISU_I/VISU_MultiResult_i.hh [new file with mode: 0644]
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Prs3dUtils.cc [new file with mode: 0644]
src/VISU_I/VISU_Prs3dUtils.hh [new file with mode: 0644]
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_PrsObject_i.cc
src/VISU_I/VISU_PrsObject_i.hh
src/VISU_I/VISU_ResultUtils.cc [new file with mode: 0644]
src/VISU_I/VISU_ResultUtils.hh [new file with mode: 0644]
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Table_i.hh
src/VISU_I/VISU_Vectors_i.cc

index 560a870aa4dd468acebb00c954a720e513eeaedd..f092a2a76b72d1e7748d98ac53f9af5cd661dd5c 100644 (file)
@@ -57,11 +57,13 @@ module VISU {
    * This enumeration contains a set of elements defining the
    * type of the %entity (topological units) constituting a mesh.
    */
-  enum Entity{ NODE, /*!< Node corresponds to a geometrical point. */
-               EDGE, /*!< Edge corresponds to a geometrical line connecting two points. */
-              FACE, /*!< Face corresponds to a geometrical plane bounded by several lines. */
-              CELL  /*!< Cell is a volumic element of a mesh */
-              };
+  enum Entity {
+    NODE, /*!< Node corresponds to a geometrical point. */
+    EDGE, /*!< Edge corresponds to a geometrical line connecting two points. */
+    FACE, /*!< Face corresponds to a geometrical plane bounded by several lines. */
+    CELL,  /*!< Cell is a volumic element of a mesh */
+    NONE  /*!< Indicates undefined entity value */
+  };
 
   /*!
    * This enumeration contains a set of elements defining the type of the %VISU object.
@@ -420,6 +422,13 @@ module VISU {
      */
     long GetScalarMode();
 
+    /*!
+     * Sets scalar range - min and max boundaries of the scalar bar.
+     * \param theMin  Min boundary of the scalar bar.
+     * \param theMax  Max boundary of the scalar bar.
+     */
+    void SetRange(in double theMin, in double theMax);
+
     /*!
      * Gets the min boundary of the scalar bar.
      */
@@ -430,6 +439,11 @@ module VISU {
      */
     double GetMax();
 
+    /*!
+     * Sets scalar range that corresponds to the source data.
+     */
+    void SetSourceRange();
+
     /*!
      * Gets the min boundary of the scalar bar from source data.
      */
@@ -686,18 +700,6 @@ module VISU {
      */
     Scaling GetScaling();
 
-    /*!
-     * Sets scalar range - min and max boundaries of the scalar bar.
-     * \param theMin  Min boundary of the scalar bar.
-     * \param theMax  Max boundary of the scalar bar.
-     */
-    void SetRange(in double theMin, in double theMax);
-
-    /*!
-     * Sets scalar range that corresponds to the source data.
-     */
-    void SetSourceRange();
-
     /*!
      * Add group as geometry of presentation.
      * \param theMeshName  - mesh name
@@ -719,14 +721,157 @@ module VISU {
    * Presentation parameters of the Gauss Points presentation.
    */
   //-------------------------------------------------------
-  interface GaussPoints : ColoredPrs3d {
+  interface GaussPoints : ColoredPrs3d 
+  {
+    //! Set flag indicating which scalar bar is active.
+    void SetIsActiveLocalScalarBar(in boolean theFlag);
+
+    //! Get flag indicating which scalar bar is active.
+    boolean GetIsActiveLocalScalarBar();
+
+    //! Set flag indicating visibility of global scalar bar.
+    void SetIsDispGlobalScalarBar(in boolean theFlag);
+
+    //! Get flag indicating visibility of global scalar bar.
+    boolean GetIsDispGlobalScalarBar();
+
+    //! Set value of the distance between global and local scalar bars.
+    void SetSpacing(in double theSpacing);
+
+    //! Get value of the distance between global and local scalar bars.
+    double GetSpacing();
+
+    /*!  
+     * Set the Multicolored mode.
+     * \param theIsColored is used to switch between Results and Geometry modes.
+     * Multiple colors are using when the presentation is
+     * drawing in the Results mode, one color - in the Geometry mode.
+     */
+    void SetIsColored(in boolean theIsColored);
+
+    //! Gets current color mode
+    boolean GetIsColored();
+
+    /*! Sets the color of this presentation in case of IsColored switched off.
+     * \param theColor The color of this presentation. This parameter
+     *                 is taken from the <VAR>Color</VAR> enumeration.
+     */
+    void SetColor(in SALOMEDS::Color theColor);
+
+    /*!
+     * When the Bicolor parameter is set to true, scalar bars are
+     * drawing with two colors : red color correspoonds to positive
+     * scalar values, blue color - to negative values.
+     */
+    void SetBiColor(in boolean theIsBiColor);
+
+    //! Get the Bicolor mode.
+    boolean GetBiColor();
+
+    //! Checks whether the Gauss Points will be deformed or not
+    boolean GetIsDeformed();
+
+    //! Apply deformation on the Gauss Points
+    void SetIsDeformed(in boolean theIsDeformed);
+
+    /*!
+     *  Sets the scale factor for scalar values
+     *  (how much corresponding mesh elements should be translated).
+     *  \param theScaleFactor The scaling factor.
+     */
+    void SetScaleFactor(in double theScaleFactor);
+
+    /*!
+     *  Gets the scale factor for scalar values.
+     *  (how much corresponding mesh elements is translated)
+     */
+    double GetScaleFactor();
+
+    /*!
+     * This enumeration contains a set of elements defining the type of representation of the vector head.
+     */
+    enum PrimitiveType { 
+      SPRITE,
+      POINT,
+      SPHERE
+    };
+
+    //! Set type of the primitives which is used for drawing the Gauss Points
+    void SetPrimitiveType(in PrimitiveType thePrimitiveType);
+
+    //! Get type of the primitives which is used for drawing the Gauss Points
+    PrimitiveType GetPrimitiveType();
+
+    //! Sets Point Sprite clamp
+    void SetClamp(in double theClamp);
+
+    //! Gets Point Sprite clamp
+    double GetClamp();
+
+    //! Sets minimum size of Point Sprites
+    void SetMinSize(in double theMinSize);
+
+    //! Gets minimum size of Point Sprites
+    double GetMinSize();
+
+    //! Sets maximum size of Point Sprites
+    void SetMaxSize(in double theMaxSize);
+
+    //! Gets maximum size of Point Sprites
+    double GetMaxSize();
+
+    //! Sets magnification for Point Sprites
+    void SetMagnification(in double theMagnification);
+
+    //! Gets magnification for Point Sprites
+    double GetMagnification();
+
+    //! Sets the increment of changing Magnification parameter
+    void SetMagnificationIncrement(in double theIncrement);
+
+    //! Gets the increment of changing Magnification parameter
+    double GetMagnificationIncrement();
+
+    //! Sets Point Sprites size
+    void SetGeomSize(in double theGeomSize);
+
+    //! Sets size of Point Sprite
+    double GetGeomSize();
+
+    //! Get path to the image using for Main Point Sprite texture
+    string GetMainTexture();
+
+    //! Get path to the image using for Alpha Point Sprite texture
+    string GetAlphaTexture();
+
+    //! Points Main and AlphaMask images to be used by Point Sprites
+    void SetTextures(in string theMainTexture, in string theAlphaTexture);
+
+    //! Sets Point Sprite Alpha threshold
+    void SetAlphaThreshold(in double theAlphaThreshold);
+
+    //! Gets Point Sprite Alpha threshold
+    double GetAlphaThreshold();
+
+    //! Sets resolution of the Geometrical Sphere
+    void SetResolution(in long theResolution);
+
+    //! Sets resolution of the Geometrical Sphere
+    long GetResolution();
+
+    //! Sets how many faces of can be drawn in the Geometrical Sphere primitive mode
+    void SetFaceLimit(in long theFaceLimit);
+
+    //! Defines how many faces of can be drawn in the Geometrical Sphere primitive mode
+    long GetFaceLimit();
   };
 
   /*! \brief Deformed shape presentation interface
    *
    * Presentation parameters of the deformed shape presentation.
    */
-  interface DeformedShape : ScalarMap {
+  interface DeformedShape : ScalarMap 
+  {
     /*!
      * Sets the scale of the presentatable object.
      * \param theScale Double value defining the scale of this presentable object.
@@ -1334,7 +1479,8 @@ module VISU {
    * <BR><B>Time stamp</B> represents a subfield: the results
    * of calculations are taken in one definite moment.
    */
-  interface Animation : Base {
+  interface Animation : Base 
+  {
     /*!
    * This enumeration contains a set of available animation modes.
    */
@@ -1548,13 +1694,15 @@ module VISU {
     void ApplyProperties(in long theFieldNum, in ColoredPrs3d thePrs);
   };
 
+  
   /*! \brief Interface %Result
    *
    * This interface serves for inner representation of data generated
    * in other sources (MED object or file). This data is needed
    * for further construction of graphical presentations.
    */
-  interface Result : RemovableObject, SALOME::GenericObj {
+  interface Result : RemovableObject, SALOME::GenericObj 
+  {
     /*! Reads all data from the corresponding sources. By default the data is loaded on demand.
      */
     boolean BuildAll();
@@ -1582,6 +1730,61 @@ module VISU {
 
     /*! Allow to check is min / max calculation over field's components already perfrormed or not */
     boolean IsMinMaxDone();
+
+    /*! Allow to check is corresponding multi resolution structure already loaded or not */
+    boolean IsPartsDone();
+
+    typedef sequence<Entity> Entities;
+
+    typedef string EntityName;
+
+    typedef sequence<EntityName> EntityNames;
+
+    typedef long TimeStampNumber;
+
+    typedef sequence<TimeStampNumber> TimeStampNumbers;
+
+    enum Resolution {
+      FULL,
+      MEDIUM,
+      LOW,
+      HIDDEN
+    };
+
+    typedef sequence<Resolution> Resolutions;
+
+    /*! Gets existing mesh names */
+    EntityNames GetMeshNames();
+
+    /*! Gets existing mesh entites for the given mesh name */
+    Entities GetEntities(in EntityName theMeshName);
+
+    /*! Gets existing families for the given mesh name and entity */
+    EntityNames GetFamilies(in EntityName theMeshName, in Entity theEntity);
+
+    /*! Gets existing families for the given mesh name */
+    EntityNames GetGroups(in EntityName theMeshName);
+
+    /*! Gets existing fields for the given mesh name and entity */
+    EntityNames GetFields(in EntityName theMeshName, in Entity theEntity);
+
+    /*! Gets number of components for the given mesh name, entity and name of field */
+    long GetNumberOfComponents(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName);
+
+    /*! Gets existing numbers of time stamps for the given mesh name, entity and name of field */
+    TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName);
+
+    /*! Gets existing parts of multi resolution structure for the given mesh name */
+    EntityNames GetPartNames(in EntityName theMeshName);
+
+    /*! Gets available resolutions of multi resolution structure for the given mesh and part names */
+    Resolutions GetResolutions(in EntityName theMeshName, in EntityName thePartName);
+
+    /*! Gets current resolution of multi resolution structure for the given mesh and part names */
+    Resolution GetResolution(in EntityName theMeshName, in EntityName thePartName);
+
+    /*! Gets current resolution of multi resolution structure for the given mesh and part names */
+    void SetResolution(in EntityName theMeshName, in EntityName thePartName, in Resolution theResolution);
   };
 
   //-------------------------------------------------------
@@ -1593,7 +1796,8 @@ module VISU {
    * post-processing presentations from given %Result and %Table object reference,
    * using the views provided by %ViewManager.
    */
-  interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base {
+  interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base 
+  {
     /*! Sets a definite study to be current.
      */
     void SetCurrentStudy(in SALOMEDS::Study theStudy);
@@ -1703,11 +1907,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     ScalarMap ScalarMapOnField(in Result theResult, in string theMeshName,
                               in Entity theEntity, in string theFieldName,
-                              in long theIteration);
+                              in long theTimeStampNumber);
 
     /*!
      * Creates a Gauss Points presentation.
@@ -1715,11 +1919,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     GaussPoints GaussPointsOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in long theIteration);
+                                  in long theTimeStampNumber);
 
     /*!
      * Creates a deformed shape presentation.
@@ -1727,11 +1931,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     DeformedShape DeformedShapeOnField(in Result theResult, in string theMeshName,
                                       in Entity theEntity, in string theFieldName,
-                                      in long theIteration);
+                                      in long theTimeStampNumber);
 
     /*!
      * Creates a deformed shape presentation.
@@ -1739,11 +1943,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     ScalarMapOnDeformedShape ScalarMapOnDeformedShapeOnField(in Result theResult, in string theMeshName,
                                                             in Entity theEntity, in string theFieldName,
-                                                            in long theIteration);
+                                                            in long theTimeStampNumber);
 
     /*!
      * Creates a vector presentation.
@@ -1751,11 +1955,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     Vectors VectorsOnField(in Result theResult, in string theMeshName,
                           in Entity theEntity, in string theFieldName,
-                          in long theIteration);
+                          in long theTimeStampNumber);
 
     /*!
      * Creates an iso surface presentation.
@@ -1763,11 +1967,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     IsoSurfaces IsoSurfacesOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in long theIteration);
+                                  in long theTimeStampNumber);
 
     /*!
      * Creates an stream lines presentation.
@@ -1775,11 +1979,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     StreamLines StreamLinesOnField(in Result theResult, in string theMeshName,
                                   in Entity theEntity, in string theFieldName,
-                                  in long theIteration);
+                                  in long theTimeStampNumber);
 
     /*!
      * Creates a presentation of cut planes.
@@ -1787,11 +1991,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     CutPlanes CutPlanesOnField(in Result theResult, in string theMeshName,
                               in Entity theEntity, in string theFieldName,
-                              in long theIteration);
+                              in long theTimeStampNumber);
 
     /*!
      * Creates a presentation of cut lines.
@@ -1799,11 +2003,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     CutLines CutLinesOnField(in Result theResult, in string theMeshName,
                             in Entity theEntity, in string theFieldName,
-                            in long theIteration);
+                            in long theTimeStampNumber);
 
     /*!
      * Creates a Plot3D presentation.
@@ -1811,11 +2015,11 @@ module VISU {
      * \param theMeshName  One of the meshes presented in MED file
      * \param theEntity    Type of entity where the field is defined
      * \param theFieldName Group of data attributed to the %MESH. The data can be scalar or vector.
-     * \param theIteration Number of iteration on the field
+     * \param theTimeStampNumber Number of iteration on the field
      */
     Plot3D Plot3DOnField(in Result theResult, in string theMeshName,
                         in Entity theEntity, in string theFieldName,
-                        in long theIteration);
+                        in long theTimeStampNumber);
 
     /*!
      * Creates a table presentation.
index 1c6fd8d8c8d547bbbdb5cefa861333472e93d737..2526962b7a6218e750fe04d04994cd0e5ff32182 100644 (file)
 #include <utility>
 
 
+//---------------------------------------------------------------
+VISU_Convertor
+::VISU_Convertor():
+  myIsDone(false)
+{}
+
+
+//---------------------------------------------------------------
+const std::string& 
+VISU_Convertor
+::GetName()
+{
+  return myName;
+}
+
+
+//---------------------------------------------------------------
+int
+VISU_Convertor
+::IsDone() const 
+{
+  return myIsDone; 
+}
+
 //---------------------------------------------------------------
 const VISU::TMeshMap& 
 VISU_Convertor
index 45edc030da4b94a5acddec9abb8c688ed96b1f6c..c5819c08a2853cb3f761a061370fe14614f0b67a 100644 (file)
 class VISU_CONVERTOR_EXPORT VISU_Convertor
 {
 public:
-  virtual 
-  ~VISU_Convertor()
-  {};
-  
   //! Get brief name of the corresponding source MED file
   virtual
   const std::string& 
-  GetName(){ return myName;}
+  GetName();
 
   //! Let known whether the source MED file parsed or not
   virtual
   int
-  IsDone() const { return myIsDone; }
+  IsDone() const;
 
   //! This method perform first parsing of MED file to get known what MED entities are pressent in it
   virtual
@@ -205,6 +201,8 @@ public:
   GenerateName(const std::string& theName, unsigned int theTimeId);
 
 protected:
+  VISU_Convertor();
+  
   std::string myName;
   VISU::TMeshMap myMeshMap;
   int myIsDone;
@@ -212,8 +210,8 @@ protected:
 
 extern "C"
 {
-VISU_CONVERTOR_EXPORT
   //! Instatiate proper VISU_Convertor subclass
+  VISU_CONVERTOR_EXPORT
   VISU_Convertor*
   CreateConvertor(const std::string& theFileName);
 };
index c2cd889314fd9b8f78a3ba473cc5b5578c4932c5..66f53771f3ea86b0068b20c1941a2e8512c47397 100644 (file)
@@ -563,10 +563,8 @@ namespace
 
 //---------------------------------------------------------------
 VISU_Convertor_impl
-::VISU_Convertor_impl() 
-{
-  myIsDone = false;
-}
+::VISU_Convertor_impl()
+{}
 
 
 //---------------------------------------------------------------
@@ -601,6 +599,7 @@ VISU_Convertor*
 VISU_Convertor_impl
 ::BuildFields() 
 { 
+  BuildEntities();
   return this;
 }
 
@@ -608,6 +607,7 @@ VISU_Convertor*
 VISU_Convertor_impl
 ::BuildMinMax() 
 { 
+  BuildFields();
   return this;
 }
 
index 31cf0d9d50fde8048f5e296f1b89124f51eb1d45..62166ee34c600f9d6b1e2e5d195a19ce7e1d1f96 100644 (file)
@@ -1328,8 +1328,7 @@ VISU_MedConvertor
   myIsMinMaxDone(false),
   myMed(theMed)
 {
-  myFileInfo.setFile(QString(theFileName.c_str()));
-  myName = myFileInfo.baseName().latin1();
+  myName = theFileName;
 }
 
 
@@ -1455,6 +1454,8 @@ VISU_MedConvertor
   if(myIsFieldsDone)
     return this;
 
+  VISU_Convertor_impl::BuildFields();
+
   TSetIsDone aSetIsDone(myIsFieldsDone);
   VISU::TTimerLog aTimerLog(MYDEBUG,"BuildFields");
 
@@ -1581,6 +1582,8 @@ VISU_MedConvertor
   if(myIsMinMaxDone)
     return this;
 
+  VISU_Convertor_impl::BuildMinMax();
+
   TSetIsDone aSetIsDone(myIsMinMaxDone);
   VISU::TTimerLog aTimerLog(MYDEBUG,"BuildMinMax");
 
index e3834ab2d227e30816e83fb907673435e75e2a69..7b2c6b80177c8b5e2b5aa1767f9b622def18b813 100644 (file)
@@ -31,7 +31,6 @@
 #include "MED_GaussUtils.hxx"
 
 #include <boost/thread/mutex.hpp>
-#include <qfileinfo.h>
 
 namespace VISU
 {
@@ -357,7 +356,6 @@ public:
   BuildGroups();
 
 protected:
-  QFileInfo myFileInfo;
   MED::PWrapper myMed; // mpv : bug 13568: one med per converter
 
   virtual
index d067added02a5b82760828db08b68dfc0c78c2be..49600e845e7c9a7d0b2bf8a039fe72602e98fa18 100644 (file)
@@ -57,11 +57,28 @@ VISU_ColoredPL
 }
 
 
+//----------------------------------------------------------------------------
 VISU_ColoredPL
 ::~VISU_ColoredPL()
 {}
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_ColoredPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myMapperTable->GetMTime());
+  aTime = std::max(aTime, myBarTable->GetMTime());
+  aTime = std::max(aTime, myExtractor->GetMTime());
+  aTime = std::max(aTime, myFieldTransform->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_ColoredPL
@@ -135,6 +152,9 @@ VISU_ColoredPL
 {
   if(theRange[0] > theRange[1]) 
     return;
+  
+  if(VISU::CheckIsSameRange(GetScalarRange(), theRange))
+    return;
 
   myFieldTransform->SetScalarRange(theRange);
   myBarTable->SetRange(theRange);
@@ -232,9 +252,11 @@ VISU_ColoredPL
   vtkFloatingPointType *aRange = GetScalarRange();
   vtkFloatingPointType aScalarRange[2] = {aRange[0], aRange[1]};
   if(myBarTable->GetScale() == VTK_SCALE_LOG10)
-    VISU_LookupTable::ComputeLogRange(aRange,aScalarRange);
-  myMapperTable->SetRange(aScalarRange);
+    VISU_LookupTable::ComputeLogRange(aRange, aScalarRange);
 
+  if(!VISU::CheckIsSameRange(myMapperTable->GetRange(), aScalarRange))
+    myMapperTable->SetRange(aScalarRange);
+  
   myMapperTable->Build();
   myBarTable->Build();
 
index 045db348f7b86de7171206b4a30851a48add63b2..3743750af2e63becf748066625bf475f932c49e1 100644 (file)
@@ -43,6 +43,10 @@ class VISU_ColoredPL : public VISU_PipeLine
 public:
   vtkTypeMacro(VISU_ColoredPL, VISU_PipeLine);
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
   //----------------------------------------------------------------------------
   virtual
   int
index 6a1d391b69f0eb94558b11679b4de1289dd2372f..5811683414924df07c684056fe9484f6c03008cf 100644 (file)
@@ -122,7 +122,6 @@ public:
 
 protected:
   VISU_CutLinesPL();
-  VISU_CutLinesPL(const VISU_CutLinesPL&);
 
   virtual
   void
@@ -135,6 +134,10 @@ protected:
   vtkFloatingPointType myBasePnt[3];
   vtkFloatingPointType myPosition;
   int myCondition;
+
+private:
+  VISU_CutLinesPL(const VISU_CutLinesPL&);  // Not implemented.
+  void operator=(const VISU_CutLinesPL&);  // Not implemented.
 };
 
 
index 3abaeeea41d38ff1ad97343c40ee62bdfa70b8f7..22493a104f8b33e3ceb508f0d4579ff7479ce4af 100644 (file)
@@ -70,6 +70,19 @@ VISU_CutPlanesPL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_CutPlanesPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myAppendPolyData->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_CutPlanesPL
index f59d3eb193c22da009f77d9e722d76ed3aa3d9a8..27d377fd8971d3ecac67413a3a3f132c601d419f 100644 (file)
@@ -40,11 +40,16 @@ class VISU_PIPELINE_EXPORT VISU_CutPlanesPL : public VISU_ScalarMapPL
 {
 public:
   vtkTypeMacro(VISU_CutPlanesPL, VISU_ScalarMapPL);
-  static VISU_CutPlanesPL* New();
+
+  static 
+  VISU_CutPlanesPL* 
+  New();
 
   virtual
-  ~VISU_CutPlanesPL();
+  unsigned long int 
+  GetMTime();
 
+  //----------------------------------------------------------------------------
   enum PlaneOrientation {XY, YZ, ZX};
 
   virtual 
@@ -176,9 +181,12 @@ public:
                const std::vector<vtkFloatingPointType>& thePlanePosition,
                const std::vector<int>& thePlaneCondition,
                vtkFloatingPointType theDisplacement);
+
 protected:
   VISU_CutPlanesPL();
-  VISU_CutPlanesPL(const VISU_CutPlanesPL&);
+
+  virtual
+  ~VISU_CutPlanesPL();
 
   virtual 
   vtkDataSet* 
@@ -198,6 +206,10 @@ protected:
   vtkAppendPolyData *myAppendPolyData;
   std::vector<vtkFloatingPointType> myPartPosition;
   std::vector<int> myPartCondition;
+
+private:
+  VISU_CutPlanesPL(const VISU_CutPlanesPL&);  // Not implemented.
+  void operator=(const VISU_CutPlanesPL&);  // Not implemented.
 };
 
 #endif
index 168963929994af3d2212a1be2a419aa421110fde..6631af081dda168fcf1ec15b0334ffc25b797cec 100644 (file)
@@ -58,6 +58,20 @@ VISU_DeformedShapePL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_DeformedShapePL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myWarpVector->GetMTime());
+  aTime = std::max(aTime, myCellDataToPointData->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_DeformedShapePL
index e09b4cf78a19499b21685b344c0b6a78abfed65c..6011e501175ce531c838a7011fb2883612867382 100644 (file)
@@ -44,6 +44,11 @@ public:
   VISU_DeformedShapePL* 
   New();
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
   virtual
   void
   SetScale(vtkFloatingPointType theScale);
@@ -80,7 +85,6 @@ public:
   
 protected:
   VISU_DeformedShapePL();
-  VISU_DeformedShapePL(const VISU_DeformedShapePL&);
 
   virtual
   ~VISU_DeformedShapePL();
@@ -97,6 +101,10 @@ protected:
   vtkFloatingPointType myScaleFactor;
   vtkWarpVector *myWarpVector;
   vtkCellDataToPointData* myCellDataToPointData;
+
+private:
+  VISU_DeformedShapePL(const VISU_DeformedShapePL&);  // Not implemented.
+  void operator=(const VISU_DeformedShapePL&);  // Not implemented.
 };
 
 
index 12a895b612e9a2ee1c2c201b9ce815b2d490e562..5cda7ebb69a870f1fff68d3beece65f7eb6f4d45 100644 (file)
@@ -91,6 +91,24 @@ VISU_GaussPointsPL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_GaussPointsPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myWarpVector->GetMTime());
+  aTime = std::max(aTime, myGlyph->GetMTime());
+  aTime = std::max(aTime, mySphereSource->GetMTime());
+
+  for(int i = 0; i < 3; i++)
+    aTime = std::max(aTime, myPassFilter[i]->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void  
 VISU_GaussPointsPL
index d489362ce041ee71fa04053aff05feaa25d02517..cdb2378e23d60a1f8308932c1ce1640022ab35d9 100644 (file)
@@ -64,6 +64,10 @@ public:
   VISU_GaussPointsPL* 
   New();
   
+  virtual
+  unsigned long int 
+  GetMTime();
+
   //----------------------------------------------------------------------------
   void 
   SetGaussPtsIDMapper(const VISU::PGaussPtsIDMapper& theGaussPtsIDMapper);
@@ -304,6 +308,10 @@ private:
   vtkFloatingPointType myMagnificationIncrement;
 
   int myPrimitiveType;
+
+private:
+  VISU_GaussPointsPL(const VISU_GaussPointsPL&);  // Not implemented.
+  void operator=(const VISU_GaussPointsPL&);  // Not implemented.
 };
   
 #endif
index 8f92a1cbbd52de1c4afbd1c27e26dabcf537cbb8..bea9854f35cfe9ffd5ba52774d85447d5dcf67e6 100644 (file)
@@ -62,6 +62,20 @@ VISU_IsoSurfacesPL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_IsoSurfacesPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myCellDataToPointData->GetMTime());
+  aTime = std::max(aTime, myContourFilter->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_IsoSurfacesPL
index d53aeb3545bce0da0fc39d6a25c8c68952ae9f91..83a646dd8d3623b6574854fe2696f8d4ffb4bf81 100644 (file)
@@ -44,6 +44,11 @@ public:
   VISU_IsoSurfacesPL* 
   New();
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
   virtual
   int
   GetNbParts();
@@ -92,7 +97,6 @@ public:
 
 protected:
   VISU_IsoSurfacesPL();
-  VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);
 
   virtual
   ~VISU_IsoSurfacesPL();
@@ -106,6 +110,11 @@ protected:
   vtkFloatingPointType myRange[2];
   vtkCellDataToPointData* myCellDataToPointData;
   vtkContourFilter *myContourFilter;
+
+private:
+  VISU_IsoSurfacesPL(const VISU_IsoSurfacesPL&);;  // Not implemented.
+  void operator=(const VISU_IsoSurfacesPL&);  // Not implemented.
+
 };
 
 
index dc0254997046c48a7c29e606896c146caa074c7e..d64efa6c52c5a6c61eaf1186d1d1ed81e551b637 100644 (file)
@@ -135,6 +135,8 @@ VISU_MapperHolder
       myPipeLine->Init();
       myPipeLine->Update();
     }
+
+  Modified();
 }
 
 
index 06661f017aa686815df71663c4ec3aa63d8b8e22..ea165bc078c1c073b603e35d5ab35e7f35cf4f2e 100644 (file)
@@ -274,7 +274,11 @@ void
 VISU_PipeLine
 ::SetIsShrinkable(bool theIsShrinkable)
 {
+  if(myIsShrinkable == theIsShrinkable)
+    return;
+
   myIsShrinkable = theIsShrinkable;
+  Modified();
 }
 
 
index 602445689f467b7ef02bf91fe22199be382c6451..7696d62e5d5453ae344ec30efd6e543808ef9011 100644 (file)
@@ -75,7 +75,23 @@ VISU_Plot3DPL
 //----------------------------------------------------------------------------
 VISU_Plot3DPL
 ::~VISU_Plot3DPL()
+{}
+
+
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_Plot3DPL
+::GetMTime()
 {
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myCellDataToPointData->GetMTime());
+  aTime = std::max(aTime, myAppendPolyData->GetMTime());
+  aTime = std::max(aTime, myGeometryFilter->GetMTime());
+  aTime = std::max(aTime, myContourFilter->GetMTime());
+  aTime = std::max(aTime, myWarpScalar->GetMTime());
+
+  return aTime;
 }
 
 
index 82d0855fb44fdb6ae80e98de1ddd7a76d3e6f2e3..2cb63767ca03c63e1779a09b764e83ec2bf035b7 100644 (file)
@@ -47,9 +47,11 @@ public:
   VISU_Plot3DPL* 
   New();
 
-  virtual 
-  ~VISU_Plot3DPL();
+  virtual
+  unsigned long int 
+  GetMTime();
 
+  //----------------------------------------------------------------------------
   VISU_CutPlanesPL::PlaneOrientation
   GetPlaneOrientation();
 
@@ -126,7 +128,8 @@ public:
 
 protected:
   VISU_Plot3DPL();
-  VISU_Plot3DPL(const VISU_Plot3DPL&);
+  virtual 
+  ~VISU_Plot3DPL();
 
   virtual
   vtkDataSet* 
@@ -147,6 +150,10 @@ protected:
   vtkSmartPointer<vtkGeometryFilter> myGeometryFilter;
   vtkSmartPointer<vtkContourFilter> myContourFilter;
   vtkSmartPointer<vtkWarpScalar> myWarpScalar;
+
+private:
+  VISU_Plot3DPL(const VISU_Plot3DPL&);;  // Not implemented.
+  void operator=(const VISU_Plot3DPL&);  // Not implemented.
 };
 
 #endif
index a4df7b39dd1fe2366b51688b941a928b447b5783..55352b8e9c9276efa08a6556ba523a56b7aa3a37 100644 (file)
@@ -69,6 +69,20 @@ VISU_ScalarMapPL
 {}
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_ScalarMapPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myAppendFilter->GetMTime());
+  aTime = std::max(aTime, myMergeFilter->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void  
 VISU_ScalarMapPL
index eda0bea10fcd815983aee825a8ffc3f4a9aeddb2..c23e95a68e1ba9d58c9358efec50c0a239b7cf89 100644 (file)
@@ -48,6 +48,11 @@ public:
   VISU_ScalarMapPL* 
   New();
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
   virtual
   void
   Update();
@@ -83,7 +88,6 @@ public:
 protected:
   //----------------------------------------------------------------------------
   VISU_ScalarMapPL();
-  VISU_ScalarMapPL(const VISU_ScalarMapPL&);
   
   virtual
   ~VISU_ScalarMapPL();
@@ -106,6 +110,9 @@ protected:
                bool theIsCopyInput);
 
 private:
+  VISU_ScalarMapPL(const VISU_ScalarMapPL&);  // Not implemented.
+  void operator=(const VISU_ScalarMapPL&);  // Not implemented.
+
   vtkSmartPointer<VISU_AppendFilter> myAppendFilter;
   vtkSmartPointer<VISU_MergeFilter> myMergeFilter;
 };
index 375d99ac5d426c1d3ab6b717229617c518faddbd..2f3ae2bb530e2d7bb7dad5e4c2819a88564a52ec 100644 (file)
@@ -90,6 +90,23 @@ VISU_StreamLinesPL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_StreamLinesPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myStream->GetMTime());
+  aTime = std::max(aTime, mySource->GetMTime());
+  aTime = std::max(aTime, myCenters->GetMTime());
+  aTime = std::max(aTime, myGeomFilter->GetMTime());
+  aTime = std::max(aTime, myPointsFilter->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_StreamLinesPL
index 7909b760bfce599b3ec755ded44d1687c12e4a7f..6bff1d61edfc09eb63880a485631da6c9fa4e6a9 100644 (file)
@@ -48,6 +48,11 @@ public:
   VISU_StreamLinesPL*
   New();
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
   virtual
   size_t
   SetParams(vtkFloatingPointType theIntStep,
@@ -192,7 +197,6 @@ public:
 
 protected:
   VISU_StreamLinesPL();
-  VISU_StreamLinesPL(const VISU_StreamLinesPL&);
 
   virtual
   ~VISU_StreamLinesPL();
@@ -238,6 +242,10 @@ protected:
   VTKViewer_GeometryFilter *myGeomFilter;
   VISU_MaskPointsFilter *myPointsFilter;
   vtkFloatingPointType myPercents;
+
+private:
+  VISU_StreamLinesPL(const VISU_StreamLinesPL&);  // Not implemented.
+  void operator=(const VISU_StreamLinesPL&);  // Not implemented.
 };
 
 
index 73153dfc5c3003a3411bcc353f9b9e89881ffe6e..5192eefb9364d98ace4df4742eceac1571b35a0f 100644 (file)
@@ -100,6 +100,25 @@ VISU_VectorsPL
 }
 
 
+//----------------------------------------------------------------------------
+unsigned long int 
+VISU_VectorsPL
+::GetMTime()
+{
+  unsigned long int aTime = Superclass::GetMTime();
+
+  aTime = std::max(aTime, myBaseGlyph->GetMTime());
+  aTime = std::max(aTime, myTransformedGlyph->GetMTime());
+  aTime = std::max(aTime, myCenters->GetMTime());
+  aTime = std::max(aTime, myGlyphSource->GetMTime());
+  aTime = std::max(aTime, myConeSource->GetMTime());
+  aTime = std::max(aTime, myLineSource->GetMTime());
+  aTime = std::max(aTime, myTransformFilter->GetMTime());
+
+  return aTime;
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_VectorsPL
index 9bf2a43c042ac43f9b0b7f85981a42d27aeb2803..09fe54cb5c603f031fe4a4fa2471fde1f2df4b63 100644 (file)
@@ -52,6 +52,11 @@ public:
   VISU_VectorsPL* 
   New();
 
+  virtual
+  unsigned long int 
+  GetMTime();
+
+  //----------------------------------------------------------------------------
   virtual
   void
   SetScale(vtkFloatingPointType theScale);
@@ -115,7 +120,6 @@ public:
 
 protected:
   VISU_VectorsPL();
-  VISU_VectorsPL(const VISU_VectorsPL&);
 
   virtual
   ~VISU_VectorsPL();
@@ -142,6 +146,10 @@ protected:
   VTKViewer_TransformFilter *myTransformFilter;
 
   VISU_UsedPointsFilter* myUsedPointsFilter;
+
+private:
+  VISU_VectorsPL(const VISU_VectorsPL&);  // Not implemented.
+  void operator=(const VISU_VectorsPL&);  // Not implemented.
 };
 
 
index 9e512fe420368b274765f3edb9bbbd1afdff7040..170aff646d7a675306370242d9ba8b579334121f 100644 (file)
@@ -215,7 +215,6 @@ VisuGUI
       application()->putInfo( anInfo );
 
       QApplication::setOverrideCursor(Qt::waitCursor);
-      // MULTIPR: CreateResult
       VISU::Result_var aResult = GetVisuGen(this)->CreateResult( aFileInfo.filePath() );
 
       if (CORBA::is_nil(aResult.in())) {
@@ -2341,8 +2340,6 @@ VisuGUI
                 tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
                 this, SLOT(OnCacheProperties()));
 
-#ifdef ENABLE_MULTIPR
-  // MULTIPR
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
   createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIconSet(aPixmap),
                 tr("MEN_MULTIPR_VIEW_FULL_RES"), "", 0, aParent, false,
@@ -2362,7 +2359,6 @@ VisuGUI
   createAction( VISU_MULTIPR_HIDE, tr("MEN_MULTIPR_VIEW_HIDE"), QIconSet(aPixmap),
                 tr("MEN_MULTIPR_VIEW_HIDE"), "", 0, aParent, false,
                 this, SLOT(OnMultiprViewHide()));
-#endif
 }
 
 void
@@ -2540,14 +2536,10 @@ VisuGUI
 
   mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
 
-#ifdef ENABLE_MULTIPR
-  // MULTIPR
   mgr->insert( action( VISU_MULTIPR_FULL_RES ), -1, -1, -1 );
   mgr->insert( action( VISU_MULTIPR_MED_RES ), -1, -1, -1 );
   mgr->insert( action( VISU_MULTIPR_LOW_RES ), -1, -1, -1 );
   mgr->insert( action( VISU_MULTIPR_HIDE ), -1, -1, -1 );
-#endif
-  
   
   // Rules
 
@@ -2651,7 +2643,8 @@ VisuGUI
   mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
                " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
                "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
-  mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
+  mgr->setRule( action( VISU_OPACITY ), aRule + " and hasActor=1", true );
+
   mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
 
   // rename command
@@ -2723,14 +2716,23 @@ VisuGUI
   //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
   //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
   
-#ifdef ENABLE_MULTIPR
-  // MULTIPR
-  aRule = "client='ObjectBrowser' and $type in {'VISU::TPART'}";
-  mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aRule + " and selcount>=1", true );
-  mgr->setRule( action( VISU_MULTIPR_MED_RES ), aRule + " and selcount>=1", true );
-  mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aRule + " and selcount>=1", true );
-  mgr->setRule( action( VISU_MULTIPR_HIDE), aRule + " and selcount>=1", true );
-#endif
+  aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
+  {
+    QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
+    mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aCustomRule, true );
+  }
+  {
+    QString aCustomRule = aRule + "mediumResolution=1 and resolutionState!='M'";
+    mgr->setRule( action( VISU_MULTIPR_MED_RES ), aCustomRule, true );
+  }
+  {
+    QString aCustomRule = aRule + "lowResolution=1 and resolutionState!='L'";
+    mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aCustomRule, true );
+  }
+  {
+    QString aCustomRule = aRule + "resolutionState!='H'";
+    mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule, true );
+  }
 }
 
 //***************************************************************************
@@ -3521,42 +3523,38 @@ void VisuGUI::OnCacheProperties()
   aDlg->exec();
 }
 
-// MULTIPR
+
+//---------------------------------------------------------------
 void VisuGUI::OnMultiprViewFullRes()
 {
-#ifdef ENABLE_MULTIPR
-       OnMultiprChangeRes('F');
-#endif
+  OnMultiprChangeRes(VISU::Result::FULL);
 }
 
-// MULTIPR
+
+//---------------------------------------------------------------
 void VisuGUI::OnMultiprViewMediumRes()
 {
-#ifdef ENABLE_MULTIPR
-       OnMultiprChangeRes('M');
-#endif
+  OnMultiprChangeRes(VISU::Result::MEDIUM);
 }
 
-// MULTIPR
+
+//---------------------------------------------------------------
 void VisuGUI::OnMultiprViewLowRes()
 {
-#ifdef ENABLE_MULTIPR
-       OnMultiprChangeRes('L');
-#endif
+  OnMultiprChangeRes(VISU::Result::LOW);
 }
 
-// MULTIPR
+
+//---------------------------------------------------------------
 void VisuGUI::OnMultiprViewHide()
 {
-#ifdef ENABLE_MULTIPR
-       OnMultiprChangeRes('H');
-#endif
+  OnMultiprChangeRes(VISU::Result::HIDDEN);
 }
 
-// MULTIPR
-void VisuGUI::OnMultiprChangeRes(char resolution)
+
+//---------------------------------------------------------------
+void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
 {
-#ifdef ENABLE_MULTIPR
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   if (CheckLock(aCStudy,GetDesktop(this)))
     return;
@@ -3565,10 +3563,13 @@ void VisuGUI::OnMultiprChangeRes(char resolution)
   if(aSelectionInfo.empty())
     return;
 
-  //cout << "selection: #=" << aSelectionInfo.size() << endl;
+  QApplication::setOverrideCursor(Qt::waitCursor);
 
-  for (int i=0; i<aSelectionInfo.size(); i++)
-  {
+  typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
+  typedef std::map<TResultPtr, _PTR(SObject)> TResult2SObject;
+  TResult2SObject aResult2SObject;
+
+  for (int i=0; i < aSelectionInfo.size(); i++) {
     VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
 
     _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
@@ -3576,48 +3577,35 @@ void VisuGUI::OnMultiprChangeRes(char resolution)
       continue;
 
     VISU::Result_var aResult = FindResult( VISU::GetSObject( aSObject ).in() );
-    VISU::Result_i* result = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
+    if(CORBA::is_nil(aResult.in()))
+      continue;
+    
+    VISU::Result_i* aCResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(aResult).in());
+    if(!aCResult)
+      continue;
 
-    _PTR(GenericAttribute) anAttr;
-    if (aSObject->FindAttribute(anAttr, "AttributePixMap"))
-    {
-      _PTR(AttributePixMap) aPixMap(anAttr);
-      if ( aPixMap->HasPixMap() )
-      {
-        const char* oldIcon = aPixMap->GetPixMap().c_str();
-        if ( (strcmp(oldIcon, "ICON_MULTIPR_VIEW_FULL")   == 0) ||
-             (strcmp(oldIcon, "ICON_MULTIPR_VIEW_MEDIUM") == 0) ||
-             (strcmp(oldIcon, "ICON_MULTIPR_VIEW_LOW")    == 0) ||
-             (strcmp(oldIcon, "ICON_MULTIPR_VIEW_HIDE")   == 0) )
-        {
-          bool hasMediumOrLow = (strstr(aSObject->GetComment().c_str(), "res=FML") != NULL);
-
-          if (resolution == 'F') 
-          {
-            if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'F');
-            aPixMap->SetPixMap("ICON_MULTIPR_VIEW_FULL");
-          } 
-          else if ((resolution == 'M') && hasMediumOrLow) 
-          {
-            if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'M');
-            aPixMap->SetPixMap("ICON_MULTIPR_VIEW_MEDIUM");
-          } 
-          else if ((resolution == 'L') && hasMediumOrLow) 
-          {
-            if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'L');
-            aPixMap->SetPixMap("ICON_MULTIPR_VIEW_LOW"); 
-          }
-          else if (resolution == 'H') 
-          {
-            if (result != NULL) result->SetResolutionMultipr(aSObject->GetName().c_str(), 'H');
-            aPixMap->SetPixMap("ICON_MULTIPR_VIEW_HIDE");
-          }
-        }
-      }
-    }
+    Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSObject);
+    bool anIsFound = false;
+    QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
+    if(!anIsFound)
+      continue;
+      
+    std::string aPartName = aSObject->GetName();
+
+    aCResult->SetResolution(aMeshName.latin1(), aPartName.c_str(), theResolution);
+
+    aResult2SObject[TResultPtr(aCResult)] = aSObject;
   }
 
-  UpdateObjBrowser(this, false);
-#endif
+  // To update all result observers
+  TResult2SObject::const_iterator anIter = aResult2SObject.begin();
+  for(; anIter != aResult2SObject.end(); anIter++){
+    const TResultPtr& aResultPtr = anIter->first;
+    const _PTR(SObject)& aSObject = anIter->second;
+    aResultPtr->UpdateObservers();
+    VISU::UpdateObjBrowser(this, false, aSObject);
+  }
+
+  QApplication::restoreOverrideCursor();
 }
 
index b5a5bfeb79698268a78e69968a623ac762abf13b..c672c5d806d96f5f4ee1d0dc34e126320a54f5dc 100644 (file)
@@ -172,7 +172,7 @@ protected slots:
   void OnMultiprViewMediumRes();
   void OnMultiprViewLowRes();
   void OnMultiprViewHide();
-  void OnMultiprChangeRes(char resolution);
+  void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
 
 protected:
   virtual LightApp_Selection* createSelection() const;
index d7122e5f028ccb7f2bd030c849eeb07c2996efb0..a7fc9d93cc7b4235c3ff2a41f3ac4f4190e2344d 100644 (file)
@@ -250,8 +250,6 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 
   aMainLayout->addWidget(aBtnBox);
 
-  myCutLines = NULL;
-
   // signals and slots connections
   connect(mySelPlane    , SIGNAL(clicked(int))          , this, SLOT(onPlaneSelect(int)));
   connect(myCBSetDef    , SIGNAL(toggled(bool))         , this, SLOT(setBaseDefault()));
@@ -273,10 +271,6 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
   connect(aOkBtn, SIGNAL(clicked()), this, SLOT(accept()));
   connect(aCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
   connect(aHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
-  //connect(myMgr, SIGNAL(closeAllViews()), this, SLOT(reject()));
-  //connect(VisuGUI::application()->desktop(),
-  //        SIGNAL(windowActivated(SUIT_ViewWindow*)),
-  //        this, SLOT(onWindowActivated(SUIT_ViewWindow*)));
 }
 
 /*!
@@ -284,10 +278,7 @@ VisuGUI_CutLinesDlg::VisuGUI_CutLinesDlg (SalomeApp_Module* theModule)
 */
 VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg()
 {
-  cout<<"### VisuGUI_CutLinesDlg::~VisuGUI_CutLinesDlg"<<endl;
   deletePlanes();
-  if (myCutLines) //delete myCutLines;
-    myCutLines->Destroy();
   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
@@ -314,7 +305,8 @@ void VisuGUI_CutLinesDlg::initFromPrsObject (VISU::ColoredPrs3d_i* thePrs, bool
   hasInit = true;
   myCutLines = VISU::TSameAsFactory<VISU::TCUTLINES>().Create(myPrsCopy, VISU::ColoredPrs3d_i::EDoNotPublish);
   myCutLines->CopyCurvesInverted(myPrsCopy->GetCurvesInverted());
-  if (myCutLines->IsAllCurvesInverted()) myAllCurvesInvertedCheck->setChecked(true);
+  if (myCutLines->IsAllCurvesInverted()) 
+    myAllCurvesInvertedCheck->setChecked(true);
   myBasePlanePos->setText( QString::number(myCutLines->GetBasePlanePosition()) );
   myCBSetDef->setChecked(myPrsCopy->IsDefault());
   DrawTable();
@@ -363,7 +355,7 @@ int VisuGUI_CutLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
   if (myAllCurvesInvertedCheck->isChecked())
     myPrsCopy->SetAllCurvesInverted(true);
 
-  VISU::TSameAsFactory<VISU::TCUTLINES>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TCUTLINES>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
@@ -373,7 +365,7 @@ void VisuGUI_CutLinesDlg::createPlanes()
 {
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView == NULL) return;
-  if (myCutLines == NULL) return;
+  if (!myCutLines) return;
   if (myPreviewActor != 0) return;
 
   storeToPrsObject(myCutLines);
@@ -473,15 +465,9 @@ void VisuGUI_CutLinesDlg::onCutSelect (int theId, bool theUpdate)
   }
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
-    if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
-      /*myCutLines->SetOrientation2(getOrientaion(false),
-                                  myRotXSpn2->value()*PI/180.,
-                                  myRotYSpn2->value()*PI/180.);
-                                 myCutLines->SetDisplacement2(myPosSpn2->value());*/
-      //myCutLines->GetPipeLine()->Update();
+    if (theUpdate && myPreviewCheck->isChecked() && myCutLines) {
       deletePlanes();
       createPlanes();
-      //aView->Repaint();
     }
   }
 }
@@ -493,22 +479,12 @@ void VisuGUI_CutLinesDlg::setBaseDefault (bool theUpdate)
 
   if (myCBSetDef->isChecked()) {
     if (!myCutLines->IsDefault()) myCutLines->SetDefault();
-    /*myCutLines->SetOrientation(getOrientaion(),
-                               myRotXSpn->value()*PI/180.,
-                               myRotYSpn->value()*PI/180.);
-                              myCutLines->SetDisplacement(myPosSpn->value());*/
-    /*    float aPos = myCutLines->GetBasePlanePosition();
-    myBasePlanePos->setText( QString::number(aPos) );
-    myBasePlanePos->setEnabled(false);*/
     myCutLines->SetDisplacement(myPosSpn->value());
     SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
-      if (theUpdate && myPreviewCheck->isChecked() && (myCutLines != NULL)) {
-        //myCutLines->SetBasePlanePosition(aPos);
-       //        myCutLines->GetPipeLine()->Update();
+      if (theUpdate && myPreviewCheck->isChecked() && myCutLines) {
         deletePlanes();
         createPlanes();
-        //aView->Repaint();
       }
     }
     vtkFloatingPointType aPos = myCutLines->GetBasePlanePosition();
@@ -576,10 +552,8 @@ void VisuGUI_CutLinesDlg::DrawTable()
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
-      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
-      //aView->Repaint();
     }
   }
 }
@@ -744,27 +718,18 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
     SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
     if (aView) {
       if (myPreviewCheck->isChecked()) {
-       //Update Preview
-       //myCutLines->SetLinePosition( theRow, aTxt.toDouble());
-       //      myCutLines->GetPipeLine()->Update();
        deletePlanes();
        createPlanes();
-       //aView->Repaint();
       }
     }
   } else if (theCol == 1){
     bool isDefault = ((QCheckTableItem*)myPosTable->item(theRow, theCol))->isChecked();
     if (isDefault) {
-      //myCutLines->SetDefaultPosition(theRow);
-      // myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
       SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
       if (aView) {
        if (myPreviewCheck->isChecked()) {
-         //Update Preview
-         //      myCutLines->GetPipeLine()->Update();
          deletePlanes();
          createPlanes();
-         //aView->Repaint();
        }
       }
       myPosTable->setText(theRow, 0, QString::number(myCutLines->GetLinePosition(theRow)));
@@ -775,87 +740,6 @@ void VisuGUI_CutLinesDlg::onValueChanged (int theRow, int theCol)
 
 void VisuGUI_CutLinesDlg::accept()
 {
-  //if ( !VisuGUI::CheckActiveStudyLock() ) {
-  //  reject();
-  //  return;
-  //}
-  //  if (myScalarPane->check()) {
-    /*jfa tmp:((QWidget*)sender())->setDisabled(true);
-    storeToPrsObject(myPrsCopy);
-    if (myIsCreation) {
-      if (isGenerateTable()) {
-       visuGUI->GetVisuGen()->CreateTable(myPrsCopy->GetEntry());
-       if (isGenerateCurves()) {
-         SALOMEDSClient_Study* aStudy = study()->studyDS();
-         SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrsCopy->GetEntry());
-         if( aSObject ) {
-           SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
-           SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
-           for ( ;aIter->More(); aIter->Next()) {
-             SALOMEDSClient_SObject* aTblObj = aIter->Value();
-             if ( aTblObj ) {
-               SALOMEDSClient_GenericAttribute* anAttr;
-               if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
-                 visuGUI->CreatePlot(aTblObj);
-               }
-             }
-           }
-         }
-       }
-      }
-      if (GET_VTK_VIEWWINDOW(myMgr)) {
-       try {
-         visuGUI->CreateActor(myPrsCopy);
-       } catch (...) {
-         reject();
-         return;
-       }
-       GET_VTK_VIEWWINDOW(myMgr)->onFitAll();
-      }
-    } else {
-      visuGUI->RecreateActor(myPrsCopy);
-      if (VTKViewer_ViewWindow* vf = GET_VTK_VIEWWINDOW(myMgr)) {
-       if (vf->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
-         vf->getRenderer()->ResetCameraClippingRange();
-         vf->Repaint();
-       }
-      }
-      // Remove old Table
-      SALOMEDSClient_Study* aStudy = study()->studyDS();
-      SALOMEDSClient_SObject* aSObject = aStudy->FindObjectID(myPrsCopy->GetEntry());
-      if( aSObject ) {
-       SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
-       SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
-       for ( ;aIter->More(); aIter->Next()) {
-         SALOMEDSClient_SObject* aTblObj = aIter->Value();
-         if ( aTblObj ) {
-           SALOMEDSClient_GenericAttribute* anAttr;
-           if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
-             aBuilder->RemoveObjectWithChildren(aIter->Value()); // We should have only one child
-             break;
-           }
-         }
-       }
-       if (isGenerateTable()) {
-         visuGUI->GetVisuGen()->CreateTable(aSObject->GetID().c_str());
-         if (isGenerateCurves()) {
-           SALOMEDSClient_Study* aStudy = study()->studyDS();
-           SALOMEDSClient_ChildIterator* aIter = aStudy->NewChildIterator( aSObject );
-           SALOMEDSClient_StudyBuilder* aBuilder = aStudy->NewBuilder();
-           for ( ;aIter->More(); aIter->Next()) {
-             SALOMEDSClient_SObject* aTblObj = aIter->Value();
-             if ( aTblObj ) {
-               SALOMEDSClient_GenericAttribute* anAttr;
-               if (aTblObj->FindAttribute(anAttr, "AttributeName")) {
-                 visuGUI->CreatePlot(aTblObj);
-               }
-             }
-           }
-         }
-       }
-      }
-    }
-    VisuGUI::application()->objectBrowser()->updateTree();*/
     myScalarPane->deletePreview();
     deletePlanes();
     QDialog::accept();
@@ -863,10 +747,6 @@ void VisuGUI_CutLinesDlg::accept()
 
 void VisuGUI_CutLinesDlg::reject()
 {
-  /*jfa tmp:if (myIsCreation) {
-    myPrsCopy->RemoveFromStudy();
-    VisuGUI::application()->objectBrowser()->updateTree();
-  }*/
   myScalarPane->deletePreview();
   deletePlanes();
   QDialog::reject();
@@ -876,10 +756,7 @@ void VisuGUI_CutLinesDlg::onPreviewCheck (bool thePreview)
 {
   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
     if (thePreview) {
-      //storeToPrsObject(myCutLines);
-      //      myCutLines->GetPipeLine()->Update();
       createPlanes();
-      //vf->onFitAll();
     } else {
       deletePlanes();
       vf->Repaint();
@@ -904,36 +781,24 @@ void VisuGUI_CutLinesDlg::onAllCurvesInvertedCheck(bool theInvert)
 
 void VisuGUI_CutLinesDlg::onRotation (double theValue)
 {
-  if (myCutLines == NULL) return;
+  if (!myCutLines) return;
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
-
-      /*myCutLines->SetOrientation(getOrientaion(),
-                                 myRotXSpn->value()*PI/180.,
-                                 myRotYSpn->value()*PI/180.);
-      myCutLines->SetOrientation2(getOrientaion(false),
-                                  myRotXSpn2->value()*PI/180.,
-                                  myRotYSpn2->value()*PI/180.);*/
-      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
-      //aView->Repaint();
     }
   }
 }
 
 void VisuGUI_CutLinesDlg::onPlanePos (const QString& theValue)
 {
-  if (myCutLines == NULL) return;
+  if (!myCutLines) return;
   SVTK_ViewWindow* aView = VISU::GetActiveViewWindow<SVTK_ViewWindow>();
   if (aView) {
     if (myPreviewCheck->isChecked()) {
-      //myCutLines->SetBasePlanePosition(theValue.toDouble());
-      //      myCutLines->GetPipeLine()->Update();
       deletePlanes();
       createPlanes();
-      //aView->Repaint();
     }
   }
 }
index 9e7405e77d15ffc7cbfbba1fd8059ae6fa9dae83..52142bdfbf04864bf8126a5c6144bfa7267553df 100644 (file)
@@ -104,7 +104,7 @@ private:
   bool hasInit;
 
   QDoubleValidator *mydvalidator;
-  VISU::CutLines_i* myCutLines;
+  SALOME::GenericObjPtr<VISU::CutLines_i> myCutLines;
 
   QTabWidget*            myTabBox;
   VisuGUI_ScalarBarPane* myScalarPane;
index 591a413bd7b511f9e0ccb1f13da7e7a34a86d434..8006fd486a5bdf0b360826bc6c5c7b5bdc6cf0d3 100644 (file)
@@ -166,7 +166,6 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
   connect( th, SIGNAL( clicked(int)), this, SLOT( setDefault(int) ) );
 
   // default values
-  myCutPlanes = NULL;
   hasInit = false;
   X1 = 0; X2 = 0;
   Y1 = 0; Y2 = 0;
@@ -178,8 +177,6 @@ VisuGUI_CutPlanesPane::VisuGUI_CutPlanesPane (QWidget* theParent)
 VisuGUI_CutPlanesPane::~VisuGUI_CutPlanesPane()
 {
   deletePlanes();
-  if (myCutPlanes)
-    myCutPlanes->Destroy();
   if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
     vf->Repaint();
 }
@@ -205,7 +202,7 @@ void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
 void VisuGUI_CutPlanesPane::createPlanes()
 {
   if (VISU::GetActiveViewWindow<SVTK_ViewWindow>() == NULL) return;
-  if (myCutPlanes == NULL) return;
+  if (!myCutPlanes) return;
   if (myPreviewActor != 0) return;
 
   vtkAppendPolyData* aPolyData = myCutPlanes->GetSpecificPL()->GetAppendPolyData();
@@ -311,7 +308,7 @@ void VisuGUI_CutPlanesPane::setRotation (const double r1, const double r2)
 */
 void VisuGUI_CutPlanesPane::DrawTable()
 {
-  if (myCutPlanes == NULL) return;
+  if (!myCutPlanes) return;
   if (!hasInit) return;
 
   int aNbRows = myPosTable->numRows();
@@ -441,7 +438,7 @@ void VisuGUI_CutPlanesPane::deletePlanes()
 
 void VisuGUI_CutPlanesPane::onRotation (double theValue)
 {
-  if (myCutPlanes == NULL) return;
+  if (!myCutPlanes) return;
   if (myPreviewCheck->isChecked()) {
     if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
       myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
@@ -561,7 +558,7 @@ int VisuGUI_CutPlanesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
   anIsOk &= myScalarPane->storeToPrsObject(myPrsCopy);
   anIsOk &= myCutPane->storeToPrsObject(myPrsCopy);
 
-  VISU::TSameAsFactory<VISU::TCUTPLANES>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TCUTPLANES>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index e94a7bf61630bff30c629b71a165ef46c4afd279..9f2ad6ccd5e760fff870b2e64e8a4a77ded0d104 100644 (file)
@@ -87,7 +87,7 @@ private:
     QRadioButton* RBxy;
     QtxDblSpinBox* myPosSpn;
     QTable* myPosTable;
-    VISU::CutPlanes_i* myCutPlanes;
+    SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
     QCheckBox* myPreviewCheck;
     double          X1, X2;
     double          Y1, Y2;
@@ -132,7 +132,6 @@ private:
     VisuGUI_CutPlanesPane* myCutPane;
     VisuGUI_ScalarBarPane* myScalarPane;
     VisuGUI_InputPane*     myInputPane;
-    VISU::CutPlanes_i*     myPrs;
     SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy;
 };
 
index ad81e44c8aa87ddb1cb877518fba0eaee869b2f3..3f06d6a192e51dfbe9e8ef061078a6c0f6347c3b 100644 (file)
@@ -166,7 +166,7 @@ int VisuGUI_DeformedShapeDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
   myPrsCopy->SetScale(getFactor());
   myPrsCopy->ShowColored(isColored());
 
-  VISU::TSameAsFactory<VISU::TDEFORMEDSHAPE>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index b996cc3ad78cd6b6e5203ebef8fde11152f059eb..6a66425d773bbae5cde36bb6586c371f59fd2e68 100644 (file)
@@ -125,7 +125,34 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent, bool S
   RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
   RangeGroupLayout->addWidget( myModeCombo, 0, 1 );
 
-  //TopLayout->addWidget( RangeGroup );
+  RBFieldRange = new QRadioButton (tr("FIELD_RANGE_BTN"), RangeGroup, "RBFieldRange");
+  RBImposedRange = new QRadioButton (tr("IMPOSED_RANGE_BTN"), RangeGroup, "RBImposedRange");
+  RBFieldRange->setChecked( true );
+
+  MinEdit = new QLineEdit( RangeGroup, "MinEdit" );
+  MinEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  MinEdit->setMinimumWidth( 70 );
+  MinEdit->setValidator( new QDoubleValidator(this) );
+  MinEdit->setText( "0.0" );
+  QLabel* MinLabel = new QLabel (tr("LBL_MIN"), RangeGroup, "MinLabel");
+  MinLabel->setBuddy(MinEdit);
+
+  MaxEdit = new QLineEdit( RangeGroup, "MaxEdit" );
+  MaxEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  MaxEdit->setMinimumWidth( 70 );
+  MaxEdit->setValidator( new QDoubleValidator(this) );
+  MaxEdit->setText( "0.0" );
+  QLabel* MaxLabel = new QLabel (tr("LBL_MAX"), RangeGroup, "MaxLabel");
+  MaxLabel->setBuddy(MaxEdit);
+
+  RangeGroupLayout->addWidget( myModeLbl, 0, 0 );
+  RangeGroupLayout->addMultiCellWidget( myModeCombo, 0, 0, 1, 3);
+  RangeGroupLayout->addMultiCellWidget( RBFieldRange, 1, 1, 0, 1);
+  RangeGroupLayout->addMultiCellWidget( RBImposedRange, 1, 1, 2, 3);
+  RangeGroupLayout->addWidget( MinLabel, 2, 0 );
+  RangeGroupLayout->addWidget( MinEdit,  2, 1 );
+  RangeGroupLayout->addWidget( MaxLabel, 2, 2 );
+  RangeGroupLayout->addWidget( MaxEdit,  2, 3 );
 
   // Colors and Labels ========================================================
   QGroupBox* ColLabGroup = new QGroupBox (tr("COLORS_LABELS_GRP"), this, "ColLabGroup");
@@ -263,8 +290,14 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent, bool S
   myTextDlg->setTitleVisible(!SetPref);
 
   // signals and slots connections ===========================================
-  connect( myRBLocal,     SIGNAL( toggled( bool ) ), myCBDisplayed, SLOT( setEnabled( bool ) ) );
-  connect( myRBGlobal,    SIGNAL( clicked() ),       this, SLOT( onSetDisplayGlobal() ) );
+  connect( RBFieldRange,    SIGNAL( clicked() ), this, SLOT( fieldRangeClicked() ) );
+  connect( RBImposedRange,    SIGNAL( clicked() ), this, SLOT( imposedRangeClicked() ) );
+
+  connect( myModeCombo,   SIGNAL( activated( int ) ), this, SLOT( changeScalarMode( int ) ) );
+
+  connect( myRBLocal,     SIGNAL( clicked() ), this, SLOT( onLocalScalarBar() ) );
+  connect( myRBGlobal,    SIGNAL( clicked() ), this, SLOT( onGlobalScalarBar() ) );
+
   connect( RainbowButton, SIGNAL( toggled( bool ) ), ColorLabel, SLOT( setEnabled( bool ) ) );
   connect( RainbowButton, SIGNAL( toggled( bool ) ), ColorSpin, SLOT( setEnabled( bool ) ) );
   connect( RainbowButton, SIGNAL( toggled( bool ) ), LabelLabel, SLOT( setEnabled( bool ) ) );
@@ -278,17 +311,113 @@ VisuGUI_GaussScalarBarPane::VisuGUI_GaussScalarBarPane (QWidget * parent, bool S
   myIsStoreTextProp = false;
 }
 
-void VisuGUI_GaussScalarBarPane::onSetDisplayGlobal()
+void VisuGUI_GaussScalarBarPane::onGlobalScalarBar()
 {
   myCBDisplayed->setChecked( true );
+
+  RBImposedRange->setEnabled( false );
+  RBFieldRange->setEnabled( false );
+  MinEdit->setEnabled( false );
+  MaxEdit->setEnabled( false );
+
+  myPrsCopy->SetIsActiveLocalScalarBar(false);
+}
+
+
+void VisuGUI_GaussScalarBarPane::onLocalScalarBar()
+{
+  myCBDisplayed->setEnabled( true );
+
+  RBImposedRange->setEnabled( true );
+  RBFieldRange->setEnabled( true );
+
+  if ( RBImposedRange->isChecked() ) {
+    MinEdit->setEnabled( true );
+    MaxEdit->setEnabled( true );
+  }
+
+  myPrsCopy->SetIsActiveLocalScalarBar(true);
+}
+
+
+/*!
+  Called when Range mode is changed to FieldRange
+*/
+void VisuGUI_GaussScalarBarPane::fieldRangeClicked()
+{
+  RBImposedRange->setChecked( false );
+  MinEdit->setEnabled( false );
+  MaxEdit->setEnabled( false );
+
+  MinEdit->setText( QString::number( myPrsCopy->GetSourceMin() ) );
+  MaxEdit->setText( QString::number( myPrsCopy->GetSourceMax() ) );
+
+  myPrsCopy->SetSourceRange();
+}
+
+
+/*!
+  Called when Range mode is changed to FieldRange
+*/
+void VisuGUI_GaussScalarBarPane::imposedRangeClicked()
+{
+  RBFieldRange->setChecked( false );
+  MinEdit->setEnabled( true );
+  MaxEdit->setEnabled( true );
+
+  myPrsCopy->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
 }
 
 
+/*!
+  Called when scalar mode is changed
+*/
+void VisuGUI_GaussScalarBarPane::changeScalarMode( int theMode )
+{
+  myPrsCopy->SetScalarMode( theMode );
+  if ( RBFieldRange->isChecked() ) {
+    CORBA::Double aRange[2] = {myPrsCopy->GetSourceMin(), myPrsCopy->GetSourceMax()};
+    MinEdit->setText( QString::number( aRange[0] ) );
+    MaxEdit->setText( QString::number( aRange[1] ) );
+  }
+}
+
 /**
  * Initialise dialog box from presentation object
  */
 void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs) {
+  myPrsCopy = thePrs;
+
   myModeCombo->setCurrentItem(thePrs->GetScalarMode());
+
+  bool activeLocal = thePrs->GetIsActiveLocalScalarBar();
+  if ( activeLocal ) {
+    if ( thePrs->IsRangeFixed() ) {
+      RBImposedRange->setChecked( true );
+      RBFieldRange->setChecked( false );
+      MinEdit->setEnabled( true );
+      MaxEdit->setEnabled( true );
+    } else {
+      RBImposedRange->setChecked( false );
+      RBFieldRange->setChecked( true );
+      MinEdit->setEnabled( false );
+      MaxEdit->setEnabled( false );
+    }
+  } else {
+    RBImposedRange->setEnabled( false );
+    RBFieldRange->setEnabled( false );
+    MinEdit->setEnabled( false );
+    MaxEdit->setEnabled( false );
+  }
+
+  if ( RBFieldRange->isChecked() ) {
+    MinEdit->setText( QString::number( thePrs->GetSourceMin() ) );
+    MaxEdit->setText( QString::number( thePrs->GetSourceMax() ) );
+  } else {
+    MinEdit->setText( QString::number( thePrs->GetMin() ) );
+    MaxEdit->setText( QString::number( thePrs->GetMax() ) );
+  }
+
   setPosAndSize( thePrs->GetPosX(),
                 thePrs->GetPosY(),
                 thePrs->GetWidth(),
@@ -297,7 +426,6 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs)
 
   SpacingSpin->setValue(thePrs->GetSpacing());
 
-  bool activeLocal = thePrs->GetIsActiveLocalScalarBar();
   myRBLocal->setChecked( activeLocal );
 
   myRBGlobal->setChecked( !activeLocal );
@@ -377,17 +505,24 @@ void VisuGUI_GaussScalarBarPane::initFromPrsObject(VISU::GaussPoints_i* thePrs)
  */
 int VisuGUI_GaussScalarBarPane::storeToPrsObject(VISU::GaussPoints_i* thePrs) {
   thePrs->SetScalarMode(myModeCombo->currentItem());
-  thePrs->SetPosition(XSpin->value(), YSpin->value());
-  thePrs->SetSize(WidthSpin->value(), HeightSpin->value());
+
+  if (RBFieldRange->isChecked()) {
+    thePrs->SetSourceRange();
+  } else {
+    thePrs->SetRange(MinEdit->text().toDouble(), MaxEdit->text().toDouble());
+  }
+
   thePrs->SetSpacing(SpacingSpin->value());
-  thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL);
   thePrs->SetIsActiveLocalScalarBar(myRBLocal->isChecked());
   thePrs->SetIsDispGlobalScalarBar(myCBDisplayed->isChecked());
+  thePrs->SetBiColor(BicolorButton->isChecked());
+
+  thePrs->SetPosition(XSpin->value(), YSpin->value());
+  thePrs->SetSize(WidthSpin->value(), HeightSpin->value());
+  thePrs->SetBarOrientation((RBvert->isChecked())? VISU::ColoredPrs3d::VERTICAL : VISU::ColoredPrs3d::HORIZONTAL);
   thePrs->SetNbColors(ColorSpin->value());
   thePrs->SetLabels(LabelSpin->value());
 
-  thePrs->GetSpecificPL()->SetBicolor(BicolorButton->isChecked());
-
   //if (isToSave()) storeToResources();
 
   if (myIsStoreTextProp) {
@@ -673,8 +808,8 @@ void VisuGUI_GaussPointsDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, boo
   myPrimitiveBox->setPrimitiveType( myPrsCopy->GetPrimitiveType() );
   myPrimitiveBox->setClampMaximum( myPrsCopy->GetMaximumSupportedSize() );
   myPrimitiveBox->setClamp( myPrsCopy->GetClamp() );
-  myPrimitiveBox->setMainTexture( myPrsCopy->GetMainTexture() );
-  myPrimitiveBox->setAlphaTexture( myPrsCopy->GetAlphaTexture() );
+  myPrimitiveBox->setMainTexture( myPrsCopy->GetQMainTexture() );
+  myPrimitiveBox->setAlphaTexture( myPrsCopy->GetQAlphaTexture() );
   myPrimitiveBox->setAlphaThreshold( myPrsCopy->GetAlphaThreshold() );
   myPrimitiveBox->setResolution( myPrsCopy->GetResolution() );
   myPrimitiveBox->setFaceLimit( myPrsCopy->GetFaceLimit() );
@@ -685,7 +820,7 @@ void VisuGUI_GaussPointsDlg::initFromPrsObject(VISU::ColoredPrs3d_i* thePrs, boo
   mySizeBox->setMaxSize( myPrsCopy->GetMaxSize() );
   mySizeBox->setMagnification( myPrsCopy->GetMagnification() );
   mySizeBox->setIncrement( myPrsCopy->GetMagnificationIncrement() );
-  mySizeBox->setColor( myPrsCopy->GetColor() );
+  mySizeBox->setColor( myPrsCopy->GetQColor() );
 
   if( !theInit )
     return;
@@ -705,15 +840,16 @@ int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::ColoredPrs3d_i* thePrs )
   myPrsCopy->SetIsDeformed( myDefShapeButton->isChecked() );
   myPrsCopy->SetScaleFactor( myScaleSpinBox->value() );
 
-  myPrsCopy->SetPrimitiveType( myPrimitiveBox->getPrimitiveType() );
+  int aPrimitiveType = myPrimitiveBox->getPrimitiveType();
+  myPrsCopy->SetPrimitiveType( VISU::GaussPoints::PrimitiveType( aPrimitiveType )  );
 
   myPrsCopy->SetClamp( myPrimitiveBox->getClamp() );
 
   QString aMainTexture = myPrimitiveBox->getMainTexture();
   QString anAlphaTexture = myPrimitiveBox->getAlphaTexture();
 
-  aMainTexture = aMainTexture.isNull() ? myPrsCopy->GetMainTexture() : aMainTexture;
-  anAlphaTexture = anAlphaTexture.isNull() ? myPrsCopy->GetAlphaTexture() : anAlphaTexture;
+  aMainTexture = aMainTexture.isNull() ? myPrsCopy->GetQMainTexture() : aMainTexture;
+  anAlphaTexture = anAlphaTexture.isNull() ? myPrsCopy->GetQAlphaTexture() : anAlphaTexture;
   
   myPrsCopy->SetTextures( aMainTexture, anAlphaTexture );
 
@@ -732,14 +868,14 @@ int VisuGUI_GaussPointsDlg::storeToPrsObject( VISU::ColoredPrs3d_i* thePrs )
   else
   {
     myPrsCopy->SetIsColored( false );
-    myPrsCopy->SetColor( mySizeBox->getColor() );
+    myPrsCopy->SetQColor( mySizeBox->getColor() );
     myPrsCopy->SetGeomSize( mySizeBox->getGeomSize() );
   }
 
   myPrsCopy->SetMagnification( mySizeBox->getMagnification() );
   myPrsCopy->SetMagnificationIncrement( mySizeBox->getIncrement() );
 
-  VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TGAUSSPOINTS>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index bf117d7c75c7df3fcdf528ffcd2d1a83b70b7493..e0962e51136347fa760665a70e1eb821240f3202 100644 (file)
@@ -29,6 +29,7 @@
 #define VISUGUI_GAUSSPOINTSDLS_H
 
 #include "VisuGUI_Prs3dDlg.h"
+#include "VISU_GaussPoints_i.hh"
 
 #include <qvbox.h>
 
@@ -40,10 +41,6 @@ class VVTK_SizeBox;
 class VisuGUI_TextPrefDlg;
 class VisuGUI_InputPane;
 
-namespace VISU
-{
-  class GaussPoints_i;
-}
 
 //! Specific Scalar Bar tab.
 /*! Uses for set up Gauss Points Scalar Bars preferenses. */
@@ -71,6 +68,11 @@ class VisuGUI_GaussScalarBarPane : public QVBox
 
  protected:
   QButtonGroup*   RangeGroup;
+  QRadioButton*   RBFieldRange;
+  QRadioButton*   RBImposedRange;
+  QLineEdit*      MinEdit;
+  QLineEdit*      MaxEdit;
+  SALOME::GenericObjPtr<VISU::GaussPoints_i> myPrsCopy;
 
   QRadioButton*   RBhori;
   QRadioButton*   RBvert;
@@ -105,11 +107,16 @@ class VisuGUI_GaussScalarBarPane : public QVBox
   bool myIsStoreTextProp;
 
  private slots:
+  void onGlobalScalarBar();
+  void onLocalScalarBar();
+
+  void fieldRangeClicked();
+  void imposedRangeClicked();
+  void changeScalarMode( int );
+
   void changeDefaults( int );
-//VSR: 08/06/06:  void changeRange( int );
   void XYChanged( double );
   void onTextPref();
-  void onSetDisplayGlobal();
 };
 
 //! Create Gauss Points Presentation Dialog.
index 4f7379bbee246fb6a79faee3a5f93ffa04a9d885..90915b17368a767caef253587430e35c6f6e4c04 100644 (file)
@@ -197,7 +197,9 @@ VisuGUI_InputPane::VisuGUI_InputPane( VISU::VISUType theType,
     }
   }
 
+  connect( myTimeStamps,   SIGNAL( activated( int ) ), this, SLOT( changeTimeStamp( int ) ) );
   connect( myReInit, SIGNAL( toggled( bool ) ), SLOT( onReInitialize( bool ) ) );
+
   connect( myUseGroupsGroupBox, SIGNAL( toggled( bool ) ), this, SLOT( onTypeChanged() ) );
   connect( myAllGroups,  SIGNAL( doubleClicked( QListBoxItem* ) ), this, SLOT( onListDoubleClicked( QListBoxItem* ) ) );
   connect( mySelectedGroups,  SIGNAL( doubleClicked( QListBoxItem* ) ), this, SLOT( onListDoubleClicked( QListBoxItem* ) ) );
@@ -420,6 +422,15 @@ void VisuGUI_InputPane::onSelectionChanged()
 }
 
 
+//---------------------------------------------------------------
+void VisuGUI_InputPane::changeTimeStamp( int theTimeStamp )
+{
+  myPrs->SetTimeStampNumber( myPrs->GetTimeStampNumberByIndex( theTimeStamp ) );
+  myPrs->Apply( true );
+  myDialog->initFromPrsObject( myPrs, false );
+}
+
+
 //---------------------------------------------------------------
 void VisuGUI_InputPane::onReInitialize( bool on )
 {
@@ -485,7 +496,7 @@ void VisuGUI_InputPane::initFromPrsObject( VISU::ColoredPrs3d_i* thePrs )
     VISU::GetSelectionMgr( myModule )->installFilter( myFieldFilter );
   
   // type of presentation and groups
-  VISU_Convertor* anInput = aResult->GetInput();
+  VISU::Result_i::PInput anInput = aResult->GetInput();
   const VISU::TMeshMap& aMeshMap = anInput->GetMeshMap();
   std::string aMeshName = thePrs->GetCMeshName();
   VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(aMeshName);
index 47a0cf8c6f6301e771b8c065b9cb56ccd49f670c..eea4df6410af2e895026b9d56408a5492b5da479 100644 (file)
@@ -75,6 +75,7 @@ public:
 public slots:
   virtual void       onSelectionChanged();
   virtual void       onReInitialize( bool );
+  virtual void       changeTimeStamp( int );
 
 private slots:
   void               onTypeChanged();
index e043866a10f3595ab131c0d546d88ac6f2be4b73..13a32591fa7cfb63dd0f8e602ad561ebc870860d 100644 (file)
@@ -261,7 +261,7 @@ int VisuGUI_IsoSurfacesDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
   anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
   anIsOk &= myIsoPane->storeToPrsObject( myPrsCopy );
 
-  VISU::TSameAsFactory<VISU::TISOSURFACES>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TISOSURFACES>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index 3c20b0a1d73844c4c9dfd1f676c8a26ee56b23bd..ead3d4afe8deb8d603e49ecf7ed0c3fb381b77e5 100644 (file)
@@ -661,7 +661,7 @@ int VisuGUI_Plot3DDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
   anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
   anIsOk &= myIsoPane->storeToPrsObject( myPrsCopy );
 
-  VISU::TSameAsFactory<VISU::TPLOT3D>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TPLOT3D>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index 043db8bd2131a78c5766810974035fd9085d0850..84a6326730fdc5d3ec31a92153b6c1e2f109cc17 100644 (file)
@@ -45,6 +45,8 @@ using namespace VISU;
 // Class: VisuGUI_Selection
 //////////////////////////////////////////////////
 
+
+//---------------------------------------------------------------
 QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
 {
   QtxValue val( LightApp_Selection::param( ind, p ) );
@@ -63,11 +65,18 @@ QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const
     else if ( p == "isShading"      ) val = QtxValue( isShading( ind ) );
     else if ( p == "isScalarMapAct" ) val = QtxValue( isScalarMapAct( ind ) );
     else if ( p == "isVisuComponent") val = QtxValue( isVisuComponent( ind ) );
+
+    else if ( p == "fullResolution"   ) val = QtxValue( fullResolution( ind ) );
+    else if ( p == "mediumResolution"   ) val = QtxValue( mediumResolution( ind ) );
+    else if ( p == "lowResolution"   ) val = QtxValue( lowResolution( ind ) );
+    else if ( p == "resolutionState"   ) val = QtxValue( resolutionState( ind ) );
   }
 
   return val;
 }
 
+
+//---------------------------------------------------------------
 // Macro for converting VISU enumeration items into corresponding strings
 #define ENUM2STRING( x, y ) \
   case y: \
@@ -134,6 +143,8 @@ QString VisuGUI_Selection::type( const int ind ) const
   return aResStr;
 }
 
+
+//---------------------------------------------------------------
 QString VisuGUI_Selection::nbComponents( const int ind ) const
 {
   QString aResStr;
@@ -151,6 +162,95 @@ QString VisuGUI_Selection::nbComponents( const int ind ) const
   return aResStr;
 }
 
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolutions( const int ind ) const
+{
+  QString aResStr;
+  SalomeApp_Study* aStudy = GetStudy();
+  if ( !aStudy )
+    return aResStr;
+
+  VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ));
+  VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+  bool isExist;
+  QString aVal = VISU::Storable::FindValue(aMap,"myResolutions",&isExist);
+  if ( isExist )
+    aResStr = aVal;
+
+  return aResStr;
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolution( const int ind, char theResoltuion ) const
+{
+  QString aResStr;
+
+  QString aResolutions = resolutions( ind );
+  if(aResolutions.isEmpty())
+    return aResStr;
+  
+  if(aResolutions.find(theResoltuion) != -1)
+    aResStr = "1";
+  else
+    aResStr = "0";
+
+  return aResStr;
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::fullResolution( const int ind ) const
+{
+  return resolution( ind, 'F');
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::mediumResolution( const int ind ) const
+{
+  return resolution( ind, 'M');
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::lowResolution( const int ind ) const
+{
+  return resolution( ind, 'L');
+}
+
+
+//---------------------------------------------------------------
+QString VisuGUI_Selection::resolutionState( const int ind ) const
+{
+  QString aResStr;
+  SalomeApp_Study* aStudy = GetStudy();
+  if ( !aStudy )
+    return aResStr;
+
+  VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, entry( ind ));
+  VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject);
+
+  bool isExist;
+  QString aVal = VISU::Storable::FindValue(aMap,"myState",&isExist);
+  if ( isExist ) {
+    if ( aVal.toInt() == VISU::Result::FULL )
+      aResStr = "F";
+    if ( aVal.toInt() == VISU::Result::MEDIUM )
+      aResStr = "M";
+    if ( aVal.toInt() == VISU::Result::LOW )
+      aResStr = "L";
+    if ( aVal.toInt() == VISU::Result::HIDDEN )
+      aResStr = "H";
+  }
+
+  return aResStr;
+}
+
+
+//---------------------------------------------------------------
 QString VisuGUI_Selection::medEntity( const int ind ) const
 {
   SalomeApp_Study* aStudy = GetStudy();
@@ -451,6 +551,8 @@ struct TIsScalarMapActFunctor: TViewFunctor
   }
 };
 
+
+//---------------------------------------------------------------
 QString VisuGUI_Selection::isScalarMapAct( const int ind ) const
 {
   return TPopupDispatcher<TIsScalarMapActFunctor>()(myModule, entry(ind));
index 536ef59a94745cea92a066fa2a127a69e49b992a..61a592509f2c9390e73c8dffebab5866247a7d79 100644 (file)
@@ -61,10 +61,18 @@ private:
   QString          isScalarMapAct( const int ) const;
   bool             isVisuComponent( const int ) const;
 
+  QString          fullResolution( const int ) const;
+  QString          mediumResolution( const int ) const;
+  QString          lowResolution( const int ) const;
+  QString          resolutionState( const int ) const;
+
 private:
   int              nbChild( const int, const bool ) const;
   SalomeApp_Study* GetStudy() const;
 
+  QString          resolutions( const int ) const;
+  QString          resolution( const int, char theResoltuion ) const;
+
 private:
   SalomeApp_Module* myModule;
 };
index 76e5dcaf4b1ebe17d76dbba37693f49fbec4339e..e26a102eb9fcc08478c72ded8cca1a009fb9b802 100644 (file)
@@ -186,7 +186,7 @@ int VisuGUI_ScalarBarDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
   int anIsOk = myInputPane->storeToPrsObject( myPrsCopy );
   anIsOk &= myScalarPane->storeToPrsObject( myPrsCopy );
   
-  VISU::TSameAsFactory<VISU::TSCALARMAP>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TSCALARMAP>().Copy(myPrsCopy, thePrs);
   
   return anIsOk;
 }
index 13c8046de98c9031e6eac71c6e13c799119e7f03..d6f303e986b4edc14d49a8dd1fba967d10a7c608 100644 (file)
@@ -296,7 +296,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg
   if(myUpdateScalars) 
     SetScalarField( false );
 
-  VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
@@ -460,7 +460,7 @@ VisuGUI_ScalarMapOnDeformedShapeDlg
   QString aTime("");
   VISU::TEntity anEntity = VISU::TEntity(theEntity);
   VISU::Result_i* theResult = myPrsCopy->GetCResult();
-  VISU::Result_i::TInput* anInput = theResult->GetInput();
+  VISU::Result_i::PInput anInput = theResult->GetInput();
   VISU::PField aField = anInput->GetField(myPrsCopy->GetCMeshName(),
                                          anEntity,
                                          theFieldName);
index d58995ee7f13f3d59c51d00504289e39594c6ff2..8d30b5fe3b23ed914ff436a0f23c4d069f700cf6 100644 (file)
@@ -439,7 +439,7 @@ int VisuGUI_StreamLinesDlg::storeToPrsObject (VISU::ColoredPrs3d_i* thePrs)
   //                         tr("ERR_CANT_BUILD_PRESENTATION"),
   //                         tr("BUT_OK"));
 
-  VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TSTREAMLINES>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index 4a77ad49576b608f3d327a822c9bad363ff4f321..612271daadca2f4c7dced317b83160df1374120d 100644 (file)
@@ -256,7 +256,7 @@ int VisuGUI_VectorsDlg::storeToPrsObject(VISU::ColoredPrs3d_i* thePrs)
   } else 
     myPrsCopy->SetGlyphType(VISU::Vectors::NONE);
 
-  VISU::TSameAsFactory<VISU::TVECTORS>().Copy(thePrs, myPrsCopy);
+  VISU::TSameAsFactory<VISU::TVECTORS>().Copy(myPrsCopy, thePrs);
 
   return anIsOk;
 }
index f75be372213a7d488227f813c16b3b0076ea211d..184ad65a24a1c0e4e58221437e1ef348d5e8afe5 100644 (file)
@@ -31,6 +31,7 @@ salomeinclude_HEADERS = \
        VISUConfig.hh \
        VISU_Gen_i.hh \
        VISU_Result_i.hh \
+       VISU_MultiResult_i.hh \
        VISU_PrsObject_i.hh \
        VISU_Table_i.hh \
        VISU_Prs3d_i.hh \
@@ -53,10 +54,15 @@ salomeinclude_HEADERS = \
        SALOME_GenericObjPointer.hh
 
 libVISUEngineImpl_la_SOURCES = \
-       VISU_Result_i.cc \
        VISUConfig.cc \
+       VISU_Result_i.cc \
+       VISU_ResultUtils.cc \
+       VISU_MultiResult_i.cc \
+       VISU_Gen_i.cc \
+       VISU_CorbaMedConvertor.cxx \
        VISU_PrsObject_i.cc \
        VISU_Prs3d_i.cc \
+       VISU_Prs3dUtils.cc \
        VISU_ColoredPrs3d_i.cc \
        VISU_ScalarMap_i.cc \
        VISU_GaussPoints_i.cc \
@@ -76,8 +82,6 @@ libVISUEngineImpl_la_SOURCES = \
        VISU_TimeAnimation.cxx \
        VISU_View_i.cc \
        VISU_Table_i.cc \
-       VISU_Gen_i.cc \
-       VISU_CorbaMedConvertor.cxx \
        VISU_DumpPython.cc \
        SALOME_GenericObjPointer.cc
 
@@ -98,7 +102,11 @@ libVISUEngineImpl_la_CPPFLAGS= \
        $(MED_CXXFLAGS) \
        $(GUI_CXXFLAGS) \
        $(CORBA_CXXFLAGS) $(CORBA_INCLUDES) \
-       -I$(srcdir)/../CONVERTOR -I$(srcdir)/../PIPELINE -I$(srcdir)/../OBJECT -I$(srcdir)/../VVTK -I$(srcdir)/../GUITOOLS \
+       -I$(srcdir)/../CONVERTOR \
+       -I$(srcdir)/../PIPELINE \
+       -I$(srcdir)/../OBJECT \
+       -I$(srcdir)/../VVTK \
+       -I$(srcdir)/../GUITOOLS \
        -I$(top_builddir)/idl \
        -I$(top_builddir)/salome_adm/unix
 
@@ -113,7 +121,9 @@ libVISUEngineImpl_la_LDFLAGS= \
        $(MED_LDFLAGS) \
        ../../idl/libSalomeIDLVISU.la
 
-libVISUEngineImpl_la_LIBADD= -lboost_signals@BOOST_LIBSUFFIX@ -lboost_thread@BOOST_LIBSUFFIX@ \
+libVISUEngineImpl_la_LIBADD= \
+       -lboost_signals@BOOST_LIBSUFFIX@ \
+       -lboost_thread@BOOST_LIBSUFFIX@ \
        -lSalomeHDFPersist \
        -lSalomeGenericObj \
        -lSalomeContainer \
@@ -142,7 +152,9 @@ endif
 bin_PROGRAMS = VISU_I
 dist_VISU_I_SOURCES=VISU_I.cxx
 VISU_I_CPPFLAGS=$(libVISUEngineImpl_la_CPPFLAGS)
-VISU_I_LDADD=$(libVISUEngineImpl_la_LIBADD) $(libVISUEngineImpl_la_LDFLAGS) \
+VISU_I_LDADD=\
+       $(libVISUEngineImpl_la_LIBADD) \
+       $(libVISUEngineImpl_la_LDFLAGS) \
        $(KERNEL_LDFLAGS) \
        -lSALOMEBasics \
        -lSalomeCatalog \
index e710a4f05c81129162cbf4bc64e9eab3e7cfec37..83cd25457417995188356cca6709a0c8bc376611 100644 (file)
@@ -101,7 +101,8 @@ namespace SALOME
     GenericObjPtr&
     operator=(TGenericObj* thePointer)
     {
-      GenericObjPtr(thePointer).swap(*this);
+      GenericObjPtr aTmp(thePointer);
+      aTmp.swap(*this);
       return *this;
     }
 
@@ -112,7 +113,8 @@ namespace SALOME
     GenericObjPtr& 
     operator=(const GenericObjPtr& thePointer)
     {
-      GenericObjPtr(thePointer).swap(*this);
+      GenericObjPtr aTmp(thePointer);
+      aTmp.swap(*this);
       return *this;
     }
 
@@ -153,6 +155,14 @@ namespace SALOME
   };
 }
 
+template<class T, class U> 
+inline 
+bool 
+operator<(SALOME::GenericObjPtr<T> const & a, SALOME::GenericObjPtr<U> const & b)
+{
+  return a.get() < b.get();
+}
+
 template<class T, class U> 
 inline
 bool 
index 0b7bad1fdee4a12af1bab758dbd32a89e1f57179..8e7eb323ce746bf1eece1932abb5c8dff843551c 100644 (file)
 #include "SALOMEDSClient_AttributeIOR.hxx"
 
 #include "SalomeApp_Application.h"
+#include "SalomeApp_Study.h"
+
+#include "SALOME_Event.hxx"
+
 #include <qregexp.h>
 
-using namespace std;
+#include <fstream>
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -43,7 +47,9 @@ static int MYDEBUG = 0;
 static int MYDEBUG = 0;
 #endif
 
-namespace VISU{
+
+namespace VISU
+{
 
   SUIT_Session*
   GetSession()
@@ -57,7 +63,7 @@ namespace VISU{
     return GetSession()->resourceMgr();
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
 
   QMutex* Base_i::myMutex = NULL; //apo - &VISUMutex;
   CORBA::ORB_var Base_i::myOrb;
@@ -79,7 +85,7 @@ namespace VISU{
     return CORBA::string_dup(myID.c_str());
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   static int mySCnt = 0;
   static QMutex aMutex(TRUE);
 
@@ -98,8 +104,8 @@ namespace VISU{
   }
 
 
-  //===========================================================================
-  static Storable::TCallbackMap VisuStoreMap;
+  //---------------------------------------------------------------------------
+  Storable::TStorableEngineMap Storable::myStorableEngineMap;
 
   std::string 
   Storable
@@ -114,16 +120,74 @@ namespace VISU{
   }
 
 
+  //---------------------------------------------------------------
+  CORBA::Boolean 
+  Storable
+  ::CanCopy(SALOMEDS::SObject_ptr theObject) 
+  {
+    return false;
+  }
+
+
+  //---------------------------------------------------------------
+  bool 
+  Storable
+  ::CopyFrom(SALOMEDS::SObject_ptr theObject, 
+            CORBA::Long& theObjectID,
+            const std::string& theTmpDir,
+            TFileNames& theFileNames)
+  {
+    TFileName aFileName("copy_persistent");
+    std::string aCopyPersist =  theTmpDir + aFileName;
+    std::ofstream anOutputFileStream(aCopyPersist.c_str(), ios::out);
+    anOutputFileStream<<ToString()<<endl;
+
+    theFileNames.push_back(aFileName);
+    theObjectID = 1;
+
+    return true;
+  }
+
+
   //---------------------------------------------------------------
   void 
   Storable
-  ::Registry(const std::string& theComment, 
-            TStorableEngine theEngine)
+  ::RegistryStorableEngine(const std::string& theComment, 
+                          TStorableEngine theEngine)
   {
-    if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
-      if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
+    if(!myStorableEngineMap.insert(TStorableEngineMap::value_type(theComment, theEngine)).second)
       throw std::logic_error("Storable::Registry >> dupliacte registring !!!");
+  }
+
+
+  //---------------------------------------------------------------
+  Storable* 
+  Storable
+  ::Create(SALOMEDS::SObject_ptr theSObject,
+          const std::string& theLocalPersistentID, 
+          const std::string& thePrefix,
+          CORBA::Boolean theIsMultiFile)
+  {
+    try{
+      QString aString( CorrectPersistentString( theLocalPersistentID ) );
+      TRestoringMap aRestoringMap;
+      StringToMap(aString, aRestoringMap);
+      bool anIsExists;
+      QString aComment = VISU::Storable::FindValue(aRestoringMap, "myComment", &anIsExists);
+      if ( anIsExists ) {
+       TStorableEngineMap::const_iterator anIter = myStorableEngineMap.find(aComment.latin1());
+       if(MYDEBUG) MESSAGE("Storable::Create - "<<aComment.latin1()<<" "<<(anIter != myStorableEngineMap.end()));
+       if(anIter == myStorableEngineMap.end()) 
+         return NULL;
+       TStorableEngine aStorableEngine = anIter->second;
+       return aStorableEngine(theSObject, aRestoringMap, thePrefix, theIsMultiFile);
+      }
+    }catch(std::exception& exc){
+      INFOS("Follow exception was occured :\n"<<exc.what());
+    }catch(...){
+      INFOS("Unknown exception was occured!");
     }
+    return NULL;
   }
 
 
@@ -361,11 +425,13 @@ namespace VISU{
     theStr<<output.latin1()<<";";
   }
 
+
+  //---------------------------------------------------------------
   void 
   Storable
   ::DataToStream(std::ostringstream& theStr, 
                 const QString& theName, 
-                const int theVal) 
+                int theVal) 
   {
     QString output = ( !theName.isNull() ? theName : QString("") )
                    + QString( "=" )
@@ -373,11 +439,13 @@ namespace VISU{
     theStr<<output.latin1()<<";";
   }
 
-  void
+
+  //---------------------------------------------------------------
+  void 
   Storable
   ::DataToStream(std::ostringstream& theStr, 
                 const QString& theName, 
-                const double theVal) 
+                long theVal) 
   {
     QString output = ( !theName.isNull() ? theName : QString("") )
                    + QString( "=" )
@@ -385,34 +453,22 @@ namespace VISU{
     theStr<<output.latin1()<<";";
   }
 
-  Storable* 
+
+  //---------------------------------------------------------------
+  void
   Storable
-  ::Create(SALOMEDS::SObject_ptr theSObject,
-          const std::string& thePrefix
-          const std::string& theLocalPersistentID)
+  ::DataToStream(std::ostringstream& theStr, 
+                const QString& theName
+                double theVal) 
   {
-    try{
-      QString aString( CorrectPersistentString( theLocalPersistentID ) );
-      TRestoringMap aRestoringMap;
-      StringToMap(aString, aRestoringMap);
-      bool anIsExists;
-      QString aComment = VISU::Storable::FindValue(aRestoringMap, "myComment", &anIsExists);
-      if ( anIsExists ) {
-       TCallbackMap::const_iterator anIter = VisuStoreMap.find(aComment.latin1());
-       if(MYDEBUG) MESSAGE("Storable::Create - "<<aComment.latin1()<<" "<<(anIter != VisuStoreMap.end()));
-       if(anIter == VisuStoreMap.end()) 
-         return NULL;
-       TStorableEngine aStorableEngine = anIter->second;
-       return aStorableEngine(theSObject, thePrefix, aRestoringMap);
-      }
-    }catch(std::exception& exc){
-      INFOS("Follow exception was occured :\n"<<exc.what());
-    }catch(...){
-      INFOS("Unknown exception was occured!");
-    }
-    return NULL;
+    QString output = ( !theName.isNull() ? theName : QString("") )
+                   + QString( "=" )
+                  + QString::number( theVal );
+    theStr<<output.latin1()<<";";
   }
 
+
+  //---------------------------------------------------------------
   QString
   Storable
   ::FindValue(const TRestoringMap& theMap, 
@@ -434,6 +490,7 @@ namespace VISU{
   }
 
 
+  //---------------------------------------------------------------
   QString
   Storable
   ::FindValue(const TRestoringMap& theMap, 
@@ -448,11 +505,12 @@ namespace VISU{
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   PortableServer::ServantBase_var
   GetServant(CORBA::Object_ptr theObject)
   {
-    if(CORBA::is_nil(theObject))  return NULL;
+    if(CORBA::is_nil(theObject))  
+      return NULL;
     try{
       PortableServer::POA_ptr aPOA = Base_i::GetPOA();
       PortableServer::Servant aServant = aPOA->reference_to_servant(theObject);
@@ -464,7 +522,7 @@ namespace VISU{
   }
 
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   CORBA::Object_var 
   SObjectToObject(SALOMEDS::SObject_ptr theSObject)
   {
@@ -486,7 +544,7 @@ namespace VISU{
     return anObject;
   }
 
-  //===========================================================================
+  //---------------------------------------------------------------------------
   CORBA::Object_var
   ClientSObjectToObject(_PTR(SObject) theSObject)
   {
@@ -509,8 +567,7 @@ namespace VISU{
   }
 
 
-  //===========================================================================
-  //===========================================================================
+  //---------------------------------------------------------------------------
   std::string
   CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
                   const std::string& theFatherEntry, 
@@ -529,27 +586,27 @@ namespace VISU{
     else
       aNewSObject = aFather;
     SALOMEDS::GenericAttribute_var anAttr;
-    if(theIOR != ""){
+    if(theIOR != NO_IOR){
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeIOR");
       SALOMEDS::AttributeIOR_var aCustomAttr = SALOMEDS::AttributeIOR::_narrow(anAttr);
       aCustomAttr->SetValue(theIOR.c_str());
     }
-    if(theName != ""){
+    if(theName != NO_NAME){
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeName");
       SALOMEDS::AttributeName_var aCustomAttr = SALOMEDS::AttributeName::_narrow(anAttr);
       aCustomAttr->SetValue(theName.c_str());
     }
-    if(thePersistentRef != ""){
+    if(thePersistentRef != NO_PERFSITENT_REF){
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePersistentRef");
       SALOMEDS::AttributePersistentRef_var aCustomAttr = SALOMEDS::AttributePersistentRef::_narrow(anAttr);
       aCustomAttr->SetValue(thePersistentRef.c_str());
     }
-    if(theComment != ""){
+    if(theComment != NO_COMMENT){
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeString");
       SALOMEDS::AttributeString_var aCustomAttr = SALOMEDS::AttributeString::_narrow(anAttr);
       aCustomAttr->SetValue(theComment.c_str());
     }
-    if(theIconName != ""){
+    if(theIconName != NO_ICON){
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePixMap");
       SALOMEDS::AttributePixMap_var aCustomAttr = SALOMEDS::AttributePixMap::_narrow(anAttr);
       aCustomAttr->SetPixMap(theIconName.c_str());
@@ -580,27 +637,27 @@ namespace VISU{
       aNewSObject = aFather;
 
     _PTR(GenericAttribute) anAttr;
-    if (theIOR != "") {
+    if (theIOR != NO_IOR) {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeIOR");
       _PTR(AttributeIOR) aCustomAttr (anAttr);
       aCustomAttr->SetValue(theIOR);
     }
-    if (theName != "") {
+    if (theName != NO_NAME) {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeName");
       _PTR(AttributeName) aCustomAttr (anAttr);
       aCustomAttr->SetValue(theName);
     }
-    if (thePersistentRef != "") {
+    if (thePersistentRef != NO_PERFSITENT_REF) {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePersistentRef");
       _PTR(AttributePersistentRef) aCustomAttr (anAttr);
       aCustomAttr->SetValue(thePersistentRef);
     }
-    if (theComment != "") {
+    if (theComment != NO_COMMENT) {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributeString");
       _PTR(AttributeString) aCustomAttr (anAttr);
       aCustomAttr->SetValue(theComment);
     }
-    if (theIconName != "") {
+    if (theIconName != NO_ICON) {
       anAttr = aStudyBuilder->FindOrCreateAttribute(aNewSObject, "AttributePixMap");
       _PTR(AttributePixMap) aCustomAttr (anAttr);
       aCustomAttr->SetPixMap(theIconName);
@@ -612,18 +669,21 @@ namespace VISU{
     return aRet;
   }
 
+
+  //---------------------------------------------------------------
   QString 
-  GenerateName(const string& theFmt, int theId)
+  GenerateName(const std::string& theFmt, int theId)
   {
-    static QString aName;
+    QString aName;
     if(theId > 0)
-      aName.sprintf("%s:%d",theFmt.c_str(),theId);
+      aName.sprintf("%s:%d", theFmt.c_str(), theId);
     else
-      aName.sprintf("%s",theFmt.c_str());
+      aName.sprintf("%s", theFmt.c_str());
     return aName;
   }
 
 
+  //---------------------------------------------------------------
   SALOMEDS::StudyManager_var 
   GetStudyManager()
   {
@@ -637,15 +697,76 @@ namespace VISU{
   }
 
 
+  //---------------------------------------------------------------
   SALOMEDS::Study_var 
   GetDSStudy(_PTR(Study) theStudy)
   {
-    //std::string aStudyName = theStudy->Name();
-    //return GetStudyManager()->GetStudyByName(aStudyName.c_str());
     int aStudyID = theStudy->StudyId();
     return GetStudyManager()->GetStudyByID(aStudyID);
   }
 
+
+  //---------------------------------------------------------------
+  struct TGetStudyEvent: public SALOME_Event
+  {
+    SALOMEDS::Study_var myStudy;
+    
+    typedef SalomeApp_Study* TResult;
+    TResult myResult;
+    
+    TGetStudyEvent(SALOMEDS::Study_ptr theStudy):
+      myStudy(SALOMEDS::Study::_duplicate(theStudy)),
+      myResult(NULL)
+    {}
+    
+    virtual
+    void
+    Execute()
+    {
+      if(CORBA::is_nil(myStudy))
+       return;
+      
+      int aStudyId = myStudy->StudyId();
+      SUIT_Session* aSession = SUIT_Session::session();
+      QPtrList<SUIT_Application> anApplications = aSession->applications();
+      QPtrListIterator<SUIT_Application> anIter (anApplications);
+      while (SUIT_Application* anApp = anIter.current()) {
+       ++anIter;
+       if (SUIT_Study* aSStudy = anApp->activeStudy()) {
+         if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
+           if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+             if (aStudyId == aCStudy->StudyId()) {
+               myResult = aStudy;
+               break;
+             }
+           }
+         }
+       }
+      }
+    }
+  };
+  
+
+  //---------------------------------------------------------------
+  SalomeApp_Study* 
+  GetGUIStudy(SALOMEDS::Study_ptr theStudy)
+  {
+    return ProcessEvent(new TGetStudyEvent(theStudy));
+  }
+
+
+  //---------------------------------------------------------------
+  _PTR(Study) 
+  GetStudy(SALOMEDS::Study_ptr theStudy)
+  {
+    if(SalomeApp_Study* aStudy = ProcessEvent(new TGetStudyEvent(theStudy)))
+      return aStudy->studyDS();
+    
+    return _PTR(Study)();
+  }
+
+
+  //---------------------------------------------------------------
   SALOMEDS::SObject_var 
   GetSObject( _PTR(SObject) obj )
   {
@@ -655,15 +776,17 @@ namespace VISU{
     return aSalomeDSStudy->FindObjectID( id.c_str() );
   }
 
+  //---------------------------------------------------------------
   _PTR(SObject) 
-  GetClientSObject( SALOMEDS::SObject_var obj,
-                   _PTR(Study) study )
+  GetClientSObject(SALOMEDS::SObject_ptr theSObject,
+                  _PTR(Study) theStudy)
   {
-    return study->FindObjectID( obj->GetID() );
-
+    CORBA::String_var anEntry = theSObject->GetID();
+    return theStudy->FindObjectID( anEntry.in() );
   }
 
 
+  //---------------------------------------------------------------
   void
   RemoveFromStudy (SALOMEDS::SObject_ptr theSObject,
                   bool theIsAttrOnly,
@@ -707,6 +830,8 @@ namespace VISU{
     aStudyBuilder->RemoveObjectWithChildren(theSObject);
   }
 
+
+  //---------------------------------------------------------------
   void
   RemoveFromStudy (_PTR(SObject) theSObject,
                   bool theIsAttrOnly,
index ef3ff038d50b97784ab707a801e7e5c9fdd6289a..94f11eec775381df17bdcca49bcf3a855833112e 100644 (file)
@@ -63,6 +63,8 @@
 
 class SUIT_Session;
 class SUIT_ResourceMgr;
+class SalomeApp_Study;
+
 
 namespace VISU
 {
@@ -119,8 +121,6 @@ namespace VISU
   //===========================================================================
   class VISU_I_EXPORT Storable : public virtual Base_i 
   {
-  protected:
-    virtual void ToStream(std::ostringstream& theStr) = 0;
   public:
     std::string
     ToString();
@@ -129,13 +129,31 @@ namespace VISU
     const char* 
     GetComment() const = 0;
 
+
+    //---------------------------------------------------------------
     typedef std::map<std::string, QString> TRestoringMap;
 
     typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject,
+                                        const TRestoringMap& theMap,
                                         const std::string& thePrefix,
-                                        const TRestoringMap& theMap);
-    typedef std::map<std::string,TStorableEngine> TCallbackMap;
+                                        CORBA::Boolean theIsMultiFile);
+
+    typedef std::map<std::string, TStorableEngine> TStorableEngineMap;
+
+    static 
+    void
+    RegistryStorableEngine(const std::string& theComment, 
+                          TStorableEngine theEngine);
+
+    static
+    Storable* 
+    Create(SALOMEDS::SObject_ptr theSObject,
+          const std::string& theLocalPersistentID, 
+          const std::string& thePrefix,
+          CORBA::Boolean theIsMultiFile);
+
 
+    //---------------------------------------------------------------
     static 
     VISU::VISUType
     Comment2Type(const std::string& theComment);
@@ -163,17 +181,6 @@ namespace VISU
              const TRestoringMap& theRestoringMap, 
              int IsAllLevels = true);
   
-    static 
-    void
-    Registry(const std::string& theComment, 
-            TStorableEngine theEngine);
-
-    static
-    Storable* 
-    Create(SALOMEDS::SObject_ptr, 
-          const std::string& thePrefix, 
-          const std::string& theString);
-
     static 
     QString 
     FindValue(const TRestoringMap& theMap, 
@@ -209,20 +216,47 @@ namespace VISU
     void
     DataToStream(std::ostringstream& theStr, 
                 const QString& theName, 
-                const int theVal);
+                int theVal);
+
+    static 
+    void
+    DataToStream(std::ostringstream& theStr, 
+                const QString& theName, 
+                long theVal);
 
     static
     void
     DataToStream(std::ostringstream& theStr, 
                 const QString& theName, 
-                const double theVal);
+                double theVal);
+
+    //---------------------------------------------------------------
+    virtual 
+    CORBA::Boolean 
+    CanCopy(SALOMEDS::SObject_ptr theObject);
+
+    typedef std::string TFileName;
+    typedef std::vector<TFileName> TFileNames;
+
+    virtual 
+    bool 
+    CopyFrom(SALOMEDS::SObject_ptr theObject, 
+            CORBA::Long& theObjectID,
+            const std::string& theTmpDir,
+            TFileNames& theFileNames);
+
+
+    //---------------------------------------------------------------
+  protected:
+    virtual 
+    void 
+    ToStream(std::ostringstream& theStr) = 0;
+
+  private:
+    static TStorableEngineMap myStorableEngineMap;
   };
 
   //===========================================================================
-  VISU_I_EXPORT 
-  const CORBA::Boolean 
-  IsMultifile();
-
   VISU_I_EXPORT
   QString
   GenerateName(const std::string& theFmt, int theId);
@@ -247,6 +281,12 @@ namespace VISU
   SALOMEDS::SComponent_var 
   FindOrCreateVisuComponent(SALOMEDS::Study_ptr theStudyDocument);
 
+  const char* const NO_ICON = "";
+  const char* const NO_IOR = "";
+  const char* const NO_NAME = "";
+  const char* const NO_PERFSITENT_REF = "";
+  const char* const NO_COMMENT = "";
+
   VISU_I_EXPORT
   std::string 
   CreateAttributes(SALOMEDS::Study_ptr theStudyDocument,
@@ -275,11 +315,20 @@ namespace VISU
 
   VISU_I_EXPORT
   _PTR(SObject) 
-  GetClientSObject(SALOMEDS::SObject_var, _PTR(Study));
+  GetClientSObject(SALOMEDS::SObject_ptr theSObject, 
+                  _PTR(Study) theStudy);
 
   VISU_I_EXPORT
   SALOMEDS::Study_var 
-  GetDSStudy(_PTR(Study));
+  GetDSStudy(_PTR(Study) theStudy);
+
+  VISU_I_EXPORT
+  SalomeApp_Study* 
+  GetGUIStudy(SALOMEDS::Study_ptr theStudy);
+
+  VISU_I_EXPORT
+  _PTR(Study) 
+  GetStudy(SALOMEDS::Study_ptr theStudy);
 
   VISU_I_EXPORT
   void
index 2485fe3ba50e3befa4430895abf64bbac2c92b10..d6bbf4777df446219da11e4a9541df10c2d143bd 100644 (file)
@@ -420,6 +420,7 @@ VISU::ColoredPrs3dCache_i
   }
 
   myMemoryMode = theMode;
+  GetStudyDocument()->Modified();
 }
 
 VISU::ColoredPrs3dCache::MemoryMode
@@ -447,6 +448,7 @@ VISU::ColoredPrs3dCache_i
 
   ClearCache(theMemorySize);
   myLimitedMemory = theMemorySize;
+  GetStudyDocument()->Modified();
 }
 
 CORBA::Float
@@ -806,23 +808,23 @@ VISU::ColoredPrs3dCache_i
 VISU::Storable*
 VISU::ColoredPrs3dCache_i
 ::Restore(SALOMEDS::SObject_ptr theSObject,
-         const Storable::TRestoringMap& theMap,
-         const string& thePrefix)
+         const Storable::TRestoringMap& theMap)
 {
   SetMemoryMode( (VISU::ColoredPrs3dCache::MemoryMode)VISU::Storable::FindValue( theMap, "myMemoryMode" ).toInt() );
   SetLimitedMemory( VISU::Storable::FindValue( theMap, "myLimitedMemory" ).toInt() );
-
+  
   return this;
 }
 
 //---------------------------------------------------------------
 VISU::Storable*
 VISU::ColoredPrs3dCache_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
-         const string& thePrefix,
-         const Storable::TRestoringMap& theMap)
+::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                const Storable::TRestoringMap& theMap,
+                const std::string& thePrefix,
+                CORBA::Boolean theIsMultiFile)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::ColoredPrs3dCache_i* aCache = new VISU::ColoredPrs3dCache_i(aStudy, false);
-  return aCache->Restore(theSObject,theMap,thePrefix);
+  return aCache->Restore(theSObject, theMap);
 }
index 56ab4a22005ef6fe193a3c27c0d56dc2f2bc0ce1..ead208074d4678cd5cc7cef1a1b6cdd7829908e4 100644 (file)
@@ -189,14 +189,14 @@ namespace VISU
     virtual
     Storable*
     Restore(SALOMEDS::SObject_ptr theSObject,
-           const Storable::TRestoringMap& theMap,
-           const std::string& thePrefix);
+           const Storable::TRestoringMap& theMap);
 
     static
     Storable*
-    Restore(SALOMEDS::SObject_ptr theSObject,
-           const std::string& thePrefix,
-           const Storable::TRestoringMap& theMap);
+    StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                  const Storable::TRestoringMap& theMap,
+                  const std::string& thePrefix,
+                  CORBA::Boolean theIsMultiFile);
 
     //----------------------------------------------------------------------------
     //! Finds or creates instance of the ColoredPrs3dCache in the given SALOMEDS::Study
index f77b0d22e4d74590d6787effebef44d66fa7a72a..1852297c648a2d8c4ae8590a69cb2ca90879b190 100644 (file)
@@ -32,6 +32,7 @@
 #include CORBA_SERVER_HEADER(SALOMEDS)
 
 #include "VISU_I.hxx"
+#include "SALOME_GenericObjPointer.hh"
 #include "VISU_ScalarMapOnDeformedShape_i.hh"
 #include "VISU_Plot3D_i.hh"
 #include "VISU_GaussPoints_i.hh"
@@ -274,7 +275,7 @@ namespace VISU
     typedef typename TL::TColoredEnum2Type<colored_prs3d_type_enum>::TResult TColoredPrs3d;
 
     void
-    Copy(ColoredPrs3d_i* theColoredPrs3dTo, ColoredPrs3d_i* theColoredPrs3dFrom)
+    Copy(ColoredPrs3d_i* theColoredPrs3dFrom, ColoredPrs3d_i* theColoredPrs3dTo)
     {
       theColoredPrs3dTo->SetCResult(theColoredPrs3dFrom->GetCResult());
       theColoredPrs3dTo->SetMeshName(theColoredPrs3dFrom->GetCMeshName().c_str());
@@ -284,12 +285,13 @@ namespace VISU
       theColoredPrs3dTo->SameAs(theColoredPrs3dFrom);
     }
 
-    TColoredPrs3d*
+    SALOME::GenericObjPtr<TColoredPrs3d>
     Create(ColoredPrs3d_i* theColoredPrs3d,
           ColoredPrs3d_i::EPublishInStudyMode thePublishInStudyMode)
     {
-      TColoredPrs3d* aSameColoredPrs3d = new TColoredPrs3d(thePublishInStudyMode);
-      Copy(aSameColoredPrs3d, theColoredPrs3d);
+      SALOME::GenericObjPtr<TColoredPrs3d> aSameColoredPrs3d(new TColoredPrs3d(thePublishInStudyMode));
+      Copy(theColoredPrs3d, aSameColoredPrs3d);
+      aSameColoredPrs3d->Destroy();
       return aSameColoredPrs3d;
     }
   };
index 1adcba4db6b22416356ee5e7b050ca7c0454637c..8ee44542c1ba69510e7ffbc5b9cde435fd1bc094 100644 (file)
@@ -150,7 +150,11 @@ VISU::ColoredPrs3d_i*
 VISU::ColoredPrs3dHolder_i
 ::GetPrs3dDevice()
 {
-  return myCache.GetLastVisitedPrs(this);
+  try{
+    return myCache.GetLastVisitedPrs(this);
+  }catch(...){}
+
+  return NULL;
 }
 
 
@@ -158,7 +162,10 @@ VISU::ColoredPrs3d_ptr
 VISU::ColoredPrs3dHolder_i
 ::GetDevice()
 {
-  return GetPrs3dDevice()->_this();
+  if( VISU::ColoredPrs3d_i* aDevice = GetPrs3dDevice() )
+    return aDevice->_this();
+
+  return VISU::ColoredPrs3d::_nil();
 }
 
 
@@ -240,9 +247,10 @@ VISU::ColoredPrs3dHolder_i
 //---------------------------------------------------------------
 VISU::Storable*
 VISU::ColoredPrs3dHolder_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
-         const string& thePrefix,
-         const Storable::TRestoringMap& theMap)
+::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                const Storable::TRestoringMap& theMap,
+                const std::string& thePrefix,
+                CORBA::Boolean theIsMultiFile)
 {
   using namespace VISU;
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
index bdf2c2da15d2d6a18c6987e2f93a1ee8b09ed339..840d537e459a190d94a7d2fbd1d2484a059876d2 100644 (file)
@@ -125,9 +125,10 @@ namespace VISU
 
     static
     Storable*
-    Restore(SALOMEDS::SObject_ptr theSObject,
-           const std::string& thePrefix,
-           const Storable::TRestoringMap& theMap);
+    StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                  const Storable::TRestoringMap& theMap,
+                  const std::string& thePrefix,
+                  CORBA::Boolean theIsMultiFile);
 
     virtual
     QString 
index 13246cfc774f8a97fde2485311a7c1aabbd10583..2998dd50130a008d9296ecc6361ccd6775921af7 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_Prs3dUtils.hh"
 
 #include "VISU_Result_i.hh"
 #include "VISU_ColoredPL.hxx"
@@ -114,6 +115,25 @@ VISU::ColoredPrs3d_i
   ProcessVoidEvent(new TRemoveFromStudy(this));
 }
 
+
+//----------------------------------------------------------------------------
+void
+VISU::ColoredPrs3d_i
+::UpdateFromResult(Result_i* theResult)
+{
+  try{
+    if(theResult == GetCResult()){
+      DoSetInput(false, false);
+      UpdateActors();
+    }
+  }catch(std::exception& exc){
+    INFOS("Follow exception was occured :\n"<<exc.what());
+  }catch(...){
+    INFOS("Unknown exception was occured!");
+  }
+}
+
+
 //---------------------------------------------------------------
 bool 
 VISU::ColoredPrs3d_i
@@ -159,6 +179,16 @@ VISU::ColoredPrs3d_i
 
   try{
     DoSetInput(anIsCreatNew, theReInit);
+
+    if(anIsCreatNew)
+      GetSpecificPL()->Init();
+
+    // To update scalar range according to the new input
+    if(!IsRangeFixed() || theReInit)
+      SetSourceRange();
+
+    GetCResult()->ConnectObserver(this, myResultConnection);
+
     myPreviousEntity = myEntity;
     myPreviousFieldName = myFieldName;
     myPreviousTimeStampNumber = myTimeStampNumber;
@@ -185,10 +215,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetEntity(VISU::Entity theEntity)
 {
-  if(myEntity != theEntity){
-    myEntity = theEntity;
-    myParamsTime.Modified();
-  }
+  if(myEntity == theEntity)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myEntity = theEntity;
+  myParamsTime.Modified();
 }
 
 
@@ -215,10 +248,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetFieldName(const char* theFieldName)
 {
-  if(myFieldName != theFieldName){
-    myFieldName = theFieldName;
-    myParamsTime.Modified();
-  }
+  if(myFieldName == theFieldName)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myFieldName = theFieldName;
+  myParamsTime.Modified();
 }
 
 
@@ -263,10 +299,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetTimeStampNumber(CORBA::Long theTimeStampNumber)
 {
-  if(myTimeStampNumber != theTimeStampNumber){
-    myTimeStampNumber = theTimeStampNumber;
-    myParamsTime.Modified();
-  }
+  if(myTimeStampNumber == theTimeStampNumber)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myTimeStampNumber = theTimeStampNumber;
+  myParamsTime.Modified();
 }
 
 
@@ -486,6 +525,13 @@ VISU::ColoredPrs3d_i
     SetNbColors(anOrigin->GetNbColors());
     SetBarOrientation(anOrigin->GetBarOrientation());
     
+    //  "SetRange" function changes "myIsFixedRange" attribute,
+    // so, it is necessary pay a special attention if "this" equal to "theOrigin"
+    if(anOrigin->IsRangeFixed())
+      SetRange(anOrigin->GetMin(), anOrigin->GetMax());
+    else
+      SetSourceRange();
+
     SetPosition(anOrigin->GetPosX(), anOrigin->GetPosY());
     SetSize(anOrigin->GetWidth(), anOrigin->GetHeight());
     SetLabels(anOrigin->GetLabels());
@@ -506,7 +552,6 @@ VISU::ColoredPrs3d_i
     anOrigin->GetLabelColor(&r,&g,&b);
     SetLabelColor(r,g,b);
 
-    UseFixedRange( anOrigin->IsRangeFixed() );
     myIsTimeStampFixed = anOrigin->IsTimeStampFixed();
 
     SetHolderEntry( anOrigin->GetHolderEntry() );
@@ -521,6 +566,7 @@ VISU::ColoredPrs3d_i
   return myColoredPL->GetScalarMode();
 }
 
+
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
@@ -532,6 +578,8 @@ VISU::ColoredPrs3d_i
   else if(theScalarMode > aNbComp)
     theScalarMode = 0;
 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
                   (GetSpecificPL(), &VISU_ColoredPL::SetScalarMode, theScalarMode));
 }
@@ -557,6 +605,8 @@ void
 VISU::ColoredPrs3d_i
 ::SetRange(CORBA::Double theMin, CORBA::Double theMax)
 {
+  VISU::TSetModified aModified(this);
+
   vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
                   (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
@@ -570,6 +620,8 @@ void
 VISU::ColoredPrs3d_i
 ::SetSourceRange()
 {
+  VISU::TSetModified aModified(this);
+
   if(IsTimeStampFixed()){
     GetSpecificPL()->SetSourceRange();
     ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
@@ -618,6 +670,8 @@ void
 VISU::ColoredPrs3d_i
 ::SetNbColors(CORBA::Long theNbColors)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
                   (GetSpecificPL(), &VISU_ColoredPL::SetNbColors, theNbColors));
 }
@@ -635,10 +689,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetBarOrientation(VISU::ColoredPrs3d::Orientation theOrientation)
 {
-  if(myOrientation != theOrientation){
-    myOrientation = theOrientation;
-    myParamsTime.Modified();
-  }
+  if(myOrientation == theOrientation)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myOrientation = theOrientation;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -659,6 +716,8 @@ VISU::ColoredPrs3d_i
   if(anIsSameValue)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myPosition[0] = theX; 
   myPosition[1] = theY;
   myParamsTime.Modified();
@@ -690,6 +749,8 @@ VISU::ColoredPrs3d_i
   if(anIsSameValue)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myWidth = theWidth; 
   myHeight = theHeight;
   myParamsTime.Modified();
@@ -716,10 +777,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetLabels(CORBA::Long theNbLabels)
 {
-  if(myNumberOfLabels != theNbLabels){
-    myNumberOfLabels = theNbLabels;
-    myParamsTime.Modified();
-  }
+  if(myNumberOfLabels == theNbLabels)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myNumberOfLabels = theNbLabels;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -747,6 +811,8 @@ VISU::ColoredPrs3d_i
     aStream<<theTitle<<" "<<VISU_Convertor::GenerateName(aTime)<<std::ends;
     std::string aScalarBarTitle = aStream.str();
     if(myTitle != theTitle || myScalarBarTitle != aScalarBarTitle){
+      VISU::TSetModified aModified(this);
+
       myScalarBarTitle = aScalarBarTitle;
       myTitle = theTitle;
       myParamsTime.Modified();
@@ -783,10 +849,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetBoldTitle(bool theIsBoldTitle)
 {
-  if(myIsBoldTitle != theIsBoldTitle){
-    myIsBoldTitle = theIsBoldTitle;
-    myParamsTime.Modified();
-  }
+  if(myIsBoldTitle == theIsBoldTitle)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsBoldTitle = theIsBoldTitle;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -802,10 +871,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetItalicTitle(bool theIsItalicTitle)
 { 
-  if(myIsItalicTitle != theIsItalicTitle){
-    myIsItalicTitle = theIsItalicTitle;
-    myParamsTime.Modified();
-  }
+  if(myIsItalicTitle == theIsItalicTitle)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsItalicTitle = theIsItalicTitle;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -821,10 +893,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetShadowTitle(bool theIsShadowTitle)
 { 
-  if(myIsShadowTitle != theIsShadowTitle){
-    myIsShadowTitle = theIsShadowTitle;
-    myParamsTime.Modified();
-  }
+  if(myIsShadowTitle == theIsShadowTitle)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsShadowTitle = theIsShadowTitle;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -840,10 +915,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetTitFontType(int theTitFontType)
 {
-  if(myTitFontType != theTitFontType){
-    myTitFontType = theTitFontType;
-    myParamsTime.Modified();
-  }
+  if(myTitFontType == theTitFontType)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myTitFontType = theTitFontType;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -871,6 +949,8 @@ VISU::ColoredPrs3d_i
   if(anIsSameValue)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myTitleColor[0] = theR; 
   myTitleColor[1] = theG; 
   myTitleColor[2] = theB; 
@@ -890,10 +970,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetBoldLabel(bool theIsBoldLabel) 
 {
-  if(myIsBoldLabel != theIsBoldLabel){
-    myIsBoldLabel = theIsBoldLabel;
-    myParamsTime.Modified();
-  }
+  if(myIsBoldLabel == theIsBoldLabel)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsBoldLabel = theIsBoldLabel;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -909,10 +992,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetItalicLabel(bool theIsItalicLabel)
 {
-  if(myIsItalicLabel != theIsItalicLabel){
-    myIsItalicLabel = theIsItalicLabel;
-    myParamsTime.Modified();
-  }
+  if(myIsItalicLabel == theIsItalicLabel)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsItalicLabel = theIsItalicLabel;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -928,10 +1014,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetShadowLabel(bool theIsShadowLabel)
 {
-  if(myIsShadowLabel != theIsShadowLabel){
-    myIsShadowLabel = theIsShadowLabel;
-    myParamsTime.Modified();
-  }
+  if(myIsShadowLabel == theIsShadowLabel)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myIsShadowLabel = theIsShadowLabel;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -947,10 +1036,13 @@ void
 VISU::ColoredPrs3d_i
 ::SetLblFontType(int theLblFontType)
 {
-  if(myIsShadowLabel != theLblFontType){
-    myLblFontType = theLblFontType;
-    myParamsTime.Modified();
-  }
+  if(myLblFontType == theLblFontType)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myLblFontType = theLblFontType;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -978,6 +1070,8 @@ VISU::ColoredPrs3d_i
   if(anIsSameValue)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myLabelColor[0] = theR; 
   myLabelColor[1] = theG; 
   myLabelColor[2] = theB; 
@@ -1037,6 +1131,15 @@ VISU::ColoredPrs3d_i
   int aScalarMode = aResourceMgr->integerValue("VISU", "scalar_bar_mode", 0);
   SetScalarMode(aScalarMode);
 
+  // Scalar Range
+  int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
+  if(aRangeType == 1){
+    float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
+    float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
+    SetRange(aMin, aMax);
+  }
+  UseFixedRange(aRangeType == 1);
+
   int aNumberOfColors = aResourceMgr->integerValue( "VISU", "scalar_bar_num_colors", 64 );
   SetNbColors(aNumberOfColors);
 
@@ -1173,6 +1276,12 @@ VISU::ColoredPrs3d_i
   Build(ERestore);
 
   SetScalarMode(VISU::Storable::FindValue(theMap,"myScalarMode").toInt());
+  float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
+  float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
+  SetRange(aMin, aMax);
+
+  UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange", "0").toInt());
+
   SetNbColors(VISU::Storable::FindValue(theMap,"myNumberOfColors").toInt());
   SetBarOrientation((VISU::ColoredPrs3d::Orientation)VISU::Storable::FindValue(theMap,"myOrientation").toInt());
   
@@ -1215,6 +1324,10 @@ VISU::ColoredPrs3d_i
   Storable::DataToStream( theStr, "myIsTimeStampFixed", int(myIsTimeStampFixed) );
 
   Storable::DataToStream( theStr, "myScalarMode",     int(GetScalarMode()) );
+  Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
+  Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
+  Storable::DataToStream( theStr, "myIsFixedRange",   IsRangeFixed() );
+
   Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) );
   Storable::DataToStream( theStr, "myOrientation",    myOrientation );
 
index 72ddb6fd916f9fe19baf25fe87c3afabc38c2b30..d1e64283c3233ae76750aa2622d2fe2626628d11 100644 (file)
@@ -28,6 +28,8 @@
 #define VISU_ColoredPrs3d_i_HeaderFile
 
 #include "VISU_Prs3d_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_BoostSignals.h"
 
 class VISU_ColoredPL;
 
@@ -35,6 +37,7 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   class VISU_I_EXPORT ColoredPrs3d_i : public virtual POA_VISU::ColoredPrs3d,
+                                      public virtual TResultObserver,
                                       public virtual Prs3d_i
   {
     ColoredPrs3d_i(const ColoredPrs3d_i&);
@@ -59,6 +62,12 @@ namespace VISU
     void
     RemoveFromStudy();
 
+    //----------------------------------------------------------------------------
+    //! To update the presentation from result in automatic way
+    virtual
+    void
+    UpdateFromResult(Result_i* theResult);
+
     //----------------------------------------------------------------------------
     virtual
     void
@@ -468,6 +477,8 @@ namespace VISU
     CORBA::Long myTimeStampNumber;
     CORBA::Long myPreviousTimeStampNumber;
 
+    boost::signalslib::connection myResultConnection;
+
     bool myIsTimeStampFixed;
 
     PField myField;
@@ -502,9 +513,10 @@ namespace VISU
   //----------------------------------------------------------------------------
   template<class TColoredPrs3d>
   Storable* 
-  Restore(SALOMEDS::SObject_ptr theSObject,
-         const std::string& thePrefix,
-         const Storable::TRestoringMap& theMap)
+  StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                const Storable::TRestoringMap& theMap,
+                const std::string& thePrefix,
+                CORBA::Boolean theIsMultiFile)
   {
     TColoredPrs3d* aColoredPrs3d = new TColoredPrs3d(ColoredPrs3d_i::EDoNotPublish);
     return aColoredPrs3d->Restore(theSObject, theMap);
index ede2fea61989a2b470b4545123e5d96debe4c8f4..88d83cd63b7101118e7f60827afa9460410a47ec 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_CutLines_i.hh"
+#include "VISU_Prs3dUtils.hh"
 #include "VISU_Result_i.hh"
 
 #include "VISU_Actor.h"
@@ -272,8 +273,9 @@ VISU::CutLines_i
     }
   };
 
-  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
+  VISU::TSetModified aModified(this);
 
+  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
 }
 
 //---------------------------------------------------------------
@@ -309,6 +311,8 @@ VISU::CutLines_i
     }
   };
 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
 }
 
@@ -367,6 +371,8 @@ void
 VISU::CutLines_i
 ::SetDisplacement(CORBA::Double theDisp) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 0));
 }
@@ -376,6 +382,8 @@ void
 VISU::CutLines_i
 ::SetDisplacement2(CORBA::Double theDisp) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 1));
 }
@@ -403,6 +411,8 @@ void
 VISU::CutLines_i
 ::SetBasePlanePosition(CORBA::Double thePlanePosition)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetPosition, thePlanePosition));
 }
@@ -421,6 +431,8 @@ VISU::CutLines_i
 ::SetLinePosition(CORBA::Long thePlaneNumber, 
                  CORBA::Double thePlanePosition)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, int, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
 }
@@ -439,6 +451,8 @@ void
 VISU::CutLines_i
 ::SetDefault()
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFunEvent<VISU_CutLinesPL>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetDefault));
 }
@@ -456,6 +470,8 @@ void
 VISU::CutLines_i
 ::SetDefaultPosition(CORBA::Long thePlaneNumber)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetPartDefault, thePlaneNumber));
 }
@@ -506,6 +522,8 @@ VISU::CutLines_i
   if(myMapCurvesInverted[theCurveNumber] == theInvert)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myMapCurvesInverted[theCurveNumber] = theInvert;
   myParamsTime.Modified();
 }
@@ -533,6 +551,8 @@ VISU::CutLines_i
   if(myUseAbsLength == theAbsLength)
     return;
 
+  VISU::TSetModified aModified(this);
+
   myUseAbsLength = theAbsLength;
   myParamsTime.Modified();
 }
@@ -550,6 +570,8 @@ void
 VISU::CutLines_i
 ::SetNbLines(CORBA::Long theNb) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
                   (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb));
 }
index f899ee38ad904b05b07f9a6c0d56ec2c6ee0b0ee..a0f724b7cdb0330ad02634f061ccd6cb2c6804f1 100644 (file)
 //  Module : VISU
 
 #include "VISU_CutPlanesPL.hxx"
-#include "VISU_Result_i.hh"
+#include "VISU_Prs3dUtils.hh"
 #include "VISU_CutPlanes_i.hh"
+
+#include "VISU_Result_i.hh"
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
@@ -195,6 +197,8 @@ VISU::CutPlanes_i
     }
   };
 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TEvent(GetSpecificPL(),
                              VISU_CutPlanesPL::PlaneOrientation(theOrient),
                              theXAngle,
@@ -231,6 +235,8 @@ void
 VISU::CutPlanes_i
 ::SetDisplacement(CORBA::Double theDisp) 
 {  
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, vtkFloatingPointType, int>
                   (GetSpecificPL(), &VISU_CutPlanesPL::SetDisplacement, theDisp, 0));
 }
@@ -250,6 +256,8 @@ VISU::CutPlanes_i
 ::SetPlanePosition(CORBA::Long thePlaneNumber, 
                   CORBA::Double thePlanePosition)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, int, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_CutPlanesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
 }
@@ -268,6 +276,8 @@ void
 VISU::CutPlanes_i
 ::SetDefault(CORBA::Long thePlaneNumber)
 {
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
                   (GetSpecificPL(), &VISU_CutPlanesPL::SetPartDefault, thePlaneNumber));
 }
@@ -286,6 +296,8 @@ void
 VISU::CutPlanes_i
 ::SetNbPlanes(CORBA::Long theNb) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
                   (GetSpecificPL(), &VISU_CutPlanesPL::SetNbParts, theNb));
 }
index 805cbd606732885627c80f7a1baa937a63fd6fab..5e8ae25df85037ccdb09dd3661c2870ab03b4893 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_DeformedShape_i.hh"
+#include "VISU_Prs3dUtils.hh"
 #include "VISU_Result_i.hh"
 
 #include "VISU_ScalarMapAct.h"
@@ -63,7 +64,10 @@ VISU::DeformedShape_i
                                             theTimeStampNumber,
                                             theIsMemoryCheck);
     if(aResult){
-      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theTimeStampNumber);
       VISU::PField aField = anInput->GetField(theMeshName,
                                              (VISU::TEntity)theEntity,
                                              theFieldName);
@@ -201,6 +205,8 @@ void
 VISU::DeformedShape_i
 ::SetScale(CORBA::Double theScale) 
 { 
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapePL, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_DeformedShapePL::SetScale, theScale));
 }
@@ -255,6 +261,8 @@ VISU::DeformedShape_i
   if(anIsSameValue)
     return;
 
+  VISU::TSetModified aModified(this);
+  
   myColor = theColor;
   myParamsTime.Modified();
 }
@@ -295,6 +303,8 @@ void
 VISU::DeformedShape_i
 ::SetMapScale(double theMapScale)
 {
+  VISU::TSetModified aModified(this);
+  
   myDeformedShapePL->SetMapScale(theMapScale);
 }
 
index d40749fdc9ce3d6425c03134def70fa4e53d3a9f..0495c37748c5c44e61387c62996f4f63e77094b6 100644 (file)
@@ -59,13 +59,14 @@ using namespace std;
 
 namespace VISU
 {
+  //---------------------------------------------------------------------------
   static std::string PREFIX("  ");
 
-  static std::string aResultName;
-
   typedef std::map<std::string,std::string> TName2EntryMap;
   typedef std::map<std::string,std::string> TEntry2NameMap;
 
+
+  //---------------------------------------------------------------------------
   inline
   std::string
   GenerateName(std::string theName,
@@ -86,13 +87,18 @@ namespace VISU
     return theName;
   }
 
-  struct TReplacePredicate{
+
+  //---------------------------------------------------------------------------
+  struct TReplacePredicate
+  {
     bool operator()(char theChar) const
     {
       return !(isdigit(theChar) || isalpha(theChar) || theChar == '_');
     }
   };
 
+
+  //---------------------------------------------------------------------------
   inline
   std::string
   GetName(SALOMEDS::SObject_ptr theSObject)
@@ -110,6 +116,8 @@ namespace VISU
     return aName;
   }
 
+
+  //---------------------------------------------------------------------------
   inline
   std::string
   GenerateName(SALOMEDS::SObject_ptr theSObject,
@@ -118,7 +126,30 @@ namespace VISU
   {
     std::string aName = GetName(theSObject);
 
-    return GenerateName(aName,theSObject,theName2EntryMap,theEntry2NameMap,'X');
+    return GenerateName(aName, theSObject, theName2EntryMap, theEntry2NameMap, 'X');
+  }
+
+
+  //---------------------------------------------------------------------------
+  inline
+  std::string
+  GetBoolean(bool theArgument)
+  {
+    if(theArgument)
+      return "True";
+
+    return "False";
+  }
+
+
+  //---------------------------------------------------------------------------
+  inline
+  std::string
+  GetColor(const SALOMEDS::Color& theColor)
+  {
+    std::ostringstream aStream;
+    aStream<<"SALOMEDS.Color("<<theColor.R<<", "<<theColor.G<<", "<<theColor.B<<")";
+    return aStream.str();
   }
 
 
@@ -269,9 +300,88 @@ namespace VISU
 
     theStr<<thePrefix<<theName<<".SetScalarMode("<<theServant->GetScalarMode()<<")"<<endl;
 
+    if(theServant->IsRangeFixed())
+      theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
+    else
+      theStr<<thePrefix<<theName<<".SetSourceRange()"<<endl;
+
     return thePrefix;
   }
 
+
+  //---------------------------------------------------------------------------
+  std::string
+  GaussPointsToPython(SALOMEDS::SObject_ptr theSObject,
+                     VISU::GaussPoints_i* theServant,
+                     std::ostream& theStr,
+                     const std::string& theName,
+                     TColoredPrs3dFactory& thePrsFactory,
+                     std::string thePrefix)
+  {
+    thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
+
+    bool aBoolean = theServant->GetIsActiveLocalScalarBar();
+    theStr<<thePrefix<<theName<<".SetIsActiveLocalScalarBar("<<GetBoolean(aBoolean)<<")"<<endl;
+
+    if(aBoolean){
+      aBoolean = theServant->GetIsDispGlobalScalarBar();
+      theStr<<thePrefix<<theName<<".SetIsDispGlobalScalarBar("<<GetBoolean(aBoolean)<<")"<<endl;
+    }
+
+    theStr<<thePrefix<<theName<<".SetSpacing("<<theServant->GetSpacing()<<")"<<endl;
+
+    aBoolean = theServant->GetBiColor();
+    theStr<<thePrefix<<theName<<".SetBiColor("<<GetBoolean(aBoolean)<<")"<<endl;
+
+    aBoolean = theServant->GetIsDeformed();
+    theStr<<thePrefix<<theName<<".SetIsDeformed("<<GetBoolean(aBoolean)<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetScaleFactor("<<theServant->GetScaleFactor()<<")"<<endl;
+
+    std::string aParam;
+    switch(theServant->GetPrimitiveType()){
+    case VISU::GaussPoints::SPRITE :
+      aParam = "VISU.GaussPoints.SPRITE";
+      break;
+    case VISU::GaussPoints::POINT :
+      aParam = "VISU.GaussPoints.POINT";
+      break;
+    case VISU::GaussPoints::SPHERE :
+      aParam = "VISU.GaussPoints.SPHERE";
+      break;
+    }
+    theStr<<thePrefix<<theName<<".SetPrimitiveType("<<aParam<<")"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetClamp("<<theServant->GetClamp()<<")"<<endl;
+
+    QString aMainTexture = theServant->GetQMainTexture();
+    QString anAlphaTexture = theServant->GetQAlphaTexture();
+    theStr<<thePrefix<<theName<<".SetTextures('"<<aMainTexture.latin1()<<"', '"<<anAlphaTexture.latin1()<<"')"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetAlphaThreshold("<<theServant->GetAlphaThreshold()<<")"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetResolution("<<theServant->GetResolution()<<")"<<endl;
+
+    theStr<<thePrefix<<theName<<".SetFaceLimit("<<theServant->GetFaceLimit()<<")"<<endl;
+
+    aBoolean = theServant->GetIsColored();
+    theStr<<thePrefix<<theName<<".SetIsColored("<<GetBoolean(aBoolean)<<")"<<endl;
+
+    if(aBoolean){
+      theStr<<thePrefix<<theName<<".SetMinSize("<<theServant->GetMinSize()<<")"<<endl;
+      theStr<<thePrefix<<theName<<".SetMaxSize("<<theServant->GetMaxSize()<<")"<<endl;
+    }else{
+      theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
+      theStr<<thePrefix<<theName<<".SetGeomSize("<<theServant->GetGeomSize()<<")"<<endl;
+    }
+
+    theStr<<thePrefix<<theName<<".SetMagnification("<<theServant->GetMagnification()<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetMagnificationIncrement("<<theServant->GetMagnificationIncrement()<<")"<<endl;
+
+    return thePrefix;
+  }
+
+
   //---------------------------------------------------------------------------
   std::string
   ScalarMapToPython(SALOMEDS::SObject_ptr theSObject,
@@ -282,6 +392,7 @@ namespace VISU
                    std::string thePrefix)
   {
     thePrefix = ColoredPrs3dToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     std::string aParam;
     switch(theServant->GetScaling()){
@@ -293,7 +404,6 @@ namespace VISU
       break;
     }
     theStr<<thePrefix<<theName<<".SetScaling("<<aParam<<")"<<endl;
-    theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
 
     const VISU::ScalarMap_i::TGroupNames aGroupNames = theServant->GetGroupNames();
     VISU::ScalarMap_i::TGroupNames::const_iterator anIter = aGroupNames.begin();
@@ -315,11 +425,11 @@ namespace VISU
                        std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
+
     theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
-    theStr<<thePrefix<<theName<<".ShowColored("<<theServant->IsColored()<<")"<<endl;
-    SALOMEDS::Color aColor = theServant->GetColor();
-    theStr<<thePrefix<<theName<<".SetColor(SALOMEDS.Color("<<
-      aColor.R<<", "<<aColor.G<<", "<<aColor.B<<"))"<<endl;
+    theStr<<thePrefix<<theName<<".ShowColored("<<GetBoolean(theServant->IsColored())<<")"<<endl;
+    theStr<<thePrefix<<theName<<".SetColor("<<GetColor(theServant->GetColor())<<")"<<endl;
 
     return thePrefix;
   }
@@ -336,6 +446,7 @@ namespace VISU
                      std::string thePrefix)
   {
     thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
     
     std::string aParam;
     switch(theServant->GetDirection()){
@@ -386,6 +497,7 @@ namespace VISU
                                   std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     theStr<<thePrefix<<theName<<".SetRange("<<theServant->GetMin()<<", "<<theServant->GetMax()<<")"<<endl;
     theStr<<thePrefix<<theName<<".SetScale("<<theServant->GetScale()<<")"<<endl;
@@ -430,6 +542,7 @@ namespace VISU
                  std::string thePrefix)
   {
     thePrefix = DeformedShapeToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     theStr<<thePrefix<<theName<<".SetLineWidth("<<theServant->GetLineWidth()<<")"<<endl;
 
@@ -477,6 +590,8 @@ namespace VISU
                      std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
+
     theStr<<thePrefix<<theName<<".SetNbSurfaces("<<theServant->GetNbSurfaces()<<")"<<endl;
 
     return thePrefix;
@@ -493,6 +608,7 @@ namespace VISU
                    std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     std::string aParam;
     switch(theServant->GetOrientationType()){
@@ -531,6 +647,7 @@ namespace VISU
                   std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     std::string aParam;
     switch(theServant->GetOrientationType()){
@@ -589,6 +706,7 @@ namespace VISU
                 std::string thePrefix)
   {
     thePrefix = ScalarMapToPython(theSObject, theServant, theStr, theName, thePrsFactory, thePrefix);
+    theStr<<thePrefix<<endl;
 
     std::string aParam;
     switch(theServant->GetOrientationType()){
@@ -734,7 +852,7 @@ namespace VISU
                   << aName << "_cTitles )" << endl;
 
     if(theSObject->FindAttribute(anAttr,"AttributeIOR")){
-      theStr<<endl;
+      theStr<<thePrefix<<endl;
       std::string aName = "aTable";
       theStr<<thePrefix<<"anID = "<<aSObjectName<<".GetID()"<<endl;
       theStr<<thePrefix<<aName<<" = aVisu.CreateTable(anID)"<<endl;
@@ -840,6 +958,7 @@ namespace VISU
     }
   }
 
+  
 
   //---------------------------------------------------------------------------
   void
@@ -864,31 +983,29 @@ namespace VISU
     if (!CORBA::is_nil(anObj)) {
       VISU::Base_var aBase = VISU::Base::_narrow(anObj);
       if(!CORBA::is_nil(aBase)){
-       std::string aName = GenerateName(theSObject,theName2EntryMap,theEntry2NameMap);
+       std::string aName = GenerateName(theSObject, theName2EntryMap, theEntry2NameMap);
 
         VISU::VISUType aType = aBase->GetType();
         switch(aType){
         case VISU::TRESULT:
           if(Result_i* aServant = dynamic_cast<Result_i*>(GetServant(anObj).in())){
-           aResultName = aName;
-           std::string aFileName = aServant->GetFileName();
+           std::string aFileName = aServant->GetInitFileName();
            Result_i::ECreationId anId = aServant->GetCreationId();
            if(anId == Result_i::eImportFile || anId == Result_i::eCopyAndImportFile){
              switch(anId){
              case Result_i::eImportFile:
-               //theStr<<thePrefix<<aName<<" = aVisu.ImportFile('"<<aFileName<<"')"<<endl;
                theStr<<thePrefix<<aName<<" = aVisu.CreateResult('"<<aFileName<<"')"<<endl;
 
                theStr<<thePrefix<<aName<<".SetBuildGroups("<<
-                 aServant->IsGroupsDone()<<")"<<
+                 GetBoolean(aServant->IsGroupsDone())<<")"<<
                  endl;
 
                theStr<<thePrefix<<aName<<".SetBuildFields("<<
-                 aServant->IsFieldsDone()<<", "<<
-                 aServant->IsMinMaxDone()<<")"<<
+                 GetBoolean(aServant->IsFieldsDone())<<", "<<
+                 GetBoolean(aServant->IsMinMaxDone())<<")"<<
                  endl;
 
-               theStr<<thePrefix<<aName<<".Build(0,1)"<<endl;
+               theStr<<thePrefix<<aName<<".Build(False, True)"<<endl;
 
                theStr<<thePrefix<<"if "<<aName<<".IsDone() :"<<endl;
                break;
@@ -899,6 +1016,38 @@ namespace VISU
              }
 
              thePrefix += PREFIX;
+             {
+               VISU::Result::EntityNames_var aMeshNames = aServant->GetMeshNames();
+               if (aMeshNames->length() > 0) {
+                 for(size_t aMeshId = 0; aMeshId < aMeshNames->length(); aMeshId++){
+                   CORBA::String_var aMeshName = aMeshNames[aMeshId];
+                   VISU::Result::EntityNames_var aParts = aServant->GetPartNames(aMeshName);
+                   if (aParts->length() > 0) {
+                     for(size_t aPartId = 0; aPartId < aParts->length(); aPartId++){
+                       CORBA::String_var aPart = aParts[aPartId];
+                       VISU::Result::Resolution aResolution = aServant->GetResolution(aMeshName, aPart);
+                       std::string aParam;
+                       switch(aResolution){
+                       case VISU::Result::FULL:
+                         aParam = "VISU.Result.FULL";
+                         break;
+                       case VISU::Result::MEDIUM:
+                         aParam = "VISU.Result.MEDIUM";
+                         break;
+                       case VISU::Result::LOW:
+                         aParam = "VISU.Result.LOW";
+                         break;
+                       case VISU::Result::HIDDEN:
+                         aParam = "VISU.Result.HIDDEN";
+                         break;
+                       }
+                       theStr<<thePrefix<<aName<<".SetResolution('"<<aMeshName.in()<<"', '"<<aPart.in()<<"', "<<aParam<<")"<<endl;
+                     }
+                     theStr<<thePrefix<<endl;
+                   }
+                 }
+               }
+             }
 
              theArgumentName = aName;
              DumpChildrenToPython(theStudy,
@@ -1044,7 +1193,7 @@ namespace VISU
              break;
            }
            theStr<<thePrefix<<aName<<".SetPresentationType("<<aParam<<")"<<endl;
-           theStr<<endl;
+           theStr<<thePrefix<<endl;
 
            DumpChildrenToPython(theStudy,
                                 theIsPublished,
@@ -1138,7 +1287,7 @@ namespace VISU
         case VISU::TGAUSSPOINTS:
           if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(GetServant(anObj).in())){
            TCreateFromResult aPrsFactory(theSObject, aServant, aName, "GaussPointsOnField", theArgumentName);
-           thePrefix = ColoredPrs3dToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
+           thePrefix = GaussPointsToPython(theSObject, aServant, theStr, aName, aPrsFactory, thePrefix);
            theStr<<thePrefix<<"pass"<<endl<<endl;
           }
           return;
@@ -1217,7 +1366,7 @@ namespace VISU
                  // Set name (as this object could be renamed by user)
                  theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 2"<<endl;
 
-                 theStr<<endl;
+                 theStr<<thePrefix<<endl;
 
                  theArgumentName = aName;
                  DumpChildrenToPython(theStudy,
@@ -1244,7 +1393,7 @@ namespace VISU
                  // Set name (as this object could be renamed by user)
                  theStr<<thePrefix<<aName<<".SetTitle('"<<aNameInStudy.in()<<"') # 3"<<endl;
 
-                 theStr<<endl;
+                 theStr<<thePrefix<<endl;
 
                  theArgumentName = aName;
                  DumpChildrenToPython(theStudy,
@@ -1274,101 +1423,6 @@ namespace VISU
            }
           }
           return;
-        case VISU::TCOLOREDPRS3DCACHE:
-         theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl<<endl;
-         SALOMEDS::ChildIterator_var aChildItet = theStudy->NewChildIterator(theSObject);
-         for(aChildItet->InitEx(false); aChildItet->More(); aChildItet->Next()){
-           SALOMEDS::SObject_var aSObject = aChildItet->Value();
-           CORBA::Object_var anObject = SObjectToObject(aSObject);
-           if (CORBA::is_nil(anObject))
-             continue;
-           if(ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in())){
-             ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
-             std::string anEntity;
-             switch(anInput->myEntity){
-             case VISU::NODE : anEntity = "VISU.NODE"; break;
-             case VISU::EDGE : anEntity = "VISU.EDGE"; break;
-             case VISU::FACE : anEntity = "VISU.FACE"; break;
-             case VISU::CELL : anEntity = "VISU.CELL"; break;
-             }
-             
-             ColoredPrs3d_var aDevice = aServant->GetDevice();
-             theStr<<thePrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
-               aResultName<<", '"<<
-               anInput->myMeshName<<"', "<<
-               anEntity<<", '"<<
-               anInput->myFieldName<<"', "<<
-               anInput->myTimeStampNumber<<")"<<
-               endl;
-             
-             if(Prs3d_i* aPrs3d = dynamic_cast<Prs3d_i*>(GetServant(aDevice).in())){
-               std::string aComment = aPrs3d->GetComment();
-               theStr<<thePrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
-               theStr<<thePrefix<<"if aHolder != None:"<<endl;
-               {
-                 std::string aPrefix = thePrefix + PREFIX;
-                 CORBA::String_var aNameInStudy = aSObject->GetName();
-                 theStr<<aPrefix<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
-                 theStr<<aPrefix<<"aDevice = aHolder.GetDevice()"<<endl;
-                 TColoredPrs3dFactory aPrsFactory;
-                 switch(aPrs3d->GetType()){
-                 case VISU::TSCALARMAP:
-                   if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aPrs3d)){
-                     aPrefix = ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TDEFORMEDSHAPE:
-                   if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aPrs3d)){
-                     aPrefix = DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TSTREAMLINES:
-                   if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aPrs3d)){
-                     aPrefix = StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TSCALARMAPONDEFORMEDSHAPE:
-                   if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aPrs3d)){
-                     aPrefix = ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TVECTORS:
-                   if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aPrs3d)){
-                     aPrefix = VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TISOSURFACES:
-                   if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aPrs3d)){
-                     aPrefix = IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TCUTPLANES:
-                   if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aPrs3d)){
-                     aPrefix = CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TCUTLINES:
-                   if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aPrs3d)){
-                     aPrefix = CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TPLOT3D:
-                   if (Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aPrs3d)) {
-                     aPrefix = Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 case VISU::TGAUSSPOINTS:
-                   if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aPrs3d)){
-                     aPrefix = ColoredPrs3dToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix);
-                     break;
-                   }
-                 }
-                 theStr<<aPrefix<<"pass"<<endl<<endl;
-               }
-             }
-           }
-          }
-          return;
        }
       }
     } else { /*if(!CORBA::is_nil(anObj))*/
@@ -1536,7 +1590,7 @@ namespace VISU
        continue;
 
       if(aBase->GetType() == VISU::TCONTAINER){
-       theStr<<endl;
+       theStr<<thePrefix<<endl;
        std::string aName = GenerateName(aSObject,theName2EntryMap,theEntry2NameMap);
        theStr<<thePrefix<<aName<<" = aVisu.CreateContainer()"<<endl;
        theStr<<thePrefix<<"if "<<aName<<":"<<endl;
@@ -1558,6 +1612,161 @@ namespace VISU
     }
   }
 
+
+  //---------------------------------------------------------------------------
+  void
+  DumpPrs3dCacheToPython(SALOMEDS::Study_ptr theStudy,
+                        CORBA::Boolean theIsPublished,
+                        CORBA::Boolean& theIsValidScript,
+                        SALOMEDS::SObject_ptr theSObject,
+                        std::ostream& theStr,
+                        TName2EntryMap& theName2EntryMap,
+                        TEntry2NameMap& theEntry2NameMap,
+                        std::string theArgumentName,
+                        std::string thePrefix)
+  {
+
+    SALOMEDS::ChildIterator_var anIter = theStudy->NewChildIterator(theSObject);
+    for(anIter->InitEx(false); anIter->More(); anIter->Next()){
+      SALOMEDS::SObject_var aSObject = anIter->Value();
+      CORBA::Object_var anObj = SObjectToObject(aSObject);
+      if(CORBA::is_nil(anObj))
+       continue;
+
+      VISU::Base_var aBase = VISU::Base::_narrow(anObj);
+      if(CORBA::is_nil(aBase))
+       continue;
+
+      if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE){
+       ColoredPrs3dCache_i* aCache = dynamic_cast<ColoredPrs3dCache_i*>(GetServant(aBase).in());
+       theStr<<thePrefix<<"aCache = aVisu.GetColoredPrs3dCache(aVisu.GetCurrentStudy())"<<endl;
+       theStr<<thePrefix<<"if aCache != None:"<<endl;
+       {
+         std::string aPrefix = thePrefix + PREFIX;
+         std::string anArgument;
+         VISU::ColoredPrs3dCache::MemoryMode aMode = aCache->GetMemoryMode();
+         switch(aMode){
+         case VISU::ColoredPrs3dCache::MINIMAL : anArgument = "VISU.ColoredPrs3dCache.MINIMAL"; break;
+         case VISU::ColoredPrs3dCache::LIMITED : anArgument = "VISU.ColoredPrs3dCache.LIMITED"; break;
+         }
+         theStr<<aPrefix<<"aCache.SetMemoryMode("<<anArgument<<")"<<endl;
+
+         if(aMode == VISU::ColoredPrs3dCache::LIMITED)
+           theStr<<aPrefix<<"aCache.SetLimitedMemory("<<aCache->GetLimitedMemory()<<") # (Mb)"<<endl;
+
+         SALOMEDS::ChildIterator_var aChildIter = theStudy->NewChildIterator(aSObject);
+         for(aChildIter->InitEx(false); aChildIter->More(); aChildIter->Next()){
+           SALOMEDS::SObject_var aSObject = aChildIter->Value();
+           CORBA::Object_var anObject = SObjectToObject(aSObject);
+           if (CORBA::is_nil(anObject))
+             continue;
+           
+           ColoredPrs3dHolder_i* aServant = dynamic_cast<ColoredPrs3dHolder_i*>(GetServant(anObject).in());
+           if(!aServant)
+             continue;
+         
+           ColoredPrs3d_i* aDevice = aServant->GetPrs3dDevice();
+           if(!aDevice)
+             continue;
+           
+           Result_i* aResult = aDevice->GetCResult();
+           std::string aResultEntry = aResult->GetEntry();
+           std::string aResultName = theEntry2NameMap[aResultEntry];
+           
+           ColoredPrs3dHolder::BasicInput_var anInput = aServant->GetBasicInput();
+           std::string anEntity;
+           switch(anInput->myEntity){
+           case VISU::NODE : anEntity = "VISU.NODE"; break;
+           case VISU::EDGE : anEntity = "VISU.EDGE"; break;
+           case VISU::FACE : anEntity = "VISU.FACE"; break;
+           case VISU::CELL : anEntity = "VISU.CELL"; break;
+           }
+           
+           
+           theStr<<aPrefix<<"anInput = VISU.ColoredPrs3dHolder.BasicInput("<<
+             aResultName<<", '"<<
+             anInput->myMeshName<<"', "<<
+             anEntity<<", '"<<
+             anInput->myFieldName<<"', "<<
+             anInput->myTimeStampNumber<<")"<<
+             endl;
+         
+           std::string aComment = aDevice->GetComment();
+           theStr<<aPrefix<<"aHolder = aCache.CreateHolder(VISU.T"<<aComment<<", anInput)"<<endl;
+           theStr<<aPrefix<<"if aHolder != None:"<<endl;
+           {
+             std::string aPrefix2 = aPrefix + PREFIX;
+             CORBA::String_var aNameInStudy = aSObject->GetName();
+             theStr<<aPrefix2<<"visu.SetName(aHolder, '"<<aNameInStudy.in()<<"')"<<endl;
+             theStr<<aPrefix2<<"aDevice = aHolder.GetDevice()"<<endl;
+             theStr<<aPrefix2<<"if aDevice != None:"<<endl;
+             {
+               std::string aPrefix3 = aPrefix2 + PREFIX;
+               TColoredPrs3dFactory aPrsFactory;
+               switch(aDevice->GetType()){
+               case VISU::TSCALARMAP:
+                 if(ScalarMap_i* aServant = dynamic_cast<ScalarMap_i*>(aDevice)){
+                   ScalarMapToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TDEFORMEDSHAPE:
+                 if(DeformedShape_i* aServant = dynamic_cast<DeformedShape_i*>(aDevice)){
+                   DeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TSTREAMLINES:
+                 if(StreamLines_i* aServant = dynamic_cast<StreamLines_i*>(aDevice)){
+                   StreamLinesToPython(aSObject, aServant, theStr, theEntry2NameMap, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TSCALARMAPONDEFORMEDSHAPE:
+                 if(ScalarMapOnDeformedShape_i* aServant = dynamic_cast<ScalarMapOnDeformedShape_i*>(aDevice)){
+                   ScalarMapOnDeformedShapeToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TVECTORS:
+                 if(Vectors_i* aServant = dynamic_cast<Vectors_i*>(aDevice)){
+                   VectorsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TISOSURFACES:
+                 if(IsoSurfaces_i* aServant = dynamic_cast<IsoSurfaces_i*>(aDevice)){
+                   IsoSurfacesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TCUTPLANES:
+                 if(CutPlanes_i* aServant = dynamic_cast<CutPlanes_i*>(aDevice)){
+                   CutPlanesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TCUTLINES:
+                 if(CutLines_i* aServant = dynamic_cast<CutLines_i*>(aDevice)){
+                   CutLinesToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TPLOT3D:
+                 if(Plot3D_i* aServant = dynamic_cast<Plot3D_i*>(aDevice)){
+                   Plot3DToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               case VISU::TGAUSSPOINTS:
+                 if(GaussPoints_i* aServant = dynamic_cast<GaussPoints_i*>(aDevice)){
+                   GaussPointsToPython(aSObject, aServant, theStr, "aDevice", aPrsFactory, aPrefix3);
+                   break;
+                 }
+               }
+               theStr<<aPrefix3<<"pass"<<endl;
+             }
+             theStr<<aPrefix2<<"pass"<<endl<<endl;
+           }
+         }
+         theStr<<aPrefix<<"pass"<<endl;
+       }
+      }
+    }
+  }
+
+    
   //---------------------------------------------------------------------------
   void
   DumpAnimationsToPython(SALOMEDS::Study_ptr theStudy,
@@ -1589,10 +1798,10 @@ namespace VISU
       if(!isExist || aTypeName != "ANIMATION") continue;
 
       //ANIMATION
-      theStr<<endl;
+      theStr<<thePrefix<<endl;
       QString animName = aSObject->GetName();
       theStr<<thePrefix<<"#Animation: "<<animName<<endl;
-      theStr<<endl;
+      theStr<<thePrefix<<endl;
       theStr<<thePrefix<<"animSO = aBuilder.NewObject(aSComponent)"<<endl;
       theStr<<thePrefix<<"aBuilder.SetName(animSO, '"<<animName<<"')"<< endl;
       theStr<<thePrefix<<"strAttr = aBuilder.FindOrCreateAttribute(animSO, 'AttributeString')"<< endl;
@@ -1642,7 +1851,7 @@ namespace VISU
       
     }
 
-    theStr<<endl;
+    theStr<<thePrefix<<endl;
   }
 
   //---------------------------------------------------------------------------
@@ -1685,9 +1894,42 @@ namespace VISU
     aStr<<endl;
 
     SALOMEDS::SComponent_var aComponent = FindOrCreateVisuComponent(aStudy);
-    VISU::DumpChildrenToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
-    VISU::DumpContainersToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aName2EntryMap,aEntry2NameMap,"",aPrefix);
-    VISU::DumpAnimationsToPython(aStudy,theIsPublished,theIsValidScript,aComponent.in(),aStr,aPrefix);
+    VISU::DumpChildrenToPython(aStudy,
+                              theIsPublished,
+                              theIsValidScript,
+                              aComponent.in(),
+                              aStr,
+                              aName2EntryMap,
+                              aEntry2NameMap,
+                              "",
+                              aPrefix);
+
+    VISU::DumpContainersToPython(aStudy,
+                                theIsPublished,
+                                theIsValidScript,
+                                aComponent.in(),
+                                aStr,
+                                aName2EntryMap,
+                                aEntry2NameMap,
+                                "",
+                                aPrefix);
+
+    VISU::DumpPrs3dCacheToPython(aStudy,
+                                theIsPublished,
+                                theIsValidScript,
+                                aComponent.in(),
+                                aStr,
+                                aName2EntryMap,
+                                aEntry2NameMap,
+                                "",
+                                aPrefix);
+
+    VISU::DumpAnimationsToPython(aStudy,
+                                theIsPublished,
+                                theIsValidScript,
+                                aComponent.in(),
+                                aStr,
+                                aPrefix);
 
     //Output the script that sets up the visul parameters.
     if(theIsPublished) {
index 679dd5d7c61ccd0daf63eb9f9e9c9d275ce49ea3..47ddbf40e9b3b9b4be4c5144a714a5b1cb8f887c 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "VISU_GaussPoints_i.hh"
 #include "VISU_ScalarMap_i.hh"
+#include "VISU_Prs3dUtils.hh"
 
 #include "VISU_Result_i.hh"
 #include "VISU_GaussPtsAct.h"
 #include <vtkTextProperty.h>
 #include <vtkProperty.h>
 
-#ifdef ENABLE_MULTIPR
-#include "MULTIPR_API.hxx"
-#endif
-
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 #else
@@ -74,9 +71,12 @@ VISU::GaussPoints_i
     return aResult;
   try{
     bool anIsEstimated = true;
-    VISU::Result_i::TInput* anInput = theResult->GetInput();
+    VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                        theEntity,
+                                                        theFieldName,
+                                                        theTimeStampNumber);
     size_t aSize = anInput->GetTimeStampOnGaussPtsSize(theMeshName,
-                                                      (VISU::TEntity)theEntity,
+                                                      VISU::TEntity(theEntity),
                                                       theFieldName,
                                                       theTimeStampNumber,
                                                       anIsEstimated);
@@ -169,7 +169,7 @@ VISU::GaussPoints_i
   SetScaleFactor( aScaleFactor );
 
   int aPrimitiveType = aResourceMgr->integerValue( "VISU", "point_sprite_primitive_type", GetPrimitiveType() );
-  SetPrimitiveType( aPrimitiveType );
+  SetPrimitiveType( VISU::GaussPoints::PrimitiveType(aPrimitiveType) );
 
   vtkFloatingPointType aClamp = aResourceMgr->doubleValue( "VISU", "point_sprite_clamp", GetClamp() );
   SetClamp( aClamp );
@@ -192,8 +192,8 @@ VISU::GaussPoints_i
   bool isColored = aResourceMgr->booleanValue( "VISU", "point_sprite_results", GetIsColored() );
   SetIsColored( isColored );
 
-  QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetColor() );
-  SetColor( aColor );
+  QColor aColor = aResourceMgr->colorValue( "VISU", "point_sprite_color", GetQColor() );
+  SetQColor( aColor );
 
   vtkFloatingPointType anAlphaThreshold = aResourceMgr->doubleValue( "VISU", "point_sprite_alpha_threshold", GetAlphaThreshold() );
   SetAlphaThreshold( anAlphaThreshold );
@@ -225,9 +225,6 @@ VISU::GaussPoints_i
 
   if(const GaussPoints_i* aPrs3d = dynamic_cast<const GaussPoints_i*>(theOrigin)){
     GaussPoints_i* anOrigin = const_cast<GaussPoints_i*>(aPrs3d);
-    // To restore the range after shallow copy of the pipeline mapper
-    // in the parent class
-    SetSourceRange(); 
 
     SetIsActiveLocalScalarBar(anOrigin->GetIsActiveLocalScalarBar());
     SetIsDispGlobalScalarBar(anOrigin->GetIsDispGlobalScalarBar());
@@ -275,7 +272,8 @@ VISU::GaussPoints_i
   SetBiColor(Storable::FindValue(theMap,"myIsBiColor").toInt());
   SetSpacing(Storable::FindValue(theMap,"mySpacing").toDouble());
 
-  SetPrimitiveType(Storable::FindValue(theMap,"myPrimitiveType").toInt());
+  int aPrimitiveType = Storable::FindValue(theMap,"myPrimitiveType").toInt();
+  SetPrimitiveType(VISU::GaussPoints::PrimitiveType(aPrimitiveType));
   SetClamp(Storable::FindValue(theMap,"myClamp").toDouble());
   SetMinSize(Storable::FindValue(theMap,"myMinSize").toDouble());
   SetMaxSize(Storable::FindValue(theMap,"myMaxSize").toDouble());
@@ -293,7 +291,7 @@ VISU::GaussPoints_i
   int aRed = Storable::FindValue(theMap,"myColor.R").toInt();
   int aGreen = Storable::FindValue(theMap,"myColor.G").toInt();
   int aBlue = Storable::FindValue(theMap,"myColor.B").toInt();
-  SetColor( QColor(aRed,aGreen,aBlue) );
+  SetQColor( QColor(aRed, aGreen, aBlue) );
 
   SetAlphaThreshold(Storable::FindValue(theMap,"myAlphaThreshold").toDouble());
 
@@ -333,14 +331,14 @@ VISU::GaussPoints_i
   Storable::DataToStream( theStr, "myFaceLimit", GetFaceLimit() );
 
   Storable::DataToStream( theStr, "myIsColored", GetIsColored() );
-  QColor aColor = GetColor();
+  QColor aColor = GetQColor();
   Storable::DataToStream( theStr, "myColor.R", aColor.red() );
   Storable::DataToStream( theStr, "myColor.G", aColor.green() );
   Storable::DataToStream( theStr, "myColor.B", aColor.blue() );
 
   Storable::DataToStream( theStr, "myAlphaThreshold", GetAlphaThreshold() );
-  Storable::DataToStream( theStr, "myMainTexture", GetMainTexture() );
-  Storable::DataToStream( theStr, "myAlphaTexture", GetAlphaTexture() );
+  Storable::DataToStream( theStr, "myMainTexture", GetQMainTexture() );
+  Storable::DataToStream( theStr, "myAlphaTexture", GetQAlphaTexture() );
 
   Storable::DataToStream( theStr, "myResolution", GetResolution() );
 }
@@ -354,7 +352,7 @@ VISU::GaussPoints_i
 
 
 //----------------------------------------------------------------------------
-int
+CORBA::Long
 VISU::GaussPoints_i
 ::GetFaceLimit()
 {
@@ -364,23 +362,28 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetFaceLimit( int theFaceLimit )
+::SetFaceLimit( CORBA::Long theFaceLimit )
 {
-  if( myFaceLimit != theFaceLimit ){
-    myFaceLimit = theFaceLimit;
-    myParamsTime.Modified();
-  }
+  if( myFaceLimit == theFaceLimit )
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myFaceLimit = theFaceLimit;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetIsDeformed( bool theIsDeformed )
+::SetIsDeformed( CORBA::Boolean theIsDeformed )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetIsDeformed( theIsDeformed );
 }
 
-bool
+CORBA::Boolean
 VISU::GaussPoints_i
 ::GetIsDeformed()
 {
@@ -390,12 +393,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetScaleFactor( vtkFloatingPointType theScaleFactor )
+::SetScaleFactor( CORBA::Double theScaleFactor )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetScale( theScaleFactor );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetScaleFactor()
 {
@@ -405,24 +410,52 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 QColor
 VISU::GaussPoints_i
-::GetColor()
+::GetQColor()
 {
   return myColor;
 }
 
+SALOMEDS::Color
+VISU::GaussPoints_i
+::GetColor()
+{
+  SALOMEDS::Color aColor;
+  aColor.R = myColor.red();
+  aColor.G = myColor.green();
+  aColor.B = myColor.blue();
+  return aColor;
+}
+
+
+//----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetColor( const QColor& theColor )
+::SetQColor( const QColor& theColor )
 {
+  if(myColor == theColor)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
   myColor = theColor;
   myParamsTime.Modified();
 }
 
+void
+VISU::GaussPoints_i
+::SetColor( const SALOMEDS::Color& theColor )
+{
+  SetQColor(QColor(int(theColor.R), int(theColor.G), int(theColor.B)));
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
 ::SetIsColored( bool theIsColored )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetIsColored( theIsColored );
 }
 
@@ -438,44 +471,74 @@ bool
 VISU::GaussPoints_i
 ::SetMainTexture( const QString& theMainTexture ) 
 {
-  bool update = myMainTexture != theMainTexture;
-  myMainTexture = theMainTexture;
-  return update;
+  if(myMainTexture != theMainTexture){
+    VISU::TSetModified aModified(this);
+  
+    myMainTexture = theMainTexture;
+    myParamsTime.Modified();
+    return true;
+  }
+
+  return false;
 }
 
-const QString&
+QString
 VISU::GaussPoints_i
-::GetMainTexture() 
+::GetQMainTexture() 
 { 
   return myMainTexture; 
 }
 
+char*
+VISU::GaussPoints_i
+::GetMainTexture() 
+{ 
+  return CORBA::string_dup(myMainTexture.latin1());
+}
+
+
 //----------------------------------------------------------------------------
 bool
 VISU::GaussPoints_i
 ::SetAlphaTexture( const QString& theAlphaTexture ) 
 {
-  bool update = myAlphaTexture != theAlphaTexture;
-  myAlphaTexture = theAlphaTexture;
-  return update;
+  if(myAlphaTexture != theAlphaTexture){
+    VISU::TSetModified aModified(this);
+  
+    myAlphaTexture = theAlphaTexture;
+    myParamsTime.Modified();
+    return true;
+  }
+
+  return false;
 }
 
-const QString&
+QString
 VISU::GaussPoints_i
-::GetAlphaTexture() 
+::GetQAlphaTexture() 
 { 
   return myAlphaTexture; 
 }
 
+char*
+VISU::GaussPoints_i
+::GetAlphaTexture() 
+{ 
+  return CORBA::string_dup(myAlphaTexture.latin1());
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetAlphaThreshold( vtkFloatingPointType theAlphaThreshold )
+::SetAlphaThreshold( CORBA::Double theAlphaThreshold )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetAlphaThreshold( theAlphaThreshold );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetAlphaThreshold()
 {
@@ -485,12 +548,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetResolution( int theResolution )
+::SetResolution( CORBA::Long theResolution )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetResolution( theResolution );
 }
 
-int
+CORBA::Long
 VISU::GaussPoints_i
 ::GetResolution()
 {
@@ -500,16 +565,26 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetPrimitiveType(int thePrimitiveType)
+::SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType)
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetPrimitiveType( thePrimitiveType );
 }
 
-int
+VISU::GaussPoints::PrimitiveType
 VISU::GaussPoints_i
 ::GetPrimitiveType()
 {
-  return myGaussPointsPL->GetPrimitiveType();
+  int aPrimitiveType = myGaussPointsPL->GetPrimitiveType();
+
+  if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::OpenGLPoint)
+    return VISU::GaussPoints::POINT;
+
+  if(aPrimitiveType == VISU_OpenGLPointSpriteMapper::GeomSphere)
+    return VISU::GaussPoints::SPHERE;
+
+  return VISU::GaussPoints::SPRITE;
 }
 
 //----------------------------------------------------------------------------
@@ -523,12 +598,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetClamp(vtkFloatingPointType theClamp)
+::SetClamp(CORBA::Double theClamp)
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetClamp( theClamp );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetClamp()
 {
@@ -538,12 +615,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetGeomSize( vtkFloatingPointType theGeomSize )
+::SetGeomSize( CORBA::Double theGeomSize )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetSize( theGeomSize );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetGeomSize()
 {
@@ -553,12 +632,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetMinSize( vtkFloatingPointType theMinSize )
+::SetMinSize( CORBA::Double theMinSize )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetMinSize( theMinSize );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetMinSize()
 {
@@ -568,12 +649,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetMaxSize( vtkFloatingPointType theMaxSize )
+::SetMaxSize( CORBA::Double theMaxSize )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetMaxSize( theMaxSize );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetMaxSize()
 {
@@ -583,12 +666,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetMagnification( vtkFloatingPointType theMagnification )
+::SetMagnification( CORBA::Double theMagnification )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetMagnification( theMagnification );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetMagnification()
 {
@@ -598,12 +683,14 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetMagnificationIncrement( vtkFloatingPointType theIncrement )
+::SetMagnificationIncrement( CORBA::Double theIncrement )
 {
+  VISU::TSetModified aModified(this);
+  
   myGaussPointsPL->SetMagnificationIncrement( theIncrement );
 }
 
-vtkFloatingPointType
+CORBA::Double
 VISU::GaussPoints_i
 ::GetMagnificationIncrement()
 {
@@ -615,72 +702,28 @@ void
 VISU::GaussPoints_i
 ::DoSetInput(bool theIsInitilizePipe, bool theReInit)
 {
-  static string aStrPrev = "";
-  static VISU::Result_i::TInput* anInputPrev = NULL;
-
-  // MULTIPR
-  VISU::Result_i::TInput* anInput = NULL;
-#ifdef ENABLE_MULTIPR
-  if (GetCResult()->IsDistributedMEDMultipr())
-  {        
-    vector<string> aListMEDFiles = GetCResult()->GetCurrentRepresentationMultipr();
-
-    string aStrCurrent = "";
-    for (unsigned i = 0 ; i < aListMEDFiles.size() ; i++)
-    {
-      aStrCurrent +=aListMEDFiles[i];
-    }
-    aStrCurrent += GetCMeshName();
-    aStrCurrent += GetCFieldName();
-    if (aStrPrev != aStrCurrent)
-    {        
-      if (anInputPrev != NULL) delete anInputPrev;
-
-      char aTmpFilename[256];
-      sprintf(aTmpFilename, "__tmp.med");
-
-      int res = multipr::merge(aListMEDFiles, GetCMeshName().c_str(), GetCFieldName().c_str(), aTmpFilename);
-      if (res == 0) throw std::runtime_error("empty mesh"); 
-
-      anInput = CreateConvertor(aTmpFilename);
-      anInput->Build();
-      anInputPrev = anInput;
-
-      aStrPrev = aStrCurrent;
-    }
-    else
-    {
-      anInput = anInputPrev;
-    }     
-  }
-  else
-#endif
-  {
-    anInput = GetCResult()->GetInput();
-  }
-
+  VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+                                                         GetEntity(),
+                                                         GetCFieldName(),
+                                                         GetTimeStampNumber());
   if(!anInput)
     throw std::runtime_error("Mesh_i::Build - myResult->GetInput() == NULL !!!");
 
-  SetField(anInput->GetField(GetCMeshName(),GetTEntity(),GetCFieldName()));
+  SetField(anInput->GetField(GetCMeshName(),
+                            GetTEntity(),
+                            GetCFieldName()));
   if(!GetField()) 
     throw std::runtime_error("There is no Field with the parameters !!!");
 
   VISU::PGaussPtsIDMapper aGaussPtsIDMapper =
-    anInput->GetTimeStampOnGaussPts(GetCMeshName(),GetTEntity(),GetCFieldName(),GetTimeStampNumber());
-
+    anInput->GetTimeStampOnGaussPts(GetCMeshName(),
+                                   GetTEntity(),
+                                   GetCFieldName(),
+                                   GetTimeStampNumber());
   if(!aGaussPtsIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
   GetSpecificPL()->SetGaussPtsIDMapper(aGaussPtsIDMapper);
-  if(theIsInitilizePipe){
-    GetSpecificPL()->Init();
-  }
-  GetCResult()->MinMaxConnect(this);
-
-  // To update scalar range according to the new input
-  if(!IsTimeStampFixed() || theReInit)
-    SetSourceRange();
 }
 
 
@@ -829,10 +872,15 @@ VISU::GaussPoints_i
       anActor->SetBarVisibility(true);
       GetPipeLine()->GetMapper()->SetScalarVisibility(1);
 
-      vtkFloatingPointType aRange[2];
-      GetSpecificPL()->GetSourceRange(aRange);
-      aScalarBarCtrl->SetRangeLocal(aRange);
-      
+      if(IsRangeFixed()){
+       vtkFloatingPointType* aRange = GetSpecificPL()->GetScalarRange();
+       aScalarBarCtrl->SetRangeLocal(aRange);
+      }else{
+       vtkFloatingPointType aRange[2];
+       GetSpecificPL()->GetSourceRange(aRange);
+       aScalarBarCtrl->SetRangeLocal(aRange);
+      }
+
       TMinMax aTMinMax(-VTK_LARGE_FLOAT,VTK_LARGE_FLOAT);
       bool anIsMinMaxDone = IsGlobalRangeDefined();
       if(anIsMinMaxDone)
@@ -913,46 +961,62 @@ VISU::GaussPoints_i
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetTextures( const QString& theMainTexture, 
-              const QString& theAlphaTexture )
+::SetQTextures( const QString& theMainTexture, 
+               const QString& theAlphaTexture )
 {
   bool updateMainTexture = SetMainTexture( theMainTexture );
   bool updateAlphaTexture = SetAlphaTexture( theAlphaTexture );
   if( !updateMainTexture && !updateAlphaTexture )
     return;
 
+  VISU::TSetModified aModified(this);
+  
   using namespace VISU;
-  TTextureValue aTextureValue = GetTexture(theMainTexture,theAlphaTexture);
+  TTextureValue aTextureValue = GetTexture(theMainTexture, theAlphaTexture);
   myGaussPointsPL->SetImageData( aTextureValue.GetPointer() );
 }
 
+void
+VISU::GaussPoints_i
+::SetTextures( const char* theMainTexture, 
+              const char* theAlphaTexture )
+{
+  SetQTextures(theMainTexture, theAlphaTexture);
+}
+
 
 //----------------------------------------------------------------------------
 void
 VISU::GaussPoints_i
-::SetIsActiveLocalScalarBar(const bool theIsActiveLocalScalarBar)
+::SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar)
 {
-  if(myIsActiveLocalScalarBar != theIsActiveLocalScalarBar){
-    myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
-    myParamsTime.Modified();
-  }
+  if(myIsActiveLocalScalarBar == theIsActiveLocalScalarBar)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myIsActiveLocalScalarBar = theIsActiveLocalScalarBar;
+  myParamsTime.Modified();
 }
 
-bool
+CORBA::Boolean
 VISU::GaussPoints_i
-::GetIsActiveLocalScalarBar() const 
+::GetIsActiveLocalScalarBar() 
 {
   return myIsActiveLocalScalarBar;
 }
 
 void
 VISU::GaussPoints_i
-::SetIsDispGlobalScalarBar(const bool theIsDispGlobalScalarBar)
+::SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar)
 {
-  if(myIsDispGlobalScalarBar != theIsDispGlobalScalarBar){
-    myIsDispGlobalScalarBar = theIsDispGlobalScalarBar;
-    myParamsTime.Modified();
-  }
+  if(myIsDispGlobalScalarBar == theIsDispGlobalScalarBar)
+    return;
+
+  VISU::TSetModified aModified(this);
+  
+  myIsDispGlobalScalarBar = theIsDispGlobalScalarBar;
+  myParamsTime.Modified();
 }
 
 bool
@@ -967,13 +1031,18 @@ void
 VISU::GaussPoints_i
 ::SetSourceRange()
 {
+  VISU::TSetModified aModified(this);
+
   if(IsTimeStampFixed() || GetIsActiveLocalScalarBar())
-    GetSpecificPL()->SetSourceRange();
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+                    (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
   else{
     TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
     vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
-    GetSpecificPL()->SetScalarRange(aScalarRange);
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+                    (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
   }
+  UseFixedRange(false);
 }
 
 CORBA::Double 
@@ -1006,9 +1075,9 @@ VISU::GaussPoints_i
 
 
 //----------------------------------------------------------------------------
-bool
+CORBA::Boolean
 VISU::GaussPoints_i
-::GetIsDispGlobalScalarBar() const 
+::GetIsDispGlobalScalarBar()
 {
   return myIsDispGlobalScalarBar;
 }
@@ -1016,12 +1085,14 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetBiColor(bool theIsBiColor)
+::SetBiColor(CORBA::Boolean theIsBiColor)
 {
+  VISU::TSetModified aModified(this);
+
   GetSpecificPL()->SetBicolor(theIsBiColor);
 }
 
-bool
+CORBA::Boolean
 VISU::GaussPoints_i
 ::GetBiColor() 
 {
@@ -1030,26 +1101,20 @@ VISU::GaussPoints_i
 
 void
 VISU::GaussPoints_i
-::SetSpacing(const vtkFloatingPointType theSpacing)
+::SetSpacing(CORBA::Double theSpacing)
 {
-  if(!VISU::CheckIsSameValue(mySpacing, theSpacing)){
-    mySpacing = theSpacing;
-    myParamsTime.Modified();
-  }
-}
+  if(VISU::CheckIsSameValue(mySpacing, theSpacing))
+    return;
 
-vtkFloatingPointType
-VISU::GaussPoints_i
-::GetSpacing() const 
-{
-  return mySpacing;
+  VISU::TSetModified aModified(this);
+
+  mySpacing = theSpacing;
+  myParamsTime.Modified();
 }
 
-//----------------------------------------------------------------------------
-void
+CORBA::Double
 VISU::GaussPoints_i
-::UpdateMinMax()
+::GetSpacing()
 {
-  MinMaxCunsomer::UpdateMinMax();
-  UpdateActors();
+  return mySpacing;
 }
index b4b150ece0d70d0cb71e963afed74095656f4e4d..767e4c5287e350fa63851cbf867c4b95eed29b2a 100644 (file)
@@ -27,7 +27,6 @@
 #ifndef VISU_GaussPoints_i_HeaderFile
 #define VISU_GaussPoints_i_HeaderFile
 
-#include "VISU_Result_i.hh"
 #include "VISU_ColoredPrs3d_i.hh"
 #include "VISU_GaussPtsActorFactory.h"
 
@@ -40,9 +39,8 @@ namespace VISU
 {
   //! Class of the Gauss Points presentation.
   class VISU_I_EXPORT GaussPoints_i : public virtual POA_VISU::GaussPoints,
-                       public virtual VISU::TGaussPtsActorFactory,
-                       public virtual MinMaxCunsomer,
-                       public virtual ColoredPrs3d_i
+                                     public virtual TGaussPtsActorFactory,
+                                     public virtual ColoredPrs3d_i
   {
     static int myNbPresent;
     GaussPoints_i(const GaussPoints_i&);
@@ -72,31 +70,37 @@ namespace VISU
     GetMemorySize();
 
     //----------------------------------------------------------------------------
-    int
+    CORBA::Long
     GetFaceLimit();
 
     void
-    SetFaceLimit( int theFaceLimit );
+    SetFaceLimit( CORBA::Long theFaceLimit );
 
-    bool 
+    CORBA::Boolean 
     GetIsDeformed();
 
     void
-    SetIsDeformed( bool theIsDeformed );
+    SetIsDeformed( CORBA::Boolean theIsDeformed );
 
-    vtkFloatingPointType
+    CORBA::Double
     GetScaleFactor();
 
     void
-    SetScaleFactor( vtkFloatingPointType theScaleFactor );
+    SetScaleFactor( CORBA::Double theScaleFactor );
 
     //! Get color for Geometry mode of the presentation.
-    QColor
+    SALOMEDS::Color
     GetColor();
 
+    QColor
+    GetQColor();
+
     //! Set color for Geometry mode of the presentation.
     void
-    SetColor( const QColor& theColor );
+    SetColor( const SALOMEDS::Color& theColor );
+
+    void
+    SetQColor( const QColor& theColor );
 
     //! Get flag indicating which mode of the presentation is active.
     /*! When Results mode is active, returns true. Geometry - false. */
@@ -112,7 +116,10 @@ namespace VISU
     SetMainTexture( const QString& theMainTexture );
 
     //! Get path to the image using for Main Point Sprite texture.
-    const QString&
+    QString
+    GetQMainTexture();
+
+    char*
     GetMainTexture();
 
     //! Set path to the image using for Alpha Point Sprite texture.
@@ -120,34 +127,41 @@ namespace VISU
     SetAlphaTexture( const QString& theAlphaTexture );
 
     //! Get path to the image using for Alpha Point Sprite texture.
-    const QString&
+    QString
+    GetQAlphaTexture();
+
+    char*
     GetAlphaTexture();
 
     //! Convert Main and AlphaMask images to VTI format and set them to pipeline.
     void
-    SetTextures( const QString& theMainTexture,
-                const QString& theAlphaTexture );
+    SetQTextures( const QString& theMainTexture,
+                 const QString& theAlphaTexture );
+
+    void
+    SetTextures( const char* theMainTexture, 
+                const char* theAlphaTexture );
 
     //! Redirect the request to VISU_GaussPointsPL::SetAlphaThreshold.
     void
-    SetAlphaThreshold(vtkFloatingPointType theAlphaThreshold);
+    SetAlphaThreshold(CORBA::Double theAlphaThreshold);
 
     //! Redirect the request to VISU_GaussPointsPL::GetAlphaThreshold.
-    vtkFloatingPointType
+    CORBA::Double
     GetAlphaThreshold();
 
     //! Redirect the request to VISU_GaussPointsPL::SetResolution.
     void
-    SetResolution(int theResolution);
+    SetResolution(CORBA::Long theResolution);
 
     //! Redirect the request to VISU_GaussPointsPL::GetResolution.
-    int
+    CORBA::Long
     GetResolution();
 
     void
-    SetPrimitiveType(int thePrimitiveType);
+    SetPrimitiveType(VISU::GaussPoints::PrimitiveType thePrimitiveType);
 
-    int
+    VISU::GaussPoints::PrimitiveType
     GetPrimitiveType();
 
     //! Redirect the request to VISU_GaussPointsPL::GetMaximumSupportedSize.
@@ -156,83 +170,83 @@ namespace VISU
 
     //! Redirect the request to VISU_GaussPointsPL::SetClamp.
     void
-    SetClamp(vtkFloatingPointType theClamp);
+    SetClamp(CORBA::Double theClamp);
 
     //! Redirect the request to VISU_GaussPointsPL::GetClamp.
-    vtkFloatingPointType
+    CORBA::Double
     GetClamp();
 
     //! Redirect the request to VISU_GaussPointsPL::SetSize.
     void
-    SetGeomSize(vtkFloatingPointType theGeomSize);
+    SetGeomSize(CORBA::Double theGeomSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetSize.
-    vtkFloatingPointTyp
+    CORBA::Doubl
     GetGeomSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMinSize.
     void
-    SetMinSize(vtkFloatingPointType theMinSize);
+    SetMinSize(CORBA::Double theMinSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMinSize.
-    vtkFloatingPointTyp
+    CORBA::Doubl
     GetMinSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMaxSize.
     void
-    SetMaxSize(vtkFloatingPointType theMaxSize);
+    SetMaxSize(CORBA::Double theMaxSize);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMaxSize.
-    vtkFloatingPointTyp
+    CORBA::Doubl
     GetMaxSize();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMagnification.
     void
-    SetMagnification(vtkFloatingPointType theMagnification);
+    SetMagnification(CORBA::Double theMagnification);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMagnification.
-    vtkFloatingPointType
+    CORBA::Double
     GetMagnification();
 
     //! Redirect the request to VISU_GaussPointsPL::SetMagnificationIncrement.
     void
-    SetMagnificationIncrement(vtkFloatingPointType theIncrement);
+    SetMagnificationIncrement(CORBA::Double theIncrement);
 
     //! Redirect the request to VISU_GaussPointsPL::GetMagnificationIncrement.
-    vtkFloatingPointType
+    CORBA::Double
     GetMagnificationIncrement();
 
     //! Set flag indicating which scalar bar is active.
     void
-    SetIsActiveLocalScalarBar(const bool theFlag);
+    SetIsActiveLocalScalarBar(CORBA::Boolean theIsActiveLocalScalarBar);
 
     //! Get flag indicating which scalar bar is active.
-    bool
-    GetIsActiveLocalScalarBar() const;
+    CORBA::Boolean
+    GetIsActiveLocalScalarBar();
 
     //! Set flag indicating visibility of global scalar bar.
     void
-    SetIsDispGlobalScalarBar(const bool theFlag);
+    SetIsDispGlobalScalarBar(CORBA::Boolean theIsDispGlobalScalarBar);
 
     //! Get flag indicating visibility of global scalar bar.
-    bool
-    GetIsDispGlobalScalarBar() const;
+    CORBA::Boolean
+    GetIsDispGlobalScalarBar();
 
     //! Redirect the request to VISU_GaussPointsPL::SetBicolor.
     void
-    SetBiColor(bool theIsBiColor);
+    SetBiColor(CORBA::Boolean theIsBiColor);
 
     //! Redirect the request to VISU_GaussPointsPL::GetBicolor.
-    bool
+    CORBA::Boolean
     GetBiColor();
 
     //! Set value of the distance between global and local scalar bars.
     void
-    SetSpacing(const vtkFloatingPointType theSpacing);
+    SetSpacing(CORBA::Double theSpacing);
 
     //! Get value of the distance between global and local scalar bars.
-    vtkFloatingPointType
-    GetSpacing() const;
+    CORBA::Double
+    GetSpacing();
 
     //! Let know is the global range is already calculated
     bool
@@ -250,11 +264,6 @@ namespace VISU
     void
     SetSourceRange();
 
-    //! To update the min / max automatically
-    virtual
-    void
-    UpdateMinMax();
-
     VISU_GaussPointsPL* 
     GetSpecificPL() const
     { 
index dcd5ae50ae47d5c5e097de87beddacb2ef89b5c2..034644e174b62c2b55d93db0b299f39781a015e1 100644 (file)
@@ -82,9 +82,10 @@ UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
 // STL Includes
 #include <strstream>
 
-using namespace std;
+#include <boost/filesystem/path.hpp>
+#include <boost/filesystem/operations.hpp>
+namespace filesystem = boost::filesystem;
 
-static QFileInfo aFileInfo;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -108,10 +109,13 @@ GetImpl(CORBA::ORB_ptr theORB,
 namespace VISU
 {
   //----------------------------------------------------------------------------
-  static string VisuTmpDir;
+  static std::string VISU_TMP_DIR;
 
   static CORBA::Boolean myIsMultiFile;
-  const CORBA::Boolean IsMultifile() { return myIsMultiFile;}
+  const CORBA::Boolean IsMultiFile() 
+  { 
+    return myIsMultiFile;
+  }
 
   //----------------------------------------------------------------------------
   _PTR(SComponent) 
@@ -192,23 +196,41 @@ namespace VISU
   void
   RegistryStorable() 
   {
-    Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
-    Storable::Registry(Mesh_i::myComment.c_str(),&(Mesh_i::Restore));
-    Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
-    Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore<GaussPoints_i>));
-    Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore<DeformedShape_i>));
-    Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore<CutPlanes_i>));
-    Storable::Registry(CutLines_i::myComment.c_str(),&(Restore<CutLines_i>));
-    Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore<IsoSurfaces_i>));
-    Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore<StreamLines_i>));
-    Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore<Plot3D_i>));
-    Storable::Registry(Vectors_i::myComment.c_str(),&(Restore<Vectors_i>));
-    Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore));
-    Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore));
-    Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore));
-    Storable::Registry(ScalarMapOnDeformedShape_i::myComment.c_str(),&(Restore<ScalarMapOnDeformedShape_i>));
-    Storable::Registry(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::Restore));
-    Storable::Registry(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::Restore));
+    Storable::RegistryStorableEngine(Result_i::myComment.c_str(),&(Result_i::StorableEngine));
+
+    Storable::RegistryStorableEngine(Mesh_i::myComment.c_str(),&(Mesh_i::StorableEngine));
+
+    Storable::RegistryStorableEngine(ScalarMap_i::myComment.c_str(),&(StorableEngine<ScalarMap_i>));
+    Storable::RegistryStorableEngine(GaussPoints_i::myComment.c_str(),&(StorableEngine<GaussPoints_i>));
+    Storable::RegistryStorableEngine(DeformedShape_i::myComment.c_str(),&(StorableEngine<DeformedShape_i>));
+    Storable::RegistryStorableEngine(CutPlanes_i::myComment.c_str(),&(StorableEngine<CutPlanes_i>));
+    Storable::RegistryStorableEngine(CutLines_i::myComment.c_str(),&(StorableEngine<CutLines_i>));
+    Storable::RegistryStorableEngine(IsoSurfaces_i::myComment.c_str(),&(StorableEngine<IsoSurfaces_i>));
+    Storable::RegistryStorableEngine(StreamLines_i::myComment.c_str(),&(StorableEngine<StreamLines_i>));
+    Storable::RegistryStorableEngine(Plot3D_i::myComment.c_str(),&(StorableEngine<Plot3D_i>));
+    Storable::RegistryStorableEngine(Vectors_i::myComment.c_str(),&(StorableEngine<Vectors_i>));
+    Storable::RegistryStorableEngine(ScalarMapOnDeformedShape_i::myComment.c_str(),&(StorableEngine<ScalarMapOnDeformedShape_i>));
+
+    Storable::RegistryStorableEngine(ColoredPrs3dHolder_i::myComment.c_str(),&(ColoredPrs3dHolder_i::StorableEngine));
+    Storable::RegistryStorableEngine(ColoredPrs3dCache_i::myComment.c_str(),&(ColoredPrs3dCache_i::StorableEngine));
+
+    Storable::RegistryStorableEngine(Table_i::myComment.c_str(),&(Table_i::StorableEngine));
+    Storable::RegistryStorableEngine(Curve_i::myComment.c_str(),&(Curve_i::StorableEngine));
+    Storable::RegistryStorableEngine(Container_i::myComment.c_str(),&(Container_i::StorableEngine));
+  }
+
+
+  //----------------------------------------------------------------------------
+  SALOMEDS::ListOfFileNames*
+  GetListOfFileNames(const Result_i::TFileNames& theFileNames)
+  {
+    SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
+    if(!theFileNames.empty()){
+      aListOfFileNames->length(theFileNames.size());
+      for(int aCounter = theFileNames.size(); aCounter > 0; aCounter--)
+       aListOfFileNames[aCounter-1] = theFileNames[aCounter-1].c_str();
+    }
+    return aListOfFileNames._retn();
   }
 
 
@@ -296,7 +318,7 @@ namespace VISU
   ::Load(SALOMEDS::SComponent_ptr theComponent,
         const SALOMEDS::TMPFile & theStream,
         const char* theURL,
-        bool isMultiFile)
+        CORBA::Boolean theIsMultiFile)
   {
     Mutex mt(myMutex);
     SALOMEDS::Study_var aStudy = theComponent->GetStudy();
@@ -310,12 +332,10 @@ namespace VISU
     }
 
    
-    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
-    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
-    VisuTmpDir = aTmpDir.ToCString();
+    VISU_TMP_DIR = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
     SALOMEDS::ListOfFileNames_var aSeq =
-      SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
-    myIsMultiFile = isMultiFile;
+      SALOMEDS_Tool::PutStreamToFiles(theStream, VISU_TMP_DIR, theIsMultiFile);
+    myIsMultiFile = theIsMultiFile;
     return true;
   }
 
@@ -326,9 +346,9 @@ namespace VISU
   ::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
              const SALOMEDS::TMPFile & theStream,
              const char* theURL,
-             bool isMultiFile)
+             bool theIsMultiFile)
   {
-    return Load(theComponent, theStream, theURL, isMultiFile);
+    return Load(theComponent, theStream, theURL, theIsMultiFile);
   }
 
 
@@ -336,16 +356,18 @@ namespace VISU
   char* 
   VISU_Gen_i
   ::LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
-                          const char* aLocalPersistentID,
-                          CORBA::Boolean isMultiFile,
-                          CORBA::Boolean isASCII)
+                          const char* theLocalPersistentID,
+                          CORBA::Boolean theIsMultiFile,
+                          CORBA::Boolean theIsASCII)
   {
     CORBA::String_var aString("");
-    if(strcmp(aLocalPersistentID,"") != 0) {
-      Mutex mt(myMutex);
-      Storable* aStorable =
-       Storable::Create(theSObject,VisuTmpDir.c_str(),aLocalPersistentID);
-      if(aStorable != NULL) aString = aStorable->GetID();
+    if(strcmp(theLocalPersistentID,"") != 0) {
+      Storable* aStorable = Storable::Create(theSObject, 
+                                            theLocalPersistentID,
+                                            VISU_TMP_DIR,
+                                            theIsMultiFile);
+      if(aStorable != NULL) 
+       aString = aStorable->GetID();
     }
     return aString._retn();
   }
@@ -358,64 +380,36 @@ namespace VISU
         const char* theURL,
         bool theIsMultiFile)
   {
-    Mutex mt(myMutex);
-    string aTmpDir = theURL;
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
-    
-    typedef std::vector<std::string> TFileNames;
-    TFileNames aFileNames;
-    TFileNames aFiles;
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - theURL = '"<<theURL<<"'");
+
+    Result_i::TFileNames aFileNames;
+    Result_i::TFileNames aFiles;
 
     SALOMEDS::Study_var aStudy = theComponent->GetStudy();
     SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
     for (; anIter->More(); anIter->Next()) {
-      SALOMEDS::SObject_var gotBranch = anIter->Value();
-      CORBA::Object_var anObj = SObjectToObject(gotBranch);
-      if(CORBA::is_nil(anObj)) continue;
+      SALOMEDS::SObject_var aSObject = anIter->Value();
+      CORBA::Object_var anObj = SObjectToObject(aSObject);
       if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
-       switch(aResult->GetCreationId()){
-       case Result_i::eImportFile:
-       case Result_i::eCopyAndImportFile: {
-         const QFileInfo& aFileInfo = aResult->GetFileInfo();
-         const std::string& aName = aResult->GetName();
-         std::string aFileName = std::string("_") + aName;
-         std::string aFile = aFileInfo.filePath().latin1();
-         if(theIsMultiFile){
-           aFileName = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()) + aFileName;
-
-           std::ostringstream aStream;
-           aStream<<"cp "<<aFile<<" "<<aTmpDir<<aFileName;
-           std::string aCommand = aStream.str();
-           if(system(aCommand.c_str()) != 0){
-             INFOS("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
-             continue;
-           }
-         }
-         aFileNames.push_back(aFileName);
-         aFiles.push_back(aFile);
-       }}
+       aResult->Save(theComponent, 
+                     theURL, 
+                     theIsMultiFile,
+                     false,
+                     aFileNames, 
+                     aFiles);
       }
     }
-
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
 
-    SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
-    if(!aFileNames.empty()){
-      aListOfFileNames->length(aFileNames.size());
-      for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
-       aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str();
-    }
-
-    SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames;
-    aListOfFiles->length(aFiles.size());
-    if(!aFiles.empty()){
-      for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--)
-       aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str();
-    }
-
     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
+    if(aFileNames.empty())
+      return aStreamFile._retn();
+    
+    SALOMEDS::ListOfFileNames_var aListOfFileNames = GetListOfFileNames(aFileNames);
+    SALOMEDS::ListOfFileNames_var aListOfFiles = GetListOfFileNames(aFiles);
+
     if(theIsMultiFile)
-      aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile);
+      aStreamFile = SALOMEDS_Tool::PutFilesToStream(theURL, aListOfFiles.in(), theIsMultiFile);
     else
       aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in());
 
@@ -428,60 +422,40 @@ namespace VISU
   VISU_Gen_i
   ::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
              const char* theURL,
-             bool isMultiFile)
+             bool theIsMultiFile)
   {
-    Mutex mt(myMutex);
-    string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
-    TCollection_AsciiString aTmpDir (const_cast<char*>(aDir.c_str()));
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
-    int aCounter = 0;
-    TColStd_SequenceOfAsciiString aFileNames;
+    std::string anURL = theIsMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir();
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::SaveASCII - "<<anURL);
+
+    Result_i::TFileNames aFileNames;
+    Result_i::TFileNames aFiles;
+
     SALOMEDS::Study_var aStudy = theComponent->GetStudy();
-    SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent);
-    for (; itBig->More(); itBig->Next()) {
-      SALOMEDS::SObject_var gotBranch = itBig->Value();
-      CORBA::Object_var anObj = SObjectToObject(gotBranch);
-      if(CORBA::is_nil(anObj)) continue;
-      if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
-       switch(pResult->GetCreationId()){
-       case Result_i::eImportFile:
-       case Result_i::eCopyAndImportFile: {
-         const QFileInfo& aFileInfo = pResult->GetFileInfo();
-         QString aPrefix("");
-         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str();
-         QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
-               QString tmpDir = QDir::convertSeparators( QString(aTmpDir.ToCString()) );;
-         static QString aCommand;
-    aCommand.sprintf(" %s %s%s",aFileInfo.filePath().latin1(),tmpDir.latin1(),aFileName.latin1());
-    aCommand = QDir::convertSeparators( aCommand );
-    aCommand.prepend( COPY_COMMAND );
-
-               if(system(aCommand.latin1())){
-           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
-           continue;
-         }else
-           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
-
-               QString studyPath = tmpDir.append(aFileName);
-         TCollection_AsciiString aString((char *)(aFileName.latin1()));
-
-               HDFascii::ConvertFromHDFToASCII(strdup(studyPath.latin1()), true);
-
-         aFileNames.Append(aString);
-       }}
+    SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent);
+    for (; anIter->More(); anIter->Next()) {
+      SALOMEDS::SObject_var aSObject = anIter->Value();
+      CORBA::Object_var anObj = SObjectToObject(aSObject);
+      if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(anObj).in())){
+       aResult->Save(theComponent, 
+                     anURL, 
+                     theIsMultiFile,
+                     true,
+                     aFileNames, 
+                     aFiles);
       }
     }
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::SaveASCII - aFileNames.size() - "<<aFileNames.size());
+
     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.Length() - "<<aFileNames.Length());
-    if(aFileNames.Length() > 0){
-      SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
-      aSeq->length(aFileNames.Length());
-      for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--)
-       aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString());
-      aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile);
-      if(!isMultiFile)
-       SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true);
-    }
+    if(aFileNames.empty())
+      return aStreamFile._retn();
+
+    SALOMEDS::ListOfFileNames_var aListOfFileNames = GetListOfFileNames(aFileNames);
+    aStreamFile = SALOMEDS_Tool::PutFilesToStream(anURL, aListOfFileNames.in(), theIsMultiFile);
+
+    if(!theIsMultiFile)
+      SALOMEDS_Tool::RemoveTemporaryFiles(anURL, aListOfFileNames, true);
+
     return aStreamFile._retn();
   }
 
@@ -490,20 +464,16 @@ namespace VISU
   char* 
   VISU_Gen_i
   ::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
-                          const char* IORString,
-                          CORBA::Boolean isMultiFile,
-                          CORBA::Boolean isASCII)
+                          const char* theIORString,
+                          CORBA::Boolean theIsMultiFile,
+                          CORBA::Boolean theIsASCII)
   {
-    CORBA::String_var aString(IORString);
-    if(strcmp(IORString,"") != 0){
-      CORBA::ORB_ptr anORB = GetORB();
-      CORBA::Object_var anObj = anORB->string_to_object(aString);
-      if(!CORBA::is_nil(anObj)){
-       if(Storable* pStorable = dynamic_cast<Storable*>(GetServant(anObj).in())){
-         Mutex mt(myMutex);
-         aString = pStorable->ToString().c_str();
-         return aString._retn();
-       }
+    CORBA::String_var aString("");
+    if(strcmp(theIORString, "") != 0){
+      CORBA::Object_var anObj = GetORB()->string_to_object(theIORString);
+      if(Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in())){
+       aString = aStorable->ToString().c_str();
+       return aString._retn();
       }
     }
     return aString._retn();
@@ -621,7 +591,6 @@ namespace VISU
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return SALOMEDS::SObject::_nil();
-    Mutex mt(myMutex);
     SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument);
     return aRes._retn();
   }
@@ -644,17 +613,21 @@ namespace VISU
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
-    Mutex mt(myMutex);
-    aFileInfo.setFile(theFileName);
-    Result_i* pResult = new Result_i(myStudyDocument,
-                                    Result_i::eFile,
-                                    Result_i::eImportFile);
-    if(pResult->Create(theFileName) != NULL)
-      return pResult->_this();
-    else{
-      pResult->_remove_ref();
-      return VISU::Result::_nil();
-    }
+
+    Result_i* aResult = Result_i::New(myStudyDocument,
+                                     Result_i::eFile,
+                                     Result_i::eImportFile,
+                                     true,
+                                     true,
+                                     true,
+                                     true);
+
+    if(aResult->Create(theFileName) != NULL)
+      return aResult->_this();
+    else
+      aResult->_remove_ref();
+
+    return VISU::Result::_nil();
   }
 
 
@@ -665,18 +638,21 @@ namespace VISU
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
-    Mutex mt(myMutex);
-    aFileInfo.setFile(theFileName);
-    Result_i* pResult = new Result_i(myStudyDocument,
-                                    Result_i::eFile,
-                                    Result_i::eImportFile,
-                                    false);
-    if(pResult->Create(theFileName) != NULL)
-      return pResult->_this();
-    else{
-      pResult->_remove_ref();
-      return VISU::Result::_nil();
-    }
+
+    Result_i* aResult = Result_i::New(myStudyDocument,
+                                     Result_i::eFile,
+                                     Result_i::eImportFile,
+                                     false,
+                                     true,
+                                     true,
+                                     true);
+
+    if(aResult->Create(theFileName) != NULL)
+      return aResult->_this();
+    else
+      aResult->_remove_ref();
+
+    return VISU::Result::_nil();
   }
 
 
@@ -687,15 +663,20 @@ namespace VISU
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
-    Mutex mt(myMutex);
-    VISU::Result_var aResult;
-    aFileInfo.setFile(theFileName);
-    Result_i* pResult = new Result_i(myStudyDocument,
-                                    Result_i::eRestoredFile,
-                                    Result_i::eCopyAndImportFile);
-    if(pResult->Create(theFileName) != NULL)
-      aResult = pResult->_this();
-    return aResult._retn();
+
+    Result_i* aResult = Result_i::New(myStudyDocument,
+                                     Result_i::eRestoredFile,
+                                     Result_i::eCopyAndImportFile,
+                                     true,
+                                     true,
+                                     true,
+                                     true);
+    if(aResult->Create(theFileName) != NULL)
+      return aResult->_this();
+    else
+      aResult->_remove_ref();
+
+    return VISU::Result::_nil();
   }
 
 
@@ -706,16 +687,20 @@ namespace VISU
   {
     if (myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
-    Mutex mt(myMutex);
-    Result_i* pResult = new Result_i(myStudyDocument,
-                                    Result_i::eComponent,
-                                    Result_i::eImportMed);
-    if (pResult->Create(theMedSObject) != NULL) {
-      return pResult->_this();
-    } else {
-      pResult->_remove_ref();
-      return VISU::Result::_nil();
-    }
+
+    Result_i* aResult = Result_i::New(myStudyDocument,
+                                     Result_i::eComponent,
+                                     Result_i::eImportMed,
+                                     true,
+                                     true,
+                                     true,
+                                     true);
+    if (aResult->Create(theMedSObject) != NULL)
+      return aResult->_this();
+    else
+      aResult->_remove_ref();
+    
+    return VISU::Result::_nil();
   }
 
 
@@ -726,16 +711,21 @@ namespace VISU
   {
     if (myStudyDocument->GetProperties()->IsLocked())
       return Result::_nil();
-    Mutex mt(myMutex);
-    Result_i* pResult = new Result_i(myStudyDocument,
-                                    Result_i::eComponent,
-                                    Result_i::eImportMedField);
-    if (pResult->Create(theField) != NULL) {
-      return pResult->_this();
-    } else {
-      pResult->_remove_ref();
-      return VISU::Result::_nil();
-    }
+
+    Result_i* aResult = Result_i::New(myStudyDocument,
+                                     Result_i::eComponent,
+                                     Result_i::eImportMedField,
+                                     true,
+                                     true,
+                                     true,
+                                     true);
+
+    if (aResult->Create(theField) != NULL)
+      return aResult->_this();
+    else
+      aResult->_remove_ref();
+    
+    return VISU::Result::_nil();
   }
 
   void
@@ -746,13 +736,15 @@ namespace VISU
                      const std::string& theSubMeshName, // Family or Group name
                      const std::string& theNewName)
   {
-    if (myStudyDocument->GetProperties()->IsLocked()) 
-      return;
-
     Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
     if (!aResult) 
       return;
 
+    SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
+    if (aStudyDocument->GetProperties()->IsLocked()) 
+      return;
+
+
     QString aComment;
     VISU::VISUType aType;
     if (theEntity >= 0)
@@ -786,9 +778,9 @@ namespace VISU
     if (anEntry == "") 
       return;
 
-    SALOMEDS::SObject_ptr aSObject = myStudyDocument->FindObjectID(anEntry.c_str());
+    SALOMEDS::SObject_ptr aSObject = aStudyDocument->FindObjectID(anEntry.c_str());
 
-    SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudyDocument->NewBuilder();
     aStudyBuilder->NewCommand(); // There is a transaction
 
     SALOMEDS::GenericAttribute_var anAttr =
@@ -844,17 +836,20 @@ namespace VISU
                 const char* theMeshName,
                 VISU::Entity theEntity)
   {
-    if(myStudyDocument->GetProperties()->IsLocked())
-      return Mesh::_nil();
+    Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+    if (!aResult) 
+      return VISU::Mesh::_nil();
+
+    SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
+    if (aStudyDocument->GetProperties()->IsLocked()) 
+      return VISU::Mesh::_nil();
+
+    Mesh_i* aPresent = new Mesh_i();
+    if(aPresent->Create(aResult, theMeshName, theEntity))
+      return aPresent->_this();
+    else
+      aPresent->_remove_ref();
 
-    if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
-      Mesh_i* aPresent = new Mesh_i();
-      if(aPresent->Create(aResult, theMeshName, theEntity))
-       return aPresent->_this();
-      else{
-       aPresent->_remove_ref();
-      }
-    }
     return VISU::Mesh::_nil();
   }
 
@@ -867,17 +862,20 @@ namespace VISU
                       VISU::Entity theEntity,
                       const char* theFamilyName)
   {
-    if(myStudyDocument->GetProperties()->IsLocked())
-      return Mesh::_nil();
+    Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+    if (!aResult) 
+      return VISU::Mesh::_nil();
+
+    SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
+    if (aStudyDocument->GetProperties()->IsLocked()) 
+      return VISU::Mesh::_nil();
+
+    Mesh_i* aPresent = new Mesh_i();
+    if(aPresent->Create(aResult, theMeshName, theEntity, theFamilyName))
+      return aPresent->_this();
+    else
+      aPresent->_remove_ref();
 
-    if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
-      Mesh_i* aPresent = new Mesh_i();
-      if(aPresent->Create(aResult, theMeshName, theEntity, theFamilyName))
-       return aPresent->_this();
-      else{
-       aPresent->_remove_ref();
-      }
-    }
     return VISU::Mesh::_nil();
   }
 
@@ -889,17 +887,20 @@ namespace VISU
              const char* theMeshName,
              const char* theGroupName)
   {
-    if(myStudyDocument->GetProperties()->IsLocked())
-      return Mesh::_nil();
+    Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+    if (!aResult) 
+      return VISU::Mesh::_nil();
+
+    SALOMEDS::Study_var aStudyDocument = aResult->GetStudyDocument();
+    if (aStudyDocument->GetProperties()->IsLocked()) 
+      return VISU::Mesh::_nil();
+
+    Mesh_i* aPresent = new Mesh_i();
+    if(aPresent->Create(aResult, theMeshName, theGroupName))
+      return aPresent->_this();
+    else
+      aPresent->_remove_ref();
 
-    if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
-      Mesh_i* aPresent = new Mesh_i();
-      if(aPresent->Create(aResult, theMeshName, theGroupName))
-       return aPresent->_this();
-      else{
-       aPresent->_remove_ref();
-      }
-    }
     return VISU::Mesh::_nil();
   }
 
@@ -937,6 +938,8 @@ namespace VISU
                                             theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   DeformedShape_ptr 
   VISU_Gen_i
   ::DeformedShapeOnField(Result_ptr theResult,
@@ -952,6 +955,8 @@ namespace VISU
                                               theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   ScalarMapOnDeformedShape_ptr 
   VISU_Gen_i
   ::ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
@@ -967,6 +972,8 @@ namespace VISU
                                                          theIteration)._retn();
   }
   
+
+  //---------------------------------------------------------------
   Vectors_ptr 
   VISU_Gen_i
   ::VectorsOnField(Result_ptr theResult,
@@ -982,6 +989,8 @@ namespace VISU
                                         theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   IsoSurfaces_ptr 
   VISU_Gen_i
   ::IsoSurfacesOnField(Result_ptr theResult,
@@ -997,6 +1006,8 @@ namespace VISU
                                             theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   StreamLines_ptr 
   VISU_Gen_i
   ::StreamLinesOnField(Result_ptr theResult,
@@ -1012,6 +1023,8 @@ namespace VISU
                                             theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   Plot3D_ptr 
   VISU_Gen_i
   ::Plot3DOnField(Result_ptr theResult,
@@ -1027,11 +1040,15 @@ namespace VISU
                                        theIteration)._retn();
   }
 
-  CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult,
-                                            const char* theMeshName,
-                                            VISU::Entity theEntity,
-                                            const char* theFieldName,
-                                            CORBA::Long theIteration)
+
+  //---------------------------------------------------------------
+  CutPlanes_ptr
+  VISU_Gen_i
+  ::CutPlanesOnField(Result_ptr theResult,
+                    const char* theMeshName,
+                    VISU::Entity theEntity,
+                    const char* theFieldName,
+                    CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::CutPlanes_i>(theResult,
                                           theMeshName,
@@ -1040,11 +1057,15 @@ namespace VISU
                                           theIteration)._retn();
   }
 
-  CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult,
-                                          const char* theMeshName,
-                                          VISU::Entity theEntity,
-                                          const char* theFieldName,
-                                          CORBA::Long theIteration)
+
+  //---------------------------------------------------------------
+  CutLines_ptr
+  VISU_Gen_i
+  ::CutLinesOnField(Result_ptr theResult,
+                   const char* theMeshName,
+                   VISU::Entity theEntity,
+                   const char* theFieldName,
+                   CORBA::Long theIteration)
   {
     return Prs3dOnField<VISU::CutLines_i>(theResult,
                                          theMeshName,
@@ -1053,6 +1074,8 @@ namespace VISU
                                          theIteration)._retn();
   }
 
+
+  //---------------------------------------------------------------
   struct CreateTableEvent: public SALOME_Event
   {
     SALOMEDS::Study_var myStudyDocument;
@@ -1082,7 +1105,10 @@ namespace VISU
   };
 
 
-  Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry)
+  //---------------------------------------------------------------
+  Table_ptr
+  VISU_Gen_i
+  ::CreateTable(const char* theTableEntry)
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Table::_nil();
@@ -1090,17 +1116,25 @@ namespace VISU
     return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
   }
 
-  Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
-                                   CORBA::Long theHRow,
-                                   CORBA::Long theVRow)
+
+  //---------------------------------------------------------------
+  Curve_ptr
+  VISU_Gen_i
+  ::CreateCurve(Table_ptr theTable,
+               CORBA::Long theHRow,
+               CORBA::Long theVRow)
   {
     return CreateCurveWithZ( theTable, theHRow, theVRow, 0 );
   }
 
-  Curve_ptr VISU_Gen_i::CreateCurveWithZ(Table_ptr theTable,
-                                   CORBA::Long theHRow,
-                                   CORBA::Long theVRow,
-                                   CORBA::Long theZRow)
+
+  //---------------------------------------------------------------
+  Curve_ptr
+  VISU_Gen_i
+  ::CreateCurveWithZ(Table_ptr theTable,
+                    CORBA::Long theHRow,
+                    CORBA::Long theVRow,
+                    CORBA::Long theZRow)
   {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Curve::_nil();
@@ -1116,7 +1150,13 @@ namespace VISU
     }
   }
 
-  Container_ptr VISU_Gen_i::CreateContainer(){
+
+
+  //---------------------------------------------------------------
+  Container_ptr
+  VISU_Gen_i
+  ::CreateContainer()
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Container::_nil();
     Mutex mt(myMutex);
@@ -1129,7 +1169,12 @@ namespace VISU
     }
   }
 
-  Animation_ptr VISU_Gen_i::CreateAnimation(View3D_ptr theView3D){
+
+  //---------------------------------------------------------------
+  Animation_ptr
+  VISU_Gen_i
+  ::CreateAnimation(View3D_ptr theView3D)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Animation::_nil();
     Mutex mt(myMutex);
@@ -1139,32 +1184,58 @@ namespace VISU
       return VISU::Animation::_nil();
   }
 
-  void VISU_Gen_i::DeleteResult (Result_ptr theResult)
+
+  //---------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::DeleteResult (Result_ptr theResult)
   {
     theResult->RemoveFromStudy();
   }
 
-  void VISU_Gen_i::DeletePrs3d (Prs3d_ptr thePrs3d)
+
+  //---------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::DeletePrs3d(Prs3d_ptr thePrs3d)
   {
     thePrs3d->RemoveFromStudy();
   }
 
-  void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){
-  }
 
-  char* VISU_Gen_i::ComponentDataType(){
+  //---------------------------------------------------------------
+  void
+  VISU_Gen_i
+  ::Close(SALOMEDS::SComponent_ptr theComponent)
+  {}
+
+
+  //---------------------------------------------------------------
+  char* 
+  VISU_Gen_i
+  ::ComponentDataType()
+  {
     return CORBA::string_dup("VISU");
   }
 
-  bool VISU_Gen_i::CanPublishInStudy(CORBA::Object_ptr theIOR) {
+
+  //---------------------------------------------------------------
+  bool
+  VISU_Gen_i
+  ::CanPublishInStudy(CORBA::Object_ptr theIOR) 
+  {
     Result_var aResultObj = Result::_narrow(theIOR);
     return !(aResultObj->_is_nil());
   }
 
-  SALOMEDS::SObject_ptr VISU_Gen_i::PublishInStudy(SALOMEDS::Study_ptr theStudy,
-                                                  SALOMEDS::SObject_ptr theSObject,
-                                                  CORBA::Object_ptr theObject,
-                                                  const char* theName)
+
+  //---------------------------------------------------------------
+  SALOMEDS::SObject_ptr
+  VISU_Gen_i
+  ::PublishInStudy(SALOMEDS::Study_ptr theStudy,
+                  SALOMEDS::SObject_ptr theSObject,
+                  CORBA::Object_ptr theObject,
+                  const char* theName)
     throw (SALOME::SALOME_Exception)
   {
     Unexpect aCatch(SalomeException);
@@ -1172,180 +1243,133 @@ namespace VISU
     Mutex mt(myMutex);
     SALOMEDS::SObject_var aResultSO;
     Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(theObject).in());
-    if (!aResultObj) return aResultSO._retn();
+    if (!aResultObj) 
+      return aResultSO._retn();
     const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
     CORBA::String_var anEntry = aResultObj->Create(aFileInfo.filePath().latin1())->GetID();
     aResultSO = theStudy->FindObjectID(anEntry);
     return aResultSO._retn();
   }
 
-  CORBA::Boolean VISU_Gen_i::CanCopy(SALOMEDS::SObject_ptr theObject) {
-    Mutex mt(myMutex);
-    SALOMEDS::GenericAttribute_var anAttr;
-    if (!theObject->FindAttribute(anAttr, "AttributeIOR")) return false;
-    try {
-      SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
-      CORBA::String_var aValue = anIOR->Value();
-      if(strcmp(aValue,"") != 0){
-       CORBA::Object_ptr anObj = GetORB()->string_to_object(aValue);
-       if (!CORBA::is_nil(anObj)){
-         Result_var aResultObj = Result::_narrow(anObj);
-         if(!aResultObj->_is_nil()){
-           if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(aResultObj).in())){
-             switch(pResult->GetCreationId()){
-             case Result_i::eImportFile:
-             case Result_i::eCopyAndImportFile:
-               return true;
-             }
-           }
-         }
-       }
-      }
-    }catch(std::exception& exc){
-      INFOS("Follow exception was occured :\n"<<exc.what());
-    }catch (...){
-      INFOS("Unknown exception was occured!");
-    }
+
+  //---------------------------------------------------------------
+  CORBA::Boolean 
+  VISU_Gen_i
+  ::CanCopy(SALOMEDS::SObject_ptr theObject) 
+  {
+    CORBA::Object_var anObj = SObjectToObject(theObject);
+    if (Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in()))
+      return aStorable->CanCopy(theObject);
+
     return false;
   }
 
-  SALOMEDS::TMPFile* VISU_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
-    Mutex mt(myMutex);
+
+  //---------------------------------------------------------------
+  SALOMEDS::TMPFile* 
+  VISU_Gen_i
+  ::CopyFrom(SALOMEDS::SObject_ptr theObject, 
+            CORBA::Long& theObjectID) 
+  {
     theObjectID = 0;
     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
-    SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
 
-    PortableServer::POA_ptr aPOA = GetPOA();
-
-    SALOMEDS::GenericAttribute_var anAttr;
-    if (!theObject->FindAttribute(anAttr,"AttributeIOR")) return NULL;
-    SALOMEDS::AttributeIOR_var anIORAttr = SALOMEDS::AttributeIOR::_narrow(anAttr);
-    CORBA::Object_var aCorbaObj;
-    try {
-      aCorbaObj = GetORB()->string_to_object(anIORAttr->Value());
-    } catch(...) {
+    CORBA::Object_var anObj = SObjectToObject(theObject);
+    if (CORBA::is_nil(anObj)) {
       aStreamFile->length(1);
-      aStreamFile[0] = strdup("E")[0];
-      return aStreamFile._retn();
-    }
-    if (CORBA::is_nil(aCorbaObj)) {
-      return NULL;
-    }
+      aStreamFile[0] = CORBA::string_dup("E")[0];
+    } else if (Storable* aStorable = dynamic_cast<Storable*>(GetServant(anObj).in())) {
+      std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+      Storable::TFileNames aFileNames;
+      bool anIsDone = aStorable->CopyFrom(theObject, theObjectID, aTmpDir, aFileNames);
 
-    Storable* pStorable = dynamic_cast<Storable*>(GetServant(aCorbaObj).in());
-    if (!pStorable) {
-      return NULL;
-    }
-
-    string aTmpDir = SALOMEDS_Tool::GetTmpDir();
-    string aCopyPersist =  aTmpDir + "copy_persistent";
-
-    ofstream stmOut2(aCopyPersist.c_str(),ios::out);
-    string aStr = pStorable->ToString().c_str();
-    stmOut2<<aStr<<endl;
-    stmOut2.close();
-
-    if (Result_i* aResultObj = dynamic_cast<Result_i*>(aPOA->reference_to_servant(aCorbaObj))) {
-      string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_";
-      if(strlen(aFileName.c_str()) == 1) aFileName="";
-      const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
-      aFileName += aFileInfo.fileName().latin1();
-      static QString aCommand;
-      string aFullFileName =  aTmpDir + aFileName;
-      aCommand.sprintf(" %s %s",aFileInfo.filePath().latin1(), aFullFileName.c_str() );
-      aCommand = QDir::convertSeparators( aCommand );
-      aCommand.prepend( COPY_COMMAND );
-
-      if(system(aCommand.latin1()) == -1) {
-       if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
-       return NULL;
-      }
-      aSeq->length(2);
-      aSeq[0] = "copy_persistent";
-      aSeq[1] = aFileName.c_str();
-    } else {
-      aSeq->length(1);
-      aSeq[0] = "copy_persistent";
-    }
-
-    aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.c_str(), aSeq.in(), false);
-    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeq.in(), true);
+      SALOMEDS::ListOfFileNames_var aListOfFileNames = new SALOMEDS::ListOfFileNames;
+      aListOfFileNames->length(aFileNames.size());
+      for(size_t anId = 0; anId < aFileNames.size(); anId++)
+       aListOfFileNames[anId] = aFileNames[anId].c_str();
 
-    // Assign an ID = 1 the the type VISU::Result
-    theObjectID = 1;
+      if(anIsDone)
+       aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFileNames.in(), false);
 
-    SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU");
+      SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aListOfFileNames.in(), true);
+    }
     return aStreamFile._retn();
   }
 
-  CORBA::Boolean VISU_Gen_i::CanPaste(const char* theComponentName, CORBA::Long theObjectID) {
+
+  //---------------------------------------------------------------
+  CORBA::Boolean 
+  VISU_Gen_i
+  ::CanPaste(const char* theComponentName, CORBA::Long theObjectID) {
     // The VISU component can paste only objects copied by VISU component
-    // and with the object type = 1
-    if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1)
-      return false;
-    return true;
+    CORBA::String_var aString = ComponentDataType();
+    if (strcmp(theComponentName, aString.in()) == 0 && theObjectID == 1)
+      return true;
+    return false;
   }
 
-  SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
-                                             CORBA::Long theObjectID,
-                                             SALOMEDS::SObject_ptr theObject)
+
+  //---------------------------------------------------------------
+  SALOMEDS::SObject_ptr
+  VISU_Gen_i
+  ::PasteInto(const SALOMEDS::TMPFile& theStream,
+             CORBA::Long theObjectID,
+             SALOMEDS::SObject_ptr theSObject)
   {
-    Mutex mt(myMutex);
-    SALOMEDS::SObject_var aResultSO;
     if (theObjectID != 1)
-      return aResultSO._retn();
-
-    string aTmpDir = SALOMEDS_Tool::GetTmpDir();
-    SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.c_str(), false);
-
-    ifstream stmIn((aTmpDir + string("copy_persistent")).c_str());
-    stmIn.seekg(0, ios::end);
-    int aLength = stmIn.tellg();
-    stmIn.seekg(0, ios::beg);
-    char* aString = new char[aLength+1];
-    stmIn.read(aString, aLength);
-    stmIn.close();
-    aString[aLength] = 0;
-    myIsMultiFile = false;
-
-    string aFileName(aTmpDir);
-    string aBasicFileName;
-    if(aSeq->length() > 1) {
-      aBasicFileName = aSeq[1].in();
-      aFileName += aBasicFileName;
-    }
+      return SALOMEDS::SObject::_nil();
 
-    SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
-    SALOMEDS::Study_var aStudy = theObject->GetStudy();
+    SALOMEDS::SComponent_var aComponent = theSObject->GetFatherComponent();
+    SALOMEDS::Study_var aStudy = theSObject->GetStudy();
     SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
-    CORBA::String_var aComponentID(aComponent->GetID()), aSObjID(theObject->GetID());
-
-    if (strcmp(aComponentID, aSObjID) == 0) //create the new result SObject
-      aResultSO = aStudyBuilder->NewObject(aComponent);
+    CORBA::String_var aComponentID(aComponent->GetID());
+    CORBA::String_var aSObjectID(theSObject->GetID());
+    
+    SALOMEDS::SObject_var aSObject;
+    if (strcmp(aComponentID, aSObjectID) == 0) //create the new result SObject
+      aSObject = aStudyBuilder->NewObject(aComponent);
     else
-      aResultSO = SALOMEDS::SObject::_duplicate(theObject);
-
+      aSObject = SALOMEDS::SObject::_duplicate(theSObject);
+    
+    std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
+    SALOMEDS::ListOfFileNames_var aListOfFileNames = 
+      SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
+    if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<<aListOfFileNames->length());
+    
+    std::string aLocalPersistentID;
+    {
+      std::string aCopyPersist =  aTmpDir + "copy_persistent";
+      std::ifstream anInputFileStream(aCopyPersist.c_str());
+      anInputFileStream>>aLocalPersistentID;
+      anInputFileStream.close();
+    }
+    
     //Just for Result::Restore to find the Comment attribute :(
-    SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeString");
-
-    Storable* aStorable = Storable::Create(aResultSO,aFileName,aString);
-
-    SALOMEDS::ListOfFileNames_var aSeqToRm = new SALOMEDS::ListOfFileNames;
-    aSeqToRm->length(1);
-    aSeqToRm[0] = "copy_persistent";
-
-    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.c_str(), aSeqToRm.in(), true);
-
-    anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
+    SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
+    
+    std::string aFileName(aTmpDir);
+    if(aListOfFileNames->length() > 1)
+      aFileName += aListOfFileNames[1].in();
+    Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID, aFileName, false);
+    
+    SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames;
+    aFilesToRemove->length(1);
+    aFilesToRemove[0] = aListOfFileNames[0];
+    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aFilesToRemove.in(), true);
+    
+    anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
     SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
     CORBA::String_var anIORValue(aStorable->GetID());
     anIOR->SetValue(anIORValue);
-    return aResultSO._retn();
+    
+    return aSObject._retn();
   }
 
+
+  //---------------------------------------------------------------
   VISU::ColoredPrs3dCache_ptr
-  VISU_Gen_i::
-  GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
+  VISU_Gen_i
+  ::GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy)
   {
     return ColoredPrs3dCache_i::GetInstance(theStudy);
   }
index 769e48de3c4d5994eee0f4d0f6028c8f27f4f7e7..96377ac7c03c0616209ea2d07fc5d4a99cf37815 100644 (file)
 //  Author : Alexey PETROV
 //  Module : VISU
 
+#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_Prs3dUtils.hh"
+
 #include "VISU_IsoSurfacesPL.hxx"
 #include "VISU_Result_i.hh"
-#include "VISU_IsoSurfaces_i.hh"
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
@@ -152,6 +154,8 @@ void
 VISU::IsoSurfaces_i
 ::SetNbSurfaces(CORBA::Long theNb)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, int>
                   (GetSpecificPL(), &VISU_IsoSurfacesPL::SetNbParts, theNb));
 }
@@ -170,6 +174,8 @@ void
 VISU::IsoSurfaces_i
 ::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
 { 
+  VISU::TSetModified aModified(this);
+  
   vtkFloatingPointType aRange[2] = {theMin, theMax};
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, vtkFloatingPointType*>
                   (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange));
index 46f3b1511271fa3afd43a18915c3c73f937672f0..6b9f866078d5d5492b0345dbd6013c52f94ce601 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_Mesh_i.hh"
+#include "VISU_Prs3dUtils.hh"
 
 #include "VISU_Result_i.hh"
 
@@ -214,7 +215,7 @@ VISU::Mesh_i
     aRestoringMap["myMeshName"] = GetCMeshName();
 
     VISU::PUnstructuredGridIDMapper anIDMapper;
-    VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+    VISU::Result_i::PInput anInput = GetCResult()->GetInput();
     switch(myType){
     case VISU::TENTITY :
       anIDMapper = anInput->GetMeshOnEntity(aMeshName,
@@ -323,6 +324,8 @@ VISU::Mesh_i
   if(IsSameColor(myCellColor, theColor))
     return;
 
+  VISU::TSetModified aModified(this);
+  
   myCellColor = theColor;
   myParamsTime.Modified();
 }
@@ -345,6 +348,8 @@ VISU::Mesh_i
   if(IsSameColor(myNodeColor, theColor))
     return;
 
+  VISU::TSetModified aModified(this);
+  
   myNodeColor = theColor;
   myParamsTime.Modified();
 }
@@ -367,6 +372,8 @@ VISU::Mesh_i
   if(IsSameColor(myLinkColor, theColor))
     return;
 
+  VISU::TSetModified aModified(this);
+  
   myLinkColor = theColor;
   myParamsTime.Modified();
 }
@@ -389,6 +396,8 @@ VISU::Mesh_i
   if(myPresentType == theType)
     return;
 
+  VISU::TSetModified aModified(this);
+  
   myPresentType = theType;
   myParamsTime.Modified();
 }
@@ -454,9 +463,10 @@ VISU::Mesh_i
 //----------------------------------------------------------------------------
 VISU::Storable*
 VISU::Mesh_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
-         const string& thePrefix,
-         const Storable::TRestoringMap& theMap)
+::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                const Storable::TRestoringMap& theMap,
+                const std::string& thePrefix,
+                CORBA::Boolean theIsMultiFile)
 {
   Mesh_i* aMesh = new Mesh_i();
   return aMesh->Restore(theSObject, theMap);
index a6b452211d18278f78f97be49a4e514c781c661f..6576b7be3263801fe6335447d79819c686e53453 100644 (file)
@@ -167,9 +167,10 @@ namespace VISU
 
     static 
     Storable* 
-    Restore(SALOMEDS::SObject_ptr theSObject,
-           const std::string& thePrefix,
-           const Storable::TRestoringMap& theMap);
+    StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                  const Storable::TRestoringMap& theMap,
+                  const std::string& thePrefix,
+                  CORBA::Boolean theIsMultiFile);
     
     virtual
     VISU_Actor* 
diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc
new file mode 100644 (file)
index 0000000..7639c4e
--- /dev/null
@@ -0,0 +1,1129 @@
+//  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_MultiResult_i.cc
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifdef ENABLE_MULTIPR
+
+#include "VISU_MultiResult_i.hh"
+#include "VISU_ResultUtils.hh"
+
+#include "VISU_Convertor.hxx"
+#include "VISU_ConvertorUtils.hxx"
+
+#include "MULTIPR_Obj.hxx"
+#include "MULTIPR_API.hxx"
+#include "MULTIPR_Exceptions.hxx"
+
+#include "SALOMEDS_Tool.hxx"
+#include "HDFascii.hxx"
+
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+
+#include <strstream>
+
+#ifdef _DEBUG_
+static int MYDEBUG = 0;
+static int MYTIMEDEBUG = 0;
+#else
+static int MYDEBUG = 0;
+static int MYTIMEDEBUG = 0;
+#endif
+
+
+namespace VISU
+{
+  //---------------------------------------------------------------
+  class TSubString: public std::string
+  {
+  public:
+    typedef std::string::size_type size_type;
+
+    TSubString(std::string& theSource, 
+              const std::string& theTarget):
+      mySource(theSource),
+      myPosition(theSource.find(theTarget)),
+      mySize(theTarget.length())
+    {}
+
+    TSubString&
+    operator = (const std::string& theTarget)
+    {
+      if(myPosition != std::string::npos)
+       mySource.replace(myPosition, mySize, theTarget);
+      return *this;
+    }
+
+  private:
+    std::string& mySource;
+    size_type myPosition;
+    size_type mySize;
+  };
+
+
+  //---------------------------------------------------------------
+  inline
+  std::ostream& 
+  operator<<(std::ostream& theStream,
+            const MultiResult_i::TPartInfo& thePartInfo)
+  {
+    theStream<<(thePartInfo.myMeshName)<<" ";
+    theStream<<(thePartInfo.myPartID)<<" ";
+    theStream<<(thePartInfo.myName)<<" ";
+    theStream<<(thePartInfo.myPath)<<" ";
+    theStream<<(thePartInfo.myFileName);
+    return theStream;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  std::istream& 
+  operator>>(std::istream& theStream,
+            MultiResult_i::TPartInfo& thePartInfo)
+  {
+    theStream>>(thePartInfo.myMeshName);
+    theStream>>(thePartInfo.myPartID);
+    theStream>>(thePartInfo.myName);
+    theStream>>(thePartInfo.myPath);
+    theStream>>(thePartInfo.myFileName);
+    return theStream;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  MultiResult_i::TPartInfo
+  GetPartInfo(const std::string theInfoString)
+  {
+    MultiResult_i::TPartInfo aPartInfo;
+    std::istrstream anOutputStream(theInfoString.c_str());
+    anOutputStream>>aPartInfo;
+    return aPartInfo;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  MultiResult_i::TPartInfo
+  GetPartInfo(multipr::Obj& theMultiprObj,
+             const MultiResult_i::TPartName& thePartName)
+  {
+    return GetPartInfo(theMultiprObj.getPartInfo(thePartName.c_str()));
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  std::string
+  ExtractMainPart(const std::string& thePartName)
+  {
+    size_t aPos = thePartName.rfind('_');
+    if(aPos == std::string::npos)
+      return thePartName;
+
+    std::string aSuffix = thePartName.substr(aPos);
+    if(aSuffix == "_MED" || aSuffix == "_LOW")
+      return thePartName.substr(0, aPos);
+
+    return thePartName;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  bool
+  IsSubString(const std::string& theSource,
+             const std::string& theSubString)
+  {
+    return theSource.rfind(theSubString) != std::string::npos;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  bool
+  IsMediumResolution(const std::string& thePartName)
+  {
+    return IsSubString(thePartName, "_MED");
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  bool
+  IsLowResolution(const std::string& thePartName)
+  {
+    return IsSubString(thePartName, "_LOW");
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  bool
+  IsFullResolution(const std::string& thePartName)
+  {
+    return !IsMediumResolution(thePartName)  && !IsLowResolution(thePartName);
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  MultiResult_i::TResolutions
+  GetResolutions(const MultiResult_i::TMainPart2SubPartNames& theMainPart2SubPartNames,
+                const std::string& thePartName)
+  {
+    MultiResult_i::TResolutions aResolutions;
+    aResolutions.insert(VISU::Result::FULL);
+
+    MultiResult_i::TPartName aMainPart = ExtractMainPart(thePartName);
+    MultiResult_i::TMainPart2SubPartNames::const_iterator anIter = theMainPart2SubPartNames.find(aMainPart);
+    if(anIter != theMainPart2SubPartNames.end()){
+      const MultiResult_i::TSubPartNames& aSubPartNames = anIter->second;
+
+      if(aSubPartNames.find(aMainPart + "_LOW") != aSubPartNames.end())
+       aResolutions.insert(VISU::Result::LOW);
+
+      if(aSubPartNames.find(aMainPart + "_MED") != aSubPartNames.end())
+       aResolutions.insert(VISU::Result::MEDIUM);
+    }
+    return aResolutions;
+  }
+
+
+  std::string
+  Resolutions2String(const MultiResult_i::TResolutions& theResolutions)
+  {
+    std::string aResult;
+    MultiResult_i::TResolutions::const_iterator anIter = theResolutions.begin();
+    for(; anIter != theResolutions.end(); anIter++){
+      VISU::Result::Resolution aResolution = *anIter;
+      if(aResolution == VISU::Result::FULL)
+       aResult += "F";
+      if(aResolution == VISU::Result::LOW)
+       aResult += "L";
+      if(aResolution == VISU::Result::MEDIUM)
+       aResult += "M";
+    }
+    return aResult;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  VISU::Result::Resolution
+  GetResolution(const MultiResult_i::TMainPart2SubPartNames& theMainPart2SubPartNames,
+                 const std::string& thePartName)
+  {
+    MultiResult_i::TResolutions aResolutions = GetResolutions(theMainPart2SubPartNames, thePartName);
+
+    if(aResolutions.find(VISU::Result::LOW) != aResolutions.end())
+      return VISU::Result::LOW;
+
+    if(aResolutions.find(VISU::Result::MEDIUM) != aResolutions.end())
+      return VISU::Result::MEDIUM;
+
+    return VISU::Result::FULL;
+  }
+
+
+  //---------------------------------------------------------------
+  inline
+  std::string
+  GetIconName(const MultiResult_i::TMainPart2SubPartNames& theMainPart2SubPartNames,
+             const std::string& thePartName)
+  {
+    VISU::Result::Resolution aResolution = GetResolution(theMainPart2SubPartNames,
+                                                        thePartName);
+    if(aResolution == VISU::Result::LOW)
+      return "ICON_MULTIPR_VIEW_LOW";
+
+    if(aResolution == VISU::Result::MEDIUM)
+      return "ICON_MULTIPR_VIEW_MEDIUM";
+
+    return "ICON_MULTIPR_VIEW_FULL";
+  }
+
+
+  //----------------------------------------------------------------------------
+  void 
+  BuildParts(Result_i* theResult,
+            Result_i::PInput theInput,
+            multipr::Obj* theMultiprObj,
+            MultiResult_i::TPartInfos* thePartInfos,
+            MultiResult_i::TPartName2FileName* thePartName2FileName,
+            MultiResult_i::TPartName2Resolution* thePartName2Resolution,
+            MultiResult_i::TMainPart2SubPartNames* theMainPart2SubPartNames,
+            CORBA::Boolean* theIsDone,
+            CORBA::Boolean theIsBuild,
+            _PTR(Study) theStudy,
+            bool thePublishInStudy)
+  {
+    if(!theIsBuild || *theIsDone)
+      return;
+    
+    TTimerLog aTimerLog(MYTIMEDEBUG, "BuildParts");
+    TResultManager aResultManager(theResult);
+    TTransactionManager aTransactionManager(theStudy);
+    
+    try {
+      multipr::Obj& aMultiprObj = *theMultiprObj;
+      const VISU::TMeshMap& aMeshMap = theInput->GetMeshMap();
+      VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+      const VISU::PMesh& aMesh = aMeshMapIter->second;
+      
+      MultiResult_i::TPartNames aPartNames = aMultiprObj.getParts();
+      
+      if(thePublishInStudy){
+       QString aComment = "Sub-parts: #";
+       aComment += QString::number(aPartNames.size());
+       
+       CreateAttributes(theStudy,
+                        aMesh->myPartsEntry,
+                        NO_ICON,
+                        NO_IOR,
+                        "Parts",
+                        NO_PERFSITENT_REF,
+                        aComment.latin1(),
+                        false);
+      }
+      
+      MultiResult_i::TPartInfos& aPartInfos = *thePartInfos;
+      MultiResult_i::TPartName2FileName& aPartName2FileName = *thePartName2FileName;
+      MultiResult_i::TPartName2Resolution& aPartName2Resolution = *thePartName2Resolution;
+      
+      MultiResult_i::TMainPart2SubPartNames& aMainPart2SubPartNames = *theMainPart2SubPartNames;
+      
+      for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+       const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+       MultiResult_i::TPartName aMainPart = ExtractMainPart(aPartName);
+       aMainPart2SubPartNames[aMainPart].insert(aPartName);
+      }
+      
+      for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+       const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+       MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aMultiprObj, aPartName);
+
+       QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
+       aPartInfos[aFileInfo.fileName()] = aPartInfo;
+       
+       aPartName2FileName[aPartInfo.myName] = aPartInfo.myFileName;
+       
+       if(!thePublishInStudy)
+         continue;
+       
+       QString aComment = "";
+       MultiResult_i::TResolutions aResoltutions = GetResolutions(aMainPart2SubPartNames, aPartInfo.myName);
+       std::string aResoltutionsString = Resolutions2String(aResoltutions);
+       if ( IsFullResolution(aPartInfo.myName) ) {
+         std::string anIconName = GetIconName(aMainPart2SubPartNames, aPartInfo.myName);
+         VISU::Result::Resolution aResolution = GetResolution(aMainPart2SubPartNames, aPartInfo.myName);
+         aComment.sprintf("myComment=PART;myMeshName=%s;myName=%s;myResolutions=%s;myState=%d", 
+                          aPartInfo.myMeshName.c_str(), aPartInfo.myName.c_str(), aResoltutionsString.c_str(), aResolution); 
+         CreateAttributes(theStudy,
+                          aMesh->myPartsEntry,
+                          anIconName,
+                          NO_IOR,
+                          aPartInfo.myName,
+                          NO_PERFSITENT_REF,
+                          aComment.latin1(),
+                          true);
+         aPartName2Resolution[aPartInfo.myName] = aResolution;
+       }
+      }
+      
+      *theIsDone = true;
+    }catch(std::exception& exc){
+      INFOS("Follow exception was occured :\n"<<exc.what());
+    }catch(...){
+      INFOS("Unknown exception was occured!");
+    }
+    
+    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(), theIsDone));
+  }
+
+
+  //---------------------------------------------------------------
+  struct TBuildPartsArgs
+  {
+    Result_i* myResult;
+    Result_i::PInput myInput;
+    multipr::Obj* myMultiprObj;
+    MultiResult_i::TPartInfos* myPartInfos;
+    MultiResult_i::TPartName2FileName* myPartName2FileName;
+    MultiResult_i::TPartName2Resolution* myPartName2Resolution;
+    MultiResult_i::TMainPart2SubPartNames* myMainPart2SubPartNames;
+    CORBA::Boolean* myIsDone;
+    CORBA::Boolean myIsBuild;
+    _PTR(Study) myStudy;
+    bool myPublishInStudy;
+
+    TBuildPartsArgs(Result_i* theResult,
+                   Result_i::PInput theInput,
+                   multipr::Obj* theMultiprObj,
+                   MultiResult_i::TPartInfos* thePartInfos,
+                   MultiResult_i::TPartName2FileName* thePartName2FileName,
+                   MultiResult_i::TPartName2Resolution* thePartName2Resolution,
+                   MultiResult_i::TMainPart2SubPartNames* theMainPart2SubPartNames,
+                   CORBA::Boolean* theIsDone,
+                   CORBA::Boolean theIsBuild,
+                   _PTR(Study) theStudy,
+                   bool thePublishInStudy):
+      myResult(theResult),
+      myInput(theInput),
+      myMultiprObj(theMultiprObj),
+      myPartInfos(thePartInfos),
+      myPartName2FileName(thePartName2FileName),
+      myPartName2Resolution(thePartName2Resolution),
+      myMainPart2SubPartNames(theMainPart2SubPartNames),
+      myIsDone(theIsDone),
+      myIsBuild(theIsBuild),
+      myStudy(theStudy),
+      myPublishInStudy(thePublishInStudy)
+    {}
+  };
+
+
+  //----------------------------------------------------------------------------
+  void 
+  BuildParts(const TBuildPartsArgs& theArgs)
+  {
+    BuildParts(theArgs.myResult,
+              theArgs.myInput,
+              theArgs.myMultiprObj,
+              theArgs.myPartInfos,
+              theArgs.myPartName2FileName,
+              theArgs.myPartName2Resolution,
+              theArgs.myMainPart2SubPartNames,
+              theArgs.myIsDone,
+              theArgs.myIsBuild,
+              theArgs.myStudy,
+              theArgs.myPublishInStudy);
+  }
+
+
+  //---------------------------------------------------------------
+}
+
+
+//---------------------------------------------------------------
+VISU::MultiResult_i
+::MultiResult_i(SALOMEDS::Study_ptr theStudy,
+               const ESourceId& theSourceId,
+               const ECreationId& theCreationId,
+               CORBA::Boolean theIsBuildImmediately,
+               CORBA::Boolean theIsBuildFields,
+               CORBA::Boolean theIsBuildMinMax,
+               CORBA::Boolean theIsBuildGroups):
+  Result_i(theStudy,
+          theSourceId,
+          theCreationId,
+          theIsBuildImmediately,
+          theIsBuildFields,
+          theIsBuildMinMax,
+          theIsBuildGroups)
+{}
+
+
+//---------------------------------------------------------------
+VISU::MultiResult_i
+::MultiResult_i()
+{}
+
+
+//---------------------------------------------------------------
+size_t
+VISU::MultiResult_i
+::IsPossible()
+{
+  return TSuperClass::IsPossible();
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Build(SALOMEDS::SObject_ptr theSObject,
+       CORBA::Boolean theIsAtOnce)
+{
+  if(!TSuperClass::Build(theSObject, theIsAtOnce))
+    return NULL;
+
+  if(IsDone())
+    return this;
+
+  if(theIsAtOnce){
+    BuildParts(this,
+              GetInput(),
+              &myMultiprObj,
+              &myPartInfos,
+              &myPartName2FileName,
+              &myPartName2Resolution,
+              &myMainPart2SubPartNames,
+              &myIsPartsDone,
+              myIsBuildParts,
+              myStudy,
+              true);
+  }
+
+  return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::MultiResult_i
+::BuildDataTree(const std::string& theResultEntry)
+{
+  BuildEntities(this,
+               GetInput(),
+               &myIsEntitiesDone,
+               theResultEntry,
+               false,
+               myIsBuildGroups,
+               myIsBuildFields,
+               myIsBuildParts,
+               myStudy);
+  {
+    TBuildPartsArgs anArgs(this,
+                          GetInput(),
+                          &myMultiprObj,
+                          &myPartInfos,
+                          &myPartName2FileName,
+                          &myPartName2Resolution,
+                          &myMainPart2SubPartNames,
+                          &myIsPartsDone,
+                          myIsBuildParts,
+                          myStudy,
+                          true);
+
+    boost::thread aThread(boost::bind(&BuildParts, anArgs));
+  }
+  {
+    boost::thread aThread(boost::bind(&BuildGroups,
+                                     this,
+                                     GetInput(),
+                                     &myIsGroupsDone,
+                                     myIsBuildGroups,
+                                     false,
+                                     myStudy));
+  }
+  {
+    boost::thread aThread(boost::bind(&BuildFieldDataTree,
+                                     this,
+                                     GetInput(),
+                                     &myIsFieldsDone,
+                                     myIsBuildFields,
+                                     &myIsMinMaxDone,
+                                     myIsBuildMinMax,
+                                     myStudy));
+  }
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Create(const char* theFileName)
+{
+  QFileInfo aFileInfo(theFileName);
+  QString aTargetFileName = aFileInfo.filePath();
+  if(aTargetFileName.endsWith("_grains_maitre.med")){
+    myMultiprObj.create(theFileName);
+    if (myMultiprObj.isValidDistributedMEDFile()) {
+      aTargetFileName = myMultiprObj.getSequentialMEDFilename();
+      SetInitFileName(aFileInfo.filePath().latin1());
+      SetName(VISU::GenerateName(aFileInfo.fileName()).latin1(), false);
+      myIsBuildParts = true;
+    }
+  }
+
+  return TSuperClass::Create(aTargetFileName);
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::MultiResult_i
+::Save(SALOMEDS::SComponent_ptr theComponent,
+       const std::string& theURL,
+       bool theIsMultiFile,
+       bool theIsASCII,
+       TFileNames& theFileNames,
+       TFileNames& theFiles)
+{
+  bool anIsDone = Result_i::Save(theComponent, 
+                                theURL, 
+                                theIsMultiFile,
+                                theIsASCII, 
+                                theFileNames, 
+                                theFiles);
+  if(!anIsDone)
+    return false;
+
+  if(!myMultiprObj.isValidDistributedMEDFile())
+    return true;
+
+  INITMSG(MYDEBUG, "MultiResult_i::Save - this = "<<this<<"\n");
+  INITMSGA(MYDEBUG, 0, "theIsMultiFile = "<<theIsMultiFile<<"; theIsASCII = "<<theIsASCII<<"\n");
+
+  // To generate an unique prefix for the set of multi sub files
+  std::string aPrefix;
+  if (theIsMultiFile) {
+    CORBA::String_var anURL = GetStudyDocument()->URL();
+    aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+  }
+
+  std::string aBase, aSuffix;
+  SplitName(GetFileName(), aBase, aSuffix);
+  BEGMSG(MYDEBUG, "aBase = '"<<aBase<<"'; aSuffix = '"<<aSuffix<<"'\n");
+
+  aPrefix = aPrefix + "_" + aBase;
+  VISU::TSubString(aPrefix, ".med") = "";
+
+  BEGMSG(MYDEBUG, "aPrefix = '"<<aPrefix<<"'\n");
+
+  // To get a common prefix used in the multi file
+  QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename());
+  std::string aFilePrefix = aFileInfo.baseName(TRUE).latin1();
+
+  MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
+  for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+    const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+    MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
+
+    QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
+    std::string aFile = aFileInfo.absFilePath().latin1();
+
+    std::string aFileName = aFileInfo.fileName().latin1();
+    VISU::TSubString(aFileName, aFilePrefix) = aPrefix;
+    VISU::TSubString(aFileName, aSuffix) = "";
+    aFileName = aFileName + aSuffix;
+    INITMSG(MYDEBUG, "aFileName = '"<<aFileName<<"'\n");
+
+    if(theIsMultiFile || theIsASCII){
+      std::string aPathToCopy(theURL + aFileName);
+      BEGMSG(MYDEBUG, "aPathToCopy = '"<<aPathToCopy<<"'\n");
+      
+      if(!VISU::CopyFile(aFile, aPathToCopy))
+       return false;
+
+      if(theIsASCII)
+       HDFascii::ConvertFromHDFToASCII(const_cast<char*>(aPathToCopy.c_str()), true);
+    }
+
+    theFileNames.push_back(aFileName);
+    theFiles.push_back(aFile);
+  }
+  
+  return true;
+}
+
+
+//---------------------------------------------------------------
+CORBA::Boolean 
+VISU::MultiResult_i
+::CanCopy(SALOMEDS::SObject_ptr theObject) 
+{
+  if(!myIsPartsDone)
+    return Result_i::CanCopy(theObject);
+
+  return false;
+}
+
+
+//---------------------------------------------------------------
+void 
+VISU::MultiResult_i
+::ToStream(std::ostringstream& theStr)
+{
+  INITMSG(MYDEBUG, "MultiResult_i::ToStream - this = "<<this<<"\n");
+
+  TSuperClass::ToStream(theStr);
+
+  Storable::DataToStream(theStr,"myIsBuildParts", myIsPartsDone);
+  if(!myIsPartsDone)
+    return;
+
+  {
+    std::ostringstream aPartNames, aResolutions;
+    TPartName2Resolution::const_iterator anIter = myPartName2Resolution.begin();
+    for ( ; anIter != myPartName2Resolution.end() ; anIter++) {
+      const TPartName& aPartName = anIter->first;
+      aPartNames<<aPartName<<"|";
+      const VISU::Result::Resolution& aResolution = anIter->second;
+      aResolutions<<aResolution<<"|";
+    }
+    
+    Storable::DataToStream(theStr, "myPartNames",  aPartNames.str().c_str());   
+    Storable::DataToStream(theStr, "myResolutions", aResolutions.str().c_str());
+  }
+
+  {
+    std::string aBase, aSuffix;
+    VISU::SplitName(GetFileName(), aBase, aSuffix);
+    INITMSG(MYDEBUG, "aBase = '"<<aBase<<"'; aSuffix = '"<<aSuffix<<"'\n");
+
+    QFileInfo aFileInfo(myMultiprObj.getSequentialMEDFilename());
+    std::string aFilePrefix = aFileInfo.baseName(TRUE).latin1();
+    BEGMSG(MYDEBUG, "aFilePrefix = '"<<aFilePrefix<<"'\n");
+
+    std::ostringstream aPartInfos;
+    MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
+    for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+      const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+      MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
+
+      QFileInfo aFileInfo(aPartInfo.myFileName.c_str());
+      std::string aFileName = aFileInfo.fileName().latin1();
+      VISU::TSubString(aFileName, aFilePrefix + "_") = "";      
+      VISU::TSubString(aFileName, aSuffix) = "";
+      aPartInfo.myFileName = aFileName + aSuffix;
+      aPartInfos<<aPartInfo<<"|";
+
+      INITMSG(MYDEBUG, "aFileName = '"<<aPartInfo.myFileName<<"'\n");
+    }
+
+    Storable::DataToStream(theStr, "myPartInfos", aPartInfos.str().c_str());
+  }
+}
+
+
+//---------------------------------------------------------------
+VISU::Storable*
+VISU::MultiResult_i
+::Restore(SALOMEDS::SObject_ptr theSObject,
+         const Storable::TRestoringMap& theMap,
+         const std::string& thePrefix,
+         CORBA::Boolean theIsMultiFile)
+{
+  INITMSG(MYDEBUG, "MultiResult_i::Restore - this = "<<this<<"\n");
+
+  if(!TSuperClass::Restore(theSObject, theMap, thePrefix, theIsMultiFile))
+    return NULL;
+
+  myIsBuildParts = Storable::FindValue(theMap, "myIsBuildParts", "0").toInt();
+  if(!myIsBuildParts)
+    return this;
+  
+  QStringList aResolutions = QStringList::split("|", VISU::Storable::FindValue(theMap, "myResolutions"));
+  QStringList aPartNames = QStringList::split("|",VISU::Storable::FindValue(theMap, "myPartNames") );
+  for(size_t anId = 0, anEnd = aPartNames.size(); anId < anEnd; anId++){
+    const QString& aPartName = aPartNames[anId];
+    VISU::Result::Resolution aResolution = VISU::Result::Resolution(aResolutions[anId].toInt());
+    myPartName2Resolution[aPartName.latin1()] = aResolution;
+    INITMSG(MYDEBUG, "aPartName = '"<<aPartName<<"' = "<<aResolution<<"\n");
+  }
+  
+  std::string aBase, aSuffix;
+  SplitName(GetFileName(), aBase, aSuffix);
+  INITMSGA(MYDEBUG, 0, "aBase = '"<<aBase<<"'; aSuffix = '"<<aSuffix<<"'\n");
+
+  std::string aSourceFileName = GetFileInfo().absFilePath().latin1();
+  BEGMSG(MYDEBUG, "aSourceFileName = '"<<aSourceFileName<<"'\n");    
+  
+  std::string aPrefix = aSourceFileName;
+  VISU::TSubString(aPrefix, ".med") = "";
+  VISU::TSubString(aPrefix, aSuffix) = "";
+  BEGMSG(MYDEBUG, "aPrefix = '"<<aPrefix<<"'\n");    
+  
+  std::string aMultiFileName(aPrefix + "_grains_maitre.med" + aSuffix);
+  BEGMSG(MYDEBUG, "aMultiFileName = '"<<aMultiFileName<<"'\n");    
+
+  {
+    std::ofstream aMultiFileStream(aMultiFileName.c_str());
+    aMultiFileStream<<"# MED file v2.3 - Master file created by VISU\n";
+    aMultiFileStream<<"#\n";
+    aMultiFileStream<<"# [SOURCE]="<<aSourceFileName<<"\n";
+    aMultiFileStream<<"#\n";
+
+    QStringList aPartInfos = QStringList::split("|", VISU::Storable::FindValue(theMap, "myPartInfos"));
+    aMultiFileStream<<aPartInfos.size()<<"\n";
+
+    for(size_t anId = 0, anEnd = aPartInfos.size(); anId < anEnd; anId++){
+      MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aPartInfos[anId].latin1());
+      aPartInfo.myFileName = aPrefix + "_" + aPartInfo.myFileName;
+      INITMSG(MYDEBUG, "aPartInfo.myFileName = '"<<aPartInfo.myFileName<<"'\n");    
+      aMultiFileStream<<aPartInfo<<"\n";
+    }
+  }
+
+  {
+    myMultiprObj.create(aMultiFileName.c_str());
+    BuildParts(this,
+              GetInput(),
+              &myMultiprObj,
+              &myPartInfos,
+              &myPartName2FileName,
+              &myPartName2Resolution,
+              &myMainPart2SubPartNames,
+              &myIsPartsDone,
+              myIsBuildParts,
+              myStudy,
+              false);
+  }
+
+  return this;
+}
+
+
+//---------------------------------------------------------------
+CORBA::Boolean 
+VISU::MultiResult_i
+::IsDone() 
+{
+  return TSuperClass::IsDone() && 
+    (myIsBuildParts? myIsPartsDone: true);
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames* 
+VISU::MultiResult_i
+::GetPartNames(const char* theMeshName)
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  if(!myIsBuildParts)
+    return aResult._retn();
+    
+  MultiResult_i::TPartNames aMeshParts;
+  MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
+  for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+    const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+    if(!IsFullResolution(aPartName))
+      continue;
+
+    MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
+    if(aPartInfo.myMeshName == theMeshName)
+      aMeshParts.push_back(aPartName);
+  }
+
+  if(aMeshParts.empty())
+    return aResult._retn();
+
+  aResult->length(aMeshParts.size());
+  for (size_t aPartID = 0 ; aPartID < aMeshParts.size() ; aPartID++) {
+    const MultiResult_i::TPartName& aPartName = aMeshParts[aPartID];
+    aResult[aPartID] = aPartName.c_str();
+  }
+
+  return aResult._retn();
+}
+
+VISU::Result::Resolutions* 
+VISU::MultiResult_i
+::GetResolutions(const char* theMeshName, 
+                const char* thePartName)
+{
+  VISU::Result::Resolutions_var aResult = new VISU::Result::Resolutions();
+  if(!myIsBuildParts)
+    return aResult._retn();
+
+  MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
+  for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+    const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+    MultiResult_i::TPartName aMainPart = ExtractMainPart(thePartName);
+    if(aMainPart != thePartName)
+      continue;
+
+    MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
+    if(aPartInfo.myMeshName != theMeshName)
+      continue;
+
+    MultiResult_i::TResolutions aResolutions = VISU::GetResolutions(myMainPart2SubPartNames, thePartName);
+    if(aResolutions.empty())
+      return aResult._retn();
+
+    aResult->length(aResolutions.size());
+    MultiResult_i::TResolutions::const_iterator anIter = aResolutions.end();
+    for(size_t anId = 0; anIter != aResolutions.end(); anIter++, anId++){
+      const VISU::Result::Resolution& aResolution = *anIter;
+      aResult[anId] = aResolution;
+    }
+
+    break;
+  }
+
+  return aResult._retn();
+}
+
+VISU::Result::Resolution
+VISU::MultiResult_i
+::GetResolution(const char* theMeshName, 
+               const char* thePartName)
+{
+  TPartName2Resolution::iterator anIter = myPartName2Resolution.find(thePartName);
+  if(anIter == myPartName2Resolution.end())
+    return VISU::Result::HIDDEN;
+
+  const VISU::Result::Resolution& aResolution = anIter->second;
+  return aResolution;
+}
+
+void 
+VISU::MultiResult_i
+::SetResolution(const char* theMeshName, 
+               const char* thePartName, 
+               VISU::Result::Resolution theResolution)
+{
+  if(!IsFullResolution(thePartName))
+    return;
+
+  TPartName2Resolution::iterator anIter = myPartName2Resolution.find(thePartName);
+  if(anIter == myPartName2Resolution.end())
+    return;
+
+  VISU::Result::Resolution& aResolution = anIter->second;
+  if(aResolution == theResolution)
+    return;
+
+  if(theResolution != VISU::Result::HIDDEN){
+    MultiResult_i::TResolutions aResolutions = VISU::GetResolutions(myMainPart2SubPartNames, thePartName);
+    MultiResult_i::TResolutions::iterator anIter = aResolutions.find(theResolution);
+    if(anIter == aResolutions.end())
+      return;
+  }
+
+  VISU::Storable::TRestoringMap aRestoringMap;
+  aRestoringMap["myComment"] = "PART";
+  aRestoringMap["myMeshName"] = theMeshName;
+  aRestoringMap["myName"] = thePartName;
+
+  const VISU::TMeshMap& aMeshMap = Result_i::GetInput()->GetMeshMap();
+  VISU::TMeshMap::const_iterator aMeshIter = aMeshMap.find(theMeshName);
+  if(aMeshIter == aMeshMap.end())
+    return;
+
+  std::string aFatherEntry;
+  const VISU::PMesh& aMesh = aMeshIter->second;
+  if(aMesh->myPartsEntry != "")
+    aFatherEntry = Storable::FindEntry(GetStudyDocument(),
+                                      aMesh->myPartsEntry,
+                                      aRestoringMap);
+  else
+    aFatherEntry = Result_i::GetEntry(aRestoringMap);
+  
+  std::string anIconName = "ICON_MULTIPR_VIEW_HIDE";
+  if(theResolution == VISU::Result::FULL)
+    anIconName = "ICON_MULTIPR_VIEW_FULL";
+  else if(theResolution == VISU::Result::MEDIUM)
+    anIconName = "ICON_MULTIPR_VIEW_MEDIUM";
+  else if(theResolution == VISU::Result::LOW)
+    anIconName = "ICON_MULTIPR_VIEW_LOW";
+
+  _PTR(Study) aStudy = GetStudy();
+  _PTR(SObject) aSObject = aStudy->FindObjectID(aFatherEntry);
+  aRestoringMap = Storable::GetStorableMap(aSObject);
+
+  std::ostrstream anOutputStream;
+  anOutputStream<<"myComment=PART;";
+  anOutputStream<<"myName="<<thePartName<<";";
+  anOutputStream<<"myMeshName="<<theMeshName<<";";
+  anOutputStream<<"myResolutions="<<aRestoringMap["myResolutions"]<<";";
+  anOutputStream<<"myState="<<theResolution;
+  anOutputStream<<ends;
+
+  CreateAttributes(aStudy,
+                  aFatherEntry,
+                  anIconName,
+                  NO_IOR,
+                  NO_NAME,
+                  NO_PERFSITENT_REF,
+                  anOutputStream.str(),
+                  false);
+
+  aResolution = theResolution;
+}
+
+
+//---------------------------------------------------------------
+VISU::MultiResult_i
+::~MultiResult_i()
+{
+  INITMSG(MYDEBUG, "MultiResult_i::~MultiResult_i - this = "<<this<<"\n");
+  if(myIsBuildParts){
+    TRepresentation2Input::iterator anIter = myRepresentation2Input.begin();
+    for ( ; anIter != myRepresentation2Input.end() ; anIter++) {
+      const PInput& anInput = anIter->second;
+      std::string aFileName = anInput->GetName();
+      INITMSG(MYDEBUG, "RemoveFile - aFileName = '"<<aFileName<<"'\n");
+      VISU::RemoveFile(aFileName);
+    }
+    if (GetSourceId() == eRestoredFile) {
+      INITMSG(MYDEBUG, "RemoveFile - myMultiprObj.getMEDFilename = '"<<myMultiprObj.getMEDFilename()<<"'\n");
+      VISU::RemoveFile(myMultiprObj.getMEDFilename());
+      MultiResult_i::TPartNames aPartNames = myMultiprObj.getParts();
+      for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
+       const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
+       MultiResult_i::TPartInfo aPartInfo = GetPartInfo(myMultiprObj, aPartName);
+       INITMSG(MYDEBUG, "RemoveFile - aPartInfo.myFileName = '"<<aPartInfo.myFileName<<"'\n");
+       VISU::RemoveFile(aPartInfo.myFileName);
+      }
+    }
+  }
+}
+
+
+namespace VISU
+{
+  //---------------------------------------------------------------
+  inline
+  void
+  UpdateRepresentationKey(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+                         MultiResult_i::TRepresentationKey& theRepresentationKey,
+                         const std::string& thePartName)
+  {
+    MultiResult_i::TPartName2FileName::const_iterator anIterator = thePartName2FileName.find(thePartName);
+    if (anIterator != thePartName2FileName.end()){
+      const MultiResult_i::TFileName& aFileName = anIterator->second;
+      theRepresentationKey.insert(aFileName);
+    }
+  }
+
+
+  //---------------------------------------------------------------
+  MultiResult_i::TRepresentationKey
+  GetRepresentation(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+                   const MultiResult_i::TPartName2Resolution& thePartName2Resolution)
+  {
+    // name of selected parts
+    MultiResult_i::TRepresentationKey aRepresentationKey;
+
+    // for each part of the mesh
+    MultiResult_i::TPartName2Resolution::const_iterator anIter = thePartName2Resolution.begin();
+    for ( ; anIter != thePartName2Resolution.end() ; anIter++) {
+      const MultiResult_i::TPartName& aPartName = anIter->first;
+      if(IsFullResolution(aPartName)){
+       const VISU::Result::Resolution& aResolution = anIter->second;
+       if(aResolution == VISU::Result::FULL) 
+         UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName);
+       if(aResolution == VISU::Result::MEDIUM) 
+         UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_MED");
+       else if(aResolution == VISU::Result::LOW) 
+         UpdateRepresentationKey(thePartName2FileName, aRepresentationKey, aPartName + "_LOW");
+      }
+    }
+    return aRepresentationKey;
+  }
+
+
+  //---------------------------------------------------------------
+  bool 
+  UseInitialInput(const MultiResult_i::TPartName2FileName& thePartName2FileName,
+                 const MultiResult_i::TPartName2Resolution& thePartName2Resolution)
+  {
+    bool aResult = true;
+    MultiResult_i::TPartName2FileName::const_iterator anIter = thePartName2FileName.begin();
+    for ( ; anIter != thePartName2FileName.end() ; anIter++) {
+      const MultiResult_i::TPartName& aPartName = anIter->first;
+      if(IsFullResolution(aPartName)){
+       MultiResult_i::TPartName2Resolution::const_iterator anIter2 = thePartName2Resolution.find(aPartName);
+       if(anIter2 != thePartName2Resolution.end()){
+         const VISU::Result::Resolution& aResolution = anIter2->second;
+         if(aResolution == VISU::Result::FULL)
+           continue;
+       }
+       aResult = false;
+       break;
+      }
+    }
+    return aResult;
+  }
+}
+
+
+//---------------------------------------------------------------
+VISU::Result_i::PInput
+VISU::MultiResult_i
+::GetInput(const std::string& theMeshName, 
+          VISU::Entity theEntity,
+          const std::string& theFieldName, 
+          CORBA::Long theTimeStampNumber) 
+{
+  if(theEntity == NONE) // If client wants use initial behaviour
+    return TSuperClass::GetInput();
+
+  if(!myIsPartsDone) // If corresponding data is not ready yet
+    return TSuperClass::GetInput();
+
+  //if(UseInitialInput(myPartName2FileName, myPartName2Resolution)) 
+  //  return TSuperClass::GetInput();
+
+  MultiResult_i::TRepresentationKey aRepresentationKey = 
+    GetRepresentation(myPartName2FileName, myPartName2Resolution);
+
+  typedef std::vector<TFileName> TFileNames;
+  TFileNames aFileNames(aRepresentationKey.begin(), aRepresentationKey.end());
+
+  aRepresentationKey.insert( theMeshName );
+  aRepresentationKey.insert( theFieldName );
+
+  TRepresentation2Input::iterator anIter = myRepresentation2Input.find(aRepresentationKey);
+  if(anIter == myRepresentation2Input.end()){
+    INITMSG(MYDEBUG, "MultiResult_i::GetInput - this = "<<this<<"\n");
+    std::string aFileName = SALOMEDS_Tool::GetTmpDir() + "multipr_merge.med";
+    if(MYDEBUG){
+      INITMSG(MYDEBUG, "aFileName = '"<<aFileName<<"':\n");
+      TFileNames::const_iterator anIter = aFileNames.begin();
+      for ( ; anIter != aFileNames.end() ; anIter++) {
+       const MultiResult_i::TFileName& aFileName = *anIter;
+       INITMSG(MYDEBUG, "'"<<aFileName<<"'\n");
+      }
+    }
+    int aRes = false;
+    std::string anErrorMessage("empty mesh");
+    try {
+      INITMSG(MYDEBUG, "theMeshName = '"<<aFileName<<"'; theFieldName = '"<<theFieldName<<"'\n");
+      aRes = multipr::merge(aFileNames, theMeshName.c_str(), theFieldName.c_str(), aFileName.c_str());
+    }catch(std::exception& exc){
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<exc.what());
+      anErrorMessage = exc.what();
+    }catch(multipr::RuntimeException& exc){
+      std::ostringstream aStream;
+      exc.dump(aStream);
+      aStream<<ends;
+      MSG(MYDEBUG,"Follow exception was occured in:\n"<<aStream.str());
+      anErrorMessage = aStream.str();
+    }catch(...){
+      MSG(MYDEBUG,"Unknown exception !!!");
+    }
+    INITMSGA(MYDEBUG, 0, "aRes = "<<aRes<<"\n");
+    if (aRes == 0) {
+      VISU::RemoveFile(aFileName);
+      throw std::runtime_error(anErrorMessage); 
+    }
+    PInput anInput(CreateConvertor(aFileName));
+    anInput->BuildFields();
+    if(myIsBuildMinMax)
+      anInput->BuildMinMax();
+    myRepresentation2Input[aRepresentationKey] = anInput;
+    return anInput;
+  }
+  
+  return anIter->second;
+}
+
+
+#endif // ENABLE_MULTIPR
diff --git a/src/VISU_I/VISU_MultiResult_i.hh b/src/VISU_I/VISU_MultiResult_i.hh
new file mode 100644 (file)
index 0000000..18598c8
--- /dev/null
@@ -0,0 +1,181 @@
+//  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_MultiResult_i.hh
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifndef __VISU_MULTI_RESULT_I_H__
+#define __VISU_MULTI_RESULT_I_H__
+
+#ifndef ENABLE_MULTIPR
+#  define RESULT_CLASS_NAME Result_i
+#else
+#  define RESULT_CLASS_NAME MultiResult_i
+
+#include "VISU_Result_i.hh"
+#include "MULTIPR_Obj.hxx"
+
+#include <set>
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  class MultiResult_i : public virtual Result_i
+  {
+    MultiResult_i(const MultiResult_i&);
+
+  public:
+    typedef Result_i TSuperClass;
+
+    MultiResult_i(SALOMEDS::Study_ptr theStudy,
+                 const ESourceId& theSourceId,
+                 const ECreationId& theCreationId,
+                 CORBA::Boolean theIsBuildImmediately,
+                 CORBA::Boolean theIsBuildFields,
+                 CORBA::Boolean theIsBuildMinMax,
+                 CORBA::Boolean theIsBuildGroups);
+
+    MultiResult_i();
+
+    virtual
+    ~MultiResult_i();
+
+    virtual
+    CORBA::Boolean
+    IsDone();
+
+    virtual
+    VISU::Result::EntityNames* 
+    GetPartNames(const char* theMeshName);
+
+    virtual
+    VISU::Result::Resolutions* 
+    GetResolutions(const char* theMeshName, 
+                  const char* thePartName);
+
+    virtual
+    VISU::Result::Resolution
+    GetResolution(const char* theMeshName, 
+                 const char* thePartName);
+
+    virtual
+    void 
+    SetResolution(const char* theMeshName, 
+                 const char* thePartName, 
+                 VISU::Result::Resolution theResolution);
+
+
+    typedef std::string TPartName;
+    typedef std::vector<TPartName> TPartNames;
+
+    typedef size_t TPartID;
+    typedef std::string TPath;
+    typedef std::string TMeshName;
+
+    struct TPartInfo
+    {
+      TMeshName myMeshName;
+      TPartName myName;
+      TPartID myPartID;
+      TPath myPath;
+      TFileName myFileName;
+    };
+
+    typedef std::map<TFileName, TPartInfo> TPartInfos;
+    TPartInfos myPartInfos;
+
+    typedef std::map<TPartName, TFileName> TPartName2FileName;
+    typedef std::map<TPartName, VISU::Result::Resolution> TPartName2Resolution;
+    typedef std::set<VISU::Result::Resolution> TResolutions;
+
+    typedef std::set<std::string> TRepresentationKey;
+    typedef std::map<TRepresentationKey, PInput> TRepresentation2Input;
+
+    typedef std::set<TPartName> TSubPartNames;
+    typedef std::map<TPartName, TSubPartNames> TMainPart2SubPartNames;
+
+  private:
+    multipr::Obj myMultiprObj;
+    TPartName2FileName myPartName2FileName;
+    TPartName2Resolution myPartName2Resolution;
+    TMainPart2SubPartNames myMainPart2SubPartNames;
+
+    TRepresentation2Input myRepresentation2Input;
+
+  protected:
+    virtual
+    Storable* 
+    Build(SALOMEDS::SObject_ptr theSObject,
+         CORBA::Boolean theIsAtOnce = true) ;
+
+    virtual
+    void
+    BuildDataTree(const std::string& theResultEntry);
+
+  public:
+    virtual 
+    size_t
+    IsPossible();
+
+    virtual
+    Storable* 
+    Create(const char* theFileName);
+
+    virtual 
+    Storable*
+    Restore(SALOMEDS::SObject_ptr theSObject,
+           const Storable::TRestoringMap& theMap,
+           const std::string& thePrefix,
+           CORBA::Boolean theIsMultiFile);
+
+    //---------------------------------------------------------------
+    virtual 
+    bool
+    Save(SALOMEDS::SComponent_ptr theComponent,
+        const std::string& theURL,
+        bool theIsMultiFile,
+        bool theIsASCII,
+        TFileNames& theFileNames,
+        TFileNames& theFiles);
+
+    virtual 
+    CORBA::Boolean 
+    CanCopy(SALOMEDS::SObject_ptr theObject);
+
+    virtual
+    void
+    ToStream(std::ostringstream& theStr);
+
+    virtual
+    PInput
+    GetInput(const std::string& theMeshName = "",
+            VISU::Entity theEntity = VISU::NONE,
+            const std::string& theFieldName = "", 
+            CORBA::Long theTimeStampNumber = -1);
+  };
+
+}
+
+#endif // ENABLE_MULTIPR
+
+#endif // __VISU_MULTI_RESULT_I_H__
index cf2b8ebba293c62fbe84c31903eae2adf9fb12a9..a8de05e67d153a7b2ae860a23d5d6b43e13b1ed1 100644 (file)
@@ -19,6 +19,7 @@
 //
 
 #include "VISU_Plot3D_i.hh"
+#include "VISU_Prs3dUtils.hh"
 
 #include "VISU_Result_i.hh"
 #include "VISU_Plot3DPL.hxx"
@@ -188,6 +189,8 @@ VISU::Plot3D_i
     }
   };
 
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TEvent(GetSpecificPL(),
                              VISU_CutPlanesPL::PlaneOrientation(theOrient),
                              theXAngle,
@@ -228,6 +231,8 @@ VISU::Plot3D_i
 ::SetPlanePosition(CORBA::Double  thePlanePosition,
                   CORBA::Boolean theIsRelative)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_Plot3DPL, vtkFloatingPointType, bool>
                   (GetSpecificPL(), &VISU_Plot3DPL::SetPlanePosition, thePlanePosition, theIsRelative));
 }
@@ -256,6 +261,8 @@ void
 VISU::Plot3D_i
 ::SetScaleFactor(CORBA::Double theScaleFactor)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_Plot3DPL::SetScaleFactor, theScaleFactor));
 }
@@ -275,6 +282,8 @@ void
 VISU::Plot3D_i
 ::SetNbOfContours(CORBA::Long theNb)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, int>
                   (GetSpecificPL(), &VISU_Plot3DPL::SetNumberOfContours, theNb));
 }
@@ -294,6 +303,8 @@ void
 VISU::Plot3D_i
 ::SetContourPrs(CORBA::Boolean theIsContourPrs)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, bool>
                   (GetSpecificPL(), &VISU_Plot3DPL::SetContourPrs, theIsContourPrs));
 }
diff --git a/src/VISU_I/VISU_Prs3dUtils.cc b/src/VISU_I/VISU_Prs3dUtils.cc
new file mode 100644 (file)
index 0000000..f99e784
--- /dev/null
@@ -0,0 +1,75 @@
+//  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_Prs3dUtils.cc
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#include "VISU_Prs3dUtils.hh"
+#include "SalomeApp_Study.h"
+#include "SALOME_Event.hxx"
+
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  TSetModified
+  ::TSetModified(VISU::Prs3d_i* thePrs3d):
+    myPrs3d(thePrs3d)
+  {
+    this->Modified();
+  }
+
+
+  //----------------------------------------------------------------------------
+  TSetModified
+  ::~TSetModified()
+  {
+    struct TEvent: public SALOME_Event
+    {
+      VISU::TSetModified* mySetModified;
+      TEvent(VISU::TSetModified* theSetModified):
+       mySetModified(theSetModified)
+      {}
+    
+      virtual
+      void
+      Execute()
+      {
+       VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d;
+
+       if(!aPrs3d || aPrs3d->GetActorEntry() == "")
+         return;
+       
+       if(aPrs3d->GetMTime() > mySetModified->GetMTime()){
+         if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy())
+           aStudy->Modified();
+       }
+      }
+    };
+
+    ProcessVoidEvent(new TEvent(this));
+  }
+
+
+  //----------------------------------------------------------------------------
+};
diff --git a/src/VISU_I/VISU_Prs3dUtils.hh b/src/VISU_I/VISU_Prs3dUtils.hh
new file mode 100644 (file)
index 0000000..2f4bf8b
--- /dev/null
@@ -0,0 +1,52 @@
+//  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_Prs3dUtils.hh
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifndef __VISU_PRS3D_UTILS_H__
+#define __VISU_PRS3D_UTILS_H__
+
+#include "VISU_Prs3d_i.hh"
+
+#include <vtkTimeStamp.h>
+
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  struct TSetModified: vtkTimeStamp
+  {
+    VISU::Prs3d_i* myPrs3d;
+    
+    TSetModified(VISU::Prs3d_i* thePrs3d);
+    
+    ~TSetModified();
+  };
+
+
+  //----------------------------------------------------------------------------
+}
+
+
+#endif // __VISU_PRS3D_UTILS_H__
index b8edb3a7bd67126549622bd1416d4d16fe24b2f3..0c2acd0b1b351ebc22547ea7c9f81cef8b6b3908 100644 (file)
@@ -24,8 +24,9 @@
 //  Author : Alexey PETROV
 //  Module : VISU
 
-#include "VISU_PipeLine.hxx"
 #include "VISU_Prs3d_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_PipeLine.hxx"
 
 #include "VISU_Result_i.hh"
 #include "VISU_Actor.h"
@@ -65,6 +66,8 @@ VISU::Prs3d_i
 ::SameAs(const Prs3d_i* theOrigin)
 {
   if(Prs3d_i* anOrigin = const_cast<Prs3d_i*>(theOrigin)){
+    VISU::TSetModified aModified(this);
+
     GetPipeLine()->SameAs(anOrigin->GetPipeLine());
     anOrigin->GetOffset(myOffset);
   }
@@ -153,17 +156,16 @@ void
 VISU::Prs3d_i
 ::SetCResult(VISU::Result_i* theResult)
 {
-  VISU::Result_i* aResult = GetCResult();
-  if(aResult != theResult){
-    if(aResult)
-      aResult->Destroy();
-    if(theResult){
-      theResult->Register();
-      SetStudyDocument(theResult->GetStudyDocument());
-    }
-    myResult = theResult;
-    myParamsTime.Modified();
-  }
+  if(GetCResult() == theResult)
+    return;
+
+  if(theResult)
+    SetStudyDocument(theResult->GetStudyDocument());
+  
+  VISU::TSetModified aModified(this);
+  
+  myResult = theResult;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -216,10 +218,13 @@ void
 VISU::Prs3d_i
 ::SetMeshName(const char* theMeshName)
 {
-  if(myMeshName != theMeshName){
-    myMeshName = theMeshName;
-    myParamsTime.Modified();
-  }
+  if(myMeshName == theMeshName)
+    return;
+
+  VISU::TSetModified aModified(this);
+
+  myMeshName = theMeshName;
+  myParamsTime.Modified();
 }
 
 
@@ -248,7 +253,7 @@ VISU::Prs3d_i
 {
   unsigned long int aTime = myParamsTime.GetMTime();
   if(IsPipeLineExists())
-    aTime = std::max(aTime,GetPipeLine()->GetMTime());
+    aTime = std::max(aTime, GetPipeLine()->GetMTime());
   return aTime;
 }
 
index 6419d111df1bd8f63e031e60a39a7d24e2fc58b2..5471eef6e92f292d8ab5a49dedd9138598c88d65 100644 (file)
@@ -50,8 +50,19 @@ class vtkDataSet;
 
 namespace VISU
 {
+  //----------------------------------------------------------------------------
   class Result_i;
 
+
+  //----------------------------------------------------------------------------
+  struct TResultObserver: public virtual boost::signalslib::trackable
+  {
+    virtual
+    void
+    UpdateFromResult(Result_i* theResult) = 0;
+  };
+
+
   //----------------------------------------------------------------------------
   //! Base class for all VTK 3D presentations.
   /*!
@@ -63,11 +74,10 @@ namespace VISU
     - implement basic actor management (CreateActor, UpdateActor, UpdateActors, RemoveActor and RemoveActors);
     - implement common 3D functionality like "clipping planes" and offset.
   */
-  class VISU_I_EXPORT Prs3d_i :
-    public virtual POA_VISU::Prs3d,
-    public virtual SALOME::GenericObj_i,
-    public virtual TActorFactory,
-    public virtual PrsObject_i
+  class VISU_I_EXPORT Prs3d_i : public virtual POA_VISU::Prs3d,
+                               public virtual SALOME::GenericObj_i,
+                               public virtual TActorFactory,
+                               public virtual PrsObject_i
 
   {
     Prs3d_i(const Prs3d_i&);
@@ -267,6 +277,11 @@ namespace VISU
     Handle(SALOME_InteractiveObject)
     GetIO();
 
+    //! Used in derived classes to initilize the IO for actors
+    virtual
+    std::string
+    GetActorEntry();
+
   protected:
     /*! 
       Used in Apply method to get know whether it is possible to create presentation
@@ -304,11 +319,6 @@ namespace VISU
     vtkTimeStamp myUpdateTime;
     vtkTimeStamp myParamsTime;
 
-    //! Used in derived classes to initilize the IO for actors
-    virtual
-    std::string
-    GetActorEntry();
-
   private:
     void
     SetResultEntry(const std::string& theResultEntry);
index 2ebbadd5f93b4534dc3b03d9afcede1c846d621c..b6ab264c9c54cb23f7b0dc44a290db18743717d1 100644 (file)
@@ -56,9 +56,9 @@ VISU::RemovableObject_i
 {
   myName = theName;
   if(theIsUpdateStudyAttr){
-    SALOMEDS::SObject_var aSObject = myStudy->FindObjectID(GetEntry().c_str());
+    SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectID(GetEntry().c_str());
     if(!aSObject->_is_nil()){
-      SALOMEDS::StudyBuilder_var aBuilder = myStudy->NewBuilder();
+      SALOMEDS::StudyBuilder_var aBuilder = GetStudyDocument()->NewBuilder();
       SALOMEDS::GenericAttribute_var anAttr = aBuilder->FindOrCreateAttribute( aSObject, "AttributeName" );
       SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow( anAttr );
       aNameAttr->SetValue( theName.c_str() );
@@ -68,7 +68,7 @@ VISU::RemovableObject_i
 
 
 //---------------------------------------------------------------
-const std::string&
+std::string
 VISU::RemovableObject_i
 ::GetName() const 
 { 
@@ -77,11 +77,20 @@ VISU::RemovableObject_i
 
 
 //---------------------------------------------------------------
-const SALOMEDS::Study_var& 
+SALOMEDS::Study_var
 VISU::RemovableObject_i
 ::GetStudyDocument() const 
 { 
-  return myStudy;
+  return myStudyDocument;
+}
+
+
+//---------------------------------------------------------------
+SalomeApp_Study*
+VISU::RemovableObject_i
+::GetGUIStudy() const 
+{ 
+  return myGUIStudy;
 }
 
 
@@ -90,7 +99,8 @@ void
 VISU::RemovableObject_i
 ::SetStudyDocument(SALOMEDS::Study_ptr theStudy) 
 { 
-  myStudy = SALOMEDS::Study::_duplicate(theStudy);
+  myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
+  myGUIStudy = VISU::GetGUIStudy(theStudy);
 }
 
 
@@ -100,7 +110,7 @@ VISU::RemovableObject_i
 ::GetEntry() 
 { 
   CORBA::String_var anIOR = GetID();
-  SALOMEDS::SObject_var aSObject = myStudy->FindObjectIOR(anIOR.in());
+  SALOMEDS::SObject_var aSObject = GetStudyDocument()->FindObjectIOR(anIOR.in());
   CORBA::String_var anEntry("");
   if(!CORBA::is_nil(aSObject.in()))
     anEntry = aSObject->GetID();
index de524352fd638dbfc3182d84e4020ff596e0c63d..08e95ef88c44db04086e7027d1ecc05217fe6db3 100644 (file)
@@ -41,15 +41,18 @@ namespace VISU
     virtual 
     ~RemovableObject_i();
 
-    const SALOMEDS::Study_var& 
+    SALOMEDS::Study_var
     GetStudyDocument() const;
 
+    SalomeApp_Study* 
+    GetGUIStudy() const;
+
     virtual
     std::string
     GetEntry();
 
     virtual 
-    const std::string&
+    std::string
     GetName() const;
 
     virtual 
@@ -65,7 +68,8 @@ namespace VISU
 
   private:
     std::string myName;
-    SALOMEDS::Study_var myStudy;
+    SalomeApp_Study* myGUIStudy;
+    SALOMEDS::Study_var myStudyDocument;
 
     RemovableObject_i(const RemovableObject_i&);
   };
diff --git a/src/VISU_I/VISU_ResultUtils.cc b/src/VISU_I/VISU_ResultUtils.cc
new file mode 100644 (file)
index 0000000..9f8d37d
--- /dev/null
@@ -0,0 +1,673 @@
+//  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_ResultUtils.cc
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#include "VISU_ResultUtils.hh"
+
+#include "SUIT_Session.h"
+#include "SALOME_Event.hxx"
+#include "SalomeApp_Study.h"
+#include "SalomeApp_Application.h"
+
+#include "VISU_Convertor.hxx"
+#include "VISU_ConvertorUtils.hxx"
+
+#include <qfileinfo.h>
+#include <qfile.h>
+#include <qdir.h>
+
+#include <boost/thread/recursive_mutex.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+
+#ifdef _DEBUG_
+static int MYTIMEDEBUG = 0;
+#else
+static int MYTIMEDEBUG = 0;
+#endif
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  typedef boost::recursive_mutex TMutex;
+  typedef TMutex::scoped_lock TLock;
+
+  static TMutex myMutex;
+
+  //----------------------------------------------------------------------------
+  TResultManager
+  ::TResultManager(Result_i* theResult):
+    myResult(theResult)
+  {
+    myResult->Register();
+  }
+
+
+  //----------------------------------------------------------------------------
+  TResultManager
+  ::~TResultManager()
+  {
+    myResult->Destroy();
+  }
+
+
+  //----------------------------------------------------------------------------
+  TTransactionManager
+  ::TTransactionManager(_PTR(Study) theStudyDocument):
+    myStudyBuilder(theStudyDocument->NewBuilder())
+  {
+    TLock aLock(myMutex);
+    myStudyBuilder->NewCommand();
+  }
+
+
+  //----------------------------------------------------------------------------
+  TTransactionManager
+  ::~TTransactionManager()
+  {
+    TLock aLock(myMutex);
+    myStudyBuilder->CommitCommand();
+  }
+
+
+  //----------------------------------------------------------------------------
+  TUpdateObjBrowser
+  ::TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone):
+    myStudyId(theStudyId),
+    myIsDone(theIsDone)
+  {}
+    
+  
+  //----------------------------------------------------------------------------
+  void
+  TUpdateObjBrowser
+  ::Execute()
+  {
+    TLock aLock(myMutex);
+    SUIT_Session* aSession = SUIT_Session::session();
+    QPtrList<SUIT_Application> anApplications = aSession->applications();
+    QPtrListIterator<SUIT_Application> anIter (anApplications);
+    while (SUIT_Application* aSApp = anIter.current()) {
+      if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
+       if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
+         if (_PTR(Study) aCStudy = aStudy->studyDS()) {
+           if (myStudyId == aCStudy->StudyId()) {
+             TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::updateObjectBrowser");
+             anApp->updateObjectBrowser();
+             *myIsDone = true;
+             break;
+           }
+         }
+       }
+      }
+      ++anIter;
+    }
+  }
+
+
+  //----------------------------------------------------------------------------
+  QString
+  GenerateName(const std::string& theName)
+  {
+    TLock aLock(myMutex);
+
+    typedef std::map<std::string, int> TNameMap;
+    static TNameMap aMap;
+
+    TNameMap::const_iterator anIter = aMap.find(theName);
+    QString aResult;
+    if (anIter == aMap.end()) {
+      aMap[theName] = 0;
+      aResult = theName;
+    } else {
+      aResult = GenerateName(theName,++aMap[theName]);
+    }
+    return aResult;
+  }
+  
+
+  //----------------------------------------------------------------------------
+  bool
+  SplitName(const std::string& theName,
+           std::string& theBase,
+           std::string& theSuffix,
+           char theDelimeter)
+  {
+    size_t aPosition = theName.rfind(theDelimeter);
+    if(aPosition == std::string::npos){
+      theBase = theName;
+      theSuffix = "";
+      return false;
+    }
+
+    theBase = theName.substr(0, aPosition);
+    theSuffix = theName.substr(aPosition);
+    return true;
+  }
+  
+
+  //----------------------------------------------------------------------------
+  std::string
+  MakeFileName(const std::string& theName,
+              const void* thePointer)
+  {
+    std::ostringstream aStream;    
+    aStream<<theName<<":"<<thePointer;
+    return aStream.str();
+  }
+  
+
+  //----------------------------------------------------------------------------
+  QString 
+  GenerateFieldName(const std::string& theName, 
+                   const std::string& theUnits)
+  {
+    QString aName;
+    const string tmp (theUnits.size(),' ');
+    if (theUnits == "" || theUnits == tmp)
+      aName.sprintf("%s, -",theName.c_str());
+    else
+      aName.sprintf("%s, %s",theName.c_str(),theUnits.c_str());
+    aName = aName.simplifyWhiteSpace();
+    return aName.latin1();
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  CreateReference(_PTR(Study) theStudyDocument,
+                 const std::string& theFatherEntry, 
+                 const std::string& theRefEntry)
+  {
+    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+    _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
+    _PTR(SObject) aNewObj = aStudyBuilder->NewObject(aFather);
+    _PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
+    aStudyBuilder->Addreference(aNewObj,aRefSObj);
+  }
+
+
+  //----------------------------------------------------------------------------
+  void 
+  RemoveSObject(_PTR(Study) theStudyDocument,
+               const string& theEntry)
+  {
+    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
+    _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
+    aStudyBuilder->RemoveObject(aSObject);
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildEntities(Result_i* theResult,
+               Result_i::PInput theInput,
+               CORBA::Boolean* theIsDone,
+               const std::string& theResultEntry,
+               CORBA::Boolean theIsAtOnce,
+               CORBA::Boolean theIsBuildGroups,
+               CORBA::Boolean theIsBuildFields,
+               CORBA::Boolean theIsBuildParts,
+               _PTR(Study) theStudy)
+  {
+    if(*theIsDone)
+      return;
+
+    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildEntities");
+    TResultManager aResultManager(theResult);
+    TTransactionManager aTransactionManager(theStudy);
+
+    {
+      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildEntities");
+      theInput->BuildEntities();
+    }
+
+    QString aComment,aTmp;
+    const TMeshMap& aMeshMap = theInput->GetMeshMap();
+    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
+      const string& aMeshName = aMeshMapIter->first;
+      const PMesh& aMesh = aMeshMapIter->second;
+      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+      if(aMeshOnEntityMap.empty()) 
+       continue;
+      aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
+                      aMeshName.c_str(),
+                      aMesh->myDim);
+      aMesh->myEntry = 
+       CreateAttributes(theStudy,
+                        theResultEntry,
+                        NO_ICON,
+                        NO_IOR,
+                        aMeshName,
+                        NO_PERFSITENT_REF,
+                        aComment.latin1(),
+                        true);
+    
+      aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
+                      aMeshName.c_str());
+      std::string aSubMeshesEntry = 
+       CreateAttributes(theStudy,
+                        aMesh->myEntry,
+                        NO_ICON,
+                        NO_IOR,
+                        "Families",
+                        NO_PERFSITENT_REF,
+                        aComment.latin1(),
+                        true);
+
+      if(theIsBuildGroups){
+       aMesh->myGroupsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          NO_ICON,
+                          NO_IOR,
+                          NO_NAME,
+                          NO_PERFSITENT_REF,
+                          NO_COMMENT,
+                          true);
+      }
+       
+      if(theIsBuildFields){
+       aMesh->myFieldsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          NO_ICON,
+                          NO_IOR,
+                          NO_NAME,
+                          NO_PERFSITENT_REF,
+                          NO_COMMENT,
+                          true);
+      }
+
+      if(theIsBuildParts){
+       aMesh->myPartsEntry =
+         CreateAttributes(theStudy,
+                          aMesh->myEntry,
+                          NO_ICON,
+                          NO_IOR,
+                          NO_NAME,
+                          NO_PERFSITENT_REF,
+                          NO_COMMENT,
+                          true);
+      }
+
+      //Import entities
+      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+       const TEntity& anEntity = aMeshOnEntityMapIter->first;
+       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+       
+       string anEntityName;
+       switch(anEntity){
+       case NODE_ENTITY: 
+         anEntityName = "onNodes"; 
+         break;
+       case EDGE_ENTITY: 
+         anEntityName = "onEdges"; 
+         break;
+       case FACE_ENTITY: 
+         anEntityName = "onFaces"; 
+         break;
+       case CELL_ENTITY: 
+         anEntityName = "onCells"; 
+         break;
+       default:
+       continue;
+       }
+       
+       aComment.sprintf("myComment=ENTITY;myMeshName=%s;myId=%d",
+                        aMeshName.c_str(),
+                        anEntity);
+       
+       aMeshOnEntity->myEntry = 
+         CreateAttributes(theStudy, 
+                          aSubMeshesEntry, 
+                          NO_ICON,
+                          NO_IOR,
+                          anEntityName.c_str(),
+                          NO_PERFSITENT_REF,
+                          aComment.latin1(), 
+                          true);
+      }
+    }
+    
+    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildGroups(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
+             _PTR(Study) theStudy)
+  {
+    if(!theIsBuild || *theIsDone)
+      return;
+
+    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildGroups");
+    TResultManager aResultManager(theResult);
+    TTransactionManager aTransactionManager(theStudy);
+    
+    {
+      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildGroups");
+      theInput->BuildGroups();
+    }
+
+    QString aComment,aTmp;
+    const TMeshMap& aMeshMap = theInput->GetMeshMap();
+    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
+      const string& aMeshName = aMeshMapIter->first;
+      const PMesh& aMesh = aMeshMapIter->second;
+      
+      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+      if(aMeshOnEntityMap.empty()) 
+       continue;
+      
+      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
+       const TEntity& anEntity = aMeshOnEntityMapIter->first;
+       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+       
+       const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+       TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
+       for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
+         const string& aFamilyName = aFamilyMapIter->first;
+         const PFamily& aFamily = aFamilyMapIter->second;
+         aComment.sprintf("myComment=FAMILY;myMeshName=%s;myEntityId=%d;myName=%s",
+                          aMeshName.c_str(),
+                          anEntity,
+                          aFamilyName.c_str());
+         
+         aFamily->myEntry =
+           CreateAttributes(theStudy,
+                            aMeshOnEntity->myEntry,
+                            NO_ICON,
+                            NO_IOR,
+                            aFamilyName,
+                            NO_PERFSITENT_REF,
+                            aComment.latin1(),
+                            true);
+       }
+      }
+      //Importing groups
+      const TGroupMap& aGroupMap = aMesh->myGroupMap;
+      if(!aGroupMap.empty()){
+       aComment.sprintf("myComment=GROUPS;myMeshName=%s",
+                        aMeshName.c_str());
+       
+       CreateAttributes(theStudy,
+                        aMesh->myGroupsEntry,
+                        NO_ICON,
+                        NO_IOR,
+                        "Groups",
+                        NO_PERFSITENT_REF,
+                        aComment.latin1(),
+                        false);
+
+       TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+       for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+         const string& aGroupName = aGroupMapIter->first;
+         const PGroup& aGroup = aGroupMapIter->second;
+         aComment.sprintf("myComment=GROUP;myMeshName=%s;myName=%s",
+                          aMeshName.c_str(),
+                          aGroupName.c_str());
+         aGroup->myEntry = 
+           CreateAttributes(theStudy,
+                            aMesh->myGroupsEntry,
+                            NO_ICON,
+                            NO_IOR,
+                            aGroupName,
+                            NO_PERFSITENT_REF,
+                            aComment.latin1(),
+                            true);
+         const TFamilySet& aFamilySet = aGroup->myFamilySet;
+         TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
+         for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
+           const PFamily& aFamily = *aFamilyIter;
+           CreateReference(theStudy,
+                           aGroup->myEntry,
+                           aFamily->myEntry);
+         }
+       }
+      }else if(!theIsAtOnce)
+       RemoveSObject(theStudy,
+                     aMesh->myGroupsEntry);
+    }
+    
+    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildFields(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
+             _PTR(Study) theStudy)
+  {
+    if(!theIsBuild || *theIsDone)
+      return;
+
+    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildFields");
+    TResultManager aResultManager(theResult);
+    TTransactionManager aTransactionManager(theStudy);
+
+    {
+      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildFields");
+      theInput->BuildFields();
+    }
+
+    QString aComment,aTmp;
+    const TMeshMap& aMeshMap = theInput->GetMeshMap();
+    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
+
+    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++)
+    {
+      const string& aMeshName = aMeshMapIter->first;
+      const PMesh& aMesh = aMeshMapIter->second;
+
+      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+      if(aMeshOnEntityMap.empty()) 
+       continue;
+
+      //Import fields
+      bool anIsFieldsEntryUpdated = false;
+      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
+
+      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
+      {
+       const TEntity& anEntity = aMeshOnEntityMapIter->first;
+       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
+       const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+       TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
+
+       for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
+       {
+         if(!anIsFieldsEntryUpdated)
+         {
+           aComment = "";
+           aComment.append("myComment=FIELDS;");
+           aComment.append("myMeshName=");aComment.append(aMeshName);
+
+           CreateAttributes(theStudy,
+                            aMesh->myFieldsEntry,
+                            NO_ICON,
+                            NO_IOR,
+                            "Fields",
+                            NO_PERFSITENT_REF,
+                            aComment.latin1(),
+                            false);
+
+           anIsFieldsEntryUpdated = true;
+         }
+
+         const string& aFieldName = aFieldMapIter->first;
+         const PField& aField = aFieldMapIter->second;
+         const TValField& aValField = aField->myValField;
+         QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
+         aComment.sprintf("myComment=FIELD;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
+                          aMeshName.c_str(),
+                          anEntity,
+                          aFieldName.c_str(),
+                          aValField.size(),
+                          aField->myNbComp);
+         
+         aField->myEntry = CreateAttributes(theStudy,
+                                            aMesh->myFieldsEntry,
+                                            NO_ICON,
+                                            NO_IOR,
+                                            aFieldNameWithUnit.latin1(),
+                                            NO_PERFSITENT_REF,
+                                            aComment.latin1(),
+                                            true);
+
+         CreateReference(theStudy,
+                         aField->myEntry,
+                         aMeshOnEntity->myEntry);
+
+         TValField::const_iterator aValFieldIter = aValField.begin();
+
+         for(; aValFieldIter != aValField.end(); aValFieldIter++)
+         {
+           int aTimeStamp = aValFieldIter->first;
+           const PValForTime& aValForTime = aValFieldIter->second;
+           aComment.sprintf("myComment=TIMESTAMP;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
+                            aMeshName.c_str(),
+                            anEntity,
+                            aFieldName.c_str(),
+                            aTimeStamp,
+                            aField->myNbComp);
+
+           string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
+
+           aValForTime->myEntry = CreateAttributes(theStudy,
+                                                   aField->myEntry,
+                                                   NO_ICON,
+                                                   NO_IOR,
+                                                   aTimeStampId,
+                                                   NO_PERFSITENT_REF,
+                                                   aComment.latin1(),
+                                                   true);
+         }
+       }
+      }
+
+      if(!anIsFieldsEntryUpdated && !theIsAtOnce)
+       RemoveSObject(theStudy, aMesh->myFieldsEntry);
+    }
+
+    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildMinMax(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild)
+  {
+    if(!theIsBuild || *theIsDone)
+      return;
+
+    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildMinMax");
+    TResultManager aResultManager(theResult);
+    
+    theInput->BuildMinMax();
+
+    *theIsDone = true;
+
+    theResult->UpdateObservers();
+  }
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildFieldDataTree(Result_i* theResult,
+                    Result_i::PInput theInput,
+                    CORBA::Boolean* theIsFieldsDone,
+                    CORBA::Boolean theIsBuildFields,
+                    CORBA::Boolean* theIsMinMaxDone,
+                    CORBA::Boolean theIsBuildMinMax,
+                    _PTR(Study) theStudy)
+  {
+    BuildFields(theResult,
+               theInput,
+               theIsFieldsDone,
+               theIsBuildFields,
+               false,
+               theStudy);
+
+    BuildMinMax(theResult,
+               theInput,
+               theIsMinMaxDone,
+               theIsBuildMinMax);
+  }
+
+
+  //----------------------------------------------------------------------------
+  bool
+  RemoveFile(const std::string& theFileName,
+            bool theRemoveEmptyDir)
+  {
+    QFileInfo aFileInfo(theFileName);
+    QFile(aFileInfo.absFilePath()).remove();
+    
+    if(theRemoveEmptyDir)
+      QDir().rmdir(aFileInfo.dirPath(TRUE));
+
+    return aFileInfo.exists();
+  }
+
+
+  //----------------------------------------------------------------------------
+  bool
+  CopyFile(const std::string& theSourceFileName,
+          const std::string& theTargetFileName)
+  {
+    QFileInfo aSourceFileInfo(theSourceFileName);
+    QFileInfo aTargetFileInfo(theTargetFileName);
+    if(aSourceFileInfo.absFilePath() == aTargetFileInfo.absFilePath())
+      return true;
+
+    QString aCommand;
+    aCommand.sprintf("%s %s %s",
+                    COPY_COMMAND,
+                    aSourceFileInfo.filePath().latin1(),
+                    aTargetFileInfo.filePath().latin1());
+
+    return system(aCommand.latin1()) == 0;
+  }
+
+
+  //----------------------------------------------------------------------------
+}
diff --git a/src/VISU_I/VISU_ResultUtils.hh b/src/VISU_I/VISU_ResultUtils.hh
new file mode 100644 (file)
index 0000000..357dfd4
--- /dev/null
@@ -0,0 +1,156 @@
+//  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_ResultUtils.hh
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifndef __VISU_RESULT_UTILS_H__
+#define __VISU_RESULT_UTILS_H__
+
+#include "VISU_Result_i.hh"
+#include "SALOME_Event.hxx"
+
+#include <set>
+
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  struct TUpdateObjBrowser: public SALOME_Event
+  {
+    int myStudyId;
+    CORBA::Boolean* myIsDone;
+    TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone);
+
+    virtual
+    void
+    Execute();
+  };
+
+
+  //----------------------------------------------------------------------------
+  struct TResultManager
+  {
+    Result_i* myResult;
+
+    TResultManager(Result_i* theResult);
+
+    ~TResultManager();
+  };
+
+
+  //----------------------------------------------------------------------------
+  struct TTransactionManager
+  {
+    _PTR(StudyBuilder) myStudyBuilder;
+
+    TTransactionManager(_PTR(Study) theStudyDocument);
+
+    ~TTransactionManager();
+  };
+
+
+  //----------------------------------------------------------------------------
+  QString
+  GenerateName(const std::string& theName);
+
+
+  //----------------------------------------------------------------------------
+  bool
+  SplitName(const std::string& theName,
+           std::string& theBase,
+           std::string& theSuffix,
+           char theDelimeter = ':');
+
+
+  //----------------------------------------------------------------------------
+  std::string
+  MakeFileName(const std::string& theName,
+              const void* thePointer);
+    
+    
+  //----------------------------------------------------------------------------
+  void
+  BuildEntities(Result_i* theResult,
+               Result_i::PInput theInput,
+               CORBA::Boolean* theIsDone,
+               const std::string& theResultEntry,
+               CORBA::Boolean theIsAtOnce,
+               CORBA::Boolean theIsBuildGroups,
+               CORBA::Boolean theIsBuildFields,
+               CORBA::Boolean theIsBuildParts,
+               _PTR(Study) theStudy);
+
+  
+  //----------------------------------------------------------------------------
+  void
+  BuildGroups(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
+             _PTR(Study) theStudy);
+
+  
+  //----------------------------------------------------------------------------
+  void
+  BuildFields(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild,
+             CORBA::Boolean theIsAtOnce,
+             _PTR(Study) theStudy);
+
+  
+  //----------------------------------------------------------------------------
+  void
+  BuildMinMax(Result_i* theResult,
+             Result_i::PInput theInput,
+             CORBA::Boolean* theIsDone,
+             CORBA::Boolean theIsBuild);
+
+
+  //----------------------------------------------------------------------------
+  void
+  BuildFieldDataTree(Result_i* theResult,
+                    Result_i::PInput theInput,
+                    CORBA::Boolean* theIsFieldsDone,
+                    CORBA::Boolean theIsBuildFields,
+                    CORBA::Boolean* theIsMinMaxDone,
+                    CORBA::Boolean theIsBuildMinMax,
+                    _PTR(Study) theStudy);
+
+  //----------------------------------------------------------------------------
+  bool
+  RemoveFile(const std::string& theFileName,
+            bool theRemoveEmptyDir = true);
+
+  //----------------------------------------------------------------------------
+  bool
+  CopyFile(const std::string& theSourceFileName,
+          const std::string& theTargetFileName);
+
+  //----------------------------------------------------------------------------
+}
+
+
+#endif // __VISU_RESULT_UTILS_H__
index 162842b96d4f44189266d565a6d1776215fc5f46..d7af2d036035ef2b7dc7048affb2477619f187ee 100644 (file)
@@ -24,7 +24,9 @@
 //  Author : Alexey PETROV
 //  Module : VISU
 
-#include "VISU_Result_i.hh"
+#include "VISU_MultiResult_i.hh"
+#include "VISU_ResultUtils.hh"
+#include "VISU_Prs3d_i.hh"
 
 #include "VISU_Convertor_impl.hxx"
 #include "VISU_CorbaMedConvertor.hxx"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Application.h"
 
-#include <boost/thread/recursive_mutex.hpp>
 #include <boost/thread/thread.hpp>
-
-#include <boost/thread/mutex.hpp>
 #include <boost/bind.hpp>
 
 // QT Includes
 // OCCT Includes
 #include <Bnd_Box.hxx>
 
-#ifdef ENABLE_MULTIPR
-// MULTIPR
-#include "MULTIPR_Obj.hxx"
-#endif
-
-using namespace VISU;
-using namespace std;
-
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
-static int MYTIMEDEBUG = 0;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
-static int MYTIMEDEBUG = 0;
 #endif
 
 
@@ -82,7 +71,7 @@ namespace VISU
 {
   //---------------------------------------------------------------
   Result_var 
-  FindResult (SALOMEDS::SObject_ptr theSObject)
+  FindResult(SALOMEDS::SObject_ptr theSObject)
   {
     SALOMEDS::SComponent_var aSComponent = theSObject->GetFatherComponent();
     SALOMEDS::SObject_var aFather = theSObject->GetFather();
@@ -117,85 +106,7 @@ namespace VISU
 
 
   //---------------------------------------------------------------
-  typedef boost::recursive_mutex TMutex;
-  typedef TMutex::scoped_lock TLock;
-
-  static TMutex myMutex;
-
-  //---------------------------------------------------------------
-  struct TGetStudy: public SALOME_Event
-  {
-    typedef _PTR(Study) TResult;
-    TResult myResult;
-    int myStudyId;
-
-    TGetStudy(const int theStudyId):
-      myStudyId(theStudyId)
-    {}
-    
-    virtual
-    void
-    Execute()
-    {
-      SUIT_Session* aSession = SUIT_Session::session();
-      QPtrList<SUIT_Application> anApplications = aSession->applications();
-      QPtrListIterator<SUIT_Application> anIter (anApplications);
-      while (SUIT_Application* aSApp = anIter.current()) {
-       if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
-         if(SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
-           if(_PTR(Study) aStudyDS = aStudy->studyDS()){
-             if(aStudyDS->StudyId() == myStudyId){
-               myResult = aStudy->studyDS();
-               break;
-             }
-           }
-         }
-       }
-       ++anIter;
-      }
-    }
-  };
-
-
-  //---------------------------------------------------------------
-  QString
-  GenerateName (const std::string& theName)
-  {
-    TLock aLock(myMutex);
-
-    typedef map<string,int> TNameMap;
-    static TNameMap aMap;
-
-    TNameMap::const_iterator i = aMap.find(theName);
-    QString tmp;
-    if (i == aMap.end()) {
-      aMap[theName] = 0;
-      tmp = theName;
-    } else {
-      tmp = GenerateName(theName,++aMap[theName]);
-    }
-    if(MYDEBUG) MESSAGE("GenerateName - "<<tmp<<" from - "<<theName<<"; " <<aMap[theName]);
-    return tmp;
-  }
-  
-
-  //---------------------------------------------------------------
-  QString 
-  GenerateFieldName (const string& theName, const string& theUnits)
-  {
-    QString aName;
-    const string tmp (theUnits.size(),' ');
-    if (theUnits == "" || theUnits == tmp)
-      aName.sprintf("%s, -",theName.c_str());
-    else
-      aName.sprintf("%s, %s",theName.c_str(),theUnits.c_str());
-    aName = aName.simplifyWhiteSpace();
-    return aName.latin1();
-  }
-
-
-  //---------------------------------------------------------------
-  string
+  std::string
   GetComponentDataType (SALOMEDS::SObject_ptr theSObject)
   {
     SALOMEDS::SComponent_var aCompRefSObj = theSObject->GetFatherComponent();
@@ -218,858 +129,7 @@ namespace VISU
   }
 
 
-  //---------------------------------------------------------------
-  void
-  CreateReference (_PTR(Study) theStudyDocument,
-                  const string& theFatherEntry, 
-                  const string& theRefEntry)
-  {
-    TLock aLock(myMutex);
-
-    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
-    _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
-    _PTR(SObject) aNewObj = aStudyBuilder->NewObject(aFather);
-    _PTR(SObject) aRefSObj = theStudyDocument->FindObjectID(theRefEntry);
-    aStudyBuilder->Addreference(aNewObj,aRefSObj);
-  }
-
-
-  //---------------------------------------------------------------
-  inline
-  std::string 
-  CreateAttributes(_PTR(Study) theStudyDocument,
-                  const string& theFatherEntry, 
-                  const string& theIOR, 
-                  const string& theName,
-                  const string& theComment,
-                  CORBA::Boolean theCreateNew,
-                  const string& theIcon = "")
-  {
-    TLock aLock(myMutex);
-
-    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
-    _PTR(SObject) aFather = theStudyDocument->FindObjectID(theFatherEntry);
-
-    _PTR(SObject) aNewObj;
-    if(theCreateNew)
-      aNewObj = aStudyBuilder->NewObject(aFather);
-    else
-      aNewObj = aFather;
-
-    _PTR(GenericAttribute) anAttr;
-    if (theIOR != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeIOR");
-      _PTR(AttributeIOR) anIOR (anAttr);
-      anIOR->SetValue(theIOR);
-    }
-    if (theName != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeName");
-      _PTR(AttributeName) aName (anAttr);
-      aName->SetValue(theName);
-    }
-    if (theComment != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributeString");
-      _PTR(AttributeString) aCmnt (anAttr);
-      aCmnt->SetValue(theComment);
-    }
-    // MULTIPR
-    if (theIcon != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aNewObj, "AttributePixMap");
-      _PTR(AttributePixMap) aPixmap (anAttr);
-      aPixmap->SetPixMap(theIcon.c_str());
-    }
-    return aNewObj->GetID();
-  }
-
-
-  //---------------------------------------------------------------
-  inline
-  void 
-  UpdateAttributes(_PTR(Study) theStudyDocument,
-                  const string& theEntry,
-                  const string& theIOR, 
-                  const string& theName,
-                  const string& theComment)
-  {
-    TLock aLock(myMutex);
-
-    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
-    _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
-
-    _PTR(GenericAttribute) anAttr;
-    if (theIOR != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeIOR");
-      _PTR(AttributeIOR) anIOR (anAttr);
-      anIOR->SetValue(theIOR);
-    }
-    if (theName != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeName");
-      _PTR(AttributeName) aName (anAttr);
-      aName->SetValue(theName);
-    }
-    if (theComment != "") {
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
-      _PTR(AttributeString) aCmnt (anAttr);
-      aCmnt->SetValue(theComment);
-    }
-  }
-
-
-  //---------------------------------------------------------------
-  inline
-  void 
-  RemoveSObject(_PTR(Study) theStudyDocument,
-                  const string& theEntry)
-  {
-    TLock aLock(myMutex);
-
-    _PTR(StudyBuilder) aStudyBuilder = theStudyDocument->NewBuilder();
-    _PTR(SObject) aSObject = theStudyDocument->FindObjectID(theEntry);
-    aStudyBuilder->RemoveObject(aSObject);
-  }
-
-
-  //---------------------------------------------------------------
-  struct TResultManager
-  {
-    Result_i* myResult;
-
-    TResultManager(Result_i* theResult):
-      myResult(theResult)
-    {
-      myResult->Register();
-    }
-
-    ~TResultManager()
-    {
-      myResult->Destroy();
-    }
-  };
-
-
-  //---------------------------------------------------------------
-  struct TTransactionManager
-  {
-    _PTR(StudyBuilder) myStudyBuilder;
-
-    TTransactionManager(_PTR(Study) theStudyDocument):
-      myStudyBuilder(theStudyDocument->NewBuilder())
-    {
-      TLock aLock(myMutex);
-      myStudyBuilder->NewCommand();
-    }
-
-    ~TTransactionManager()
-    {
-      TLock aLock(myMutex);
-      myStudyBuilder->CommitCommand();
-    }
-  };
-
-
-  //---------------------------------------------------------------
-  struct TUpdateObjBrowser: public SALOME_Event
-  {
-    int myStudyId;
-    CORBA::Boolean* myIsDone;
-    TUpdateObjBrowser(const int theStudyId,
-                     CORBA::Boolean* theIsDone):
-      myStudyId(theStudyId),
-      myIsDone(theIsDone)
-    {}
-    
-    virtual
-    void
-    Execute()
-    {
-      TLock aLock(myMutex);
-      SUIT_Session* aSession = SUIT_Session::session();
-      QPtrList<SUIT_Application> anApplications = aSession->applications();
-      QPtrListIterator<SUIT_Application> anIter (anApplications);
-      while (SUIT_Application* aSApp = anIter.current()) {
-       if(SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>(aSApp)){
-         if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(anApp->activeStudy())) {
-           if (_PTR(Study) aCStudy = aStudy->studyDS()) {
-             if (myStudyId == aCStudy->StudyId()) {
-               TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::updateObjectBrowser");
-               anApp->updateObjectBrowser();
-               *myIsDone = true;
-               break;
-             }
-           }
-         }
-       }
-       ++anIter;
-      }
-    }
-  };
-
-
-  //---------------------------------------------------------------
-  void
-  BuildEntities(Result_i* theResult,
-               VISU_Convertor* theInput,
-               CORBA::Boolean* theIsDone,
-               std::string theResultEntry,
-               CORBA::Boolean theIsAtOnce,
-               CORBA::Boolean theIsBuildGroups,
-               CORBA::Boolean theIsBuildFields,
-               _PTR(Study) theStudy)
-  {
-    if(*theIsDone)
-      return;
-
-    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildEntities");
-    TResultManager aResultManager(theResult);
-    TTransactionManager aTransactionManager(theStudy);
-
-    {
-      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildEntities");
-      theInput->BuildEntities();
-    }
-
-    QString aComment,aTmp;
-    const TMeshMap& aMeshMap = theInput->GetMeshMap();
-    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
-      const string& aMeshName = aMeshMapIter->first;
-      const PMesh& aMesh = aMeshMapIter->second;
-      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-      if(aMeshOnEntityMap.empty()) 
-       continue;
-      aComment.sprintf("myComment=MESH;myName=%s;myDim=%d",
-                      aMeshName.c_str(),
-                      aMesh->myDim);
-      aMesh->myEntry = 
-       CreateAttributes(theStudy,
-                        theResultEntry,
-                        "",
-                        aMeshName,
-                        aComment.latin1(),
-                        true);
-    
-      aComment.sprintf("myComment=FAMILIES;myMeshName=%s",
-                      aMeshName.c_str());
-      string aSubMeshesEntry = 
-       CreateAttributes(theStudy,
-                        aMesh->myEntry,
-                        "",
-                        "Families",
-                        aComment.latin1(),
-                        true);
-
-      if(theIsBuildGroups){
-       aMesh->myGroupsEntry =
-         CreateAttributes(theStudy,
-                          aMesh->myEntry,
-                          "",
-                          "",
-                          "",
-                          true);
-      }
-       
-      if(theIsBuildFields){
-       aMesh->myFieldsEntry =
-         CreateAttributes(theStudy,
-                          aMesh->myEntry,
-                          "",
-                          "",
-                          "",
-                          true);
-      }
-
-#ifdef ENABLE_MULTIPR
-      // MULTIPR
-      aMesh->myPartsEntry =
-       CreateAttributes(theStudy,
-                        aMesh->myEntry,
-                        "",
-                        "",
-                        "",
-                        true);
-#endif
-
-      //Import entities
-      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
-       const TEntity& anEntity = aMeshOnEntityMapIter->first;
-       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-       
-       string anEntityName;
-       switch(anEntity){
-       case NODE_ENTITY: 
-         anEntityName = "onNodes"; 
-         break;
-       case EDGE_ENTITY: 
-         anEntityName = "onEdges"; 
-         break;
-       case FACE_ENTITY: 
-         anEntityName = "onFaces"; 
-         break;
-       case CELL_ENTITY: 
-         anEntityName = "onCells"; 
-         break;
-       default:
-       continue;
-       }
-       
-       aComment.sprintf("myComment=ENTITY;myMeshName=%s;myId=%d",
-                        aMeshName.c_str(),
-                        anEntity);
-       
-       aMeshOnEntity->myEntry = 
-         CreateAttributes(theStudy, 
-                          aSubMeshesEntry, 
-                          "", 
-                          anEntityName.c_str(), 
-                          aComment.latin1(), 
-                          true);
-      }
-    }
-    
-    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
-  }
-
-  //---------------------------------------------------------------
-  void
-  BuildGroups(Result_i* theResult,
-             VISU_Convertor* theInput,
-             CORBA::Boolean* theIsDone,
-             CORBA::Boolean theIsBuild,
-             CORBA::Boolean theIsAtOnce,
-             _PTR(Study) theStudy)
-  {
-    if(!theIsBuild || *theIsDone)
-      return;
-
-    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildGroups");
-    TResultManager aResultManager(theResult);
-    TTransactionManager aTransactionManager(theStudy);
-    
-    {
-      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildGroups");
-      theInput->BuildGroups();
-    }
-
-    QString aComment,aTmp;
-    const TMeshMap& aMeshMap = theInput->GetMeshMap();
-    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++){
-      const string& aMeshName = aMeshMapIter->first;
-      const PMesh& aMesh = aMeshMapIter->second;
-      
-      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-      if(aMeshOnEntityMap.empty()) 
-       continue;
-      
-      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
-       const TEntity& anEntity = aMeshOnEntityMapIter->first;
-       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-       
-       const TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
-       TFamilyMap::const_iterator aFamilyMapIter = aFamilyMap.begin();
-       for(; aFamilyMapIter != aFamilyMap.end(); aFamilyMapIter++){
-         const string& aFamilyName = aFamilyMapIter->first;
-         const PFamily& aFamily = aFamilyMapIter->second;
-         aComment.sprintf("myComment=FAMILY;myMeshName=%s;myEntityId=%d;myName=%s",
-                          aMeshName.c_str(),
-                          anEntity,
-                          aFamilyName.c_str());
-         
-         aFamily->myEntry =
-           CreateAttributes(theStudy,
-                            aMeshOnEntity->myEntry,
-                            "",
-                            aFamilyName,
-                            aComment.latin1(),
-                            true);
-       }
-      }
-      //Importing groups
-      const TGroupMap& aGroupMap = aMesh->myGroupMap;
-      if(!aGroupMap.empty()){
-       aComment.sprintf("myComment=GROUPS;myMeshName=%s",
-                        aMeshName.c_str());
-       
-       UpdateAttributes(theStudy,
-                        aMesh->myGroupsEntry,
-                        "",
-                        "Groups",
-                        aComment.latin1());
-
-       TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
-       for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
-         const string& aGroupName = aGroupMapIter->first;
-         const PGroup& aGroup = aGroupMapIter->second;
-         aComment.sprintf("myComment=GROUP;myMeshName=%s;myName=%s",
-                          aMeshName.c_str(),
-                          aGroupName.c_str());
-         aGroup->myEntry = 
-           CreateAttributes(theStudy,
-                            aMesh->myGroupsEntry,
-                            "",
-                            aGroupName,
-                            aComment.latin1(),
-                            true);
-         const TFamilySet& aFamilySet = aGroup->myFamilySet;
-         TFamilySet::const_iterator aFamilyIter = aFamilySet.begin();
-         for(; aFamilyIter != aFamilySet.end(); aFamilyIter++){
-           const PFamily& aFamily = *aFamilyIter;
-           CreateReference(theStudy,
-                           aGroup->myEntry,
-                           aFamily->myEntry);
-         }
-       }
-      }else if(!theIsAtOnce)
-       RemoveSObject(theStudy,
-                     aMesh->myGroupsEntry);
-    }
-    
-    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
-  }
-
-
-  //---------------------------------------------------------------
-  void BuildFields(
-       Result_i* theResult,
-       VISU_Convertor* theInput,
-       CORBA::Boolean* theIsDone,
-       CORBA::Boolean theIsBuild,
-       CORBA::Boolean theIsAtOnce,
-       _PTR(Study) theStudy)
-  {
-    if(!theIsBuild || *theIsDone)
-      return;
-
-    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildFields");
-    TResultManager aResultManager(theResult);
-    TTransactionManager aTransactionManager(theStudy);
-
-    {
-      TTimerLog aTimerLog(MYTIMEDEBUG,"theInput->BuildFields");
-      theInput->BuildFields();
-    }
-
-    QString aComment,aTmp;
-    const TMeshMap& aMeshMap = theInput->GetMeshMap();
-    TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-
-    for(; aMeshMapIter != aMeshMap.end(); aMeshMapIter++)
-    {
-      const string& aMeshName = aMeshMapIter->first;
-      const PMesh& aMesh = aMeshMapIter->second;
-
-      const TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
-      if(aMeshOnEntityMap.empty()) 
-       continue;
-
-      //Import fields
-      bool anIsFieldsEntryUpdated = false;
-      TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
-
-      for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++)
-      {
-       const TEntity& anEntity = aMeshOnEntityMapIter->first;
-       const PMeshOnEntity& aMeshOnEntity = aMeshOnEntityMapIter->second;
-       const TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
-       TFieldMap::const_iterator aFieldMapIter = aFieldMap.begin();
-
-       for(; aFieldMapIter != aFieldMap.end(); aFieldMapIter++)
-       {
-         if(!anIsFieldsEntryUpdated)
-         {
-           aComment = "";
-           aComment.append("myComment=FIELDS;");
-           aComment.append("myMeshName=");aComment.append(aMeshName);
-
-           UpdateAttributes(
-                            theStudy,
-                            aMesh->myFieldsEntry,
-                            "",
-                            "Fields",
-                            aComment.latin1());
-
-           anIsFieldsEntryUpdated = true;
-         }
-
-         const string& aFieldName = aFieldMapIter->first;
-         const PField& aField = aFieldMapIter->second;
-         const TValField& aValField = aField->myValField;
-         QString aFieldNameWithUnit = GenerateFieldName(aFieldName,aField->myUnitNames[0]);
-         aComment.sprintf("myComment=FIELD;myMeshName=%s;myEntityId=%d;myName=%s;myNbTimeStamps=%d;myNumComponent=%d",
-                          aMeshName.c_str(),
-                          anEntity,
-                          aFieldName.c_str(),
-                          aValField.size(),
-                          aField->myNbComp);
-         
-         aField->myEntry = CreateAttributes(
-                                            theStudy,
-                                            aMesh->myFieldsEntry,
-                                            "",
-                                            aFieldNameWithUnit.latin1(),
-                                            aComment.latin1(),
-                                            true);
-
-         CreateReference(
-                         theStudy,
-                         aField->myEntry,
-                         aMeshOnEntity->myEntry);
-
-         TValField::const_iterator aValFieldIter = aValField.begin();
-
-         for(; aValFieldIter != aValField.end(); aValFieldIter++)
-         {
-           int aTimeStamp = aValFieldIter->first;
-           const PValForTime& aValForTime = aValFieldIter->second;
-           aComment.sprintf("myComment=TIMESTAMP;myMeshName=%s;myEntityId=%d;myFieldName=%s;myTimeStampId=%d;myNumComponent=%d",
-                            aMeshName.c_str(),
-                            anEntity,
-                            aFieldName.c_str(),
-                            aTimeStamp,
-                            aField->myNbComp);
-
-           string aTimeStampId = VISU_Convertor::GenerateName(aValForTime->myTime);
-
-           aValForTime->myEntry = CreateAttributes(
-                                                   theStudy,
-                                                   aField->myEntry,
-                                                   "",
-                                                   aTimeStampId,
-                                                   aComment.latin1(),
-                                                   true);
-         }
-       }
-      }
-
-      if(!anIsFieldsEntryUpdated && !theIsAtOnce)
-       RemoveSObject(theStudy, aMesh->myFieldsEntry);
-    }
-
-    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
-  }
-
-
-#ifdef ENABLE_MULTIPR
-  // MULTIPR
-  void BuildParts (Result_i* theResult,
-                  VISU_Convertor* theInput,
-                  CORBA::Boolean* theIsDone,
-                  CORBA::Boolean theIsBuild,
-                  CORBA::Boolean theIsAtOnce,
-                  _PTR(Study) theStudy)
-  {
-    if(!theIsBuild || *theIsDone)
-      return;
-
-    // if MED file is not a distributed MED file (created with MULTIPR),
-    // then it is not necessary to build parts
-    if (theResult->GetFileInfoMultipr().filePath().isEmpty())
-      return;
-
-    try
-    {
-      multipr::Obj multiprObj;
-      multiprObj.create(theResult->GetFileInfoMultipr().filePath().latin1());
-      if (multiprObj.isValidDistributedMEDFile())
-      {
-       theResult->SetIsDistributedMEDMultipr(true);
-
-       const TMeshMap& aMeshMap = theInput->GetMeshMap();
-       TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
-       const PMesh& aMesh = aMeshMapIter->second;
-
-       vector<string> listParts = multiprObj.getParts();
-
-       QString aComment = "Sub-parts: #";
-       aComment += QString::number(listParts.size());
-
-       UpdateAttributes(
-                        theStudy,
-                        aMesh->myPartsEntry,
-                        "",
-                        "Parts",
-                        aComment.latin1());
-
-       string lastEntry;
-
-       for (unsigned i = 0 ; i < listParts.size() ; i++)
-       {
-         const char* strItem = listParts[i].c_str();
-         const char* strPartInfo = multiprObj.getPartInfo(strItem).c_str();
-
-         char   lMeshName[256];
-         int    lId;
-         char   lPartName[256];
-         char   lPath[256];
-         char   lMEDFileName[256];
-
-         // parse infos
-         sscanf(strPartInfo, "%s %d %s %s %s", 
-                lMeshName,
-                &lId,
-                lPartName,
-                lPath,
-                lMEDFileName);
-
-         if ((strstr(lPartName,"_MED") != NULL) || (strstr(lPartName,"_LOW") != NULL))
-         {
-           QString aComment = "";
-           aComment.append("myComment=PART;"); 
-           aComment.append("res=ML;");
-           aComment.append("file=");
-           aComment.append(lMEDFileName);
-
-           CreateAttributes(
-                            theStudy,
-                            lastEntry, // father
-                            "",
-                            lPartName,
-                            aComment.latin1(),
-                            true);
-         }
-         else
-         {
-           QString aComment = "";
-           QString icon = "";
-
-           if (i != listParts.size()-1)
-           {
-             const char* strItemNext = listParts[i+1].c_str();
-             const char* strPartInfoNext = multiprObj.getPartInfo(strItemNext).c_str();
-             if ((strstr(strPartInfoNext,"_MED") != NULL) || (strstr(strPartInfoNext,"_LOW") != NULL))
-             {
-               // next part is MED or LOW resolution
-               icon = "ICON_MULTIPR_VIEW_LOW";
-               theResult->SetResolutionMultipr(lPartName, 'L');
-
-               aComment.append("myComment=PART;"); 
-               aComment.append("res=FML;");
-               aComment.append("file=");
-               aComment.append(lMEDFileName);
-             }
-             else
-             {
-               // no resolution associated with this part
-               icon = "ICON_MULTIPR_VIEW_FULL";
-               theResult->SetResolutionMultipr(lPartName, 'F');
-
-               aComment.append("myComment=PART;"); 
-               aComment.append("res=F;");
-               aComment.append("file=");
-               aComment.append(lMEDFileName);
-             }
-           }
-           else
-           {
-             // last part
-             icon = "ICON_MULTIPR_VIEW_FULL";
-             theResult->SetResolutionMultipr(lPartName, 'F');
-
-             aComment.append("myComment=PART;"); 
-             aComment.append("res=FML;");
-             aComment.append("file=");
-             aComment.append(lMEDFileName);
-           }
-
-           lastEntry = CreateAttributes(
-                                        theStudy,
-                                        aMesh->myPartsEntry, // father
-                                        "",
-                                        lPartName,
-                                        aComment.latin1(),
-                                        true,
-                                        icon.latin1());
-         }
-
-         theResult->AddPartMultipr(lPartName, lMEDFileName);
-       }
-      }
-      else
-      {
-       // invalid distributed MED file
-       return;
-      }
-    }
-    catch (...)
-    {
-      throw std::runtime_error("error while reading distributed MED file"); 
-    }
-
-    ProcessVoidEvent(new TUpdateObjBrowser(theStudy->StudyId(),theIsDone));
-  }
-#endif
-
-
-  //---------------------------------------------------------------
-  void
-  BuildMinMax(Result_i* theResult,
-             VISU_Convertor* theInput,
-             CORBA::Boolean* theIsDone,
-             CORBA::Boolean theIsBuild,
-             Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal)
-  {
-    if(!theIsBuild || *theIsDone)
-      return;
-
-    TTimerLog aTimerLog(MYTIMEDEBUG,"Result_i::BuildMinMax");
-    TResultManager aResultManager(theResult);
-    
-    theInput->BuildMinMax();
-
-    *theIsDone = true;
-
-    (*theUpdateMinMaxSignal)();
-  }
-
-
-  //---------------------------------------------------------------
-  void
-  BuildFieldDataTree(Result_i* theResult,
-                    VISU_Convertor* theInput,
-                    CORBA::Boolean* theIsFieldsDone,
-                    CORBA::Boolean theIsBuildFields,
-                    CORBA::Boolean* theIsMinMaxDone,
-                    CORBA::Boolean theIsBuildMinMax,
-                    Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal,
-                    _PTR(Study) theStudy)
-  {
-    BuildFields(theResult,
-               theInput,
-               theIsFieldsDone,
-               theIsBuildFields,
-               false,
-               theStudy);
-
-    BuildMinMax(theResult,
-               theInput,
-               theIsMinMaxDone,
-               theIsBuildMinMax,
-               theUpdateMinMaxSignal);
-  }
-
-
-  //---------------------------------------------------------------
-  struct TBuildArgs
-  {
-    Result_i* myResult;
-    VISU_Convertor* myInput;
-    CORBA::Boolean* myIsEntitiesDone;
-    std::string myResultEntry;
-    CORBA::Boolean* myIsFieldsDone;
-    CORBA::Boolean myIsBuildFields;
-    CORBA::Boolean* myIsMinMaxDone;
-    CORBA::Boolean myIsBuildMinMax;
-    Result_i::TUpdateMinMaxSignal* myUpdateMinMaxSignal;
-    CORBA::Boolean* myIsGroupsDone;
-    CORBA::Boolean myIsBuildGroups;
-#ifdef ENABLE_MULTIPR
-    CORBA::Boolean* myIsPartsDone;
-    CORBA::Boolean myIsBuildParts;
-#endif
-    _PTR(Study) myStudy;
-
-    TBuildArgs(Result_i* theResult,
-              VISU_Convertor* theInput,
-              CORBA::Boolean* theIsEntitiesDone,
-              std::string theResultEntry,
-              CORBA::Boolean* theIsFieldsDone,
-              CORBA::Boolean theIsBuildFields,
-              CORBA::Boolean* theIsMinMaxDone,
-              CORBA::Boolean theIsBuildMinMax,
-              Result_i::TUpdateMinMaxSignal* theUpdateMinMaxSignal,
-              CORBA::Boolean* theIsGroupsDone,
-              CORBA::Boolean theIsBuildGroups,
-#ifdef ENABLE_MULTIPR
-              CORBA::Boolean* theIsPartsDone,
-              CORBA::Boolean theIsBuildParts,
-#endif
-              _PTR(Study) theStudy):
-      myResult(theResult),
-      myInput(theInput),
-      myIsEntitiesDone(theIsEntitiesDone),
-      myResultEntry(theResultEntry),
-      myIsFieldsDone(theIsFieldsDone),
-      myIsBuildFields(theIsBuildFields),
-      myIsMinMaxDone(theIsMinMaxDone),
-      myIsBuildMinMax(theIsBuildMinMax),
-      myUpdateMinMaxSignal(theUpdateMinMaxSignal),
-      myIsGroupsDone(theIsGroupsDone),
-      myIsBuildGroups(theIsBuildGroups),
-#ifdef ENABLE_MULTIPR
-      myIsPartsDone(theIsPartsDone),
-      myIsBuildParts(theIsBuildParts),
-#endif
-      myStudy(theStudy)
-    {}
-  };
-
-  //---------------------------------------------------------------
-  void
-  BuildDataTree(TBuildArgs theBuildArgs)
-  {
-    BuildEntities(theBuildArgs.myResult,
-                 theBuildArgs.myInput,
-                 theBuildArgs.myIsEntitiesDone,
-                 theBuildArgs.myResultEntry,
-                 false,
-                 theBuildArgs.myIsBuildGroups,
-                 theBuildArgs.myIsBuildFields,
-                 theBuildArgs.myStudy);
-
-    {
-      boost::thread aThread(boost::bind(&BuildGroups,
-                                       theBuildArgs.myResult,
-                                       theBuildArgs.myInput,
-                                       theBuildArgs.myIsGroupsDone,
-                                       theBuildArgs.myIsBuildGroups,
-                                       false,
-                                       theBuildArgs.myStudy));
-    }
-    {
-      boost::thread aThread(boost::bind(&BuildFieldDataTree,
-                                       theBuildArgs.myResult,
-                                       theBuildArgs.myInput,
-                                       theBuildArgs.myIsFieldsDone,
-                                       theBuildArgs.myIsBuildFields,
-                                       theBuildArgs.myIsMinMaxDone,
-                                       theBuildArgs.myIsBuildMinMax,
-                                       theBuildArgs.myUpdateMinMaxSignal,
-                                       theBuildArgs.myStudy));
-    }
-
-    /*
-    // MULTIPR
-    BuildParts(theBuildArgs.myResult,
-               theBuildArgs.myInput,
-              theBuildArgs.myIsPartsDone,
-              theBuildArgs.myIsBuildParts,
-              false,
-              theBuildArgs.myStudy);
-    */
-  }
-}
-
-
 //---------------------------------------------------------------
-VISU::MinMaxCunsomer
-::MinMaxCunsomer():
-  myMinMaxIsInitilized(false)
-{}
-
-bool
-VISU::MinMaxCunsomer
-::IsMinMaxInitilized()
-{
-  return myMinMaxIsInitilized;
-}
-
-void
-VISU::MinMaxCunsomer
-::UpdateMinMax()
-{
-  myMinMaxIsInitilized = true;
 }
 
 
@@ -1079,13 +139,13 @@ const char* VISU::Result_i::GetComment() const { return myComment.c_str();}
 
 //---------------------------------------------------------------
 VISU::Result_i
-::Result_i (SALOMEDS::Study_ptr theStudy,
-           const ESourceId& theSourceId,
-           const ECreationId& theCreationId,
-           CORBA::Boolean theIsBuildImmediately,
-           CORBA::Boolean theIsBuildFields,
-           CORBA::Boolean theIsBuildMinMax,
-           CORBA::Boolean theIsBuildGroups):
+::Result_i(SALOMEDS::Study_ptr theStudy,
+          const ESourceId& theSourceId,
+          const ECreationId& theCreationId,
+          CORBA::Boolean theIsBuildImmediately,
+          CORBA::Boolean theIsBuildFields,
+          CORBA::Boolean theIsBuildMinMax,
+          CORBA::Boolean theIsBuildGroups):
   myStudyDocument(SALOMEDS::Study::_duplicate(theStudy)),
   myCreationId(theCreationId),
   mySourceId(theSourceId),
@@ -1093,23 +153,38 @@ VISU::Result_i
   myIsBuildFields(theIsBuildFields),
   myIsBuildMinMax(theIsBuildMinMax),
   myIsBuildGroups(theIsBuildGroups),
-#ifdef ENABLE_MULTIPR
-  myIsBuildParts(true),
-#endif
   myIsEntitiesDone(false),
   myIsFieldsDone(false),
   myIsGroupsDone(false),
   myIsMinMaxDone(false),
-#ifdef ENABLE_MULTIPR
-  myIsPartsDone(false),
-#endif
   myIsAllDone(false),
-  myInput(NULL)
+  myIsBuildParts(false),
+  myIsPartsDone(false)
 {
-  myStudy = ProcessEvent(new TGetStudy(myStudyDocument->StudyId()));
-#ifdef ENABLE_MULTIPR
-  myIsDistributedMEDMultipr = false;
-#endif
+  myStudy = VISU::GetStudy(myStudyDocument);
+}
+
+
+//---------------------------------------------------------------
+VISU::Result_i
+::Result_i():
+  myIsEntitiesDone(false),
+  myIsFieldsDone(false),
+  myIsGroupsDone(false),
+  myIsMinMaxDone(false),
+  myIsAllDone(false),
+  myIsBuildParts(false),
+  myIsPartsDone(false)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Result_i
+::~Result_i()
+{
+  MESSAGE("Result_i::~Result_i() - this = "<<this);
+  if (GetSourceId() == eRestoredFile) 
+    VISU::RemoveFile(myFileInfo.filePath().latin1());
 }
 
 
@@ -1142,9 +217,26 @@ VISU::Result_i
 //---------------------------------------------------------------
 void 
 VISU::Result_i
-::MinMaxConnect(VISU::MinMaxCunsomer* theMinMaxCunsomer)
+::ConnectObserver(TResultObserver* theObserver,
+                 boost::signalslib::connection& theConnection)
 {
-  myUpdateMinMaxSignal.connect(boost::bind(&MinMaxCunsomer::UpdateMinMax,theMinMaxCunsomer));
+  if(theConnection.connected())
+    theConnection.disconnect();
+
+  theConnection = 
+    myUpdateObserverSignal.connect(boost::bind(boost::bind(&TResultObserver::UpdateFromResult, 
+                                                          theObserver, 
+                                                          _1),
+                                              this));
+}
+
+
+//---------------------------------------------------------------
+void 
+VISU::Result_i
+::UpdateObservers()
+{
+  myUpdateObserverSignal();
 }
 
 
@@ -1263,7 +355,7 @@ VISU::Result_i
   if(theIsBuildAll)
     theIsAtOnce = true;
 
-  if(Build(SALOMEDS::SObject::_nil(),theIsAtOnce)){
+  if(Build(SALOMEDS::SObject::_nil(), theIsAtOnce)){
     
     // Set icon
     SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
@@ -1303,18 +395,20 @@ VISU::Result_i
   aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
                   GetComment(),
                   myFileInfo.filePath().latin1(),
-                  myInitFileName.c_str()); // Restoring of Python dump
-  string aResultEntry =
+                  GetInitFileName().c_str()); // Restoring of Python dump
+  std::string aResultEntry = 
     CreateAttributes(myStudy,
                     aSComponentEntry.in(),
+                    NO_ICON,
                     anIOR.in(),
-                    myName,
+                    GetName(),
+                    NO_PERFSITENT_REF,
                     aComment.latin1(),
                     true);
   mySObject = myStudyDocument->FindObjectID(aResultEntry.c_str());
   if(!CORBA::is_nil(theSObject)){
     CORBA::String_var aString = theSObject->GetID();
-    CreateReference(myStudyDocument,aResultEntry,aString.in());
+    CreateReference(myStudyDocument, aResultEntry, aString.in());
   }
 
   if(theIsAtOnce){
@@ -1325,6 +419,7 @@ VISU::Result_i
                  theIsAtOnce,
                  myIsBuildGroups,
                  myIsBuildFields,
+                 myIsBuildParts,
                  myStudy);
     
     BuildGroups(this,
@@ -1334,101 +429,58 @@ VISU::Result_i
                theIsAtOnce,
                myStudy);
 
-    BuildFields(this,
+    BuildFieldDataTree(this,
+                      myInput,
+                      &myIsFieldsDone,
+                      myIsBuildFields,
+                      &myIsMinMaxDone,
+                      myIsBuildMinMax,
+                      myStudy);
+  } else {
+    boost::thread aThread(boost::bind(boost::bind(&Result_i::BuildDataTree, this, _1),
+                                     aResultEntry));
+  }
+
+  return this;
+}
+
+
+//---------------------------------------------------------------
+void
+VISU::Result_i
+::BuildDataTree(const std::string& theResultEntry)
+{
+  BuildEntities(this,
                myInput,
-               &myIsFieldsDone,
+               &myIsEntitiesDone,
+               theResultEntry,
+               false,
+               myIsBuildGroups,
                myIsBuildFields,
-               theIsAtOnce,
+               myIsBuildParts,
                myStudy);
-    
-    BuildMinMax(this,
-               myInput,
-               &myIsMinMaxDone,
-               myIsBuildMinMax,
-               &myUpdateMinMaxSignal);
-
-#ifdef ENABLE_MULTIPR
-    // MULTIPR
-    BuildParts(this,
-              myInput,
-              &myIsPartsDone,
-              myIsBuildParts,
-              theIsAtOnce,
-              myStudy);
-#endif
-  }
-  else {
-#ifdef ENABLE_MULTIPR
-    if (strlen(GetFileInfoMultipr().filePath().latin1()) == 0)
-#endif
-    {
-      // sequential MED file
-      TBuildArgs aBuildArgs(this,
-                           myInput,
-                           &myIsEntitiesDone,
-                           aResultEntry,
-                           &myIsFieldsDone,
-                           myIsBuildFields,
-                           &myIsMinMaxDone,
-                           myIsBuildMinMax,
-                           &myUpdateMinMaxSignal,
-                           &myIsGroupsDone,
-                           myIsBuildGroups,
-#ifdef ENABLE_MULTIPR
-                           &myIsPartsDone,
-                           myIsBuildParts,
-#endif
-                           myStudy);
-      boost::thread aThread(boost::bind(&BuildDataTree, aBuildArgs));
-    }
-#ifdef ENABLE_MULTIPR
-    else
-    {
-      // distributed MED file
-      BuildEntities(this,
-                   myInput,
-                   &myIsEntitiesDone,
-                   aResultEntry,
-                   theIsAtOnce,
-                   myIsBuildGroups,
-                   myIsBuildFields,
-                   myStudy);
-
-      BuildGroups(this,
-                 myInput,
-                 &myIsGroupsDone,
-                 myIsBuildGroups,
-                 theIsAtOnce,
-                 myStudy);
 
-      BuildFields(this,
-                 myInput,
-                 &myIsFieldsDone,
-                 myIsBuildFields,
-                 theIsAtOnce,
-                 myStudy);
-
-      BuildMinMax(this,
-                 myInput,
-                 &myIsMinMaxDone,
-                 myIsBuildMinMax,
-                 &myUpdateMinMaxSignal);
-
-      // MULTIPR
-      BuildParts(this,
-                myInput,
-                &myIsPartsDone,
-                myIsBuildParts,
-                theIsAtOnce,
-                myStudy);
-    }
-#endif
+  {
+    boost::thread aThread(boost::bind(&BuildGroups,
+                                     this,
+                                     myInput,
+                                     &myIsGroupsDone,
+                                     myIsBuildGroups,
+                                     false,
+                                     myStudy));
+  }
+  {
+    boost::thread aThread(boost::bind(&BuildFieldDataTree,
+                                     this,
+                                     myInput,
+                                     &myIsFieldsDone,
+                                     myIsBuildFields,
+                                     &myIsMinMaxDone,
+                                     myIsBuildMinMax,
+                                     myStudy));
   }
-
-  return this;
 }
 
-
 //---------------------------------------------------------------
 VISU::Storable*
 VISU::Result_i
@@ -1452,67 +504,30 @@ VISU::Result_i
 
 //---------------------------------------------------------------
 VISU::Storable*
-VISU::Result_i::
-Create(const char* theFileName)
+VISU::Result_i
+::Create(const char* theFileName)
 {      
   try {
     myFileInfo.setFile(theFileName);
+    myFileName = myFileInfo.fileName().latin1();
 
-#ifdef ENABLE_MULTIPR
-    // MULTIPR    
-    if (myFileInfo.filePath().endsWith("_grains_maitre.med"))
-    {
-      // retrieve source MED file (sequential MED file)
-      QString originalMEDFileName = "";
-      FILE* aFile = fopen(theFileName, "rt");
-      char aBuf[1024];
-      while (!feof(aFile))
-      {
-       fgets(aBuf, 1024, aFile);
-       char* strTag = NULL;
-       if ((aBuf[0] == '#') && ((strTag = strstr(aBuf, "[SOURCE]=")) != NULL))
-       {
-         char strSequentialMEDFilename[256];
-         int ret = sscanf(strTag, "[SOURCE]=%s", strSequentialMEDFilename);
-         if (ret == 1)
-         {
-           originalMEDFileName = strSequentialMEDFilename;
-           break;
-         }
-       }
-      }
-      fclose(aFile);
-      if (originalMEDFileName == "") 
-       throw std::runtime_error("distributed MED file; bad format"); 
-
-      //cout << "MULTIPR: original med file=" << originalMEDFileName << endl;
-      myFileInfoMultipr.setFile(myFileInfo.filePath());
-      myFileInfo.setFile(originalMEDFileName);
+    if(!myIsBuildParts){
+      SetInitFileName(myFileInfo.filePath().latin1());
+      SetName(VISU::GenerateName(myFileInfo.fileName()).latin1(), false);
     }
-    else
-    {
-      myFileInfoMultipr.setFile("");
-    }
-#endif
 
-    myInitFileName = myFileInfo.filePath().latin1();
-    myName = ::GenerateName(myFileInfo.fileName()).latin1();
     if(mySourceId == eRestoredFile){
-      std::string aTmpDir(SALOMEDS_Tool::GetTmpDir());
-      static QString aCommand;
-      aCommand.sprintf(" %s %s", myFileInfo.absFilePath().latin1(), aTmpDir.c_str() );
-      aCommand = QDir::convertSeparators( aCommand );
-      aCommand.prepend( COPY_COMMAND );
-
-      if(system(aCommand.latin1()) == -1){
-       MESSAGE("Create - Can't execute the command :"<<aCommand);
+      QString aTmpDir(SALOMEDS_Tool::GetTmpDir().c_str());
+      std::string aFileName = VISU::MakeFileName(myFileInfo.fileName().latin1(), this);
+      QString aPathToCopy(aTmpDir + aFileName.c_str());
+      if(!VISU::CopyFile(myFileInfo.absFilePath().latin1(), aPathToCopy.latin1()))
        return NULL;
-      }
-      if(MYDEBUG) MESSAGE("Result_i::Create - aCommand = "<<aCommand);
-      myFileInfo.setFile(QString(aTmpDir.c_str()) + myFileInfo.fileName());
-    }
 
-    myInput = CreateConvertor(myFileInfo.absFilePath().latin1());
+      myFileInfo.setFile(aPathToCopy);
+      myFileName = myFileInfo.fileName().latin1();
+   }
+
+    myInput.reset(CreateConvertor(myFileInfo.absFilePath().latin1()));
 
     if(myInput){
       if(myIsBuildImmediately)
@@ -1535,17 +550,17 @@ VISU::Result_i
 {
   if(MYDEBUG)  MESSAGE("Result_i::Create MedObject from SALOMEDS::SObject_ptr");
   try{
-    myInput = CreateMEDConvertor(theMedSObject);
-    if(myInput == NULL)
+    myInput.reset(CreateMEDConvertor(theMedSObject));
+    if(!myInput)
       return NULL;
 
     myInput->Build();
 
     string aCompDataType = GetComponentDataType(theMedSObject);
     myFileInfo.setFile(aCompDataType.c_str());
-    myInitFileName = aCompDataType;
+    SetInitFileName(aCompDataType);
 
-    myName = ::GenerateName("aResult").latin1();
+    myFileName = VISU::GenerateName("aResult").latin1();
 
     return Build(theMedSObject);
   }catch(std::exception& exc){
@@ -1564,17 +579,17 @@ VISU::Result_i
 {
   if(MYDEBUG)  MESSAGE("Result_i::Create MedObject from SALOME_MED::FIELD_ptr");
   try{
-    myInput = CreateMEDFieldConvertor(theField);
-    if(myInput == NULL)
+    myInput.reset(CreateMEDFieldConvertor(theField));
+    if(!myInput)
       return NULL;
 
     myInput->Build();
 
     string aCompDataType = "MED";
     myFileInfo.setFile(aCompDataType.c_str());
-    myInitFileName = aCompDataType;
+    SetInitFileName(aCompDataType);
 
-    myName = ::GenerateName("aResult").latin1();
+    myFileName = VISU::GenerateName("aResult").latin1();
 
     CORBA::String_var anIOR = myStudyDocument->ConvertObjectToIOR(theField);
     SALOMEDS::SObject_var aFieldSObject = myStudyDocument->FindObjectIOR(anIOR);
@@ -1585,7 +600,106 @@ VISU::Result_i
   }catch(...){
     INFOS("Unknown exception was occured!!!");
   }
-  return NULL;
+  return NULL;
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::Result_i
+::Save(SALOMEDS::SComponent_ptr theComponent,
+       const std::string& theURL,
+       bool theIsMultiFile,
+       bool theIsASCII,
+       TFileNames& theFileNames,
+       TFileNames& theFiles)
+{
+  switch(GetCreationId()){
+  case Result_i::eImportFile:
+  case Result_i::eCopyAndImportFile: {
+    INITMSG(MYDEBUG, "Result::Save - this = "<<this<<"\n");
+    INITMSGA(MYDEBUG, 0, "theIsMultiFile = "<<theIsMultiFile<<"; theIsASCII = "<<theIsASCII<<"\n");
+
+    std::string aPrefix;
+    if (theIsMultiFile) {
+      CORBA::String_var anURL = GetStudyDocument()->URL();
+      aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+    }
+
+    std::string aFileName = aPrefix + "_" + GetFileName();
+    BEGMSG(MYDEBUG, "aFileName = '"<<aFileName<<"'\n");
+
+    std::string aFile = GetFileInfo().filePath().latin1();
+    BEGMSG(MYDEBUG, "aFile = '"<<aFile<<"'\n");
+
+    if(theIsMultiFile || theIsASCII){
+      std::string aPathToCopy(theURL + aFileName);
+      BEGMSG(MYDEBUG, "aPathToCopy = '"<<aPathToCopy<<"'\n");
+      
+      if(!VISU::CopyFile(aFile, aPathToCopy))
+       return false;
+
+      if(theIsASCII)
+       HDFascii::ConvertFromHDFToASCII(const_cast<char*>(aPathToCopy.c_str()), true);
+    }
+
+    theFileNames.push_back(aFileName);
+    theFiles.push_back(aFile);
+
+    return true;
+  }}
+
+  return false;
+}
+
+
+//---------------------------------------------------------------
+CORBA::Boolean 
+VISU::Result_i
+::CanCopy(SALOMEDS::SObject_ptr theObject) 
+{
+  switch(GetCreationId()){
+  case Result_i::eImportFile:
+  case Result_i::eCopyAndImportFile: 
+    return true;
+  }
+  
+  return false;
+}
+
+
+//---------------------------------------------------------------
+bool
+VISU::Result_i
+::CopyFrom(SALOMEDS::SObject_ptr theObject, 
+          CORBA::Long& theObjectID,
+          const std::string& theTmpDir,
+          TFileNames& theFileNames) 
+{
+  if(!Storable::CopyFrom(theObject, theObjectID, theTmpDir, theFileNames))
+    return false;
+  
+  SALOMEDS::Study_var aStudy = theObject->GetStudy();
+  CORBA::String_var anURL = aStudy->URL();
+  std::string aPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+  std::string aFileName = aPrefix + GetFileInfo().fileName().latin1();
+
+  static QString aCommand;
+  std::string aFilePath =  theTmpDir + aFileName;
+  aCommand.sprintf(" %s %s", GetFileInfo().filePath().latin1(), aFilePath.c_str());
+  aCommand = QDir::convertSeparators( aCommand );
+  aCommand.prepend( COPY_COMMAND );
+
+  if(system(aCommand.latin1()) != 0) {
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
+    return false;
+  }
+
+  SALOMEDS::SComponent_var aSComponent = aStudy->FindComponent("VISU");
+
+  theFileNames.push_back(aFileName);
+
+  return true;
 }
 
 
@@ -1594,20 +708,32 @@ VISU::Storable*
 VISU::Result_i
 ::Restore(SALOMEDS::SObject_ptr theSObject,
          const Storable::TRestoringMap& theMap,
-         const string& thePrefix)
+         const string& thePrefix,
+         CORBA::Boolean theIsMultiFile)
 {
   if(MYDEBUG) MESSAGE("Result_i::Restore - " << thePrefix);
+  mySObject = SALOMEDS::SObject::_duplicate(theSObject);
+  mySComponent = mySObject->GetFatherComponent();
+  myStudyDocument = theSObject->GetStudy();
+  myStudy = VISU::GetStudy(myStudyDocument);
+
+  myCreationId = ECreationId(Storable::FindValue(theMap, "myCreationId").toInt());
+  mySourceId = eRestoredFile;
+  if(myCreationId == eImportMed || myCreationId == eImportMedField)
+    mySourceId = eRestoredComponent;
+
+  myIsBuildFields = Storable::FindValue(theMap, "myIsBuildFields", "1").toInt();
+  myIsBuildMinMax = Storable::FindValue(theMap, "myIsBuildMinMax", "1").toInt();
+  myIsBuildGroups = Storable::FindValue(theMap, "myIsBuildGroups", "1").toInt();
+
+  myIsBuildImmediately = true;
+
   try {
-    mySObject = SALOMEDS::SObject::_duplicate(theSObject);
-    myStudyDocument = mySObject->GetStudy();
-    mySComponent = mySObject->GetFatherComponent();
-    myName = VISU::Storable::FindValue(theMap, "myName").latin1();
-    myInitFileName = VISU::Storable::FindValue(theMap, "myInitFileName").latin1();
+    myFileName = VISU::Storable::FindValue(theMap, "myName").latin1();
+    SetInitFileName(VISU::Storable::FindValue(theMap, "myInitFileName").latin1());
     
     SALOMEDS::SObject_var aRefSObj, aTargetRefSObj;
-    if (mySObject->FindSubObject(1, aRefSObj) &&
-       aRefSObj->ReferencedObject(aTargetRefSObj)) 
-    {
+    if (theSObject->FindSubObject(1, aRefSObj) && aRefSObj->ReferencedObject(aTargetRefSObj)) {
       if(MYDEBUG) MESSAGE("Result_i::GetInput - There is some reference.");
       SALOMEDS::SComponent_var aCompRefSObj = aTargetRefSObj->GetFatherComponent();
       CORBA::String_var aDataType = aCompRefSObj->ComponentDataType();
@@ -1620,31 +746,17 @@ VISU::Result_i
       SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
       SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(aEngComp);
       aStudyBuilder->LoadWith(aCompRefSObj, aDriver);
-      /*
-      if (strcmp(aDataType, "MED") == 0){
-        // create field or MED converter
-        CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
-        SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
-        if(!CORBA::is_nil(aField))
-          myInput = CreateMEDFieldConvertor(aField);
-        else
-          myInput = CreateMEDConvertor(aTargetRefSObj);
-       myInput->Build();
-      }else
-       throw std::runtime_error("GetInput - There is no convertor for the aDataType !!!");
-      //*/
-
       // create field or MED converter
       CORBA::Object_var aMedObject = VISU::SObjectToObject(aTargetRefSObj);
       SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(aMedObject);
       if (!CORBA::is_nil(aField)) {
         // create field converter
-       myInput = CreateMEDFieldConvertor(aField);
+       myInput.reset(CreateMEDFieldConvertor(aField));
        myInput->Build();
       }
       else if (strcmp(aDataType, "MED") == 0) {
         // create MED converter
-       myInput = CreateMEDConvertor(aTargetRefSObj);
+       myInput.reset(CreateMEDConvertor(aTargetRefSObj));
        myInput->Build();
       }
       else {
@@ -1653,11 +765,13 @@ VISU::Result_i
     } else {
       myFileInfo.setFile(thePrefix.c_str());
 
-      string aStudyPrefix ("");
-      if (IsMultifile())
-       aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(myStudyDocument->URL());
+      std::string aStudyPrefix ("");
+      if (theIsMultiFile) {
+       CORBA::String_var anURL(GetStudyDocument()->URL());
+       aStudyPrefix = SALOMEDS_Tool::GetNameFromPath(anURL.in());
+      }
       if (!myFileInfo.isFile()) {
-       string aFileName = thePrefix + aStudyPrefix + "_" + myName;
+       std::string aFileName = thePrefix + aStudyPrefix + "_" + myFileName;
        myFileInfo.setFile(aFileName.c_str());
       }
       if(MYDEBUG)
@@ -1671,7 +785,7 @@ VISU::Result_i
        char* aHDFFileName = new char[strlen(aResultPath) + 19];
        sprintf(aHDFFileName, "%shdf_from_ascii.hdf", aResultPath);
        
-       if (IsMultifile()) { // set this file as new - temporary
+       if (theIsMultiFile) { // set this file as new - temporary
          static QString aCommand;
          aCommand.sprintf(" %s %s%s",aHDFFileName, aResultPath, myFileInfo.baseName().latin1());
          aCommand = QDir::convertSeparators( aCommand );
@@ -1702,13 +816,13 @@ VISU::Result_i
        mySourceId = eRestoredFile;
        delete(aResultPath);
        delete(aHDFFileName);
-      } else if (!IsMultifile()) {
+      } else if (!theIsMultiFile) {
        mySourceId = eRestoredFile;
       } else {
-       mySourceId = eFile;
+       mySourceId = eSavedFile;
       }
       if(MYDEBUG) MESSAGE("VISU::Result_i::Restore - mySourceId = " << mySourceId);
-      myInput = CreateConvertor(myFileInfo.filePath().latin1());
+      myInput.reset(CreateConvertor(myFileInfo.filePath().latin1()));
 
       myInput->BuildEntities();
       if(myIsBuildFields){
@@ -1728,7 +842,7 @@ VISU::Result_i
       aComment.sprintf("myComment=%s;myFileName=%s;myInitFileName=%s",
                       GetComment(), 
                       myFileInfo.filePath().latin1(),
-                      myInitFileName.c_str()); // Restoring of Python dump
+                      GetInitFileName().c_str()); // Restoring of Python dump
       SALOMEDS::GenericAttribute_var anAttr;
       if (!theSObject->FindAttribute(anAttr, "AttributeString"))
        throw std::runtime_error("Build - There is no AttributeString for the SObject !!!");
@@ -1747,14 +861,19 @@ VISU::Result_i
   return NULL;
 }
 
+
 //---------------------------------------------------------------
-VISU::Result_i::TInput* 
+VISU::Result_i::PInput
 VISU::Result_i
-::GetInput() 
+::GetInput(const std::string& theMeshName, 
+          VISU::Entity theEntity,
+          const std::string& theFieldName, 
+          CORBA::Long theTimeStampNumber) 
 {
   return myInput;
 }
 
+
 //---------------------------------------------------------------
 CORBA::Boolean 
 VISU::Result_i
@@ -1814,60 +933,437 @@ VISU::Result_i
   return myIsMinMaxDone;
 }
 
+CORBA::Boolean 
+VISU::Result_i
+::IsPartsDone()
+{
+  return myIsPartsDone;
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames* 
+VISU::Result_i
+::GetMeshNames()
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult._retn();
+
+  aResult->length(aMeshMap.size());
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.begin();
+  for(size_t anId = 0; anIter != aMeshMap.end(); anIter++, anId++){
+    const std::string& aName = anIter->first;
+    aResult[anId] = aName.c_str();
+  }
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::Entities* 
+VISU::Result_i
+::GetEntities(const char* theMeshName)
+{
+  VISU::Result::Entities_var anEntities = new VISU::Result::Entities();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return anEntities._retn();
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return anEntities._retn();
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+  if(aMeshOnEntityMap.empty())
+    return anEntities._retn();
+
+  {
+    anEntities->length(aMeshOnEntityMap.size());
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.end();
+    for(size_t anId = 0; anIter != aMeshOnEntityMap.end(); anIter++, anId++){
+      const VISU::TEntity& anEntity = anIter->first;
+      anEntities[anId] = VISU::Entity(anEntity);
+    }
+  }
+
+  return anEntities._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames* 
+VISU::Result_i
+::GetFamilies(const char* theMeshName, 
+             VISU::Entity theEntity)
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult._retn();
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return aResult._retn();
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+  if(aMeshOnEntityMap.empty())
+    return aResult._retn();
+
+  {
+    VISU::TEntity anEntity = VISU::TEntity(theEntity);
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity);
+    if(anIter == aMeshOnEntityMap.end())
+      return aResult._retn();
+
+    const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second;
+    const VISU::TFamilyMap& aFamilyMap = aMeshOnEntity->myFamilyMap;
+    if(aFamilyMap.empty())
+      return aResult._retn();
+    
+    {
+      aResult->length(aFamilyMap.size());
+      VISU::TFamilyMap::const_iterator anIter = aFamilyMap.end();
+      for(size_t anId = 0; anIter != aFamilyMap.end(); anIter++, anId++){
+       const std::string& aName = anIter->first;
+       aResult[anId] = aName.c_str();
+      }
+    }
+  }
+
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames* 
+VISU::Result_i
+::GetGroups(const char* theMeshName)
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult._retn();
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return aResult._retn();
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+  if(aGroupMap.empty())
+    return aResult._retn();
+
+  {
+    aResult->length(aGroupMap.size());
+    VISU::TGroupMap::const_iterator anIter = aGroupMap.end();
+    for(size_t anId = 0; anIter != aGroupMap.end(); anIter++, anId++){
+      const std::string& aName = anIter->first;
+      aResult[anId] = aName.c_str();
+    }
+  }
+
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames*
+VISU::Result_i
+::GetFields(const char* theMeshName, 
+           VISU::Entity theEntity)
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult._retn();
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return aResult._retn();
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+  if(aMeshOnEntityMap.empty())
+    return aResult._retn();
+
+  {
+    VISU::TEntity anEntity = VISU::TEntity(theEntity);
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity);
+    if(anIter == aMeshOnEntityMap.end())
+      return aResult._retn();
+
+    const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second;
+    const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+    if(aFieldMap.empty())
+      return aResult._retn();
+    
+    {
+      aResult->length(aFieldMap.size());
+      VISU::TFieldMap::const_iterator anIter = aFieldMap.end();
+      for(size_t anId = 0; anIter != aFieldMap.end(); anIter++, anId++){
+       const std::string& aName = anIter->first;
+       aResult[anId] = aName.c_str();
+      }
+    }
+  }
+
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::TimeStampNumbers* 
+VISU::Result_i
+::GetTimeStampNumbers(const char* theMeshName, 
+                     VISU::Entity theEntity, 
+                     const char* theFieldName)
+{
+  VISU::Result::TimeStampNumbers_var aResult = new VISU::Result::TimeStampNumbers();
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult._retn();
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return aResult._retn();
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+  if(aMeshOnEntityMap.empty())
+    return aResult._retn();
+
+  {
+    VISU::TEntity anEntity = VISU::TEntity(theEntity);
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity);
+    if(anIter == aMeshOnEntityMap.end())
+      return aResult._retn();
+
+    const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second;
+    const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+    if(aFieldMap.empty())
+      return aResult._retn();
+
+    {
+      VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName);
+      if(anIter == aFieldMap.end())
+       return aResult._retn();
+
+      {
+       const VISU::PField& aField = anIter->second;
+       const VISU::TValField& aValField = aField->myValField;
+       if(aValField.empty())
+         return aResult._retn();
+
+       {
+         aResult->length(aValField.size());
+         VISU::TValField::const_iterator anIter = aValField.end();
+         for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){
+           const vtkIdType& aTimeStampNumber = anIter->first;
+           aResult[anId] = aTimeStampNumber;
+         }
+       }
+      }
+    }
+  }
+
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+CORBA::Long 
+VISU::Result_i
+::GetNumberOfComponents(const char* theMeshName, 
+                       VISU::Entity theEntity, 
+                       const char* theFieldName)
+{
+  CORBA::Long aResult = 0;
+  const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap();
+  if(aMeshMap.empty())
+    return aResult;
+
+  VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName);
+  if(anIter == aMeshMap.end())
+    return aResult;
+  
+  const VISU::PMesh& aMesh = anIter->second;
+  const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
+  if(aMeshOnEntityMap.empty())
+    return aResult;
+
+  {
+    VISU::TEntity anEntity = VISU::TEntity(theEntity);
+    VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity);
+    if(anIter == aMeshOnEntityMap.end())
+      return aResult;
+
+    const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second;
+    const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap;
+    if(aFieldMap.empty())
+      return aResult;
+
+    {
+      VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName);
+      if(anIter == aFieldMap.end())
+       return aResult;
+
+      {
+       const VISU::PField& aField = anIter->second;
+       aResult = aField->myNbComp;
+      }
+    }
+  }
+
+  return aResult;
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::EntityNames* 
+VISU::Result_i
+::GetPartNames(const char* theMeshName)
+{
+  VISU::Result::EntityNames_var aResult = new VISU::Result::EntityNames();
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::Resolutions* 
+VISU::Result_i
+::GetResolutions(const char* theMeshName, 
+                const char* thePartName)
+{
+  VISU::Result::Resolutions_var aResult = new VISU::Result::Resolutions();
+  return aResult._retn();
+}
+
+
+//---------------------------------------------------------------
+VISU::Result::Resolution
+VISU::Result_i
+::GetResolution(const char* theMeshName, 
+               const char* thePartName)
+{
+  return VISU::Result::HIDDEN;
+}
+
+
 //---------------------------------------------------------------
 void 
 VISU::Result_i
-::ToStream(std::ostringstream& theStr)
+::SetResolution(const char* theMeshName, 
+               const char* thePartName, 
+               VISU::Result::Resolution theResolution)
+{}
+
+
+//---------------------------------------------------------------
+VISU::Result_i*
+VISU::Result_i
+::New(SALOMEDS::Study_ptr theStudy,
+      const ESourceId& theSourceId,
+      const ECreationId& theCreationId,
+      CORBA::Boolean theIsBuildImmediately,
+      CORBA::Boolean theIsBuildFields,
+      CORBA::Boolean theIsBuildMinMax,
+      CORBA::Boolean theIsBuildGroups)
 {
-  if(MYDEBUG) MESSAGE(GetComment());
-  Storable::DataToStream(theStr,"myName",myName.c_str());
-  Storable::DataToStream(theStr,"myInitFileName",myInitFileName.c_str());
-  Storable::DataToStream(theStr,"myCreationId",myCreationId);
-  Storable::DataToStream(theStr,"myIsBuildFields",myIsFieldsDone);
-  Storable::DataToStream(theStr,"myIsBuildMinMax",myIsMinMaxDone);
-  Storable::DataToStream(theStr,"myIsBuildGroups",myIsGroupsDone);
+  return new RESULT_CLASS_NAME(theStudy,
+                              theSourceId,
+                              theCreationId,
+                              theIsBuildImmediately,
+                              theIsBuildFields,
+                              theIsBuildMinMax,
+                              theIsBuildGroups);
 }
 
 
 //---------------------------------------------------------------
 VISU::Storable*
 VISU::Result_i
-::Restore(SALOMEDS::SObject_ptr theSObject,
-         const string& thePrefix,
-         const Storable::TRestoringMap& theMap)
+::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                const Storable::TRestoringMap& theMap,
+                const std::string& thePrefix,
+                CORBA::Boolean theIsMultiFile)
 {
-  SALOMEDS::Study_var aStudy = theSObject->GetStudy();
-
-  ECreationId aCreationId = ECreationId(Storable::FindValue(theMap, "myCreationId").toInt());
-  ESourceId aSourceId = eRestoredFile;
-  if(aCreationId == eImportMed || aCreationId == eImportMedField)
-    aSourceId = eRestoredComponent;
-
-  CORBA::Boolean anIsBuildFields = Storable::FindValue(theMap,"myIsBuildFields","1").toInt();
-  CORBA::Boolean anIsBuildMinMax = Storable::FindValue(theMap,"myIsBuildMinMax","1").toInt();
-  CORBA::Boolean anIsBuildGroups = Storable::FindValue(theMap,"myIsBuildGroups","1").toInt();
-
-  VISU::Result_i* aResult = new VISU::Result_i(aStudy,
-                                              aSourceId,
-                                              aCreationId,
-                                              anIsBuildFields,
-                                              anIsBuildMinMax,
-                                              anIsBuildGroups);
-  if (aResult == NULL)
-    return NULL;
+  VISU::Result_i* aResult = new RESULT_CLASS_NAME();
+  return aResult->Restore(theSObject, theMap, thePrefix, theIsMultiFile);
+}
+
+
+//---------------------------------------------------------------
+void 
+VISU::Result_i
+::ToStream(std::ostringstream& theStr)
+{
+  Storable::DataToStream(theStr,"myName", GetFileName().c_str());
+  Storable::DataToStream(theStr,"myInitFileName", GetInitFileName().c_str());
+  Storable::DataToStream(theStr,"myCreationId", myCreationId);
+  Storable::DataToStream(theStr,"myIsBuildFields", myIsFieldsDone);
+  Storable::DataToStream(theStr,"myIsBuildMinMax", myIsMinMaxDone);
+  Storable::DataToStream(theStr,"myIsBuildGroups", myIsGroupsDone);
+}
+
+
+//---------------------------------------------------------------
+std::string
+VISU::Result_i
+::GetInitFileName() const
+{
+  return myInitFileName;
+}
+
 
-  return aResult->Restore(theSObject,theMap,thePrefix);
+void 
+VISU::Result_i
+::SetInitFileName(const std::string& theFileName)
+{
+  myInitFileName = theFileName;
 }
 
 
 //---------------------------------------------------------------
-string 
+std::string
+VISU::Result_i
+::GetFileName() const
+{
+  if(GetSourceId() == eFile)
+    return VISU::MakeFileName(myFileName, this);
+
+  return myFileName;
+}
+
+
+QFileInfo
+VISU::Result_i
+::GetFileInfo() const
+{
+  return myFileInfo;
+}
+
+VISU::Result_i::ECreationId
+VISU::Result_i
+::GetCreationId() const
+{
+  return myCreationId;
+}
+
+
+VISU::Result_i::ESourceId
 VISU::Result_i
-::GetRefFatherEntry() 
+::GetSourceId() const
 {
-  return "";
+  return mySourceId;
 }
 
+
+//---------------------------------------------------------------
 std::string
 VISU::Result_i
 ::GetEntry()
@@ -1876,21 +1372,28 @@ VISU::Result_i
   return anEntry.in();
 }
 
-const SALOMEDS::SObject_var& 
+SALOMEDS::SObject_var
 VISU::Result_i
 ::GetSObject() const 
 { 
   return mySObject;
 }
 
-const SALOMEDS::Study_var& 
+SALOMEDS::Study_var
 VISU::Result_i
 ::GetStudyDocument() const 
 { 
   return myStudyDocument;
 }
 
-const SALOMEDS::SComponent_var& 
+_PTR(Study) 
+VISU::Result_i
+::GetStudy() const 
+{ 
+  return myStudy;
+}
+
+SALOMEDS::SComponent_var
 VISU::Result_i
 ::GetSComponent() const
 {
@@ -1906,40 +1409,13 @@ VISU::Result_i
                             theRestoringMap);
 }
 
-#include <stdio.h>
-//---------------------------------------------------------------
-VISU::Result_i
-::~Result_i()
-{
-  MESSAGE("Result_i::~Result_i() - this = "<<this);
-  if (mySourceId == eRestoredFile) {
-    static QString aCommand;
-#ifndef WNT
-    aCommand.sprintf("rm %s",myFileInfo.filePath().latin1());
-#else
-    aCommand.sprintf("del /F %s",myFileInfo.filePath().latin1());
-#endif
-    int res = system(aCommand);
-    MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<res);
-
-#ifndef WNT
-    aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",myFileInfo.dirPath().latin1());
-#else
-    aCommand.sprintf("del /F %s",myFileInfo.dirPath().latin1());
-#endif
-
-    res = system(aCommand);
-    MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<res);
-  }
-  if(myInput) delete myInput;
-}
 
 //=======================================================================
 //function : GetAxisInfo
 //purpose  :
 //=======================================================================
-const Result_i::TAxisInfo* 
-Result_i
+const VISU::Result_i::TAxisInfo* 
+VISU::Result_i
 ::GetAxisInfo(const string& theMeshName,
              TAxis         theAxis,
              gp_Dir&       thePlaneNormal)
@@ -2196,94 +1672,3 @@ Result_i
 
   return components;
 }
-
-
-#ifdef ENABLE_MULTIPR
-//=======================================================================
-// MULTIPR
-//=======================================================================
-
-// MULTIPR
-void VISU::Result_i::AddPartMultipr(const char* thePartName, const char* theMEDFilename)
-{
-  myMapPartNameToMEDFilename.insert(make_pair(thePartName, theMEDFilename));
-}
-
-// MULTIPR
-void VISU::Result_i::SetResolutionMultipr(const char* theName, char theNewResolution)
-{
-  map<string, char>::iterator anIterator = mySelectedResolutionMultipr.find(theName);
-
-  if (anIterator == mySelectedResolutionMultipr.end())
-  {
-    // current name does not exist: create
-    mySelectedResolutionMultipr.insert(make_pair(theName, theNewResolution));
-  }
-  else
-  {
-    // modify
-    (*anIterator).second = theNewResolution;
-  }
-}
-
-// MULTIPR
-string VISU::Result_i::FindPartMultipr(const char* theName)
-{
-  map<string, string>::iterator anIterator = myMapPartNameToMEDFilename.find(theName);
-
-  if (anIterator == myMapPartNameToMEDFilename.end())
-  {
-    return NULL;
-  }
-  return (*anIterator).second;
-}
-
-// MULTIPR
-void VISU::Result_i::SetIsDistributedMEDMultipr(bool theIsDistributedMED)
-{
-  myIsDistributedMEDMultipr = theIsDistributedMED;
-}
-
-// MULTIPR
-bool VISU::Result_i::IsDistributedMEDMultipr() const
-{
-  return myIsDistributedMEDMultipr;
-}
-
-// MULTIPR
-vector<string> VISU::Result_i::GetCurrentRepresentationMultipr()
-{
-  // name of selected parts
-  vector<string> res;
-
-  // for each part of the mesh
-  for (map<string, char>::iterator it = mySelectedResolutionMultipr.begin() ; 
-       it != mySelectedResolutionMultipr.end() ; 
-       it++)
-  {
-    const char* partName = ((*it).first).c_str();
-    char resolution = (*it).second;
-
-    //cout << "name=" << partName << " res=" << resolution << endl;
-
-    if (resolution == 'F')
-    {
-      res.push_back( FindPartMultipr(partName) );
-    } 
-    else if (resolution == 'M')
-    {
-      char subPartName[256];
-      sprintf(subPartName, "%s_MED", partName);
-      res.push_back( FindPartMultipr(subPartName) );
-    }
-    else if (resolution == 'L')
-    {
-      char subPartName[256];
-      sprintf(subPartName, "%s_LOW", partName);
-      res.push_back( FindPartMultipr(subPartName) );
-    }
-  }
-
-  return res;
-}
-#endif // ENABLE_MULTIPR
index 4ef575d048a1c4bbf2d9904e4b71c93cdd96cf85..40eff416ff9e7d4ce1714fb7e8f9c6e18821d9bc 100644 (file)
 #include "VISU_BoostSignals.h"
 #include "SALOME_GenericObj_i.hh"
 
+#include "SALOME_Event.hxx"
 #include "VTKViewer.h"
 
+#include <boost/shared_ptr.hpp>
 #include <gp_Dir.hxx>
 #include <vector>
 #include <map>
@@ -42,164 +44,337 @@ class VISU_Convertor;
 namespace VISU
 {
   //----------------------------------------------------------------------------
-  class VISU_I_EXPORT MinMaxCunsomer: public virtual boost::signalslib::trackable
+  class TResultObserver;
+
+
+  //----------------------------------------------------------------------------
+  class VISU_I_EXPORT Result_i : public virtual POA_VISU::Result,
+                                public virtual RemovableObject_i,
+                                public virtual SALOME::GenericObj_i
   {
-  protected:
-    bool myMinMaxIsInitilized;
-    MinMaxCunsomer();
+    Result_i(const Result_i &);
 
   public:
+    enum ESourceId {
+      eRestoredComponent = -2, 
+      eRestoredFile = -1,  
+      eSavedFile = 0, 
+      eFile = 1, 
+      eComponent = 2
+    };
+
+    enum ECreationId {
+      eImportFile, 
+      eCopyAndImportFile, 
+      eImportMed, 
+      eImportMedField
+    };
+
+    static
+    Result_i*
+    New(SALOMEDS::Study_ptr theStudy,
+       const ESourceId& theSourceId,
+       const ECreationId& theCreationId,
+       CORBA::Boolean theIsBuildImmediately,
+       CORBA::Boolean theIsBuildFields,
+       CORBA::Boolean theIsBuildMinMax,
+       CORBA::Boolean theIsBuildGroups);
+    
     virtual
-    bool
-    IsMinMaxInitilized();
+    void
+    RemoveFromStudy();
+
+    virtual
+    VISU::VISUType 
+    GetType() 
+    {
+      return VISU::TRESULT;
+    }
+
+    virtual
+    CORBA::Boolean
+    BuildAll();
+
+    virtual
+    CORBA::Boolean 
+    Build(CORBA::Boolean theIsBuildAll,
+         CORBA::Boolean theIsAtOnce);
+
+    virtual
+    CORBA::Boolean
+    IsDone();
+
+    virtual
+    CORBA::Boolean
+    IsEntitiesDone();
 
     virtual
     void
-    UpdateMinMax();
-  };
+    SetBuildFields(CORBA::Boolean theIsBuildFields, 
+                  CORBA::Boolean theIsCalculateMinMax);
 
+    virtual
+    CORBA::Boolean
+    IsFieldsDone();
 
-  //----------------------------------------------------------------------------
-  class VISU_I_EXPORT Result_i : public virtual POA_VISU::Result,
-                   public virtual RemovableObject_i,
-                  public virtual SALOME::GenericObj_i
-  {
-    Result_i(const Result_i &);
+    virtual
+    void 
+    SetBuildGroups(CORBA::Boolean theIsBuildGroups);
 
-  public:
-    enum ESourceId {eRestoredComponent = -2, eRestoredFile = -1, eFile = 1, eComponent = 2};
-    enum ECreationId {eImportFile, eCopyAndImportFile, eImportMed, eImportMedField};
+    virtual
+    CORBA::Boolean
+    IsGroupsDone();
 
-    Result_i(SALOMEDS::Study_ptr theStudy,
-            const ESourceId& theSourceId,
-            const ECreationId& theCreationId,
-            CORBA::Boolean theIsBuildImmediately = true,
-            CORBA::Boolean theIsBuildFields = true,
-            CORBA::Boolean theIsBuildMinMax = true,
-            CORBA::Boolean theIsBuildGroups = true);
+    virtual
+    CORBA::Boolean
+    IsMinMaxDone();
 
-    virtual ~Result_i();
-    virtual void RemoveFromStudy();
+    virtual
+    CORBA::Boolean 
+    IsPartsDone();
 
-    virtual VISU::VISUType GetType() { return VISU::TRESULT;}
-    virtual CORBA::Boolean BuildAll();
+    virtual
+    VISU::Result::EntityNames* 
+    GetMeshNames();
 
-    virtual CORBA::Boolean Build(CORBA::Boolean theIsBuildAll,
-                                CORBA::Boolean theIsAtOnce);
-    virtual CORBA::Boolean IsDone();
+    virtual
+    VISU::Result::Entities* 
+    GetEntities(const char* theMeshName);
 
-    virtual CORBA::Boolean IsEntitiesDone();
+    virtual
+    VISU::Result::EntityNames* 
+    GetFamilies(const char* theMeshName, 
+               Entity theEntity);
 
-    virtual void SetBuildFields(CORBA::Boolean theIsBuildFields, 
-                               CORBA::Boolean theIsCalculateMinMax);
-    virtual CORBA::Boolean IsFieldsDone();
+    virtual
+    VISU::Result::EntityNames* 
+    GetGroups(const char* theMeshName);
 
-    virtual void SetBuildGroups(CORBA::Boolean theIsBuildGroups);
-    virtual CORBA::Boolean IsGroupsDone();
+    virtual
+    VISU::Result::EntityNames*
+    GetFields(const char* theMeshName, 
+             Entity theEntity);
 
-    virtual CORBA::Boolean IsMinMaxDone();
+    virtual
+    VISU::Result::TimeStampNumbers* 
+    GetTimeStampNumbers(const char* theMeshName, 
+                       Entity theEntity, 
+                       const char* theFieldName);
+
+    virtual
+    CORBA::Long 
+    GetNumberOfComponents(const char* theMeshName, 
+                         Entity theEntity, 
+                         const char* theFieldName);
+
+    virtual
+    VISU::Result::EntityNames* 
+    GetPartNames(const char* theMeshName);
+
+    virtual
+    VISU::Result::Resolutions* 
+    GetResolutions(const char* theMeshName, 
+                  const char* thePartName);
+
+    virtual
+    VISU::Result::Resolution
+    GetResolution(const char* theMeshName, 
+                 const char* thePartName);
+
+    virtual
+    void 
+    SetResolution(const char* theMeshName, 
+                 const char* thePartName, 
+                 VISU::Result::Resolution theResolution);
+
+    virtual 
+    void
+    UpdateObservers();
 
     virtual 
     void
-    MinMaxConnect(MinMaxCunsomer* theMinMaxCunsomer);
+    ConnectObserver(TResultObserver* theObserver,
+                   boost::signalslib::connection& theConnection);
 
-    typedef boost::signal0<void> TUpdateMinMaxSignal;
+    typedef boost::signal0<void> TUpdateObserverSignal;
 
     typedef VISU_Convertor TInput;
+    typedef boost::shared_ptr<TInput> PInput;
 
   private:
     ESourceId mySourceId;
     ECreationId myCreationId;
 
-    TInput *myInput;
-       std::string myName, myInitFileName;
+    PInput myInput;
+    std::string myFileName;
     QFileInfo myFileInfo;
-
-#ifdef ENABLE_MULTIPR
-    // MULTIPR
-    QFileInfo                          myFileInfoMultipr;
-    std::map<std::string, std::string> myMapPartNameToMEDFilename;
-    std::map<std::string, char>        mySelectedResolutionMultipr;
-    bool                               myIsDistributedMEDMultipr;
-#endif
+    std::string myInitFileName;
 
   protected:
-    virtual Storable* Build(SALOMEDS::SObject_ptr theSObject,
-                           CORBA::Boolean theIsAtOnce = true) ;
-    virtual Storable* BuildAll(SALOMEDS::SObject_ptr theSObject) ;
+    Result_i(SALOMEDS::Study_ptr theStudy,
+            const ESourceId& theSourceId,
+            const ECreationId& theCreationId,
+            CORBA::Boolean theIsBuildImmediately,
+            CORBA::Boolean theIsBuildFields,
+            CORBA::Boolean theIsBuildMinMax,
+            CORBA::Boolean theIsBuildGroups);
+
+    Result_i();
+
+    virtual
+    ~Result_i();
+
+    virtual
+    Storable* 
+    Build(SALOMEDS::SObject_ptr theSObject,
+         CORBA::Boolean theIsAtOnce = true) ;
 
+    virtual
+    void
+    BuildDataTree(const std::string& theResultEntry);
+
+    virtual
+    Storable* 
+    BuildAll(SALOMEDS::SObject_ptr theSObject) ;
+
+    ESourceId
+    GetSourceId() const;
+       
     _PTR(Study) myStudy;
     CORBA::Boolean myIsBuildImmediately;
 
     CORBA::Boolean myIsEntitiesDone;
-    CORBA::Boolean myIsFieldsDone;
-    CORBA::Boolean myIsGroupsDone;
-    CORBA::Boolean myIsMinMaxDone;
-#ifdef ENABLE_MULTIPR
-    CORBA::Boolean myIsPartsDone; // MULTIPR
-#endif
 
+    CORBA::Boolean myIsFieldsDone;
     CORBA::Boolean myIsBuildFields;
+
+    CORBA::Boolean myIsGroupsDone;
     CORBA::Boolean myIsBuildGroups;
 
+    CORBA::Boolean myIsPartsDone;
+    CORBA::Boolean myIsBuildParts;
+
+    CORBA::Boolean myIsMinMaxDone;
     CORBA::Boolean myIsBuildMinMax;
-#ifdef ENABLE_MULTIPR
-    CORBA::Boolean myIsBuildParts; // MULTIPR
-#endif
-    TUpdateMinMaxSignal myUpdateMinMaxSignal;
+    TUpdateObserverSignal myUpdateObserverSignal;
 
     CORBA::Boolean myIsAllDone;
 
   public:
-    virtual size_t IsPossible();
+    virtual
+    size_t
+    IsPossible();
+
+    virtual
+    Storable* 
+    Create(const char* theFileName);
+
+    virtual
+    Storable* 
+    Create(SALOMEDS::SObject_ptr theMedSObject);
+
+    virtual
+    Storable* 
+    Create(SALOME_MED::FIELD_ptr theField);
+
+    virtual
+    Storable* 
+    Restore(SALOMEDS::SObject_ptr theSObject,
+           const Storable::TRestoringMap& theMap,
+           const std::string& thePrefix,
+           CORBA::Boolean theIsMultiFile);
+
+    static 
+    Storable* 
+    StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                  const Storable::TRestoringMap& theMap,
+                  const std::string& thePrefix,
+                  CORBA::Boolean theIsMultiFile);
 
-    virtual Storable* Create(const char* theFileName);
-    virtual Storable* Create(SALOMEDS::SObject_ptr theMedSObject);
-    virtual Storable* Create(SALOME_MED::FIELD_ptr theField);
+    virtual 
+    void
+    ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                             const Storable::TRestoringMap& theMap,
-                             const std::string& thePrefix);
+    //---------------------------------------------------------------
+    typedef std::string TFileName;
+    typedef std::vector<TFileName> TFileNames;
 
-    static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                            const std::string& thePrefix,
-                            const Storable::TRestoringMap& theMap);
+    virtual 
+    bool
+    Save(SALOMEDS::SComponent_ptr theComponent,
+        const std::string& theURL,
+        bool theIsMultiFile,
+        bool theIsASCII,
+        TFileNames& theFileNames,
+        TFileNames& theFiles);
+
+    //---------------------------------------------------------------
+    virtual 
+    CORBA::Boolean 
+    CanCopy(SALOMEDS::SObject_ptr theObject);
+
+    virtual 
+    bool 
+    CopyFrom(SALOMEDS::SObject_ptr theObject, 
+            CORBA::Long& theObjectID,
+            const std::string& theTmpDir,
+            TFileNames& theFileNames);
+
+    //---------------------------------------------------------------
+    virtual
+    const char* 
+    GetComment() const;
 
-    virtual void ToStream(std::ostringstream& theStr);
-    virtual const char* GetComment() const;
     static const std::string myComment;
-    TInput* GetInput();
 
-    const std::string& GetName() const { return myName;}
-    const QFileInfo& GetFileInfo() const { return myFileInfo;}
-#ifdef ENABLE_MULTIPR
-    const QFileInfo& GetFileInfoMultipr() const { return myFileInfoMultipr;}
-#endif
-    const std::string& GetFileName() const { return myInitFileName;}
-    const ECreationId& GetCreationId() const { return myCreationId;}
-       
-#ifdef ENABLE_MULTIPR
-    // MULTIPR
-    void AddPartMultipr(const char* thePartName, const char* theMEDFilename);
-    void SetResolutionMultipr(const char* theName, char theNewResolution); // 'F'=FULL  'M'=MEDIUM  'L'=LOW  'H'=HIDE 
-    std::string FindPartMultipr(const char* theName);
-    std::vector<std::string> GetCurrentRepresentationMultipr();
-    void SetIsDistributedMEDMultipr(bool theIsDistributedMED);
-    bool IsDistributedMEDMultipr() const;
-#endif
+    virtual
+    PInput 
+    GetInput(const std::string& theMeshName = "",
+            VISU::Entity theEntity = VISU::NONE,
+            const std::string& theFieldName = "", 
+            CORBA::Long theTimeStampNumber = -1);
+
+    virtual
+    std::string
+    GetInitFileName() const;
+
+    virtual
+    void 
+    SetInitFileName(const std::string& theFileName);
+
+    virtual
+    std::string
+    GetFileName() const;
 
+    QFileInfo
+    GetFileInfo() const;
+
+    ECreationId
+    GetCreationId() const;
+       
   private:
     SALOMEDS::SObject_var mySObject;
     SALOMEDS::Study_var myStudyDocument;
     SALOMEDS::SComponent_var mySComponent;
 
   public:
-    std::string GetRefFatherEntry();
-    std::string GetEntry();
-    const SALOMEDS::SObject_var& GetSObject() const;
-    const SALOMEDS::Study_var& GetStudyDocument() const;
-    const SALOMEDS::SComponent_var& GetSComponent() const;
-    std::string GetEntry(const Storable::TRestoringMap& theRestoringMap);
+    std::string
+    GetEntry();
+
+    SALOMEDS::SObject_var
+    GetSObject() const;
+
+    SALOMEDS::Study_var
+    GetStudyDocument() const;
+
+    _PTR(Study) 
+    GetStudy() const;
+
+    SALOMEDS::SComponent_var
+    GetSComponent() const;
+
+    std::string
+    GetEntry(const Storable::TRestoringMap& theRestoringMap);
 
     // Info on structured mesh contained in TInput
   public:
@@ -219,7 +394,8 @@ namespace VISU
   };
 
   //! To find Result object as published on father of the given SObject
-  VISU_I_EXPORT Result_var 
+  VISU_I_EXPORT
+  Result_var 
   FindResult(SALOMEDS::SObject_ptr theSObject);
 
   //! To get VISU::Result object published on the given SALOMEDS::SObject
index 2dacbee64124eabcd907e3ab33ff5455fc0dbe38..53ffb8e7e5ce660a533f11866d6a4cbd30d3a5cd 100644 (file)
 //  Module : VISU
 
 #include "VISU_ScalarMapOnDeformedShape_i.hh"
+#include "VISU_Prs3dUtils.hh"
+#include "VISU_Result_i.hh"
+
 #include "VISU_ScalarMapAct.h"
 #include "VISU_ScalarMapOnDeformedShapePL.hxx"
 #include "VISU_Convertor.hxx"
-#include "VISU_Result_i.hh"
 
 #include "SUIT_ResourceMgr.h"
 #include "SALOME_Event.hxx"
@@ -65,7 +67,10 @@ VISU::ScalarMapOnDeformedShape_i
                                      theTimeStampNumber,
                                      false);
     if(theIsMemoryCheck && aResult){
-      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theTimeStampNumber);
       const VISU::PField aField = anInput->GetField(theMeshName,
                                                    (VISU::TEntity)theEntity,
                                                    theFieldName);
@@ -81,7 +86,8 @@ VISU::ScalarMapOnDeformedShape_i
       if(anIsEstimated)
        aSize *= INCMEMORY;
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-      MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+      if(MYDEBUG) 
+       MESSAGE("ScalarMapOnDeformedShape_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
   }catch(std::exception& exc){
     INFOS("Follow exception was occured :\n"<<exc.what());
@@ -225,6 +231,8 @@ void
 VISU::ScalarMapOnDeformedShape_i
 ::SetScale(CORBA::Double theScale) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
                   (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
 }
@@ -310,8 +318,8 @@ VISU::ScalarMapOnDeformedShape_i
 void
 VISU::ScalarMapOnDeformedShape_i
 ::SetScalarField(VISU::Entity theEntity,
-                  const char* theFieldName,
-                  CORBA::Long theTimeStampNumber)
+                const char* theFieldName,
+                CORBA::Long theTimeStampNumber)
 {
   bool anIsModified = false;
 
@@ -327,8 +335,13 @@ VISU::ScalarMapOnDeformedShape_i
   if(!anIsModified)
     return;
 
+  VISU::TSetModified aModified(this);
+
   VISU::TEntity aEntity = VISU::TEntity(theEntity);
-  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+  VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+                                                         theEntity,
+                                                         theFieldName,
+                                                         theTimeStampNumber);
   myScalarField = anInput->GetField(GetCMeshName(), aEntity, theFieldName);
 
   VISU::PUnstructuredGridIDMapper anIDMapper = 
index 3a82f2be5abe911149e3635ae9e19ccb81446d93..8a719f63c395c5d7ee6d45eb794fba71f5d550f3 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_ScalarMap_i.hh"
+#include "VISU_Prs3dUtils.hh"
 
 #include "VISU_Result_i.hh"
 
@@ -67,7 +68,10 @@ VISU::ScalarMap_i
   try{
     if(theResult){
       bool anIsEstimated = true;
-      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theTimeStampNumber);
       size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
                                                     (VISU::TEntity)theEntity,
                                                     theFieldName,
@@ -185,9 +189,6 @@ VISU::ScalarMap_i
   if(const ScalarMap_i* aPrs3d = dynamic_cast<const ScalarMap_i*>(theOrigin)){
     ScalarMap_i* anOrigin = const_cast<ScalarMap_i*>(aPrs3d);
  
-    SetRange(anOrigin->GetMin(), anOrigin->GetMax());
-    UseFixedRange(anOrigin->IsRangeFixed());
-
     SetScaling(anOrigin->GetScaling());
     
     myGroupNames = anOrigin->GetGroupNames();
@@ -212,18 +213,7 @@ VISU::ScalarMap_i
 
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
-  // Scalar Range
-  int aRangeType = aResourceMgr->integerValue("VISU" , "scalar_range_type", 0);
-  if(aRangeType == 1){
-    float aMin = aResourceMgr->doubleValue("VISU", "scalar_range_min", 0);
-    float aMax = aResourceMgr->doubleValue("VISU", "scalar_range_max", 0);
-    SetRange(aMin,aMax);
-  }
-
-  UseFixedRange((aRangeType == 1) ? true : false);
-  bool isLog = aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false);
-
-  if( isLog )
+  if( aResourceMgr->booleanValue("VISU", "scalar_bar_logarithmic", false) )
     SetScaling(VISU::LOGARITHMIC);
   else
     SetScaling(VISU::LINEAR);
@@ -250,12 +240,6 @@ VISU::ScalarMap_i
 
   SetScaling(VISU::Scaling(VISU::Storable::FindValue(theMap,"myScaling").toInt()));
 
-  float aMin = VISU::Storable::FindValue(theMap,"myScalarRange[0]").toDouble();
-  float aMax = VISU::Storable::FindValue(theMap,"myScalarRange[1]").toDouble();
-  SetRange(aMin,aMax);
-
-  UseFixedRange(VISU::Storable::FindValue(theMap,"myIsFixedRange").toInt());
-
   bool anIsExists;
   QString aGeomNames = VISU::Storable::FindValue(theMap, "myGeomNameList", &anIsExists);
   if(anIsExists){
@@ -291,9 +275,6 @@ VISU::ScalarMap_i
 {
   TSuperClass::ToStream(theStr);
 
-  Storable::DataToStream( theStr, "myScalarRange[0]", GetMin() );
-  Storable::DataToStream( theStr, "myScalarRange[1]", GetMax() );
-  Storable::DataToStream( theStr, "myIsFixedRange",   IsRangeFixed() );
   Storable::DataToStream( theStr, "myScaling",        GetScaling() );
 
   std::ostringstream aGeomNameList;
@@ -321,26 +302,12 @@ void
 VISU::ScalarMap_i
 ::SetScaling(VISU::Scaling theScaling)
 {
+  VISU::TSetModified aModified(this);
+  
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapPL, int>
                   (GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling));
 }
 
-//----------------------------------------------------------------------------
-void
-VISU::ScalarMap_i
-::SetRange(CORBA::Double theMin, CORBA::Double theMax)
-{
-  TSuperClass::SetRange(theMin, theMax);
-}
-
-//----------------------------------------------------------------------------
-void
-VISU::ScalarMap_i
-::SetSourceRange()
-{
-  TSuperClass::SetSourceRange();
-}
-
 //----------------------------------------------------------------------------
 const VISU::ScalarMap_i::TGroupNames&
 VISU::ScalarMap_i
@@ -375,7 +342,7 @@ void
 VISU::ScalarMap_i
 ::AddMeshOnGroup(const char* theGroupName)
 {
-  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+  VISU::Result_i::PInput anInput = GetCResult()->GetInput();
   VISU::PUnstructuredGridIDMapper anIDMapper = anInput->GetMeshOnGroup(GetCMeshName(), theGroupName);
   if(anIDMapper){
     int aNbGroups  = myGroupNames.size();
@@ -407,7 +374,10 @@ void
 VISU::ScalarMap_i
 ::DoSetInput(bool theIsInitilizePipe, bool theReInit)
 {
-  VISU::Result_i::TInput* anInput = GetCResult()->GetInput();
+  VISU::Result_i::PInput anInput = GetCResult()->GetInput(GetCMeshName(),
+                                                         GetEntity(),
+                                                         GetCFieldName(),
+                                                         GetTimeStampNumber());
   if(!anInput)
     throw std::runtime_error("Mesh_i::Build - GetCResult()->GetInput() == NULL !!!");
 
@@ -422,13 +392,6 @@ VISU::ScalarMap_i
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
 
   GetSpecificPL()->SetUnstructuredGridIDMapper(anIDMapper);
-  if(theIsInitilizePipe){
-    GetSpecificPL()->Init();
-  }
-
-  // To update scalar range according to the new input
-  if(!IsTimeStampFixed() && !IsRangeFixed() || theReInit)
-    SetSourceRange();
 }
 
 
index 6d73120b0252f9b471d07655832a4101e7bfc778..d52a2fb5704d3012b23e84c5d0525824593f4c67 100644 (file)
@@ -76,14 +76,6 @@ namespace VISU
     void
     SetScaling(VISU::Scaling theScaling);
 
-    virtual
-    void
-    SetRange(CORBA::Double theMin, CORBA::Double theMax);
-
-    virtual
-    void
-    SetSourceRange();
-    
     //----------------------------------------------------------------------------
     //! Sets initial source geometry
     virtual
index 62757e1ce9cf2af9499a5e3add66ea1e6986bd4c..f62b758f61c1ffc0268c4b154ded71247ab5a47c 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_StreamLines_i.hh"
+#include "VISU_Prs3dUtils.hh"
 #include "VISU_Result_i.hh"
 
 #include "VISU_Actor.h"
@@ -59,7 +60,10 @@ VISU::StreamLines_i
     if(!TSuperClass::IsPossible(theResult, theMeshName, theEntity, theFieldName, theTimeStampNumber, false)) 
       return 0;
 
-    VISU::Result_i::TInput* anInput = theResult->GetInput();
+    VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                        theEntity,
+                                                        theFieldName,
+                                                        theTimeStampNumber);
     VISU::PUnstructuredGridIDMapper anIDMapper = 
       anInput->GetTimeStampOnMesh(theMeshName,
                                  VISU::TEntity(theEntity),
@@ -306,15 +310,18 @@ VISU::StreamLines_i
 ::SetSource(VISU::Prs3d_i* thePrs3d)
 {
   mySourceEntry = "";
-  if(thePrs3d){
-    SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
-    CORBA::String_var aString = aSObject->GetID();
-    if(mySourceEntry == aString.in())
-      return;
-
-    mySourceEntry = aString.in();
-    myParamsTime.Modified();
-  }
+  if(!thePrs3d)
+    return;
+
+  SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
+  CORBA::String_var aString = aSObject->GetID();
+  if(mySourceEntry == aString.in())
+    return;
+  
+  VISU::TSetModified aModified(this);
+  
+  mySourceEntry = aString.in();
+  myParamsTime.Modified();
 }
 
 //---------------------------------------------------------------
@@ -324,8 +331,10 @@ VISU::StreamLines_i
 {
   if(!myStreamLinesPL->GetSource() && mySourceEntry == "") 
     return;
+
   if(myStreamLinesPL->GetSource() == myAppendFilter->GetOutput()) 
     return;
+
   VISU::Prs3d_var aPrs3d = GetSource();
   SetParams(GetIntegrationStep(),
            GetPropagationTime(),
index 5e037ba1dab12deae800fa74c80dda60325954b0..ec88462de2951b7c41d326fbf0e03c99e4e8ec9e 100644 (file)
@@ -57,7 +57,7 @@ const string VISU::Table_i::myComment  = "TABLE";
 /*!
   Generate unique name
 */
-const char* VISU::Table_i::GenerateName()
+QString VISU::Table_i::GenerateName()
 {
   return VISU::GenerateName( "Table", ++myNbPresent );
 }
@@ -74,7 +74,7 @@ const char* VISU::Table_i::GetComment() const
 VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry )
      : PrsObject_i(theStudy)
 {
-  mySObj = SALOMEDS::SObject::_duplicate((theStudy->FindObjectID(theObjectEntry)));
+  mySObj = theStudy->FindObjectID(theObjectEntry);
   myOrientation = VISU::Table::HORIZONTAL;
 }
 /*!
@@ -126,11 +126,12 @@ VISU::Table_i
 }
 
 //----------------------------------------------------------------------------
-char* 
+std::string
 VISU::Table_i
 ::GetObjectEntry() 
 {
-  return CORBA::string_dup( mySObj->GetID() ); 
+  CORBA::String_var anEntry = mySObj->GetID();
+  return anEntry.in(); 
 }
 
 //----------------------------------------------------------------------------
@@ -180,7 +181,7 @@ CORBA::Long VISU::Table_i::GetNbColumns()
 VISU::Storable* VISU::Table_i::Create()
 {
   // generate name ...
-  SetName(GetTableTitle(), false);
+  SetName(GetTableTitle().latin1(), false);
 
   // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
   if ( GetName() == "" )
@@ -197,7 +198,7 @@ VISU::Storable* VISU::Table_i::Create()
     }
 
   if ( GetName() == "" )
-    SetName(GenerateName(), false);
+    SetName(GenerateName().latin1(), false);
   // ... and build the object
   return Build( false );
 }
@@ -292,8 +293,10 @@ void VISU::Table_i::ToStream( std::ostringstream& theStr )
 /*!
   Called from engine to restore table from the file
 */
-VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject,
-                                      const string& thePrefix, const Storable::TRestoringMap& theMap)
+VISU::Storable* VISU::Table_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                             const Storable::TRestoringMap& theMap,
+                                             const std::string& thePrefix,
+                                             CORBA::Boolean theIsMultiFile)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" );
@@ -302,7 +305,7 @@ VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject,
 /*!
   Gets title for the original table object
 */
-const char* VISU::Table_i::GetTableTitle()
+QString VISU::Table_i::GetTableTitle()
 {
   SALOMEDS::SObject_var SO = mySObj;
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
@@ -312,11 +315,13 @@ const char* VISU::Table_i::GetTableTitle()
   if ( !SO->_is_nil() ) {
     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
       anInt = SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
-      return anInt->GetTitle();
+      CORBA::String_var aString = anInt->GetTitle();
+      return aString.in();
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       aReal = SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
-      return aReal->GetTitle();
+      CORBA::String_var aString = aReal->GetTitle();
+      return aString.in();
     }
   }
   return "";
@@ -365,7 +370,7 @@ const string VISU::Curve_i::myComment  = "CURVE";
 /*!
   Generate unique name
 */
-const char* VISU::Curve_i::GenerateName()
+QString VISU::Curve_i::GenerateName()
 {
   return VISU::GenerateName( "Curve", ++myNbPresent );
 }
@@ -527,7 +532,7 @@ VISU::Storable* VISU::Curve_i::Build(int theRestoring )
 CORBA::Boolean VISU::Curve_i::IsValid()
 {
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -555,7 +560,7 @@ string VISU::Curve_i::GetHorTitle()
 {
   string title;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -585,7 +590,7 @@ string VISU::Curve_i::GetVerTitle()
 {
   string title;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -613,7 +618,7 @@ string VISU::Curve_i::GetHorUnits()
 {
   string units;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -641,7 +646,7 @@ string VISU::Curve_i::GetVerUnits()
 {
   string units;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -669,7 +674,7 @@ int VISU::Curve_i::GetData( double*& theHorList, double*& theVerList, QStringLis
 {
   theHorList = 0; theVerList = 0;
   // getting table SObject by it's entry
-  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry());
+  SALOMEDS::SObject_var SO = GetStudyDocument()->FindObjectID(myTable->GetObjectEntry().c_str());
   SALOMEDS::StudyBuilder_var Builder = GetStudyDocument()->NewBuilder();
   SALOMEDS::GenericAttribute_var        anAttr;
   SALOMEDS::AttributeTableOfInteger_var anInt;
@@ -791,7 +796,7 @@ SPlot2d_Curve* VISU::Curve_i::CreatePresentation()
   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().c_str()));
+    crv->setTableIO(new SALOME_InteractiveObject(myTable->GetObjectEntry().c_str(), "VISU", myTable->GetName().c_str()));
   return crv;
 }
 /*!
@@ -837,14 +842,16 @@ void VISU::Curve_i::ToStream( std::ostringstream& theStr )
 /*!
   Gets reference table's entry
 */
-const char* VISU::Curve_i::GetTableID() {
+std::string VISU::Curve_i::GetTableID() {
   return myTable->GetObjectEntry();
 }
 /*!
   Called from engine to restore curve from the file
 */
-VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject,
-                                      const string& thePrefix, const Storable::TRestoringMap& theMap)
+VISU::Storable* VISU::Curve_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                             const Storable::TRestoringMap& theMap,
+                                             const std::string& thePrefix,
+                                             CORBA::Boolean theIsMultiFile)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
@@ -889,7 +896,7 @@ const string VISU::Container_i::myComment  = "CONTAINER";
 /*!
   Generate unique name
 */
-const char* VISU::Container_i::GenerateName()
+QString VISU::Container_i::GenerateName()
 {
   return VISU::GenerateName( "Plot2DView", ++myNbPresent );
 }
@@ -1136,8 +1143,10 @@ void VISU::Container_i::ToStream( std::ostringstream& theStr )
 /*!
   Called from engine to restore container from the file
 */
-VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject,
-                                          const string& thePrefix, const Storable::TRestoringMap& theMap)
+VISU::Storable* VISU::Container_i::StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                                 const Storable::TRestoringMap& theMap,
+                                                 const std::string& thePrefix,
+                                                 CORBA::Boolean theIsMultiFile)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Container_i* pResent = new VISU::Container_i( aStudy );
index b241a6b9a5649bd09895538eaf6de77db9010fc8..dcdecc6b5adad2066081a06ba0ab622cff7a540f 100644 (file)
@@ -71,17 +71,18 @@ namespace VISU{
     virtual Storable* Restore( const Storable::TRestoringMap& theMap,
                               SALOMEDS::SObject_ptr SO);
 
-    static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                            const std::string& thePrefix,
-                            const Storable::TRestoringMap& theMap);
+    static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                   const Storable::TRestoringMap& theMap,
+                                   const std::string& thePrefix,
+                                   CORBA::Boolean theIsMultiFile);
 
     virtual void ToStream( std::ostringstream& theStr );
     static const std::string myComment;
     virtual const char* GetComment() const;
-    virtual const char* GenerateName();
-    virtual const char* GetTableTitle();
+    virtual QString GenerateName();
+    virtual QString GetTableTitle();
 
-    virtual char* GetObjectEntry();
+    virtual std::string GetObjectEntry();
   };
   SALOMEDS::SObject_var ImportTables(const char* theFileName, SALOMEDS::Study_ptr theStudy);
   bool ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
@@ -140,15 +141,16 @@ namespace VISU{
 
     virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
 
-    static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                            const std::string& thePrefix,
-                            const Storable::TRestoringMap& theMap);
+    static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                   const Storable::TRestoringMap& theMap,
+                                   const std::string& thePrefix,
+                                   CORBA::Boolean theIsMultiFile);
 
     virtual void ToStream( std::ostringstream& theStr );
     static const std::string myComment;
     virtual const char* GetComment() const;
-    virtual const char* GenerateName();
-    virtual const char* GetTableID();
+    virtual QString GenerateName();
+    virtual std::string GetTableID();
 
     virtual CORBA::Boolean IsAuto() { return myAuto; }
     virtual CORBA::Boolean IsValid();
@@ -194,14 +196,15 @@ namespace VISU{
     virtual Storable* Create();
     virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO );
 
-    static Storable* Restore(SALOMEDS::SObject_ptr theSObject,
-                            const std::string& thePrefix,
-                            const Storable::TRestoringMap& theMap);
+    static Storable* StorableEngine(SALOMEDS::SObject_ptr theSObject,
+                                   const Storable::TRestoringMap& theMap,
+                                   const std::string& thePrefix,
+                                   CORBA::Boolean theIsMultiFile);
 
     virtual void ToStream( std::ostringstream& theStr );
     static const std::string myComment;
     virtual const char* GetComment() const;
-    virtual const char* GenerateName();
+    virtual QString GenerateName();
 
     void Update();
     VISU::Curve_i* GetCurve( CORBA::Long theIndex );
index 8434c0134f84567f2327af1355c359cd38d0693b..9aca708427cec6a28306828f37fe428cd31f20fc 100644 (file)
@@ -25,6 +25,7 @@
 //  Module : VISU
 
 #include "VISU_Vectors_i.hh"
+#include "VISU_Prs3dUtils.hh"
 #include "VISU_Result_i.hh"
 
 #include "VISU_VectorsAct.h"
@@ -65,7 +66,10 @@ VISU::Vectors_i
                                             false);
     if(theIsMemoryCheck && aResult){
       bool anIsEstimated = true;
-      VISU::Result_i::TInput* anInput = theResult->GetInput();
+      VISU::Result_i::PInput anInput = theResult->GetInput(theMeshName,
+                                                          theEntity,
+                                                          theFieldName,
+                                                          theTimeStampNumber);
       size_t aSize = anInput->GetTimeStampOnMeshSize(theMeshName,
                                                     (VISU::TEntity)theEntity,
                                                     theFieldName,
@@ -203,6 +207,8 @@ VISU::Vectors_i
   if(VISU::CheckIsSameValue(myLineWidth, theWidth))
     return;
 
+  VISU::TSetModified aModified(this);
+
   myLineWidth = theWidth;
   myParamsTime.Modified();
 }
@@ -221,6 +227,8 @@ void
 VISU::Vectors_i
 ::SetGlyphType(VISU::Vectors::GlyphType theType) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphType>
                   (GetSpecificPL(), &VISU_VectorsPL::SetGlyphType, VISU_VectorsPL::GlyphType(theType)));
 }
@@ -239,6 +247,8 @@ void
 VISU::Vectors_i
 ::SetGlyphPos(VISU::Vectors::GlyphPos thePos) 
 { 
+  VISU::TSetModified aModified(this);
+
   ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphPos>
                   (GetSpecificPL(), &VISU_VectorsPL::SetGlyphPos, VISU_VectorsPL::GlyphPos(thePos)));
 }