]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
DCQ : Merge with Ecole Ete a6.
authoryfr <yfr@opencascade.com>
Fri, 25 Jun 2004 09:41:55 +0000 (09:41 +0000)
committeryfr <yfr@opencascade.com>
Fri, 25 Jun 2004 09:41:55 +0000 (09:41 +0000)
77 files changed:
INSTALL
Makefile.in
adm_local/unix/config_files/check_Med.m4
adm_local/unix/make_commence.in
bin/VERSION
configure.in.base
idl/Makefile.in
idl/VISU_Gen.idl
resources/VISU.config [new file with mode: 0644]
resources/VISU_en.xml
resources/VISU_fr.xml
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor.cxx
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx
src/CONVERTOR/VISU_DatConvertor.cxx
src/CONVERTOR/VISU_DatConvertor.hxx
src/CONVERTOR/VISU_MedConvertor.cxx
src/CONVERTOR/VISU_MedConvertor.hxx
src/Makefile.in
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_MeshAct.cxx
src/OBJECT/VISU_MeshAct.h
src/OBJECT/VISU_VectorsAct.cxx
src/OBJECT/VISU_VectorsAct.h
src/PIPELINE/Makefile.in
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_StreamLinesPL.hxx
src/VISUGUI/Makefile.in
src/VISUGUI/VISU_msg_en.po
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_CutLinesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.cxx
src/VISUGUI/VisuGUI_CutPlanesDlg.h
src/VISUGUI/VisuGUI_EditContainerDlg.cxx
src/VISUGUI/VisuGUI_FileDlg.cxx
src/VISUGUI/VisuGUI_IsoSurfacesDlg.cxx
src/VISUGUI/VisuGUI_Selection.cxx
src/VISUGUI/VisuGUI_Selection.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISU_I/Makefile.in
src/VISU_I/VISUConfig.cc
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_CorbaMedConvertor.cxx
src/VISU_I/VISU_CorbaMedConvertor.hxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Mesh_i.hh
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_Result_i.cc
src/VISU_I/VISU_Result_i.hh
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_StreamLines_i.hh
src/VISU_I/VISU_Table_i.cc
src/VISU_I/VISU_Table_i.hh
src/VISU_I/VISU_TimeAnimation.cxx
src/VISU_I/VISU_TimeAnimation.h
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh
src/VISU_I/VISU_ViewManager_i.cc
src/VISU_I/VISU_ViewManager_i.hh

diff --git a/INSTALL b/INSTALL
index 1e30dd5bbaeddb95d722cf4a9fb516acf3db3e37..a1ae4a8a8ccf613864509f37ee32085b3226648c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,4 +1,4 @@
-This is the version 1.4.0 of VISU
+This is the version 2.0.0 of VISU
 Compatible with :
-       - KERNEL 1.4.0
-       - MED 1.4.0
+       - KERNEL 2.0.0
+       - MED 2.0.0
index a8adab1bd244fc7f52b375c1820acc218d9e93b3..85b1b76d6ad2ad74f6f52429cfcd4b9b95bb1978 100644 (file)
@@ -14,7 +14,7 @@ VPATH=.:@srcdir@:@top_srcdir@/bin:@top_srcdir@/resources:./bin:@top_srcdir@/idl:
 
 @COMMENCE@
 
-SUBDIRS = idl src
+SUBDIRS = idl src doc
 
 RESOURCES_FILES = \
 ModuleVisu.png \
@@ -43,6 +43,7 @@ Visu_wireframe.png \
 Visu_scaling.png \
 VISU_en.xml \
 VISU_fr.xml \
+VISU.config \
 VISUCatalog.xml \
 Visu_tree_visu.png \
 Visu_streamlines.png
@@ -67,10 +68,10 @@ include/salome/SALOMEconfig.h: salome_adm/unix/SALOMEconfig.ref
 # test if SALOMEconfig.h has changed (contents)
 salome_adm/unix/SALOMEconfig.ref: salome_adm/unix/SALOMEconfig.h
        @if ! [ -a $@ ]; then \
-         cp -p $< $@;        \
+         cp -p -f $< $@;        \
        fi;                   \
        if ! cmp $< $@; then  \
-         cp -p $< $@;        \
+         cp -p -f $< $@;        \
        fi;                   \
 
 include/salome/sstream: salome_adm/unix/sstream
@@ -94,7 +95,7 @@ install-include: $(include_list)
        $(INSTALL) -d  $(includedir)
        @for f in X $(include_list); do                         \
           if test $$f != X; then                               \
-            ($(INSTALL_DATA) $$f $(includedir)/. || exit 1);   \
+            ($(INSTALL_DATA) -p $$f $(includedir)/. || exit 1);        \
           fi;                                                  \
        done
 
index 839a3d7beb7e748e8eca8474df5c4f539b0e7342..49272705302c59cc4c61a4feee2de1ccb57092d9 100644 (file)
@@ -45,7 +45,7 @@ if test -f ${MED_DIR}/bin/salome/libMEDMEM_Swig.py ; then
    AC_SUBST(MED_ROOT_DIR)
 
 else
-   AC_MSG_WARN("Cannot find compiled Med module distribution")
+   AC_MSG_WARN("Cannot find Med module sources")
 fi
   
 AC_MSG_RESULT(for Med: $Med_ok)
index e9de78bbf44c10e4364b510a0f4c018cfa14010e..f8b9e383199e9a16d713dd222a31c4a8c92dd5e6 100644 (file)
@@ -131,7 +131,8 @@ OMNIORB_CXXFLAGS    = @OMNIORB_CXXFLAGS@
 
 OMNIORB_IDL         = @OMNIORB_IDL@
 OMNIORB_IDLCXXFLAGS = @OMNIORB_IDLCXXFLAGS@
-OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
+OMNIORB_IDLPYFLAGS  = @OMNIORB_IDLPYFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/salome/idl \
+       -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
 
 OMNIORB_IDL_CLN_H   = @OMNIORB_IDL_CLN_H@
 OMNIORB_IDL_CLN_CXX = @OMNIORB_IDL_CLN_CXX@
@@ -148,7 +149,8 @@ CORBA_INCLUDES    = @CORBA_INCLUDES@
 CORBA_LIBS        = @CORBA_LIBS@
 CORBA_CXXFLAGS    = @CORBA_CXXFLAGS@
 
-IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
+IDLCXXFLAGS = -bcxx @IDLCXXFLAGS@ -I$(top_srcdir)/idl -I$(top_builddir)/idl/salome \
+       -I$(KERNEL_ROOT_DIR)/idl/salome -I$(MED_ROOT_DIR)/idl/salome
 IDLPYFLAGS  = @IDLPYFLAGS@
 
 IDL = @IDL@
@@ -202,13 +204,13 @@ idldir=${prefix}/idl/salome
 sharedpydir=@libdir@/python$(PYTHON_VERSION)/site-packages/salome/shared_modules
 incmakedir=${prefix}/salome_adm/unix
 
-docdir=$(datadir)/doc
+docdir=${prefix}/doc/salome
 
 #
 # begin of package rules
 #
 
-.PHONY: all lib bin inc resources data doc tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
+.PHONY: all lib bin inc resources data docs tests install uninstall dep depend depend_idl cleandep mostlyclean clean distclean
 
 .SUFFIXES: .cxx .cc .c .f .o .lo .idl .py .i .ui .po .qm
 
index fc5321c0611834437ae4d62395ed67a651fc289c..5b88fed55ea71973e356ee51dd6ee4beb165b350 100755 (executable)
@@ -1 +1 @@
-THIS IS SALOME - VISU VERSION: 1.4.0
+THIS IS SALOME - VISU VERSION: 2.0.0
index 0c666c610193db3b1b2a044616c4ef2a2d91e185..4e6c96346a6e84be9744c323676dfb0aec31493f 100644 (file)
@@ -310,7 +310,7 @@ else
 fi
 
 # make other build directories
-for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources share/salome/doc idl
+for rep in salome_adm adm_local doc bin/salome include/salome lib/salome share/salome/resources idl
 do
 #   if test ! -d $rep ; then
 #      eval mkdir $rep
@@ -343,14 +343,15 @@ dnl copy shells and utilities contained in the bin directory
 dnl excluding .in files (treated in AC-OUTPUT below) and CVS 
 dnl directory
 
-cd bin
+mkdir -p bin/salome
+cd bin/salome
 for i in $ROOT_SRCDIR/bin/*
 do
   local_bin=`echo $i | sed -e "s,$ROOT_SRCDIR,.,"`
   case "$local_bin" in
         *.in | *~)                    ;;
-        ./bin/CVS)                    ;;
-        *) ln -fs $i; echo $local_bin ;;
+        ./bin/CVS | ./bin/salome)                    ;;
+        *) /usr/bin/install -C $i .; echo $local_bin ;;
   esac
 done
 cd $ROOT_BUILDDIR
index 95c59e050366f88de03f4b9cf9a95f85afe9a83f..b032d41de2c39dca0f6042882a302b2689646c76 100644 (file)
@@ -6,7 +6,7 @@
 top_srcdir=@top_srcdir@
 top_builddir=..
 srcdir=@srcdir@
-VPATH=.:$(srcdir):${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
+VPATH=.:${KERNEL_ROOT_DIR}/idl/salome:${MED_ROOT_DIR}/idl/salome
 
 @COMMENCE@
 
@@ -16,11 +16,14 @@ IDL_FILES = \
 PY_CLIENT_IDL = $(IDL_FILES)
 
 # we copy all idl file in $(top_builddir)/idl
-inc: $(IDL_FILES:%=$(top_builddir)/idl/%)
+inc: $(top_builddir)/idl/salome $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
 
-$(IDL_FILES:%=$(top_builddir)/idl/%):$(top_builddir)/idl/%:%
+$(top_builddir)/idl/salome:
+       mkdir $@
+
+$(IDL_FILES:%=$(top_builddir)/idl/salome/%):$(IDL_FILES:%=$(top_srcdir)/idl/%)
 #      $(CP) $< $@
-       cp -f $< $@
+       cp -f $^ $(top_builddir)/idl/salome
 
 
 lib: pyidl
@@ -32,7 +35,7 @@ pyidl: $(PYTHON_BUILD_SITE) $(IDL_FILES:%.idl=$(PYTHON_BUILD_SITE)/%_idl.py)
 $(PYTHON_BUILD_SITE):
        $(INSTALL) -d  $@
 
-$(PYTHON_BUILD_SITE)/%_idl.py: %.idl
+$(PYTHON_BUILD_SITE)/%_idl.py: $(top_builddir)/idl/salome/%.idl
        $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_BUILD_SITE) $<
 
 
@@ -40,12 +43,12 @@ $(PYTHON_BUILD_SITE)/%_idl.py: %.idl
 install: install-pyidl install-idl
 
 # create directory $(idldir) and copy idl files into it
-install-idl: $(IDL_FILES)
+install-idl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        $(INSTALL) -d  $(idldir)
        $(INSTALL_DATA) $^ $(idldir)
 
 
-install-pyidl: $(IDL_FILES)
+install-pyidl: $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        $(INSTALL) -d  $(PYTHON_SITE_INSTALL)
        @for file in $^ dummy; do \
          if [ $$file != "dummy" ]; then \
@@ -60,6 +63,6 @@ cleandep:
 
 distclean:
        -$(RM) *.py
-       -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/%)
+       -$(RM) $(IDL_FILES:%=$(top_builddir)/idl/salome/%)
        -$(RM) Makefile
 
index 77957a23b8a90412950ba4917300cb19cd23189a..a01a2bb9093db3a20beeaab7c343d4f78614841c 100644 (file)
@@ -961,6 +961,14 @@ post-processing presentations from given %Result and %Table object reference, us
 provided by %ViewManager.
 */
    interface VISU_Gen : Engines::Component, SALOMEDS::Driver, Base{
+/*! SAN & VSR : Test QT_EVENT 
+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+*/
+     void CreateTestView();
+     void ShowTestObject();
+/*! SAN & VSR : Test QT_EVENT
+<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+*/
 /*! Sets a definite study to be current.
 */
      void SetCurrentStudy(in SALOMEDS::Study theStudy);
@@ -1416,10 +1424,6 @@ which the curve is constructed on the graphics.
 */
     void Destroy(in View theView);
 
-/*! Runs a cycle of events in GUI (desktop).
-\note This method is one-way.
-*/
-    void ProcessEvents();
  };
 };
 #endif
diff --git a/resources/VISU.config b/resources/VISU.config
new file mode 100644 (file)
index 0000000..6925397
--- /dev/null
@@ -0,0 +1 @@
+language=en
\ No newline at end of file
index 9b73860104ba6a76089e4dc8b693b8cee8fc954a..5be5fdf03a701c4f120d8a8fd95d3a68163ecd96 100644 (file)
                        
 <!-- ************************* Selection (menubar) ************************************** -->
 <menu-item label-id="Selection" item-id="41" pos-id="4">
-  <submenu label-id="Cell" item-id="411" pos-id="">
-    <popup-item item-id="4111" pos-id="" label-id="Select by number" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-    <popup-item item-id="4112" pos-id="" label-id="Return attributes" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-  </submenu>
-  <endsubmenu /> 
-  <submenu label-id="Point" item-id="412" pos-id="">
-    <popup-item item-id="4121" pos-id="" label-id="Select by number" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-    <popup-item item-id="4122" pos-id="" label-id="Return attributes" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
-  </submenu>
-  <endsubmenu /> 
-  <popup-item item-id="413" pos-id="" label-id="Shape" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
+    <popup-item item-id="4111" pos-id="" label-id="Selection info..." icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
 </menu-item>
 
 <!-- ************************* Representation (menubar) ************************************** -->
@@ -67,7 +57,7 @@
 
 <!-- ************************* Preferences (menubar) ************************************** -->
 <menu-item label-id="Preferences" item-id="4" pos-id="">
-  <submenu label-id="Visu" item-id="" pos-id="-1">
+  <submenu label-id="Visu" item-id="50" pos-id="-1">
     <popup-item item-id="51" pos-id="" label-id="Scalar Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
     <popup-item item-id="52" pos-id="" label-id="Sweeping" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
     <separator pos-id=""/>
   <!--toolbutton-item item-id="4017" pos-id="" label-id="Same As..." icon-id="Visu_sameas.png" tooltip-id="Same As" accel-id="" toggle-id="" execute-action=""/-->
 </toolbar>
 
-<toolbar label-id="Selection Toolbar">
-  <toolbutton-item item-id="101" pos-id="" label-id="Point" icon-id="Visu_selectionpoint.png" tooltip-id="Point selection" accel-id="" toggle-id="" execute-action=""/>
-  <toolbutton-item item-id="102" pos-id="" label-id="Edge" icon-id="Visu_selectionedge.png" tooltip-id="Edge selection" accel-id="" toggle-id="" execute-action=""/>
-  <toolbutton-item item-id="103" pos-id="" label-id="Cell" icon-id="Visu_selectioncell.png" tooltip-id="Cell selection" accel-id="" toggle-id="" execute-action=""/>
-  <toolbutton-item item-id="104" pos-id="" label-id="Actor" icon-id="Visu_selectionactor.png" tooltip-id="Actor selection" accel-id="" toggle-id="" execute-action=""/>
-</toolbar>
-  
 </desktop>      <!--   DESKTOP END    -->  
 </application>  <!-- APPLICATION END  -->
index 9b73860104ba6a76089e4dc8b693b8cee8fc954a..0aa698957103a0c879355b62fa9b4281a5e3a117 100644 (file)
@@ -67,7 +67,7 @@
 
 <!-- ************************* Preferences (menubar) ************************************** -->
 <menu-item label-id="Preferences" item-id="4" pos-id="">
-  <submenu label-id="Visu" item-id="" pos-id="-1">
+  <submenu label-id="Visu" item-id="50" pos-id="-1">
     <popup-item item-id="51" pos-id="" label-id="Scalar Bar" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
     <popup-item item-id="52" pos-id="" label-id="Sweeping" icon-id="" tooltip-id="" accel-id="" toggle-id="" execute-action=""/>
     <separator pos-id=""/>
index 4afe4b27cd4f550ac73540c5a48625a29914132f..79856149c9b8d9a36bc88dcf14e55fbf82eca278 100644 (file)
@@ -43,7 +43,7 @@ static int MYDEBUG = 1;
 static int MYDEBUG = 0;
 #endif
 
-void parseFile(const char* theFileName) throw(std::runtime_error&){
+void parseFile(const char* theFileName) {
   try{
     cout<<"'"<<theFileName<<"'...\n";
     auto_ptr<VISU_Convertor> aCon(CreateConvertor(theFileName));
index c9dbdb411965af4cae63cf3fa3e6e7890203226b..8238d72a15b37a8eb74c7705e9ce1a5d65bac9f7 100644 (file)
@@ -36,7 +36,7 @@ static int MYDEBUG = 0;
 #endif
 
 extern "C" {
-  VISU_Convertor* CreateConvertor(const string& theFileName) throw(std::runtime_error&){
+  VISU_Convertor* CreateConvertor(const string& theFileName) {
     if(QFileInfo(theFileName.c_str()).extension(false) == "med")
       return CreateMedConvertor(theFileName);
     else
@@ -60,7 +60,6 @@ namespace VISU{
   }
 
   pair<int,int> TMeshOnEntity::GetCellsDims(const string& theFamilyName) const
-    throw(std::runtime_error&)
   {
     bool isFamilyPresent = (theFamilyName != "");
     int aNbCells = 0, aCellsSize = 0;
@@ -106,7 +105,6 @@ namespace VISU{
   }
 
   const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
-    throw(std::runtime_error&) 
   {
     if(theFamilyName == "") return NULL;
     const VISU::TFamilyMap& aFamilyMap = theMeshOnEntity.myFamilyMap;
@@ -118,7 +116,6 @@ namespace VISU{
   }
   
   TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
-    throw(std::runtime_error&) 
   {
     if(theFamilyName == "") return NULL;
     VISU::TFamilyMap& aFamilyMap = theMeshOnEntity.myFamilyMap;
@@ -140,7 +137,7 @@ namespace VISU{
 }
 
 
-const VISU::TMeshMap& VISU_Convertor::GetMeshMap() throw(std::runtime_error&)
+const VISU::TMeshMap& VISU_Convertor::GetMeshMap() { 
   if(!myIsDone) { myIsDone = true;  Build();}
   return myMeshMap;
 }
index 65d2d6a32288896fc05027f94f4db47c488048f7..92a45a325d799e32e41635f49320b166a16705dc 100644 (file)
@@ -130,16 +130,15 @@ namespace VISU{
     TFamilyMap myFamilyMap;
     TFieldMap myFieldMap;
     TMeshOnEntity() : myNbCells(0), myCellsSize(0) {}
-    std::pair<vtkIdType,vtkIdType> GetCellsDims(const std::string& theFamilyName = "") const
-      throw(std::runtime_error&); 
+    std::pair<vtkIdType,vtkIdType> GetCellsDims(const std::string& theFamilyName = "") const;
+      
   };
   typedef std::map<TEntity,TMeshOnEntity> TMeshOnEntityMap;
   const TFamily* GetFamily(const VISU::TMeshOnEntity& theMeshOnEntity, 
-                    const std::string& theFamilyName)
-    throw(std::runtime_error&); 
+                    const std::string& theFamilyName);
+
   TFamily* GetFamily(VISU::TMeshOnEntity& theMeshOnEntity, 
-                    const std::string& theFamilyName)
-    throw(std::runtime_error&); 
+                    const std::string& theFamilyName);
 
   typedef std::pair<std::string,TEntity> TFamilyAndEntity;
   typedef std::set<TFamilyAndEntity> TFamilyAndEntitySet;
@@ -180,61 +179,56 @@ public:
   virtual int IsDone() const { return myIsDone;}
   typedef vtkUnstructuredGrid TOutput;
 
-  virtual VISU_Convertor* Build() throw (std::runtime_error&) = 0;
-  virtual const VISU::TMeshMap& GetMeshMap() throw(std::runtime_error&);
-  virtual float GetSize() throw (std::runtime_error&) = 0;
+  virtual VISU_Convertor* Build() = 0;
+  virtual const VISU::TMeshMap& GetMeshMap() ;
+  virtual float GetSize() = 0;
 
   virtual TOutput* GetMeshOnEntity(const std::string& theMeshName, 
                                   const VISU::TEntity& theEntity,
-                                  const std::string& theFamilyName = "")
-    throw(std::runtime_error&) = 0;
+                                  const std::string& theFamilyName = "") = 0;
+    
   virtual float GetMeshOnEntitySize(const std::string& theMeshName, 
                                    const VISU::TEntity& theEntity,
-                                   const std::string& theFamilyName = "")
-    throw (std::runtime_error&) = 0;
-  
+                                   const std::string& theFamilyName = "") = 0;
   
   virtual TOutput* GetMeshOnGroup(const std::string& theMeshName, 
-                                 const std::string& theGroupName)
-    throw(std::runtime_error&) = 0;
+                                 const std::string& theGroupName) = 0;
+
   virtual float GetMeshOnGroupSize(const std::string& theMeshName, 
-                                  const std::string& theGroupName)
-    throw(std::runtime_error&) = 0;
-  
+                                  const std::string& theGroupName) = 0;
 
   virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName, 
                                      const VISU::TEntity& theEntity,
                                      const std::string& theFieldName,
-                                     int theStampsNum)
-    throw(std::runtime_error&) = 0;
+                                     int theStampsNum) = 0;
+   
   virtual float GetTimeStampSize(const std::string& theMeshName, 
                                 const VISU::TEntity& theEntity,
                                 const std::string& theFieldName,
-                                int theStampsNum)
-    throw(std::runtime_error&) = 0;
+                                int theStampsNum) = 0;
+    
   virtual float GetFieldOnMeshSize(const std::string& theMeshName, 
                                   const VISU::TEntity& theEntity,
-                                  const std::string& theFieldName)
-    throw(std::runtime_error&) = 0;
+                                  const std::string& theFieldName) = 0;
   virtual const VISU::TField& GetField(const std::string& theMeshName, 
                                       VISU::TEntity theEntity, 
-                                      const std::string& theFieldName)
-    throw(std::runtime_error&) = 0;
+                                      const std::string& theFieldName) = 0;
+
   virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName, 
                                                        const VISU::TEntity& theEntity,
                                                        const std::string& theFieldName,
-                                                       int theStampsNum)
-    throw(std::runtime_error&) = 0;
-
+                                                       int theStampsNum) = 0;
+    
   static std::string GenerateName(const VISU::TField::TTime& aTime);
   static std::string GenerateName(const std::string& theName, unsigned int theTimeId);
   static void WriteToFile(vtkUnstructuredGrid* theDataSet, const std::string& theFileName);
 };
 
 extern "C"{
-  VISU_Convertor* CreateMedConvertor(const std::string& theFileName) throw(std::runtime_error&);
-  VISU_Convertor* CreateDatConvertor(const std::string& theFileName) throw(std::runtime_error&);
-  VISU_Convertor* CreateConvertor(const std::string& theFileName) throw(std::runtime_error&);
+  VISU_Convertor* CreateMedConvertor(const std::string& theFileName) ;
+  VISU_Convertor* CreateDatConvertor(const std::string& theFileName) ;
+  VISU_Convertor* CreateConvertor(const std::string& theFileName) ;
 };
 
 #endif
index 81a76c9779548384b70d96f4637c817d6dc47e73..bbcbf60e3422aadef032386706b4a24c1714df01 100644 (file)
@@ -73,7 +73,6 @@ void VISU::WriteToFile(vtkUnstructuredGrid* theDataSet, const string& theFileNam
 
 namespace{
   void GetPoints(VISU::TVTKSource& theStorage, VISU::TMesh& theMesh) 
-    throw (std::runtime_error&)
   {
     vtkPoints* aPoints = theMesh.myPoints.GetPointer();
     if(!aPoints){
@@ -121,7 +120,6 @@ namespace{
   void GetCellsOnEntity(VISU::TVTKSource& theStorage,
                        const VISU::TMeshOnEntity& theMeshOnEntity, 
                        const string& theFamilyName) 
-    throw (std::runtime_error&)
   {
     //Check on existing family
     const VISU::TFamily* pFamily = VISU::GetFamily(theMeshOnEntity,theFamilyName);
@@ -182,7 +180,6 @@ namespace{
   void GetCellsOnGroup(VISU::TVTKSource& theStorage,
                       const VISU::TMesh& theMesh,
                       const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) 
-    throw (std::runtime_error&)
   {
     //Calculate dimentions of the group
     int aNbCells = 0, aCellsSize = 0;
@@ -247,7 +244,6 @@ namespace{
   void InitProfile(VISU::TVTKExtractFilter& theFilter,
                   const VISU::TMeshOnEntity& theMeshOnEntity, 
                   const VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&)
   {
     const VISU::TField::TValForCells& aValForCells = theValForTime.myValForCells;
     const VISU::TMeshOnEntity::TCellsConn &aCellsConn = theMeshOnEntity.myCellsConn;
@@ -265,7 +261,6 @@ namespace{
                          const std::string& theFieldName,
                          const VISU::TField& theField,
                          const VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&)
   {
     //theFloatArray->DebugOn();
     theFloatArray->SetNumberOfTuples(theNumberOfTuples);
@@ -319,7 +314,6 @@ namespace{
                    const VISU::TMeshOnEntity& theMeshOnEntity, 
                    const VISU::TField& theField, 
                    const VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&)
   {
     int aNumberOfTuples = theField.myDataSize/theField.myNbComp;
     string aFieldName = GenerateFieldName(theField,theValForTime);
@@ -357,7 +351,6 @@ namespace{
                    const VISU::TMeshOnEntity& theMeshOnEntity, 
                    const VISU::TField& theField, 
                    const VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&)
   {
     int aNumberOfTuples = theField.myDataSize/theField.myNbComp;
     string aFieldName = GenerateFieldName(theField,theValForTime);
@@ -415,7 +408,6 @@ VISU_Convertor::TOutput*
 VISU_Convertor_impl::GetMeshOnEntity(const string& theMeshName, 
                                     const VISU::TEntity& theEntity,
                                     const string& theFamilyName)
-  throw (std::runtime_error&)
 {
   if(MYDEBUG) 
     MESSAGE("GetMeshOnEntity - theMeshName = '"<<theMeshName<<
@@ -472,7 +464,6 @@ VISU_Convertor_impl::GetMeshOnEntity(const string& theMeshName,
 VISU_Convertor::TOutput* 
 VISU_Convertor_impl::GetMeshOnGroup(const string& theMeshName, 
                                    const string& theGroupName)
-     throw(std::runtime_error&)
 {
   if(MYDEBUG) MESSAGE("GetMeshOnGroup - theMeshName = '"<<theMeshName<<
                      "'; theGroupName = '"<<theGroupName<<"'");
@@ -512,7 +503,6 @@ VISU_Convertor_impl::GetTimeStampOnMesh(const string& theMeshName,
                                        const VISU::TEntity& theEntity,
                                        const string& theFieldName,
                                        int theStampsNum)
-     throw(std::runtime_error&)
 {
   if(MYDEBUG){
     MESSAGE("GetTimeStampOnMesh - theMeshName = '"<<theMeshName<<"; theEntity = "<<theEntity);
@@ -608,7 +598,6 @@ VISU_Convertor_impl::GetTimeStampOnMesh(const string& theMeshName,
 }
 
 void VISU_Convertor_impl::FindMesh(const string& theMeshName, VISU::TMesh*& theMesh)
-  throw (std::runtime_error&)
 {
   GetMeshMap();
   if(myMeshMap.find(theMeshName) == myMeshMap.end())
@@ -624,7 +613,6 @@ void VISU_Convertor_impl::FindMeshOnEntity(const string& theMeshName,
                                           VISU::TMeshOnEntity*& theMeshOnEntity,
                                           const string& theFamilyName, 
                                           VISU::TFamily*& theFamily)
-  throw (std::runtime_error&)
 {
   FindMesh(theMeshName,theMesh);
   VISU::TMeshOnEntityMap& aMeshOnEntityMap = theMesh->myMeshOnEntityMap;
@@ -636,7 +624,7 @@ void VISU_Convertor_impl::FindMeshOnEntity(const string& theMeshName,
 }
 
 
-float VISU_Convertor_impl::GetSize() throw (std::runtime_error&){
+float VISU_Convertor_impl::GetSize() {
   float aResult = 0.0;
   const VISU::TMeshMap& aMeshMap = GetMeshMap();
   VISU::TMeshMap::const_iterator aMeshMapIter = aMeshMap.begin();
@@ -689,7 +677,6 @@ float VISU_Convertor_impl::GetSize() throw (std::runtime_error&){
 float VISU_Convertor_impl::GetMeshOnEntitySize(const std::string& theMeshName, 
                                               const VISU::TEntity& theEntity,
                                               const std::string& theFamilyName)
-  throw (std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TFamily* pFamily = NULL;
@@ -730,7 +717,6 @@ float VISU_Convertor_impl::GetMeshOnEntitySize(const std::string& theMeshName,
 
 void VISU_Convertor_impl::FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
                                          const std::string& theGroupName, VISU::TGroup*& theGroup)
-  throw (std::runtime_error&)
 {
   FindMesh(theMeshName,theMesh);
   VISU::TGroupMap& aGroupMap = theMesh->myGroupMap;
@@ -743,7 +729,6 @@ void VISU_Convertor_impl::FindMeshOnGroup(const std::string& theMeshName, VISU::
 
 float VISU_Convertor_impl::GetMeshOnGroupSize(const std::string& theMeshName, 
                                              const std::string& theGroupName)
-  throw (std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TGroup* pGroup = NULL;
@@ -777,7 +762,6 @@ void VISU_Convertor_impl::FindField(const string& theMeshName, VISU::TMesh*& the
                                    VISU::TMeshOnEntity*& theMeshOnEntity,
                                    VISU::TMeshOnEntity*& theVTKMeshOnEntity,
                                    const string& theFieldName, VISU::TField*& theField)
-  throw (std::runtime_error&)
 {
   VISU::TFamily* pFamily = NULL;
   VISU::TMeshOnEntity* pMeshOnEntity = NULL;
@@ -803,7 +787,6 @@ void VISU_Convertor_impl::FindField(const string& theMeshName, VISU::TMesh*& the
 float VISU_Convertor_impl::GetFieldOnMeshSize(const std::string& theMeshName, 
                                              const VISU::TEntity& theEntity,
                                              const std::string& theFieldName)
-  throw(std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TField* pField = NULL;
@@ -829,7 +812,6 @@ void VISU_Convertor_impl::FindTimeStamp(const std::string& theMeshName, VISU::TM
                                        VISU::TMeshOnEntity*& theVTKMeshOnEntity,
                                        const std::string& theFieldName, VISU::TField*& theField,
                                        int theStampsNum, VISU::TField::TValForTime*& theValForTime)
-  throw (std::runtime_error&)
 {
   FindField(theMeshName,theMesh,theEntity,theMeshOnEntity,theVTKMeshOnEntity,theFieldName,theField);
   VISU::TField::TValField& aValField = theField->myValField;
@@ -843,7 +825,6 @@ float VISU_Convertor_impl::GetTimeStampSize(const std::string& theMeshName,
                                            const VISU::TEntity& theEntity,
                                            const std::string& theFieldName,
                                            int theStampsNum)
-  throw (std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TField* pField = NULL;
@@ -868,7 +849,6 @@ const VISU::TField&
 VISU_Convertor_impl::GetField(const string& theMeshName, 
                              VISU::TEntity theEntity, 
                              const string& theFieldName) 
-  throw (std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TField* pField = NULL;
@@ -885,7 +865,6 @@ VISU_Convertor_impl::GetTimeStamp(const std::string& theMeshName,
                                  const VISU::TEntity& theEntity,
                                  const std::string& theFieldName,
                                  int theStampsNum)
-  throw (std::runtime_error&)
 {
   VISU::TMesh* pMesh = NULL;
   VISU::TField* pField = NULL;
index cd1518916a1c77dc67ec7ad3f7be8749e000eb91..fa2f829102dc0b9c9c348c65b8229ad67f4d4d5e 100644 (file)
@@ -20,103 +20,86 @@ extern "C"{
 
 class VISU_Convertor_impl: public VISU_Convertor{
 public:
-  virtual float GetSize() throw (std::runtime_error&);
+  virtual float GetSize() ;
 
   virtual float GetMeshOnEntitySize(const std::string& theMeshName, 
                                    const VISU::TEntity& theEntity,
-                                   const std::string& theFamilyName = "")
-    throw (std::runtime_error&);
+                                   const std::string& theFamilyName = "");
 
   virtual float GetMeshOnGroupSize(const std::string& theMeshName, 
-                                  const std::string& theGroupName)
-    throw(std::runtime_error&);
+                                  const std::string& theGroupName);
 
   virtual float GetTimeStampSize(const std::string& theMeshName, 
                                 const VISU::TEntity& theEntity,
                                 const std::string& theFieldName,
-                                int theStampsNum)
-    throw(std::runtime_error&);
+                                int theStampsNum);
 
   virtual float GetFieldOnMeshSize(const std::string& theMeshName, 
                                   const VISU::TEntity& theEntity,
-                                  const std::string& theFieldName)
-    throw(std::runtime_error&);
+                                  const std::string& theFieldName);
 
   virtual const VISU::TField& GetField(const std::string& theMeshName, 
                                       VISU::TEntity theEntity, 
-                                      const std::string& theFieldName)
-    throw(std::runtime_error&);
+                                      const std::string& theFieldName);
 
   virtual const VISU::TField::TValForTime& GetTimeStamp(const std::string& theMeshName, 
                                                        const VISU::TEntity& theEntity,
                                                        const std::string& theFieldName,
-                                                       int theStampsNum)
-    throw(std::runtime_error&);
+                                                       int theStampsNum);
 
 public:
   VISU_Convertor_impl();
 
   virtual ~VISU_Convertor_impl();
 
-  virtual VISU_Convertor* Build() throw (std::runtime_error&) { return this;};
+  virtual VISU_Convertor* Build()  { return this;};
 
   virtual TOutput* GetMeshOnEntity(const std::string& theMeshName, 
                                   const VISU::TEntity& theEntity,
-                                  const std::string& theFamilyName = "")
-    throw(std::runtime_error&);
+                                  const std::string& theFamilyName = "");
 
   virtual TOutput* GetMeshOnGroup(const std::string& theMeshName, 
-                                 const std::string& theGroupName)
-    throw(std::runtime_error&);
+                                 const std::string& theGroupName);
 
   virtual TOutput* GetTimeStampOnMesh(const std::string& theMeshName, 
                                      const VISU::TEntity& theEntity,
                                      const std::string& theFieldName,
-                                     int theStampsNum)
-    throw(std::runtime_error&);
+                                     int theStampsNum);
 
 protected:
-  void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh)
-    throw(std::runtime_error&);
+  void FindMesh(const std::string& theMeshName, VISU::TMesh*& theMesh);
 
   void FindMeshOnEntity(const std::string& theMeshName, VISU::TMesh*& theMesh,
                        const VISU::TEntity& theEntity, VISU::TMeshOnEntity*& theMeshOnEntity,
-                       const std::string& theFamilyName, VISU::TFamily*& theFamily)
-    throw (std::runtime_error&);
+                       const std::string& theFamilyName, VISU::TFamily*& theFamily);
 
   void FindMeshOnGroup(const std::string& theMeshName, VISU::TMesh*& theMesh,
-                      const std::string& theGroupName, VISU::TGroup*& theGroup)
-    throw (std::runtime_error&);
+                      const std::string& theGroupName, VISU::TGroup*& theGroup);
 
   void FindField(const std::string& theMeshName, VISU::TMesh*& theMesh,
                 const VISU::TEntity& theEntity, 
                 VISU::TMeshOnEntity*& theMeshOnEntity,
                 VISU::TMeshOnEntity*& theVTKMeshOnEntity,
-                const std::string& theFieldName, VISU::TField*& theField)
-    throw (std::runtime_error&);
+                const std::string& theFieldName, VISU::TField*& theField);
 
   void FindTimeStamp(const std::string& theMeshName, VISU::TMesh*& theMesh,
                     const VISU::TEntity& theEntity, 
                     VISU::TMeshOnEntity*& theMeshOnEntity,
                     VISU::TMeshOnEntity*& theVTKMeshOnEntity,
                     const std::string& theFieldName, VISU::TField*& theField,
-                    int theStampsNum, VISU::TField::TValForTime*& theValForTime)
-    throw (std::runtime_error&);
+                    int theStampsNum, VISU::TField::TValForTime*& theValForTime);
 
 protected:
   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
-                              const std::string& theFamilyName = "")
-    throw (std::runtime_error&) = 0;
+                              const std::string& theFamilyName = "") = 0;
 
   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
-                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-    throw (std::runtime_error&) = 0;
+                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet) = 0;
 
   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
                              VISU::TMeshOnEntity& theMeshOnEntity, 
                              VISU::TField& theField, 
-                             VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&) = 0;
+                             VISU::TField::TValForTime& theValForTime) = 0;
 };
 
 #endif
index 91151aff3e4850c1fe814679e4bebccc10bfe909..c85ac8236c9e28b7833bbdf1439acb50353df02b 100644 (file)
@@ -18,17 +18,17 @@ static int MYDEBUG = 0;
 static int PRECISION = 7;
 
 extern "C"
-VISU_Convertor* CreateDatConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_Convertor* CreateDatConvertor(const string& theFileName) {
   VISU_DatConvertor* aConvertor = new VISU_DatConvertor(theFileName);
   aConvertor->Build();
   return aConvertor;
 }
-VISU_DatConvertor::VISU_DatConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_DatConvertor::VISU_DatConvertor(const string& theFileName) {
   myFileInfo.setFile(QString(theFileName.c_str()));
   myName = (const char*)(myFileInfo.baseName());
 }
 
-VISU_Convertor* VISU_DatConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_DatConvertor::Build() {
   /*
   ifstream stmIn(myFileInfo.absFilePath());
   if(!stmIn.good())
@@ -47,7 +47,6 @@ VISU_Convertor* VISU_DatConvertor::Build() throw (std::runtime_error&){
 }
 
 int VISU_DatConvertor::ImportField(ifstream* pStmIn, int theNbPoints, vector<int>* pCellsType)
-     throw (std::runtime_error&)
 {
   /*
   ifstream &stmIn = *pStmIn;
@@ -84,7 +83,6 @@ int VISU_DatConvertor::ImportField(ifstream* pStmIn, int theNbPoints, vector<int
 
 int VISU_DatConvertor::ImportHead(ifstream* pStmIn, int* theNbPoints, 
                                  int* theNbCells, int* theNbFields) 
-     throw (std::runtime_error&)
 {
   /*
   ifstream &stmIn = *pStmIn;
@@ -104,7 +102,6 @@ int VISU_DatConvertor::ImportHead(ifstream* pStmIn, int* theNbPoints,
 }
 
 int VISU_DatConvertor::ImportPoints(ifstream* pStmIn, int theNbPoints) 
-     throw (std::runtime_error&)
 {
   /*
   ifstream &stmIn = *pStmIn;
@@ -124,7 +121,6 @@ int VISU_DatConvertor::ImportPoints(ifstream* pStmIn, int theNbPoints)
 }
 
 int VISU_DatConvertor::ImportCells(ifstream* pStmIn, vector<int>* pCellsType) 
-     throw (std::runtime_error&)
 {
   /*
   ifstream &stmIn = *pStmIn;
index f4a5ab6af2f06d9c4ff8341ac147586899ec9f67..2fa885609dc960f32cb6ac196b54b7ee2eba9fa7 100644 (file)
 #include "VISU_Convertor_impl.hxx"
 #include <fstream>     
 
+using namespace std;
+
 class VISU_DatConvertor: public VISU_Convertor_impl{
   VISU_DatConvertor();
   VISU_DatConvertor(const VISU_DatConvertor&);
 public:
-  VISU_DatConvertor(const string& theFileName) throw (std::runtime_error&);
-  virtual VISU_Convertor* Build() throw (std::runtime_error&);
+  VISU_DatConvertor(const string& theFileName) ;
+  virtual VISU_Convertor* Build() ;
 protected:
   QFileInfo myFileInfo;
-  int ImportHead(ifstream* pStmIn, int* theNbPoints, int* theNbCells, int* theNbFields) 
-    throw (std::runtime_error&);
-  int ImportPoints(ifstream*, int theNbPoints) 
-    throw (std::runtime_error&);
-  int ImportCells(ifstream*, vector<int>* aCellsType) 
-    throw (std::runtime_error&);
-  int ImportField(ifstream*, int theNbPoints, vector<int>* aCellsType) 
-    throw (std::runtime_error&);
+  int ImportHead(ifstream* pStmIn, int* theNbPoints, int* theNbCells, int* theNbFields) ;
+    
+  int ImportPoints(ifstream*, int theNbPoints) ;
+    
+  int ImportCells(ifstream*, vector<int>* aCellsType) ;
+    
+  int ImportField(ifstream*, int theNbPoints, vector<int>* aCellsType) ;
+    
  protected:
   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
                               const string& theFamilyName = "")
-    throw (std::runtime_error&) {return 1;}
+    {return 1;}
   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
                              const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-    throw (std::runtime_error&) {return 1;}
+    {return 1;}
   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
                              VISU::TMeshOnEntity& theMeshOnEntity, 
                              VISU::TField& theField, 
                              VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&) {return 1;}
+    {return 1;}
 };
 
 #endif
index ab1e1026099b0db74674acd7f62b841498dc2e80..40f41f91de6aacf6defbdb60506a0a7d40c92048 100644 (file)
@@ -73,7 +73,6 @@ static med_geometrie_element  CELLGEOM[MED_NBR_GEOMETRIE_MAILLE] = {
   };
 
 void GetEntity2Geom(const VISU::TEntity& theEntity, med_geometrie_element*& theVector, int* theEnd) 
-     throw (std::runtime_error&)
 {
   switch(theEntity){
   case VISU::CELL_ENTITY: theVector = CELLGEOM; *theEnd = MED_NBR_GEOMETRIE_MAILLE; break;
@@ -86,7 +85,7 @@ void GetEntity2Geom(const VISU::TEntity& theEntity, med_geometrie_element*& theV
 }
 
 extern "C"
-VISU_Convertor* CreateMedConvertor(const string& theFileName) throw(std::runtime_error&){
+VISU_Convertor* CreateMedConvertor(const string& theFileName) {
   return new VISU_MedConvertor(theFileName);
 }
 
@@ -96,7 +95,7 @@ class MedFile{
   MedFile();
   MedFile(const MedFile&);
 public:
-  MedFile(const char* theFileName) throw(std::runtime_error&) :
+  MedFile(const char* theFileName)  :
     myFileName(strdup(theFileName))
   {
     myFid = MEDouvrir(myFileName,MED_LECT);
@@ -113,12 +112,12 @@ public:
   const med_idt& GetFid() const { return myFid;};
 };
 
-VISU_MedConvertor::VISU_MedConvertor(const string& theFileName) throw (std::runtime_error&) {
+VISU_MedConvertor::VISU_MedConvertor(const string& theFileName)  {
   myFileInfo.setFile(QString(theFileName.c_str()));
   myName = myFileInfo.baseName().latin1();
 }
 
-VISU_Convertor* VISU_MedConvertor::Build() throw (std::runtime_error&) {
+VISU_Convertor* VISU_MedConvertor::Build()  {
   MedFile aMedFile(myFileInfo.absFilePath());
   med_idt fid = aMedFile.GetFid();
   med_int iMeshEnd = MEDnMaa(fid);  //Get number of meshes
@@ -393,7 +392,6 @@ VISU_Convertor* VISU_MedConvertor::Build() throw (std::runtime_error&) {
 
 int VISU_MedConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
                                        const string& theFamilyName)
-  throw (std::runtime_error&)
 {
   //Open the med file (it will be closed by call of destructor)
   MedFile aMedFile(myFileInfo.absFilePath());
@@ -414,7 +412,6 @@ int VISU_MedConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
 
 int VISU_MedConvertor::LoadMeshOnGroup(VISU::TMesh& theMesh, 
                                       const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-     throw (std::runtime_error&)
 {
   //Open the med file (it will be closed by call of destructor)
   MedFile aMedFile(myFileInfo.absFilePath());
@@ -443,7 +440,6 @@ int VISU_MedConvertor::LoadFieldOnMesh(VISU::TMesh& theMesh,
                                       VISU::TMeshOnEntity& theMeshOnEntity, 
                                       VISU::TField& theField, 
                                       VISU::TField::TValForTime& theValForTime)
-  throw (std::runtime_error&)
 {
   //Open the med file (it will be closed by call of destructor)
   MedFile aMedFile(myFileInfo.absFilePath());
@@ -457,7 +453,6 @@ int VISU_MedConvertor::LoadFieldOnMesh(VISU::TMesh& theMesh,
 }
 
 int VISU_MedConvertor::LoadPoints(const med_idt& fid, VISU::TMesh& theMesh, const string& theFamilyName) 
-  throw (std::runtime_error&)
 {
   try{
     //Check on existing family
@@ -532,7 +527,6 @@ int VISU_MedConvertor::LoadPoints(const med_idt& fid, VISU::TMesh& theMesh, cons
 
 int VISU_MedConvertor::LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity& theMeshOnEntity,
                                         const string& theFamilyName)
-  throw (std::runtime_error&)
 {
   try{
     //Check on existing family
@@ -565,6 +559,7 @@ int VISU_MedConvertor::LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity
     med_booleen inum_node = 
       med_booleen(MEDnumLire(fid,aMeshName,&num_node[0],aNbPoints,MED_NOEUD,med_geometrie_element(0)) >= 0);
     if(MYDEBUG) MESSAGE("LoadCellsOnEntity - inum_node = "<<inum_node);
+    inum_node = MED_FAUX;
     map<med_int,med_int> node_map;
     if(inum_node) 
       for(int i = 0; i < aNbPoints; i++) 
@@ -649,7 +644,6 @@ int VISU_MedConvertor::LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity
 
 int VISU_MedConvertor::LoadField(const med_idt& fid, const VISU::TMeshOnEntity& theMeshOnEntity,
                                 VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
-     throw (std::runtime_error&)
 {
   //Check on loading already done
   if(!theValForTime.myValForCells.empty()) return 0;
index 4549b2582a4712f86a85e51de86439bd7b13553a..c3a71e0ad376f6514666a50ff3b8fdad536cdc90 100644 (file)
@@ -19,32 +19,31 @@ class VISU_MedConvertor: public VISU_Convertor_impl{
   VISU_MedConvertor();
   VISU_MedConvertor(const VISU_MedConvertor&);
 public:
-  VISU_MedConvertor(const std::string& theFileName) throw (std::runtime_error&);
-  virtual VISU_Convertor* Build() throw (std::runtime_error&);
+  VISU_MedConvertor(const std::string& theFileName) ;
+  virtual VISU_Convertor* Build() ;
 protected:
   QFileInfo myFileInfo;
 
   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
-                              const std::string& theFamilyName = "")
-    throw (std::runtime_error&);
+                              const std::string& theFamilyName = "");
+
   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
-                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-    throw (std::runtime_error&);
+                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+
   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
                              VISU::TMeshOnEntity& theMeshOnEntity, 
                              VISU::TField& theField, 
-                             VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&);
+                             VISU::TField::TValForTime& theValForTime);
 
   int LoadPoints(const med_idt& fid, VISU::TMesh& theMesh, 
-                const std::string& theFamilyName = "") 
-    throw (std::runtime_error&);
+                const std::string& theFamilyName = "");
+
   int LoadCellsOnEntity(const med_idt& fid, VISU::TMeshOnEntity& theMeshOnEntity,
-                       const std::string& theFamilyName = "")
-    throw (std::runtime_error&);
+                       const std::string& theFamilyName = "");
+
   int LoadField(const med_idt& fid, const VISU::TMeshOnEntity& theMeshOnEntity,
-               VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&);
+               VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
+
 };
 
 #endif
index 0751cdb2beb8ba0e7e2ed9708fd618af16e19569..fe1f880ef3f9e289a5848d3e6aa35d3c861a025b 100644 (file)
@@ -32,6 +32,6 @@ VPATH=.:@srcdir@
 
 @COMMENCE@
 
-SUBDIRS = CONVERTOR PIPELINE OBJECT VISU_I VISUGUI VISU_SWIG
+SUBDIRS = CONVERTOR PIPELINE OBJECT ENGINE VISU_I VISUGUI VISU_SWIG
 
 @MODULE@
index 62d1477847b6d2a1f5d4c30c6ff49620677ed32e..24e06da8647ea37f125ebfbdb37da93bb1434338 100644 (file)
@@ -56,31 +56,47 @@ vtkStandardNewMacro(VISU_Actor);
 
 VISU_Actor::VISU_Actor(){
   SetDebug(MYVTKDEBUG);
-  myIsShrunk = false;
-  myIsShrinkable = false;
   myParent = this;
   myPipeLine = NULL;
   myPrs3d = NULL;
 
+  myStoreMapping = true;
+
+  myIsShrunk = false;
+  myIsShrinkable = false;
+  myShrinkFilter = vtkShrinkPolyData::New();
+
   myIO = NULL;
   myName = "";
 
   ishighlighted = false;
   IsHighlighting = true;
   HighlightProperty = vtkProperty::New();
-  HighlightProperty->SetAmbient(0.5);
-  HighlightProperty->SetDiffuse(0.3);
-  HighlightProperty->SetSpecular(0.2);
+  HighlightProperty->SetAmbient(0.5);            
+  HighlightProperty->SetDiffuse(0.3);            
+  HighlightProperty->SetSpecular(0.2);           
   HighlightProperty->SetRepresentationToSurface();
   HighlightProperty->SetAmbientColor(1, 1, 1);
   HighlightProperty->SetDiffuseColor(1, 1, 1);
   HighlightProperty->SetSpecularColor(0.5, 0.5, 0.5);
+
+  vtkProperty* aProperty = this->GetProperty();
+  aProperty->SetAmbient(0.5); 
+  aProperty->SetDiffuse(0.2);
+  aProperty->SetSpecular(0.2);
+  aProperty->SetAmbientColor(1, 1, 1);
+  aProperty->SetDiffuseColor(1, 1, 1);
+  aProperty->SetSpecularColor(0.5, 0.5, 0.5);
+  this->SetProperty(aProperty);
 }
 
 VISU_Actor::~VISU_Actor(){
   SALOME_Actor::SetProperty(NULL);
   HighlightProperty->Delete();
   if(myPipeLine) myPipeLine->UnRegister(this);
+
+  myShrinkFilter->UnRegisterAllOutputs();
+  myShrinkFilter->Delete();
 }
 
 void VISU_Actor::setIO(const Handle(SALOME_InteractiveObject)& theIO){
@@ -92,7 +108,7 @@ void VISU_Actor::SetPrs3d(VISU::Prs3d_i* thePrs3d){
   myPrs3d = thePrs3d;
 }
 
-void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) {
   if (myPipeLine != thePipeLine){
     if (myPipeLine != NULL) myPipeLine->UnRegister(this);
     myPipeLine = thePipeLine;
@@ -126,23 +142,15 @@ void VISU_Actor::SetParent(VISU_Actor* theParent){
 }
 
 void VISU_Actor::SetRepresentation(int theMode) { 
-  int aRepresent = GetRepresentation();
   SALOME_Actor::SetRepresentation(theMode);
-  if(GetMapper() && GetMapper()->GetInput()){
-    vtkGeometryFilter* aGeometryFilter = vtkGeometryFilter::New();
-    aGeometryFilter->SetInput(GetMapper()->GetInput());
-    vtkPolyData* aPolyData = aGeometryFilter->GetOutput();
-    aPolyData->Update();
-    static int INCMEMORY = 7;
-    float aSize = INCMEMORY*aPolyData->GetActualMemorySize()*1024.0;
-    int isPoss = VISU_PipeLine::CheckAvailableMemory(aSize);
-    if(MYDEBUG) MESSAGE("SetRepresentation - aSize = "<<aSize<<"; isPoss = "<<isPoss);
-    aPolyData->Delete();
-    if(!isPoss){
-      SALOME_Actor::SetRepresentation(aRepresent);
-      throw std::runtime_error("SetRepresentation >> There is no enough memory !!!");
-    }
-  }
+}
+
+void VISU_Actor::SetOpacity(float theValue){
+  GetProperty()->SetOpacity(theValue);
+}
+
+float VISU_Actor::GetOpacity(){ 
+  return GetProperty()->GetOpacity();
 }
 
 void VISU_Actor::SetShrinkable(bool theIsShrinkable){
@@ -150,22 +158,22 @@ void VISU_Actor::SetShrinkable(bool theIsShrinkable){
 }
 
 void VISU_Actor::SetShrink(float theFactor){
-  if(!myIsShrinkable || myIsShrunk) return;
-  vtkShrinkPolyData *aShrinkFilter = vtkShrinkPolyData::New();
-  aShrinkFilter->SetShrinkFactor(theFactor);
-  // use for post-filtering
-  aShrinkFilter->SetInput(myPassFilter[2]->GetPolyDataOutput());
-  myPassFilter[3]->SetInput(aShrinkFilter->GetOutput());
-  aShrinkFilter->Register(myPassFilter[3]);
-  aShrinkFilter->Delete();
-  myIsShrunk = true;
+  if(!myIsShrinkable) return;
+  if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
+    myShrinkFilter->SetShrinkFactor(theFactor);
+    myShrinkFilter->SetInput(aDataSet);
+    myPassFilter.at(2)->SetInput(myShrinkFilter->GetOutput());
+    myIsShrunk = true;
+  }
 }
 
 void VISU_Actor::UnShrink(){
   if(!myIsShrunk) return;
-  myPassFilter[3]->SetInput(myPassFilter[2]->GetPolyDataOutput());
-  myPassFilter[3]->Modified();
-  myIsShrunk = false;
+  if(vtkPolyData* aDataSet = myPassFilter.at(1)->GetPolyDataOutput()){
+    myPassFilter.at(2)->SetInput(aDataSet);
+    myPassFilter.at(2)->Modified();
+    myIsShrunk = false;
+  }
 }
 
 void VISU_Actor::SetVisibility(int theMode){
@@ -210,3 +218,12 @@ void VISU_Actor::highlight(Standard_Boolean highlight) {
       if(ishighlighted)        ishighlighted=false;
   }
 }
+
+int VISU_Actor::GetObjId(int theVtkID){
+  if (GetRepresentation() == 0) return -1; // points    
+  return myGeomFilter->GetObjId(theVtkID);
+}
+
+VISU_Actor::TVectorId VISU_Actor::GetVtkId(int theObjID){
+  return myGeomFilter->GetVtkId(theObjID);
+}
index 88f4e26d28f5233933b79587c460823ec8902fe3..b6925202f678b06dfc78208be3624564d70333f7 100644 (file)
 #define VISU_ACTOR_H
 
 #include "SALOME_Actor.h"
+#include "SALOME_GeometryFilter.h"
 
 #include <stdexcept>
 #include <string>
 
 class vtkProp;
 class vtkProperty;
+class vtkShrinkPolyData;
+
+class VISU_PipeLine;
 
 namespace VISU { 
   class Prs3d_i;
 }
-class VISU_PipeLine;
 
 #ifdef _WIN_32
 #define VTKOCC_EXPORT __declspec (dllexport)
@@ -61,16 +64,16 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   virtual void SetPrs3d(VISU::Prs3d_i* thePrs3d);
 
   virtual VISU_PipeLine* GetPipeLine() { return myPipeLine;}
-  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
 
   VISU_Actor* GetParent(){ return myParent;}
   virtual void SetParent(VISU_Actor* theParent);
 
-  void highlight(Standard_Boolean highlight);
+  virtual void highlight(Standard_Boolean highlight);
   Standard_Boolean isHighlighted() { return true; };
 
-  void  SetOpacity(float opa) {};
-  float GetOpacity() { return 0;};
+  virtual void SetOpacity(float theValue);
+  virtual float GetOpacity();
 
   virtual void SetShrinkable(bool theIsShrinkable);
   virtual bool GetShrinkable() { return myIsShrinkable;}
@@ -89,6 +92,9 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
 
   virtual void SetLineWidth(float theLineWidth);
   virtual float GetLineWidth();
+  
+  int GetObjId(int theVtkID);
+  TVectorId GetVtkId(int theObjID);
 
   bool IsHighlighting;
   std::string myFieldName;
@@ -100,6 +106,8 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   VISU::Prs3d_i* myPrs3d;
   VISU_PipeLine* myPipeLine;
   vtkProperty* HighlightProperty;
+
+  vtkShrinkPolyData* myShrinkFilter;
   bool myIsShrinkable;
   bool myIsShrunk;
 };
index 416e0673de4077392e6d2d5717f38773c36a842f..51ad82595e22e2f4de99575eb8d85272e04d92cd 100644 (file)
 #include <vtkFeatureEdges.h>
 #include <vtkDataSetMapper.h>
 #include <vtkDataSet.h>
+#include <vtkMatrix4x4.h>
+#include <vtkMapperCollection.h> 
 
 vtkStandardNewMacro(VISU_MeshAct);
 
 VISU_MeshAct::VISU_MeshAct(){
+  
+  vtkMatrix4x4 *m;
+  m = vtkMatrix4x4::New();
+
   mySurfaceActor = VISU_Actor::New();
   mySurfaceActor->SetParent(this);
   mySurfaceActor->GetProperty()->FrontfaceCullingOff();
   mySurfaceActor->GetProperty()->BackfaceCullingOff();
+  mySurfaceActor->SetUserMatrix(m);
   mySurfaceActor->SetRepresentation(2); //SURFACE
  
   myEdgeActor = VISU_Actor::New();
@@ -47,6 +54,7 @@ VISU_MeshAct::VISU_MeshAct(){
   myEdgeActor->PickableOff();
   myEdgeActor->GetProperty()->FrontfaceCullingOff();
   myEdgeActor->GetProperty()->BackfaceCullingOff();
+  myEdgeActor->SetUserMatrix(m);
   myEdgeActor->SetRepresentation(1); //WIREFRAME
  
   myNodeActor = VISU_Actor::New();
@@ -55,8 +63,10 @@ VISU_MeshAct::VISU_MeshAct(){
   myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE);
   myNodeActor->GetProperty()->FrontfaceCullingOff();
   myNodeActor->GetProperty()->BackfaceCullingOff();
+  myNodeActor->SetUserMatrix(m);
   myNodeActor->SetRepresentation(0); //POINT
 
+  m->Delete();
   SetRepresentation(2); //SURFACE
 }
 
@@ -67,6 +77,7 @@ VISU_MeshAct::~VISU_MeshAct(){
 }
 
 void VISU_MeshAct::setIO(const Handle(SALOME_InteractiveObject)& theIO){
+  VISU_Actor::setIO(theIO);
   mySurfaceActor->setIO(theIO);
   myEdgeActor->setIO(theIO);
   myNodeActor->setIO(theIO);
@@ -82,18 +93,16 @@ void VISU_MeshAct::SetPrs3d(VISU::Prs3d_i* thePrs3d){
 }
 
 void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){
-  theRenderer->AddActor(mySurfaceActor);
+  theRenderer->AddActor(this);
   theRenderer->AddActor(myEdgeActor);
-  theRenderer->AddActor(myNodeActor);
 }
 
 void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){
-  theRenderer->RemoveActor(mySurfaceActor);
+  theRenderer->RemoveActor(this);
   theRenderer->RemoveActor(myEdgeActor);
-  theRenderer->RemoveActor(myNodeActor);
 }
 
-void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
   VISU_Actor::SetPipeLine(thePipeLine);
   mySurfaceActor->SetPipeLine(thePipeLine);
   myEdgeActor->SetPipeLine(thePipeLine);
@@ -101,6 +110,7 @@ void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_er
 }
 
 void VISU_MeshAct::SetTransform(SALOME_Transform* theTransform){
+  VISU_Actor::SetTransform(theTransform);
   mySurfaceActor->SetTransform(theTransform);
   myEdgeActor->SetTransform(theTransform);
   myNodeActor->SetTransform(theTransform);
@@ -113,11 +123,11 @@ void VISU_MeshAct::SetShrinkable(bool theIsShrinkable){
   myNodeActor->SetShrinkable(theIsShrinkable);
 }
 
-vtkProperty* VISU_MeshAct::GetProperty(){ 
+vtkProperty* VISU_MeshAct::GetSurfaceProperty(){ 
   mySurfaceActor->GetProperty();
 } 
 
-void VISU_MeshAct::SetProperty(vtkProperty* theProperty){ 
+void VISU_MeshAct::SetSurfaceProperty(vtkProperty* theProperty){ 
   mySurfaceActor->SetProperty(theProperty);
 }
 
@@ -137,6 +147,21 @@ void VISU_MeshAct::SetNodeProperty(vtkProperty* theProperty){
   myNodeActor->SetProperty(theProperty);
 }
 
+void VISU_MeshAct::highlight(Standard_Boolean highlight){
+  VISU_Actor::highlight(highlight);
+  mySurfaceActor->highlight(highlight);
+  myEdgeActor->highlight(highlight);
+  myNodeActor->highlight(highlight);
+}
+
+void VISU_MeshAct::SetOpacity(float theValue){
+  GetSurfaceProperty()->SetOpacity(theValue);
+}
+
+float VISU_MeshAct::GetOpacity(){ 
+  return GetSurfaceProperty()->GetOpacity();
+}
+
 void VISU_MeshAct::SetLineWidth(float theLineWidth){
   GetEdgeProperty()->SetLineWidth(theLineWidth);
 }
@@ -202,3 +227,152 @@ void VISU_MeshAct::SetVisibility(int theMode){
     mySurfaceActor->VisibilityOff();
   }
 }
+
+// From vtkLODActor
+void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
+{
+  float myTime, bestTime, tempTime;
+  vtkMatrix4x4 *matrix;
+  vtkMapper *mapper, *bestMapper;
+  
+  if (this->Mapper == NULL)
+    {
+    vtkErrorMacro("No mapper for actor.");
+    return;
+    }
+  
+  // first time through create lods if non have been added
+  if (this->LODMappers->GetNumberOfItems() == 0)
+    {
+    this->CreateOwnLODs();
+    }
+  
+  // If the actor has changed or the primary mapper has changed ...
+  // Is this the correct test?
+  if (this->MediumMapper)
+    {
+    if (this->GetMTime() > this->BuildTime || 
+        this->Mapper->GetMTime() > this->BuildTime)
+      {
+      this->UpdateOwnLODs();
+      }
+    }
+  
+  // figure out how much time we have to render
+  myTime = this->AllocatedRenderTime;
+
+  // Figure out which resolution to use 
+  // none is a valid resolution. Do we want to have a lowest:
+  // bbox, single point, ...
+  // There is no order to the list, so it is assumed that mappers that take
+  // longer to render are better quality.
+  // Timings might become out of date, but we rely on 
+
+  bestMapper = this->Mapper;
+  bestTime = bestMapper->GetTimeToDraw();
+  if (bestTime > myTime)
+    {
+    this->LODMappers->InitTraversal();
+    while ((mapper = this->LODMappers->GetNextItem()) != NULL && 
+           bestTime != 0.0)
+      {
+      tempTime = mapper->GetTimeToDraw();
+      
+      // If the LOD has never been rendered, select it!
+      if (tempTime == 0.0)
+        { 
+        bestMapper = mapper;
+        bestTime = 0.0;
+        }
+      else
+        {
+        if (bestTime > myTime && tempTime < bestTime)
+          {
+          bestMapper = mapper;
+          bestTime = tempTime;
+          }
+        if (tempTime > bestTime && tempTime < myTime)
+          { 
+          bestMapper = mapper;
+          bestTime = tempTime;
+          }
+        }
+      }
+    }
+    
+  switch(GetRepresentation()){
+  case 0: //POINTS
+    myNodeActor->GetProperty()->Render(this, ren);
+    break;
+  case 1: //WIREFRAME
+    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    break;
+  case 2: //SURFACE
+    mySurfaceActor->GetProperty()->Render(this, ren);
+    break;
+  case 3: //INSIDEFRAME
+    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    break;
+  case 4: //SURFACEFRAME
+    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    mySurfaceActor->GetProperty()->Render(this, ren);
+    break;
+  }
+   
+  // render the texture
+  if (this->Texture)
+    {
+    this->Texture->Render(ren);
+    }
+     
+  switch(GetRepresentation()){
+  case 0: //POINTS
+    matrix = myNodeActor->GetUserMatrix();
+    break;
+  case 1: //WIREFRAME
+    matrix = myEdgeActor->GetUserMatrix();
+    break;
+  case 2: //SURFACE
+    matrix = mySurfaceActor->GetUserMatrix();
+    break;
+  case 3: //INSIDEFRAME
+    matrix = myEdgeActor->GetUserMatrix();
+    break;
+  case 4: //SURFACEFRAME
+    matrix = myEdgeActor->GetUserMatrix();
+    this->GetMatrix(matrix);
+    matrix = mySurfaceActor->GetUserMatrix();
+    break;
+  }
+  this->GetMatrix(matrix);
+  switch(GetRepresentation()){
+  case 0: //POINTS
+    myNodeActor->Render(ren,bestMapper);
+    break;
+  case 1: //WIREFRAME
+    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    break;
+  case 2: //SURFACE
+    mySurfaceActor->Render(ren,bestMapper);
+    break;
+  case 3: //INSIDEFRAME
+    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    break;
+  case 4: //SURFACEFRAME
+    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    mySurfaceActor->Render(ren,bestMapper);
+    break;
+  }
+  
+  this->EstimatedRenderTime = bestMapper->GetTimeToDraw();
+}
+
+// From vtkLODActor
+void VISU_MeshAct::Modified()
+{
+  myNodeActor->Modified();
+  //PAL5268: myEdgeActor->Modified();
+  mySurfaceActor->Modified();
+  this->vtkActor::Modified();
+}
index ae5e6f514cc9d9db20acff6deed564e115795db9..38b45dc35eef56247ebfce4e32fadea907e20707 100644 (file)
@@ -44,11 +44,13 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor {
   virtual void AddToRender(vtkRenderer* theRenderer); 
   virtual void RemoveFromRender(vtkRenderer* theRenderer);
 
-  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) ;
   virtual void SetTransform(SALOME_Transform* theTransform); 
 
-  virtual vtkProperty* GetProperty(); 
-  virtual void SetProperty(vtkProperty* theProperty);
+  virtual void highlight(Standard_Boolean highlight);
+
+  virtual vtkProperty* GetSurfaceProperty(); 
+  virtual void SetSurfaceProperty(vtkProperty* theProperty);
 
   virtual vtkProperty* GetEdgeProperty(); 
   virtual void SetEdgeProperty(vtkProperty* theProperty);
@@ -56,6 +58,9 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor {
   virtual vtkProperty* GetNodeProperty(); 
   virtual void SetNodeProperty(vtkProperty* theProperty);
 
+  virtual void SetOpacity(float theValue);
+  virtual float GetOpacity();
+
   virtual void SetLineWidth(float theLineWidth);
   virtual float GetLineWidth();
 
@@ -68,6 +73,9 @@ class VTKOCC_EXPORT VISU_MeshAct : public VISU_Actor {
   virtual void SetShrink(float theFactor = 0.8); 
   virtual void UnShrink(); 
 
+  virtual void Render(vtkRenderer *, vtkMapper *);
+  void Modified();
+
  protected:
   VISU_MeshAct();
   VISU_Actor *mySurfaceActor, *myEdgeActor, *myNodeActor;
index 2e823ab158e68b3a9794c30c9a2098bed985f56b..30de9bae2b2ed3ede78360aa85e75bf0e0c1e88e 100644 (file)
@@ -46,7 +46,7 @@ VISU_VectorsAct::VISU_VectorsAct(){}
 VISU_VectorsAct::~VISU_VectorsAct(){}
 
 
-void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&){
+void VISU_VectorsAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
   if(myPipeLine = dynamic_cast<VISU_VectorsPL*>(thePipeLine)){
     VISU_Actor::SetPipeLine(myPipeLine);
     myPipeLine->Delete();
index 45e3c14f0bead333b864ac377eb14be84dfa99cd..375633a40ce715034926c7c2c4831e58084fa2ce 100644 (file)
@@ -40,7 +40,7 @@ class VTKOCC_EXPORT VISU_VectorsAct : public VISU_ScalarMapAct {
   static VISU_VectorsAct* New();
   ~VISU_VectorsAct();
 
-  virtual void SetPipeLine(VISU_PipeLine* thePipeLine) throw(std::runtime_error&);
+  virtual void SetPipeLine(VISU_PipeLine* thePipeLine);
 
   virtual void SetTransform(SALOME_Transform* theTransform); 
 
index 81cbfc2698eaeb5534baf90bfade135e828787a1..ffd9da0f5172b93bb4f7a07b5af1d0c7ef8e8bcb 100644 (file)
@@ -60,6 +60,6 @@ BIN_SRC       =
 
 CPPFLAGS+= $(VTK_INCLUDES) -I${KERNEL_ROOT_DIR}/include/salome
 LDFLAGS+= $(VTK_LIBS) -lSalomeVTKFilter -lVisuConvertor \
-       -L${KERNEL_ROOT_DIR}/lib/salome
+       -L${KERNEL_ROOT_DIR}/lib/salome -lSALOMELocalTrace
 
 @CONCLUDE@
index e128b7083f4cf28fbfb4dec3f1d4c111d41c36bc..a99eba600854ef89c7862149f1f4326069aadd86 100644 (file)
@@ -92,7 +92,6 @@ void VISU_PipeLine::Update(){
   myMapper->Update();
 }
 
-
 int VISU_PipeLine::CheckAvailableMemory(const float& theSize){
   try{
     if(theSize > ULONG_MAX) return 0;
@@ -103,8 +102,11 @@ int VISU_PipeLine::CheckAvailableMemory(const float& theSize){
       MESSAGE("CheckAvailableMemory("<<theSize<<") - cannot alloacate such amount of memory!!!");
     return aCheck != NULL;
     //return theSize < 1000*1024*1024;
-  }catch(...){
-    if(MYDEBUG)
+  }catch(std::bad_alloc& exc){
+    if(MYDEBUG) 
+      MESSAGE("CheckAvailableMemory("<<theSize<<") " << exc.what());
+  } catch(...) {
+    if(MYDEBUG) 
       MESSAGE("CheckAvailableMemory("<<theSize<<") - unexpected exception was caught!!!");
   }
   return 0;
index 6e9bc4138fc3e8ca0743ad22ad855c1ed6545189..ec7a15455b22dcc3eefe36fff06e66eb4e0f2ada 100644 (file)
@@ -30,6 +30,8 @@
 #include "VISU_DeformedShapePL.hxx"
 #include <vtkStreamLine.h>
 
+using namespace std;
+
 class vtkPointSet;
 class vtkCellCenters;
 class SALOME_GeometryFilter;
index 3744c066a2df406882073e64f1dc4fe452e25e0f..1072770079436e8caac3ae88a18a10e5b768c73d 100644 (file)
@@ -96,7 +96,7 @@ CXXFLAGS +=  -ftemplate-depth-32 $(OCC_CXXFLAGS) \
        -I${KERNEL_ROOT_DIR}/include/salome
 
 LDFLAGS += $(MED2_LIBS) $(HDF5_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeGUI -lSalomeNS \
-       -lVisuObject -lVISUEngine -lmed -lVTKViewer -L${KERNEL_ROOT_DIR}/lib/salome
+       -lVisuObject -lVISUEngineImpl -lmed -lVTKViewer -L${KERNEL_ROOT_DIR}/lib/salome
 
 
 @CONCLUDE@
index 64003b6bd46239282d160b54b451753aa4f206a1..41e5a031639e4283959544953d992bd40b4fcbc3 100644 (file)
@@ -28,7 +28,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PROJECT VERSION\n"
 "POT-Creation-Date: 2002-02-22 16:56:46 CET\n"
-"PO-Revision-Date: 2003-10-07 11:25+0400\n"
+"PO-Revision-Date: 2004-02-17 11:17+0300\n"
 "Last-Translator: FULLNAME <EMAIL@ADDRESS>\n"
 "Content-Type: text/plain; charset=iso-8859-1\n"
 
@@ -289,6 +289,9 @@ msgstr "Can't visualize current object"
 msgid "WRN_CANT_VISUALIZE_PRS"
 msgstr "The presentation can't be visualized.\nNull actor is created."
 
+msgid "ERR_NO_MEMORY"
+msgstr "There is no enough memory"
+
 msgid "LBL_SOURCE_TYPE"
 msgstr "Source type"
 
index 36e79fe1ccab28c314631bc7d5587d216ec27075..a8e596684c4e34793251588d26210fc13a9def1f 100644 (file)
@@ -90,6 +90,7 @@
 #include "Plot2d_SetupPlot2dDlg.h"
 #include "Plot2d_ViewFrame.h"
 #include "VTKViewer_ViewFrame.h"
+#include "VTKViewer_InteractorStyleSALOME.h"
 #include "VisuGUI_FileDlg.h"
 
 // QT Includes
@@ -164,7 +165,7 @@ private:
   QFont font;
 };
 
-static VisuGUI MYVISUGUI;
+static VisuGUI MYVISUGUI("");
 VisuGUI *visuGUI = &MYVISUGUI;
 
 VISU::VISU_Gen_i* VisuGUI::GetVisuGen(){
@@ -260,6 +261,27 @@ VTKViewer_ViewFrame* VisuGUI::GetVtkViewFrame(){
   return dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
 }
 
+static void UpdateViewFrame() {
+  QList<QAD_StudyFrame> aFrameList = VisuGUI::GetActiveStudy()->getStudyFrames();
+
+  for (QAD_StudyFrame* aStudyFrame = aFrameList.first(); aStudyFrame; aStudyFrame = aFrameList.next()) {
+    if (aStudyFrame->getTypeView() == VIEW_VTK) {
+      QAD_ViewFrame* aViewFrame = aStudyFrame->getRightFrame()->getViewFrame();
+      VTKViewer_ViewFrame* aVtkViewFrame = dynamic_cast<VTKViewer_ViewFrame*>(aViewFrame);
+      if (!aVtkViewFrame) continue;
+      VTKViewer_RenderWindowInteractor* anInteractor = aVtkViewFrame->getRWInteractor();
+      if (anInteractor) {
+       anInteractor->SetSelectionProp();
+       anInteractor->SetSelectionTolerance();
+       VTKViewer_InteractorStyleSALOME* aStyle = anInteractor->GetInteractorStyleSALOME();
+       if (aStyle) {
+         aStyle->setPreselectionProp();
+       }
+      }
+    }
+  }
+}
+
 SALOMEDS::Study_var VisuGUI::GetStudyDocument(){
   return GetActiveStudy()->getStudyDocument();
 }
@@ -335,7 +357,9 @@ void RepaintCurrentView(){
 }
 
 
-VisuGUI::VisuGUI(){    
+VisuGUI::VisuGUI( const QString& theName, QObject* theParent ): 
+  SALOMEGUI( theName, theParent ) 
+{    
   mySelectionDlg = 0;
 }
 
@@ -379,7 +403,6 @@ bool VisuGUI::OnGUIEvent(int theCommandID,  QAD_Desktop* parent)
       /* ======================================================================================== */
       /* Import Table from file                                                                  */
       /* ======================================================================================== */
-
     case 199:
       {
        if(checkLock(aStudy)) break;
@@ -448,12 +471,6 @@ bool VisuGUI::OnGUIEvent(int theCommandID,  QAD_Desktop* parent)
       visuGUI->SelectionInfo();
       break;
 
-      /* ========================================================================================================================= */
-      /* Selection - Shape                                                                                                        */
-      /* ========================================================================================================================= */
-
-      //case 413 :
-
       /* ========================================================================================================================= */
       /* Visualization - Wireframe                                                                                                */
       /* ========================================================================================================================= */
@@ -642,11 +659,25 @@ bool VisuGUI::OnGUIEvent(int theCommandID,  QAD_Desktop* parent)
                              tr ("VISU_BUT_OK") );
       break;
     } 
+  } catch (const std::bad_alloc& e ) { 
+    INFOS("bad_alloc exception is caught "<<e.what());
+    QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+                         tr("ERR_NO_MEMORY") + " " + tr(e.what()),
+                         tr("VISU_BUT_OK") );
+    return false;
+    }
+  catch (std::exception& e){
+    INFOS(e.what());
+    QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+                         tr(e.what()),
+                         tr("VISU_BUT_OK") );
   }catch (const SALOME::SALOME_Exception& S_ex) {
+    INFOS("const SALOME::SALOME_Exception& S_ex");
     QtCatchCorbaException(S_ex);
     return false;
   }
   catch(...) {
+    INFOS(tr("ERR_UNKNOWN_EXCEPTION").latin1());
     QAD_MessageBox::warn1(QAD_Application::getDesktop(), tr ("VISU_WARNING"),
                          tr("ERR_UNKNOWN_EXCEPTION"),
                          tr("VISU_BUT_OK") );
@@ -655,12 +686,7 @@ bool VisuGUI::OnGUIEvent(int theCommandID,  QAD_Desktop* parent)
   return true;
 }
 
-
 void VisuGUI::SelectionInfo() {
-  if (mySelectionDlg) {
-    mySelectionDlg->close(true);
-    mySelectionDlg = 0;
-  }
   mySelectionDlg = new VisuGUI_SelectionDlg();
   mySelectionDlg->show();
 }
@@ -759,7 +785,6 @@ bool VisuGUI::OnKeyPress (QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* st
 // Slot-functions for presentations creation
 //=====================================================================================
 
-
 #define CREATEPRESENTATION(FunctionName)  \
  void FunctionName() { \
    if (checkLock(GetStudyDocument())) return; \
@@ -786,12 +811,11 @@ CREATEPRESENTATION(VisuGUI::CreateStreamLines);
 
 
 
-
 //=====================================================================================
-// function : setSettings()
+// function : SetSettings()
 // purpose  :
 //=====================================================================================
-bool VisuGUI::setSettings(QAD_Desktop* parent)
+bool VisuGUI::SetSettings(QAD_Desktop* parent)
 {
   int anId = 53;
   QMenuData* pp;
@@ -808,6 +832,11 @@ bool VisuGUI::setSettings(QAD_Desktop* parent)
   if(aValue.isEmpty()? 0 : aValue.toInt()) 
     pp->setItemChecked(anId, true);
   
+  anId = 50;
+  parent->menuBar()->changeItem(anId,parent->getComponentUserName("VISU"));
+
+  ::UpdateViewFrame();
+
   return true;
 }
 
@@ -1130,10 +1159,10 @@ void VisuGUI::RecreateActor(VISU::Prs3d_i* thePrs) {
            thePrs->UpdateActor(anActor);
       }
   }catch(std::runtime_error& ex){
-    QApplication::restoreOverrideCursor();
     INFOS(ex.what());
+    QApplication::restoreOverrideCursor();
     QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"), 
-                           tr ("ERR_CANT_BUILD_PRESENTATION"), 
+                           tr ("ERR_CANT_BUILD_PRESENTATION") + " " + tr(ex.what())
                            tr ("VISU_BUT_OK") );
     for(int i = 0, nbFrames = GetActiveStudy()->getStudyFramesCount(); i < nbFrames; i++)
       if(QAD_StudyFrame* aFrame = GetActiveStudy()->getStudyFrame(i)){
@@ -1198,7 +1227,7 @@ void VisuGUI::EditPrs() {
     {
       VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
       if (aPrsObject) {
-       VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, false);
+       VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, false); 
         aDlg->initFromPrsObject(aPrsObject);
        aDlg->show();
        myActiveDialogBox = aDlg;      
@@ -1398,7 +1427,7 @@ void VisuGUI::CreateMesh() {
     }catch(std::runtime_error& exc){
       INFOS(exc.what());
       QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"), 
-                             tr ("ERR_CANT_CREATE_ACTOR"), 
+                             tr ("ERR_CANT_CREATE_ACTOR") + " " + tr(exc.what())
                              tr ("VISU_BUT_OK") ); 
     }
   }
@@ -2196,57 +2225,31 @@ void VisuGUI::DeletePrs() {
 void VisuGUI::SaveViewParams()
 {
   if (checkLock(GetStudyDocument())) return;
-  SALOME_Selection* Sel = SALOME_Selection::Selection( GetActiveStudy()->getSelection() );
-  if ( Sel->IObjectCount() > 1 || GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_VTK ) 
+  SALOME_Selection* aSel = SALOME_Selection::Selection( GetActiveStudy()->getSelection() );
+  QAD_StudyFrame* aStudyFrame = GetActiveStudy()->getActiveStudyFrame();
+  if ( aSel->IObjectCount() > 1 || aStudyFrame->getTypeView() != VIEW_VTK ) 
     return;
-  VISU::ViewManager_var aVM = GetVisuGen()->GetViewManager();
-  if(!CORBA::is_nil(aVM.in())){
-    VISU::View_var aView = aVM->GetCurrentView();
-    if(!CORBA::is_nil(aView.in())){
-      VISU::View3D_var aView3D = VISU::View3D::_narrow(aView);
-      if(CORBA::is_nil(aView3D.in())) return;
-      if ( Sel->IObjectCount()  == 0 ) {
-       // Save view parameters by new name
-       aView3D->SaveViewParams( 0 );
-       GetActiveStudy()->updateObjBrowser( true );
-      }else{
-       bool isExist;
-       VISU::Storable::TRestoringMap aMap;
-       Handle(SALOME_InteractiveObject) anIO;    
-       CORBA::Object_var anObject = GetSelectedObj(&anIO,GetActiveStudy(),&aMap);
-       VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
-       if(isExist && aType == VISU::TVIEW3D){
-         aView3D->SaveViewParams( anIO->getName() );
-         GetActiveStudy()->updateObjBrowser( true );
-       }
-      }
-    }
+  if ( aSel->IObjectCount()  == 0 ) {
+    VISU::View3D_i::SaveViewParams(aStudyFrame,VISU::View3D_i::GenerateViewParamsName().latin1());
+  }else{
+    const Handle(SALOME_InteractiveObject)& anIO = aSel->firstIObject();
+    VISU::View3D_i::SaveViewParams(aStudyFrame,anIO->getName());
   }
+  GetActiveStudy()->updateObjBrowser( true );
 }
 
 
 void VisuGUI::RestoreViewParams()
 {
-  SALOME_Selection* Sel = SALOME_Selection::Selection( GetActiveStudy()->getSelection() );
-  if ( Sel->IObjectCount() > 1 || GetActiveStudy()->getActiveStudyFrame()->getTypeView() != VIEW_VTK ) 
+  SALOME_Selection* aSel = SALOME_Selection::Selection( GetActiveStudy()->getSelection() );
+  QAD_StudyFrame* aStudyFrame = GetActiveStudy()->getActiveStudyFrame();
+  if ( aSel->IObjectCount() > 1 || aStudyFrame->getTypeView() != VIEW_VTK ) 
     return;
-  VISU::ViewManager_var aVM = GetVisuGen()->GetViewManager();
-  if(!CORBA::is_nil(aVM.in())){
-    VISU::View_var aView = aVM->GetCurrentView();
-    if(!CORBA::is_nil(aView.in())){
-      VISU::View3D_var aView3D = VISU::View3D::_narrow(aView);
-      if(CORBA::is_nil(aView3D.in())) return;
-      bool isExist;
-      VISU::Storable::TRestoringMap aMap;
-      Handle(SALOME_InteractiveObject) anIO;    
-      CORBA::Object_var anObject = GetSelectedObj(&anIO,GetActiveStudy(),&aMap);
-      VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
-      if(isExist && aType == VISU::TVIEW3D)
-       aView3D->RestoreViewParams( anIO->getName() );
-    }
-  }
+  const Handle(SALOME_InteractiveObject)& anIO = aSel->firstIObject();
+  VISU::View3D_i::RestoreViewParams(aStudyFrame,anIO->getName());
 }
 
+
 //=====================================================================================
 // function : DeleteViewParams()
 // purpose  :
@@ -2304,14 +2307,20 @@ void VisuGUI::Sweep() {
   }
 
   QApplication::setOverrideCursor( Qt::waitCursor );
-  for (int j=0 ; j<aCycles; j++) {
-    for (int i=0 ; i<=aSteps; i++) {
-      float aPercents = float(i)/aSteps;
-      aPrsObject->SetMapScale(aPercents);
-      aPrsObject->UpdateActor(aActor);
-      vf->getRW()->getRenderWindow()->Render();
-      usleep(aTemp);
+  try{
+    for (int j=0 ; j<aCycles; j++) {
+      for (int i=0 ; i<=aSteps; i++) {
+       float aPercents = float(i)/aSteps;
+       aPrsObject->SetMapScale(aPercents);
+       aPrsObject->UpdateActor(aActor);
+       vf->getRW()->getRenderWindow()->Render();
+       usleep(aTemp);
+      }
     }
+  }catch(std::exception& exc){
+    INFOS("Follow exception was accured :\n"<<exc.what());
+  }catch(...){
+    INFOS("Unknown exception was accured!");
   }
   QApplication::restoreOverrideCursor();
 }
@@ -2728,8 +2737,7 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
   thePopup->clear();
   SALOME_Selection* aSelection = SALOME_Selection::Selection(GetActiveStudy()->getSelection());
   if ( aSelection->IObjectCount() == 0 ) {
-    if ( theParent == "Viewer" && isVTKViewer)
-      // Available only for VTK viewer
+    if ( theParent == "Viewer" && isVTKViewer && !aIsLocked)
       thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
     return false;
   }
@@ -2996,11 +3004,12 @@ bool VisuGUI::CustomPopup(QAD_Desktop* parent, QPopupMenu* thePopup, const QStri
          if ( !aIsLocked )thePopup->insertItem("Create Presentation", visuGUI, SLOT(CreateMesh()));    
          break;
        case VISU::TVIEW3D: 
+         if ( GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK )
+           thePopup->insertItem( "Restore view parameters", visuGUI, SLOT( RestoreViewParams() ) );
          if ( !aIsLocked ) {
            if ( GetActiveStudy()->getActiveStudyFrame()->getTypeView() == VIEW_VTK ) { 
              // Available only for VTK viewer
              thePopup->insertItem( "Save view parameters", visuGUI, SLOT( SaveViewParams() ) );
-             thePopup->insertItem( "Restore view parameters", visuGUI, SLOT( RestoreViewParams() ) );
            }
            thePopup->insertItem( "Rename...", visuGUI, SLOT( Rename() ) );
            thePopup->insertItem("Delete", visuGUI, SLOT(DeleteViewParams()));
@@ -3098,73 +3107,34 @@ void VisuGUI::BuildPresentation(const Handle(SALOME_InteractiveObject)& theIO)
          vf->AddActor(SelectedActor);
       }catch(std::runtime_error& exc){
        INFOS(exc.what());
+       throw exc; 
       }
   }else
     if(MYDEBUG) MESSAGE("CORBA::is_nil(anObject) = true");
   END_OF("VisuGUI::BuildPresentation");
 }
 
-extern "C"
-{
-  bool OnGUIEvent(int theCommandID, QAD_Desktop* parent)
-  {
-    //if(MYDEBUG) MESSAGE("VisuGUI::OnGUIEvent "<< theCommandID);
-    return VisuGUI::OnGUIEvent(theCommandID, parent);
-  }
-
-  bool OnKeyPress (QKeyEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
-  {
-    if(MYDEBUG) MESSAGE("VisuGUI::OnKeyPress ");
-    return VisuGUI::OnKeyPress (pe, parent, studyFrame);
-  }
-
-  bool OnMousePress (QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
-  {
-    //if(MYDEBUG) MESSAGE("VisuGUI::OnMousePress ");
-    return VisuGUI::OnMousePress (pe, parent, studyFrame);
-  }
 
-  bool OnMouseMove (QMouseEvent* pe, QAD_Desktop* parent, QAD_StudyFrame* studyFrame)
-  {
-    //if(MYDEBUG) MESSAGE("VisuGUI::OnMouseMove ");
-    return VisuGUI::OnMouseMove (pe, parent, studyFrame);
-  }
-
-  bool SetSettings ( QAD_Desktop* parent )
-  {
-    return VisuGUI::setSettings( parent );
-  }
-
-  bool customPopup ( QAD_Desktop* parent, QPopupMenu* popup, const QString & theContext,
-                    const QString & theParent, const QString & theObject )
-  {
-    return VisuGUI::CustomPopup( parent, popup, theContext, theParent, theObject );
-  }
-
-  void definePopup ( QString & theContext, QString & theParent, QString & theObject )
-  {
-    VisuGUI::DefinePopup( theContext, theParent, theObject );
-  }
+//===========================================================================
+// SupportedViewType
+//===========================================================================
+void VisuGUI::SupportedViewType(int* buffer, int bufferSize)
+{
+  if (!buffer || !bufferSize) return;
+  buffer[0] = (int)VIEW_VTK;
+  if (--bufferSize) buffer[1] = (int)VIEW_PLOT2D;
+} 
 
-  bool activeStudyChanged ( QAD_Desktop* parent )
-  {
-    //VisuGUI::activeStudyChanged( parent );
-  }
-    void buildPresentation ( const Handle(SALOME_InteractiveObject)& theIO )
-  {
-    VisuGUI::BuildPresentation(theIO);
+extern "C"
+{
+  Standard_EXPORT SALOMEGUI* GetComponentGUI() {
+    if ( !visuGUI )
+      visuGUI = new VisuGUI( "" );
+    return visuGUI;
   }
-
-  void supportedViewType(int* buffer, int bufferSize)
-  {
-    if (!buffer || !bufferSize) return;
-    buffer[0] = (int)VIEW_VTK;
-    if (--bufferSize) buffer[1] = (int)VIEW_PLOT2D;
-  }  
-
 }
 
+
 //////////////////////////////////////////////////////////////////////////////////
 ////////////////               CHANGE ACTOR COLOR         ////////////////////////
 //////////////////////////////////////////////////////////////////////////////////
@@ -3261,8 +3231,8 @@ void VisuGUI::NewOpacity(VISU_Actor *Actor)
   int intopac;
   CursorDlg->Comment1->setText( tr( "Set value between") );
   CursorDlg->Comment2->setText( tr( "0 (transparent) and 100 (opaque)" ) );
-  oldopac=Actor->GetProperty()->GetOpacity();
-  intopac=int(oldopac*100.);
+  oldopac=Actor->GetOpacity();
+  intopac=int(oldopac*100.+0.5);
   CursorDlg->SpinBox1->setMinValue(0);
   CursorDlg->SpinBox1->setMaxValue(100);
   CursorDlg->SpinBox1->setValue(intopac);
@@ -3272,7 +3242,7 @@ void VisuGUI::NewOpacity(VISU_Actor *Actor)
     {
       intopac  = CursorDlg->SpinBox1->value() ;
       newopac = intopac/100.;
-      Actor->GetProperty()->SetOpacity(newopac);
+      Actor->SetOpacity(newopac);
     }
   delete CursorDlg;
 }
@@ -3477,7 +3447,10 @@ bool FNAME(SALOMEDS::SObject_var theField) { \
         return false; \
       } \
     } \
-    CreateActor(pPresent); \
+     try { \
+       CreateActor(pPresent); \
+     }catch (...) {\
+       return false;} \
     return true; \
   } \
   return false; \
@@ -3493,6 +3466,7 @@ BUILDPRS(VISU::StreamLines_i, CreateStreamLinesPrs, VisuGUI::CreateStreamLines,
 
 
 bool VisuGUI::CreateCutPlanes(SALOMEDS::SObject_var theField) { 
+  try {
   VISU::Storable::TRestoringMap aMap = getMapOfValue(theField); 
   bool isExist; 
   QString aType = VISU::Storable::FindValue(aMap,"myType",&isExist); 
@@ -3529,10 +3503,12 @@ bool VisuGUI::CreateCutPlanes(SALOMEDS::SObject_var theField) {
       return true;
     }
   }
+}catch (...){return false;}
   return false;
 }
 
 bool VisuGUI::CreateCutLines(SALOMEDS::SObject_var theField) { 
+try {
   VISU::Storable::TRestoringMap aMap = getMapOfValue(theField); 
   bool isExist; 
   QString aType = VISU::Storable::FindValue(aMap,"myType",&isExist); 
@@ -3593,6 +3569,7 @@ bool VisuGUI::CreateCutLines(SALOMEDS::SObject_var theField) {
 //     return true; 
     } 
   }
+}catch (...){return false; }
   return false; 
 }
 
@@ -3702,7 +3679,13 @@ void VisuGUI::ExportTableToFile()
        try {
          GetVisuGen() -> ExportTableToFile(aSObj, aFile.latin1());
          QAD_Application::getDesktop()->putInfo(aFile+" exported.");
+       } catch(std::exception& ex) {
+         INFOS(ex.what());
+         QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+                                tr ("ERR_ERROR_DURING_EXPORT") + " " + tr(ex.what()),
+                                tr ("VISU_BUT_OK") );
        } catch(...) {
+         INFOS(tr ("ERR_ERROR_DURING_EXPORT"));
          QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
                                 tr ("ERR_ERROR_DURING_EXPORT"),
                                 tr ("VISU_BUT_OK") );
@@ -3802,7 +3785,14 @@ void VisuGUI::ExportToFile(){
        try{
          //APO - aResult->GetInput()->ToFile(aFile.latin1());
          QAD_Application::getDesktop()->putInfo(aFile+" exported.");
-       }catch(...){
+       }catch(std::exception& ex) {
+         INFOS(ex.what());
+         QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+                                tr ("ERR_ERROR_DURING_EXPORT") + " " +tr(ex.what()),
+                                tr ("VISU_BUT_OK") );
+       } 
+       catch(...){
+         INFOS(tr ("ERR_ERROR_DURING_EXPORT").latin1());
          QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
                                 tr ("ERR_ERROR_DURING_EXPORT"),
                                 tr ("VISU_BUT_OK") );
@@ -3882,11 +3872,11 @@ VISU_Actor* VisuGUI::UpdateViewer(VISU::Prs3d_i* thePrs, bool theDispOnly){
   try{
     anVISUActor = thePrs->CreateActor();
     vf->AddActor(anVISUActor);
-  }catch(std::runtime_error& exc){
+  } catch ( std::runtime_error& exc ){
     INFOS(exc.what());
     QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
-                           tr ("ERR_CANT_VISUALIZE_OBJECT"),
-                           tr ("VISU_BUT_OK") );
+                          tr("ERR_CANT_VISUALIZE_OBJECT") + " " + tr(exc.what()),
+                          tr ("VISU_BUT_OK") );
     anVISUActor = NULL;
   }
   return anVISUActor;
@@ -3946,14 +3936,26 @@ void VisuGUI::CreateActor(VISU::Prs3d_i* thePrs) {
     timer.Start();
 #endif
     try{
+      MESSAGE("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
       VISU_Actor* aActor = thePrs->CreateActor();
       vf->AddActor(aActor);
-    }catch(std::runtime_error& exc){
-      INFOS(exc.what());
+    }catch(std::runtime_error& exc) {
+      INFOS("std::runtime_error "<<exc.what());
+      INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
       QApplication::restoreOverrideCursor();
       QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
-                             tr ("WRN_CANT_VISUALIZE_PRS"),
-                             tr ("VISU_BUT_OK") );
+                               tr ("WRN_CANT_VISUALIZE_PRS") + " " + tr(exc.what()),
+                               tr ("VISU_BUT_OK") );
+      throw exc;
+    } catch (...) {
+      cout<<" Unknown exception"<<endl;
+      QApplication::restoreOverrideCursor();
+      INFOS("Unknown exception is caught in VisuGUI::CreateActor");
+      INFOS("Available memory : "<<VISU_PipeLine::GetAvailableMemory());
+      QAD_MessageBox::warn1 ( QAD_Application::getDesktop(), tr ("VISU_WARNING"),
+                            tr ("WRN_CANT_VISUALIZE_PRS") + " " + tr("ERR_UNKNOWN_EXCEPTION"),
+                            tr ("VISU_BUT_OK") );
+      throw ;
     }
 #ifdef CHECKTIME
     timer.Stop();
index ec5677ecfe48815464334e57808846660771b2a8..9bed10f884c35eba421a51a8f26a7d9cb5f39d1a 100644 (file)
@@ -54,6 +54,8 @@ class vtkRenderer;
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 #include "SALOME_ListIteratorOfListIO.hxx"
 
+#include "SALOMEGUI.h"
+
 namespace VISU{
   class VISU_Gen_i;
 
@@ -78,11 +80,11 @@ namespace VISU{
 // ======================================================================
 // 
 
-class VisuGUI : public QObject{
+class VisuGUI : public SALOMEGUI{
   Q_OBJECT;
  public:
-  VisuGUI();     
-  ~VisuGUI();    
+  VisuGUI( const QString& name = "", QObject* parent = 0 );      
+  virtual ~VisuGUI();    
   
   static VISU::VISU_Gen_i* GetVisuGen();
 
@@ -177,27 +179,29 @@ class VisuGUI : public QObject{
 // ----------------------------------------
 // All method of standard EXPORT
 // ----------------------------------------
-  Standard_EXPORT static bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
-  Standard_EXPORT static bool setSettings(QAD_Desktop* parent);
-  Standard_EXPORT static void DefinePopup(QString & theContext,
+  virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent);
+  virtual bool SetSettings(QAD_Desktop* parent);
+  virtual void DefinePopup(QString & theContext,
                                          QString & theParent, 
                                          QString & theObject ) ;
-  Standard_EXPORT static bool CustomPopup(QAD_Desktop* parent,
+  virtual bool CustomPopup(QAD_Desktop* parent,
                                          QPopupMenu* popup,
                                          const QString & theContext,
                                          const QString & theParent,
                                          const QString & theObject);
-  Standard_EXPORT static void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
-  Standard_EXPORT static bool OnMousePress(QMouseEvent* pe ,
+  virtual void BuildPresentation(const Handle(SALOME_InteractiveObject)&);
+  virtual bool OnMousePress(QMouseEvent* pe ,
                                           QAD_Desktop* parent, 
                                           QAD_StudyFrame* studyFrame);
-  Standard_EXPORT static bool OnMouseMove(QMouseEvent* pe ,
+  virtual bool OnMouseMove(QMouseEvent* pe ,
                                          QAD_Desktop* parent, 
                                          QAD_StudyFrame* studyFrame);
-  Standard_EXPORT static bool OnKeyPress(QKeyEvent* pe,
+  virtual bool OnKeyPress(QKeyEvent* pe,
                                         QAD_Desktop* parent,
                                         QAD_StudyFrame* studyFrame);
-  public slots:
+  virtual void SupportedViewType (int* buffer, int bufferSize);
+
+public slots:
   void ImportTablesFromFile();
   void ExportTableToFile();
 
@@ -267,10 +271,6 @@ private :
   QDialog* myActiveDialogBox;
   int myState ;
   VisuGUI_SelectionDlg* mySelectionDlg;
-  
-signals:
-  void SignalDeactivateActiveDialog();
-  void SignalCloseAllDialogs();
 };
 
 #endif
index b8d69724c6bb96f53e7c033be6359d7f6ab320f0..2a32fd87ce58dd7fbaf185e8b4980e1b6d32a25f 100644 (file)
@@ -591,6 +591,7 @@ void VisuGUI_CutLinesDlg::accept() {
   MYGenerateTable = myCreateTable->isChecked();
   MYGenerateCurve = myCurvesCheck->isChecked();
   if (myScalarPane->check()) {
+    ((QWidget*)sender())->setDisabled(true);
     storeToPrsObject(myPrs);
     if (myIsCreation) {
       if (isGenerateTable()) {
@@ -614,7 +615,13 @@ void VisuGUI_CutLinesDlg::accept() {
        }
       }
       if (myStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
-       visuGUI->CreateActor(myPrs);
+       try {
+         visuGUI->CreateActor(myPrs);
+       }
+       catch (...) {
+         reject();
+         return;
+       }
        GET_VTK_VIEWFRAME(myStudy)->onViewFitAll(); 
       }
     } else {
index 00d56132d1f236ffd6e75224889674442d730784..8eed6adec4b04a4b5845492422899a79bc6c99bf 100644 (file)
@@ -193,6 +193,10 @@ void VisuGUI_CutPlanesPane::createPlanes() {
 
   vtkAppendPolyData* aPolyData = myCutPlanes->GetCutPlanesPL()->GetAppendPolyData();
   vtkDataSetMapper* aPlaneMapper = vtkDataSetMapper::New();
+  if (!aPolyData->GetOutput()->GetNumberOfCells()) {
+    onPreviewCheck(false);
+    return;
+  }
   aPlaneMapper->SetInput(aPolyData->GetOutput());
   aPlaneMapper->ScalarVisibilityOff();
 
@@ -513,7 +517,13 @@ void VisuGUI_CutPlanesDlg::accept() {
       if (storeToPrsObject(myPrs)) {
        if (myIsCreation) { 
          if (myStudy->getActiveStudyFrame()->getTypeView() == VIEW_VTK) {
+           try {
            visuGUI->CreateActor(myPrs);
+           }
+           catch (...) {
+             reject();
+             return;
+           }
            GET_VTK_VIEWFRAME(myStudy)->onViewFitAll(); 
          }
        } else {
@@ -548,11 +558,6 @@ void VisuGUI_CutPlanesDlg::onFrameActivated( QAD_StudyFrame* theFrame) {
     reject();
 }
 
-VisuGUI_CutPlanesDlg::~VisuGUI_CutPlanesDlg () {
-  reject();
-}
-
-
 //###################################################################
 
 
index 0651f73872fc2dd189f578a227153dc1275d013d..b3ee6eea78a69c459145f984e3bf4258803a6ddc 100644 (file)
@@ -106,7 +106,7 @@ class VisuGUI_CutPlanesDlg : public QDialog
 
 public:
     VisuGUI_CutPlanesDlg(bool theIsCreation, bool theIsModal);
-    ~VisuGUI_CutPlanesDlg();
+    ~VisuGUI_CutPlanesDlg() {};
 
     void initFromPrsObject(VISU::CutPlanes_i* thePrs)
       {myPrs=thePrs; myScalarPane->initFromPrsObject(thePrs); myCutPane->initFromPrsObject(thePrs);}
index 58212511c9c64c0f97ebe6ff743c9c7cc4556769..50a1571bfd44eebf0c9d187934116269ae6b3668 100644 (file)
@@ -1,5 +1,3 @@
-using namespace std;
-
 //  VISU VISUGUI : GUI of VISU component
 //
 //  Copyright (C) 2003  CEA/DEN, EDF R&D
@@ -21,13 +19,14 @@ using namespace std;
 #include <qlayout.h>
 #include <qcheckbox.h>
 #include <qgroupbox.h>
-
+#include <qpushbutton.h>
 
 #include CORBA_SERVER_HEADER(VISU_Gen)
 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
 
 extern VisuGUI *visuGUI;
 
+using namespace std;
 
 
 /* XPM */
index 87672a24b90f17c06d20e6eb4f5335466089f586..f6955d896420aa2a4a70ce91f0cb68809b3a7bed 100644 (file)
@@ -103,4 +103,3 @@ bool VisuGUI_FileDlg::IsChecked()
 {
   return myCBuildAll->isChecked();
 }
-
index 45a6ac14cefa790ca7977961adb2193ec1278a13..e1a65458a27b6184a7ce70ea8a804594cf2cc964 100644 (file)
@@ -137,6 +137,7 @@ void VisuGUI_IsoSurfPane::onCBUpdate()
 
 bool VisuGUI_IsoSurfPane::check() {
   if (MinIso->text().toDouble() >= MaxIso->text().toDouble()) {
+    MESSAGE(tr("MSG_MINMAX_VALUES"));
     QAD_MessageBox::warn1( this,tr("VISU_WARNING"),
                           tr("MSG_MINMAX_VALUES"),
                           tr("VISU_BUT_OK"));
index 72fd9ef5c760d37835c2ddf24058526e9f961e88..cacf63f3a33bd280b0feb893e30107e956078c36 100644 (file)
@@ -26,8 +26,8 @@
 //  Module : VISU
 //  $Header$
 
-using namespace std;
-#include "utilities.h"
+#include "VisuGUI_Selection.h"
+
 #include "SALOME_ListIteratorOfListIO.hxx"
 #include "SALOME_Selection.h"
 #include "VISU_Actor.h"
@@ -36,11 +36,14 @@ using namespace std;
 #include "VISU_PipeLine.hxx"
 #include "VisuGUI.h"
 #include "QAD_MessageBox.h"
+#include "QAD_RightFrame.h"
 #include "VTKViewer_ViewFrame.h"
 
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_MapIteratorOfMapOfInteger.hxx>
 
+#include <map>
+
 #include <qstring.h>
 #include <qlabel.h>
 #include <qspinbox.h>
@@ -48,21 +51,27 @@ using namespace std;
 #include <qlayout.h>
 #include <qhbuttongroup.h>
 #include <qradiobutton.h>
+#include <qpushbutton.h>
 
 #include <vtkDataSet.h>
 #include <vtkCell.h>
 #include <qvalidator.h>
 
-#include "VisuGUI_Selection.h"
+#include "utilities.h"
 
+using namespace std;
 
 extern VisuGUI *visuGUI;
-
+static QAD_Study* myStudy = NULL;
+static VisuGUI_SelectionDlg* mySelectionDlg = NULL;
 
 VisuGUI_SelectionDlg::VisuGUI_SelectionDlg()    
   : QDialog( QAD_Application::getDesktop(), 0, false, 
-            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu )
+            WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu | WDestructiveClose)
 {
+  if(mySelectionDlg)
+    mySelectionDlg->close(true);
+
   setCaption( "Data on elements" );
   setSizeGripEnabled( TRUE );
   
@@ -214,27 +223,35 @@ VisuGUI_SelectionDlg::VisuGUI_SelectionDlg()
   
   TopLayout->addWidget(aBtnBox, 3, 0);
 
-  mySelection = SALOME_Selection::Selection(visuGUI->GetActiveStudy()->getSelection());
+  myStudy = visuGUI->GetActiveStudy();
+  mySelection = SALOME_Selection::Selection(myStudy->getSelection());
   connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(onSelectionEvent()));
-  
+
+  connect(visuGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close()));
+
+  myFl = false;
   onSelectionChange(0);
+
+  mySelectionDlg = this;
 }
 
 
 void VisuGUI_SelectionDlg::onSelectionChange(int theId) {
-  clearFields();
+  //  clearFields();
   switch (theId) {
   case 0: // Points
     myWidgetStack->raiseWidget(myPointsPane);    
-    QAD_Application::getDesktop()->SetSelectionMode(1, true);
+    QAD_Application::getDesktop()->SetSelectionMode(NodeSelection, true);
+    onPointIdEdit(myIDValLbl->text());
     break;
   case 1: // Cells
     myWidgetStack->raiseWidget(myCellsPane);
-    QAD_Application::getDesktop()->SetSelectionMode(3, true);
+    QAD_Application::getDesktop()->SetSelectionMode(CellSelection, true);
+    onCellIdEdit(myCellIDValLbl->text());
     break;
   case 2: // Actor
     myWidgetStack->raiseWidget(myActorsPane);
-    QAD_Application::getDesktop()->SetSelectionMode(4, true);  
+    QAD_Application::getDesktop()->SetSelectionMode(ActorSelection, true);  
   }
   onSelectionEvent();
 //   if (VTKViewer_ViewFrame* vf = visuGUI->GetVtkViewFrame())
@@ -242,8 +259,10 @@ void VisuGUI_SelectionDlg::onSelectionChange(int theId) {
 }
 
 
-void VisuGUI_SelectionDlg::closeEvent(QCloseEvent* theEvent) {  
-  QAD_Application::getDesktop()->SetSelectionMode(4, true);
+void VisuGUI_SelectionDlg::closeEvent(QCloseEvent* theEvent) {
+  mySelectionDlg = NULL;
+  myStudy->getActiveStudyFrame()->getRightFrame()->getViewFrame()->SetSelectionMode( ActorSelection );
+  QAD_Application::getDesktop()->SetSelectionMode(ActorSelection, true);
   disconnect(mySelection,0,0,0);
   QDialog::closeEvent(theEvent);
 }
@@ -270,6 +289,8 @@ template<class TData> QString getVector(TData* theData, int theId){
 #define ABS(a) (a>=0)?a:-a
 
 void VisuGUI_SelectionDlg::onSelectionEvent() {
+  if (myFl) return;
+  myFl = true;  
   Handle(SALOME_InteractiveObject) anIO;
   int aType = myWidgetStack->id(myWidgetStack->visibleWidget());
   if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
@@ -291,15 +312,21 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
       myDYLbl->setText(QString::number( ABS(aCoord[3]-aCoord[2]) ));
       myDZLbl->setText(QString::number( ABS(aCoord[5]-aCoord[4]) ));
     }
+
     TColStd_MapOfInteger aMapIndex;
+    typedef map<int,float*> PointsMap;
+    PointsMap aPointsMap;
     mySelection->GetIndex(anIO, aMapIndex);
     TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex);
-    if(anIter.More()){
-      VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);  
-      vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
-      //      vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
+    
+    VISU_Actor* anActor = visuGUI->GetActor(aPrs3d);  
+    if(!anActor)
+      return;
+    vtkDataSet* aDataSet = anActor->GetMapper()->GetInput();
+    vtkPointData* aPntData = aDataSet->GetPointData();
+
+    for (;anIter.More();anIter.Next()){
       int aID = anIter.Key();
-      vtkPointData* aPntData = aDataSet->GetPointData();
       
       switch (aType) {
       case 0:
@@ -318,45 +345,57 @@ void VisuGUI_SelectionDlg::onSelectionEvent() {
        break;
       case 1:
        {
-         int aMaxId = aDataSet->GetNumberOfCells();
+         //int aMaxId = aDataSet->GetNumberOfCells();
          //cout<<"### MaxId="<<aMaxId<<endl;
          //cout<<"### SelectedId="<<aID<<endl;
          vtkCellData* aData = aDataSet->GetCellData();
          vtkCell* aCell = aDataSet->GetCell(aID);
-         if (aCell == NULL) return;
-
-         int aNbOfPoints = aCell->GetNumberOfPoints();
-         if (aNbOfPoints <=1 ) { // Cell is point
-           clearFields();
-           return;
-         }
-         
-         myCellIDValLbl->setText( QString::number(aID) );
-         myCellScalarValLbl->setText(getValue(aData, aID));
-         myCellVectorValLbl->setText(getVector(aData, aID));
+         if (aCell != NULL) {
+           int aNbOfPoints = aCell->GetNumberOfPoints();
+           if (aNbOfPoints <=1 ) { // Cell is point
+             clearFields();
+           }
+           else {
+             int aDSId = anActor->GetObjId(aID);
+             if (aDSId==-1) aDSId = aID;
+             myCellIDValLbl->setText( QString::number(aDSId) );
+             myCellScalarValLbl->setText(getValue(aData, aID));
+             myCellVectorValLbl->setText(getVector(aData, aID));
          
-         float aCoord[3];
-         vtkIdList *aPointList = aCell->GetPointIds();
-         QListViewItem* anItem = NULL;
-         myListPoints->setNumRows(aNbOfPoints);
-         for(int i = 0; i < aNbOfPoints; i++){
-           int idCurrent = aPointList->GetId(i);
-           aDataSet->GetPoint(idCurrent,aCoord);
-           myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
-           myListPoints->setText(i, 0, QString::number( idCurrent ));
-           myListPoints->setText(i, 1, QString::number( aCoord[0] ));
-           myListPoints->setText(i, 2, QString::number( aCoord[1] ));
-           myListPoints->setText(i, 3, QString::number( aCoord[2] ));
-           myListPoints->setText(i, 4, getValue(aPntData, idCurrent));
-           myListPoints->setText(i, 5, getVector(aPntData, idCurrent));
+             float* aCoord;
+             vtkIdList *aPointList = aCell->GetPointIds();
+             QListViewItem* anItem = NULL;
+        
+             for(int i = 0; i < aNbOfPoints; i++){
+               int idCurrent = aPointList->GetId(i);
+               aCoord = aDataSet->GetPoint(idCurrent);
+               aPointsMap.insert(PointsMap::value_type(idCurrent,aCoord));
+             }
+           }
          }
        }
        break;
       }
     }
+
+    myListPoints->setNumRows(aPointsMap.size());
+    PointsMap::const_iterator It = aPointsMap.begin();
+    for(int i=0; It!=aPointsMap.end()&&i<myListPoints->numRows() ; It++,i++){
+      myListPoints->verticalHeader()->setLabel(i, QString::number( i ));
+      int id = It->first;
+      myListPoints->setText(i, 0, QString::number( id ));
+      float* aCoord = It->second;
+      myListPoints->setText(i, 1, QString::number( aCoord[0] ));
+      myListPoints->setText(i, 2, QString::number( aCoord[1] ));
+      myListPoints->setText(i, 3, QString::number( aCoord[2] ));
+      myListPoints->setText(i, 4, getValue(aPntData, id));
+      myListPoints->setText(i, 5, getVector(aPntData, id));
+    }
+    
   } else {
     clearFields();
   }
+  myFl = false;
 }
 #undef ABS
 
@@ -388,31 +427,59 @@ void VisuGUI_SelectionDlg::clearFields() {
   }
 }
 
+typedef  vtkIdType (vtkDataSet::* TDataSetMethod)();
 
-#define SELECTBYNUM(METHODNAME, DATASETMETHOD) \
-void VisuGUI_SelectionDlg::METHODNAME(const QString& theText) { \
-  int anId = theText.toInt(); \
-  Handle(SALOME_InteractiveObject) anIO; \
-  if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){ \
-    TColStd_MapOfInteger aMapIndex; \
-    mySelection->GetIndex(anIO, aMapIndex); \
-    TColStd_MapIteratorOfMapOfInteger anIter(aMapIndex); \
-    if(anIter.More()){ \
-      vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput(); \
-      int aMaxId = aDataSet->DATASETMETHOD(); \
-      if(0 <= anId && anId < aMaxId){ \
-       mySelection->AddIObject(anIO); \
-       mySelection->AddOrRemoveIndex(anIO, anId, false); \
-      } \
-    } \
-  } else { \
-    myMeshName->setText(tr ("WRN_NO_AVAILABLE_DATA")); \
-    myFieldName->setText(""); \
-  } \
+bool onIdEdit(const QString& theText, 
+             TDataSetMethod theMethod, 
+             bool theIsCell,
+             SALOME_Selection* theSelection, 
+             QLabel* theMeshName, 
+             QString theValue,
+             QLabel* theFieldName)
+{
+  int anId = theText.toInt();
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = visuGUI->GetSelectedPrs3d(&anIO)){
+    vtkDataSet* aDataSet = aPrs3d->GetPL()->GetMapper()->GetInput();
+    int aMaxId = (aDataSet->*theMethod)();
+    if(anId < 0) anId = 0;
+    if(aMaxId <= anId) anId = aMaxId-1;
+    theSelection->ClearIObjects();
+    theSelection->AddIObject(anIO);
+    VISU_Actor* anVISUActor = visuGUI->GetActor(aPrs3d);
+    if(theIsCell){
+      VISU_Actor::TVectorId aVec = anVISUActor->GetVtkId(anId);
+      if(!aVec.empty()){
+       theSelection->AddOrRemoveIndex( anIO, aVec, false );
+       return true;
+      }
+    }else{
+      theSelection->AddOrRemoveIndex(anIO, anId, false);
+      return true;
+    }
+  }else{
+    theMeshName->setText(theValue);
+    theFieldName->setText("");
+  }
+  return false;
 }
 
-SELECTBYNUM(onPointIdEdit, GetNumberOfPoints);
-SELECTBYNUM(onCellIdEdit, GetNumberOfCells);
-
-#undef SELECTBYNUM
+void VisuGUI_SelectionDlg::onPointIdEdit(const QString& theText){
+  if (myFl) return;
+  TDataSetMethod aMethod = &vtkDataSet::GetNumberOfPoints;
+  bool anIsSelected = onIdEdit(theText,aMethod,false,mySelection,
+                              myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
+                              myFieldName);
+  if(!anIsSelected)
+    clearFields();
+}
 
+void VisuGUI_SelectionDlg::onCellIdEdit(const QString& theText){
+  if (myFl) return;
+  TDataSetMethod aMethod = &vtkDataSet::GetNumberOfCells;
+  bool anIsSelected = onIdEdit(theText,aMethod,true,mySelection,
+                              myMeshName,tr("WRN_NO_AVAILABLE_DATA"),
+                              myFieldName);
+  if(!anIsSelected)
+    clearFields();
+}
index 67bbae1b2f9e523b3438354c72b53cee49d45989..fe39ef1e41b6622ccb6465ac31056261a2ab3d97 100644 (file)
@@ -91,6 +91,7 @@ private slots:
   QLabel* myDZLbl;
 
   SALOME_Selection* mySelection;
+  bool myFl;
 };
 
 
index 32ab47e06119828357d53e5f6b2d5a26ed7ff1a9..5b0779f1dc50b0d9a35454232844b1dd0af32419 100644 (file)
@@ -238,21 +238,24 @@ void SetupDlg::onTypeChanged(int theIndex) {
 void SetupDlg::onPreferencesDlg() {
   QApplication::setOverrideCursor( Qt::waitCursor );
   FieldData& aData = myAnimator->getFieldData(myFieldLst->currentItem());
-  if (aData.myPrs == 0)
+  if (aData.myPrs.empty())
     myAnimator->generatePresentations(myFieldLst->currentItem());
   QApplication::restoreOverrideCursor();
 
-#define EDITPRS(TYPE, DLG) \
-    { \
-      DLG* aDlg = new DLG(); \
-      aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0])); \
-      if (aDlg->exec()) { \
-       for (int i = 0; i < aData.myNbFrames; i++) \
-         aDlg->storeToPrsObject(dynamic_cast<TYPE*>(aData.myPrs[i])); \
-      } \
-      delete aDlg; \
-    }
+// BUG VISU5725 : Compatibility gcc 2.95
+// #define EDITPRS(TYPE, DLG) \
+//     { \
+//       DLG* aDlg = new DLG(); \
+//       aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs.at(0))); \
+//       if (aDlg->exec()) { \
+//     for (int i = 0; i < aData.myNbFrames; i++) \
+//       aDlg->storeToPrsObject(dynamic_cast<TYPE*>(aData.myPrs.at(i))); \
+//       } \
+//       delete aDlg; \
+//     }
+
 
+#define EDITPRS(TYPE, DLG) {DLG* aDlg = new DLG(); aDlg->initFromPrsObject(dynamic_cast<TYPE*>(aData.myPrs[0])); if (aDlg->exec()) { for (int i = 0; i < aData.myNbFrames; i++) aDlg->storeToPrsObject(dynamic_cast<TYPE*>(aData.myPrs[i])); } delete aDlg;}
 
   switch (myTypeCombo->currentItem()) {
   case 0: //Scalar Map
@@ -265,10 +268,10 @@ void SetupDlg::onPreferencesDlg() {
     //    EDITPRS(VISU::CutPlanes_i, VisuGUI_CutPlanesDlg);
     {
       VisuGUI_CutPlanesDlg* aDlg = new VisuGUI_CutPlanesDlg(false, true);
-      aDlg->initFromPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs[0]));
+      aDlg->initFromPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs.at(0)));
       if (aDlg->exec()) {
        for (int i = 0; i < aData.myNbFrames; i++)
-         aDlg->storeToPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs[i]));
+         aDlg->storeToPrsObject(dynamic_cast<VISU::CutPlanes_i*>(aData.myPrs.at(i)));
       }
       delete aDlg;
     }
@@ -557,6 +560,8 @@ VisuGUI_TimeAnimationDlg::VisuGUI_TimeAnimationDlg(SALOMEDS::Study_var theStudy)
 
   mySaveCheck = new QCheckBox("Save pictures to directory", aSaveBox);
   aSaveLay->addMultiCellWidget(mySaveCheck, 0, 0, 0, 2);
+  connect(mySaveCheck, SIGNAL( toggled(bool)),
+         aWheel, SLOT( setDisabled(bool) ));
 
   QLabel* aPathLbl = new QLabel("Path:", aSaveBox);
   aPathLbl->setEnabled(false);
@@ -626,7 +631,7 @@ void VisuGUI_TimeAnimationDlg::createFrames() {
   QApplication::setOverrideCursor( Qt::waitCursor );
 
   for (int i = 0; i < myAnimator->getNbFields(); i++) {
-    if (myAnimator->getFieldData(i).myPrs == 0
+    if (myAnimator->getFieldData(i).myPrs.empty()
       myAnimator->generatePresentations(i);
   }
   if (myAnimator->getNbFrames() == 0) {
index abc4a5cbc08c1edb0c28aebf342d0ccdf9054105..29cbeaee821db636dfb287cd28e41432d56639a8 100644 (file)
@@ -16,7 +16,7 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 @COMMENCE@
 
 # Libraries targets
-LIB = libVISUEngine.la
+LIB = libVISUEngineImpl.la
 LIB_SRC = VISUConfig.cc VISU_Gen_i.cc VISU_Result_i.cc \
         VISU_ViewManager_i.cc VISU_PrsObject_i.cc VISU_Table_i.cc \
        VISU_Prs3d_i.cc VISU_Mesh_i.cc VISU_ScalarMap_i.cc \
@@ -28,8 +28,8 @@ LIB_SRC = VISUConfig.cc VISU_Gen_i.cc VISU_Result_i.cc \
 LIB_MOC = VISU_TimeAnimation.h
 
 LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \
-                 SALOME_Exception.idl SALOME_GenericObj.idl \
-                 SALOME_Session.idl MED.idl
+                 SALOME_Exception.idl SALOME_GenericObj.idl MED.idl
+
 LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl
 
 # Executables targets
index e2229e199f405e8d644881d3278618b75b87c0da..1e760bbd18909079dc25732a25c9f77fdfaa704e 100644 (file)
@@ -58,32 +58,16 @@ namespace VISU{
 
   //===========================================================================
   static int mySCnt = 0;
-  static int myQCnt = 0;
-  static int myIsBatchMode = 0;
 
-  Mutex::Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay) :
-    myQApp(theQApp), isQAppLocked(theQApp->locked()), myDelay(theDelay),
-    myMutex(theMutex), isSessionLocked(theMutex->locked())
-  {
-    if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
-    if(!myIsBatchMode && isQAppLocked) myIsBatchMode++;
-    if(!isSessionLocked && !mySCnt) { myMutex->lock();}; mySCnt++;
-    if(!isQAppLocked && !myQCnt) { 
-      myQApp->lock(); 
-      myQApp->syncX();
-    };
-    myQCnt++;
+  Mutex::Mutex(QMutex* theMutex): myMutex(theMutex){
+    if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<!mySCnt);
+    if(!mySCnt++) 
+      myMutex->lock();
   }
   Mutex::~Mutex(){
-    myQCnt--; 
-    if(!isQAppLocked && !myQCnt) { 
-      myQApp->flushX(); 
-      //if(myDelay > 0)
-       myQApp->processEvents(myDelay+3);
-      myQApp->unlock();
-    }
-    mySCnt--; if(!isSessionLocked && !mySCnt) { myMutex->unlock();}
-    if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
+    if(!(--mySCnt))
+      myMutex->unlock();
+    if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<!mySCnt);
   }
 
 
@@ -99,7 +83,6 @@ namespace VISU{
   }
 
   void Storable::Registry(const char* theComment, TStorableEngine theEngine)
-    throw(std::logic_error&)
   {
     if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
       if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
@@ -151,7 +134,6 @@ namespace VISU{
   }
   Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
                             const string& thePrefix, const string& theLocalPersistentID) 
-    throw (std::runtime_error&)
   {
     try{
       QString strIn( theLocalPersistentID.c_str() );
@@ -174,7 +156,6 @@ namespace VISU{
   }
   
   const QString& Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
-    throw(std::logic_error&)
   {
     TRestoringMap::const_iterator i = theMap.find(theArg);
     if(i == theMap.end()) {
@@ -278,7 +259,7 @@ namespace VISU{
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
       SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
       aCmnt->SetValue(theComment);
-      INFOS("CreateAttributes - Comment = "<<theComment);
+      if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
     }
     if(strcmp(theRefFatherEntry,"") != 0){
       SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);
index dd9f4c6afe8b6a4c889fad6e96f5e21eb5be5bc6..ba38a0ee54365508edd7c3e155acda547c736128 100644 (file)
@@ -86,10 +86,9 @@ namespace VISU{
   //===========================================================================
   class Mutex{
     QMutex* myMutex;
-    QApplication* myQApp;
-    int isQAppLocked, isSessionLocked, myDelay;
+    int isQAppLocked;
   public:
-    Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay = 0);
+    Mutex(QMutex* theMutex);
     ~Mutex();
   };
 
@@ -105,12 +104,9 @@ namespace VISU{
     typedef Storable* (*TStorableEngine)(SALOMEDS::SObject_ptr theSObject, 
                                         const std::string& thePrefix, const TRestoringMap& theMap);
     typedef std::map<string,TStorableEngine> TCallbackMap;
-    static void Registry(const char* theComment, TStorableEngine theEngine) 
-      throw(std::logic_error&);
-    static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString) 
-      throw(std::runtime_error&);
-    static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL)
-      throw(std::logic_error&);
+    static void Registry(const char* theComment, TStorableEngine theEngine);
+    static Storable* Create(SALOMEDS::SObject_ptr, const std::string& thePrefix, const std::string& theString); 
+    static const QString& FindValue(const TRestoringMap& theMap, const std::string& theArg, bool* isFind = NULL);
     static void StrToMap(const QString& theStr, VISU::Storable::TRestoringMap& theMap);
     static SALOMEDS::SObject_ptr GetResultSO(SALOMEDS::SObject_ptr theSObject);
     static void DataToStream(std::ostringstream& theStr, const QString& theName, const QString& theVal);
index 9c6da1f5c5ee1b5c31a389b2c8be6f5bfe1896cd..9c5022d2721ea4f79b87613492a32df1373974d7 100644 (file)
@@ -46,10 +46,10 @@ static int MYDEBUG = 0;
 static med_err ret = 0;
 
 extern "C" {
-  VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) throw(std::runtime_error&){
+  VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) {
     return new VISU_MEDConvertor(theMedSObject);
   }
-  VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) throw(std::runtime_error&){
+  VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) {
     return new VISU_MEDFieldConvertor(theField);
   }
 }
@@ -118,7 +118,6 @@ static int NODEGEOM[1] = {
 };
 
 void GetEntity2Geom(const VISU::TEntity& theEntity, int*& theVector, int* theEnd)
-     throw (std::runtime_error&)
 {
   switch(theEntity){
   case VISU::CELL_ENTITY: theVector = CELLGEOM; *theEnd = MED_NBR_GEOMETRIE_MAILLE; break;
@@ -245,7 +244,7 @@ static void GetCellsSize(VISU::TMesh& theMesh,
 }
 
 
-VISU_Convertor* VISU_MEDFieldConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_MEDFieldConvertor::Build() {
   if(myField->_is_nil()) 
     throw std::runtime_error("VISU_MEDFieldConvertor::Build >> myField->_is_nil() !!!");
   
@@ -301,7 +300,7 @@ VISU_Convertor* VISU_MEDFieldConvertor::Build() throw (std::runtime_error&){
   return this;
 }
 
-VISU_Convertor* VISU_MEDConvertor::Build() throw (std::runtime_error&){
+VISU_Convertor* VISU_MEDConvertor::Build() {
   if(mySObject->_is_nil()) 
     throw std::runtime_error("VISU_MEDConvertor::Build >> mySObject->_is_nil() !!!");
   SALOMEDS::Study_var aStudy = mySObject->GetStudy();
@@ -563,7 +562,6 @@ VISU_Convertor* VISU_MEDConvertor::Build() throw (std::runtime_error&){
 
 int VISU_MEDConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
                                        const string& theFamilyName)
-     throw (std::runtime_error&) 
 {
   //Main part of code
   const string& aMeshName = theMeshOnEntity.myMeshName;
@@ -581,7 +579,6 @@ int VISU_MEDConvertor::LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity,
   
 int VISU_MEDConvertor::LoadMeshOnGroup(VISU::TMesh& theMesh, 
                                       const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-     throw (std::runtime_error&)
 {
   //Main part of code
   int isPointsUpdated = 0;
@@ -607,7 +604,6 @@ int VISU_MEDConvertor::LoadFieldOnMesh(VISU::TMesh& theMesh,
                                       VISU::TMeshOnEntity& theMeshOnEntity, 
                                       VISU::TField& theField, 
                                       VISU::TField::TValForTime& theValForTime)
-  throw (std::runtime_error&)
 {
   //Main part of code
   int isPointsUpdated = LoadPoints(theMesh);
@@ -618,7 +614,6 @@ int VISU_MEDConvertor::LoadFieldOnMesh(VISU::TMesh& theMesh,
 }
 
 int VISU_MEDConvertor::LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName)
-  throw (std::runtime_error&) 
 {
   //Check on existing family
   VISU::TMeshOnEntity& aMeshOnEntity = theMesh.myMeshOnEntityMap[VISU::NODE_ENTITY];
@@ -643,7 +638,7 @@ int VISU_MEDConvertor::LoadPoints(VISU::TMesh& theMesh, const string& theFamilyN
   if(MYDEBUG) MESSAGE("LoadPoints - iNumElemEnd = "<<iNumElemEnd);
   if (iNumElemEnd <= 0) throw std::runtime_error("LoadPoints >> There is no points in the mesh !!!");
   aPointsCoord.resize(theMesh.myDim*iNumElemEnd,0.0);
-  SALOME_MED::double_array_var coord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
+   SALOME_MED::double_array_var coord = aMedMesh->getCoordinates(SALOME_MED::MED_FULL_INTERLACE);
   if(!isPointsLoaded){
     for (int iNumElem = 0; iNumElem < iNumElemEnd; iNumElem++) 
       for(int iDim = 0, iNumElem2Dim = iNumElem*theMesh.myDim; iDim < theMesh.myDim; iDim++, iNumElem2Dim++)
@@ -677,7 +672,6 @@ int VISU_MEDConvertor::LoadPoints(VISU::TMesh& theMesh, const string& theFamilyN
 }
 
 int VISU_MEDConvertor::LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName)
-     throw (std::runtime_error&) 
 {
   //Check on existing family
   VISU::TFamily* pFamily = VISU::GetFamily(theMeshOnEntity,theFamilyName);
@@ -844,7 +838,6 @@ template<class TArray> int ImportField(TArray& theArray,
 
 int VISU_MEDConvertor::LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
                                 const VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
-     throw (std::runtime_error&)
 {
   //Check on loading already done
   if(!theValForTime.myValForCells.empty()) return 0;
index b506b18138c4975fc5ada326597b785dfe621777..5a86fc7dbb5c39f3cba806d521aff168b1de683b 100644 (file)
@@ -83,26 +83,26 @@ class VISU_MEDConvertor: public VISU_Convertor_impl{
   VISU_MEDConvertor() {};
  public:
   VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
-  virtual VISU_Convertor* Build() throw (std::runtime_error&);
+  virtual VISU_Convertor* Build() ;
  protected:
   virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
-                              const string& theFamilyName = "")
-    throw (std::runtime_error&);
+                              const string& theFamilyName = "");
+
   virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
-                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet)
-    throw (std::runtime_error&);
+                             const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
+
   virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
                              VISU::TMeshOnEntity& theMeshOnEntity, 
                              VISU::TField& theField, 
-                             VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&);
-  int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "") 
-    throw (std::runtime_error&);
-  int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "")
-    throw (std::runtime_error&);
+                             VISU::TField::TValForTime& theValForTime);
+
+  int LoadPoints(VISU::TMesh& theMesh, const string& theFamilyName = "") ;
+
+  int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const string& theFamilyName = "");
+
   int LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
-               const VISU::TField& theField, VISU::TField::TValForTime& theValForTime)
-    throw (std::runtime_error&);
+               const VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
+
 };
 
 class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
@@ -110,12 +110,12 @@ class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
   SALOME_MED::FIELD_var myField;
  public:
   VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : myField(SALOME_MED::FIELD::_duplicate(theField)) {}
-  virtual VISU_Convertor* Build() throw (std::runtime_error&);
+  virtual VISU_Convertor* Build() ;
 };
 
 extern "C" {
-  VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) throw(std::runtime_error&);
-  VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) throw(std::runtime_error&);
+  VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) ;
+  VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) ;
 }
 
 #endif
index e4017fa5b222fd4f5c46fbaa70517bb6d22b2716..76b54bca987e3e61fde4602b9844dccfed34b05d 100644 (file)
@@ -81,7 +81,6 @@ VISU::Storable* VISU::CutLines_i::Create(const char* theMeshName, VISU::Entity t
 
 
 VISU::Storable* VISU::CutLines_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   DoHook();
   SetNbLines(VISU::Storable::FindValue(theMap,"myNbLines").toInt());
index 4c4a7e094335bbe4b3b7d3a1f2e9a107cd52699e..e0ee18208411963fff78f9c1836e3422efb291d9 100644 (file)
@@ -96,8 +96,7 @@ namespace VISU{
 
     virtual void ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
     void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
 
index d48d6e0ae621d0fdb593a8e051603cdc4bd3bc4b..cfa8925261eff7a77300849859fa79eb816d3c05 100644 (file)
@@ -78,7 +78,6 @@ VISU::Storable* VISU::CutPlanes_i::Create(const char* theMeshName, VISU::Entity
 
 
 VISU::Storable* VISU::CutPlanes_i::Restore(const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   DoHook();
   SetNbPlanes(VISU::Storable::FindValue(theMap,"myNbPlanes").toInt());
index 6d64f6e5a974737210841cd64a584a67b41d2b86..867fe5d3e84bcc5a1d75c19c5d634213fe7ae844 100644 (file)
@@ -81,8 +81,7 @@ namespace VISU{
     
     virtual void ToStream(std::ostringstream& theStr);
     
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
     
     static const string myComment;
     virtual const char* GetComment() const;
index b53ec71274d4ec582cf12d0b0389b4cbe259dc43..d77a80fdf386bdd60e39946319b6c4e9637ff15f 100644 (file)
@@ -93,7 +93,6 @@ VISU::Storable* VISU::DeformedShape_i::Create(const char* theMeshName, VISU::Ent
 
 
 VISU::Storable* VISU::DeformedShape_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   DoHook();
   SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
@@ -146,7 +145,6 @@ void VISU::DeformedShape_i::SetMapScale(double theMapScale){
 
 
 VISU_Actor* VISU::DeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
-  throw (std::runtime_error&)
 {
   VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
   anActor->SetRepresentation(1);
@@ -155,7 +153,7 @@ VISU_Actor* VISU::DeformedShape_i::CreateActor(const Handle(SALOME_InteractiveOb
 }
 
 
-void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::DeformedShape_i::UpdateActor(VISU_Actor* theActor) {
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     if(IsColored()){
       anActor->SetBarVisibility(true);
index 2f36e8e1a7ee0fb10c3e21d88f33549a96a1e820..96fc4d2297affb2dfbdb4d1d1cb2e35777e7b435 100644 (file)
@@ -77,14 +77,13 @@ namespace VISU{
 
     virtual void ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
     virtual void SetMapScale(double theMapScale = 1.0);
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
-      throw (std::runtime_error&);
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual void UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
index 3441da6c4e9a8bacacb0b990c68dcc95e0565ea8..33527f6d89565c7a906701ac0af271cd427c040d 100644 (file)
 
 #include <qstring.h>
 #include <qfileinfo.h>
+#include "Utils_ExceptHandlers.hxx"
 
 using namespace std;
 
 static QFileInfo aFileInfo;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
 
-extern "C" {
-  PortableServer::ObjectId * 
-  VISUEngine_factory(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId * contId,
-                    const char *instanceName, const char *interfaceName) 
-  {
-    if(MYDEBUG) MESSAGE("VisuEngine_factory : "<<interfaceName);
-    VISU::VISU_Gen_i * pVISU_Gen = new VISU::VISU_Gen_i(orb, poa, contId, instanceName, interfaceName);
-    return pVISU_Gen->getId() ;
-  }
-  VISU::VISU_Gen_ptr  
-  GetVisuGen(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, 
-            SALOME_NamingService* theNamingService, QMutex* theMutex)
-  {
-    if(MYDEBUG) MESSAGE("extern \"C\" GetVisuGen");
-    VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex);
-    return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
-    //return aVISU_Gen->_this();
-  }
+UNEXPECT_CATCH(SalomeException, SALOME::SALOME_Exception);
+
+extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, 
+                                     PortableServer::POA_ptr thePOA, 
+                                     SALOME_NamingService* theNamingService, 
+                                     QMutex* theMutex)
+{
+  if(MYDEBUG) MESSAGE("extern \"C\" GetImpl");
+  VISU::VISU_Gen_i *aVISU_Gen = new VISU::VISU_Gen_i(theORB,thePOA,theNamingService,theMutex);
+  //return VISU::VISU_Gen::_duplicate(aVISU_Gen->_this());
+  return aVISU_Gen->_this();
 }
 
 namespace VISU{
@@ -125,10 +119,9 @@ namespace VISU{
       aStudyBuilder->CommitCommand();
     }
     return aSComponent;
-  }
-
+  }    
 
-  void RegistryStorable() throw(std::logic_error&) {
+  void RegistryStorable() {
     Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore));
     Storable::Registry(Mesh_i::myComment.c_str(),&(Restore<Mesh_i>));
     Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore<ScalarMap_i>));
@@ -145,30 +138,11 @@ namespace VISU{
 
 
   //===========================================================================
-  VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr orb,
-                        PortableServer::POA_ptr poa,
-                        PortableServer::ObjectId * contId, 
-                        const char *instanceName, 
-                        const char *interfaceName) :
-    Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
-  {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<myMutex);
-    _thisObj = this ;
-    _id = _poa->activate_object(_thisObj);
-    SALOME_NamingService aNamingService(orb);
-    CORBA::Object_ptr anObject = aNamingService.Resolve("/Kernel/Session");
-    SALOME::Session_var aSession = SALOME::Session::_narrow(anObject);
-    //aSession->GetInterface(); 
-    Engines::Component_var aComponent = aSession->GetVisuComponent();
-    myVisuGen = VISU::VISU_Gen::_narrow(aComponent);
-  } 
-
   VISU_Gen_i::VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, 
                         SALOME_NamingService* theNamingService, QMutex* theMutex) :
     Engines_Component_i()
   {
     if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : "<<theMutex);
-    Mutex mt(theMutex,qApp);
     Base_i::myMutex = theMutex;  //apo
     Base_i::myOrb = CORBA::ORB::_duplicate(theORB);
     Base_i::myPoa = PortableServer::POA::_duplicate(thePOA);
@@ -193,31 +167,27 @@ namespace VISU{
     if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i");
   }
   //===========================================================================
-  bool VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
-                       const SALOMEDS::TMPFile & theStream,
-                       const char* theURL,
-                       bool isMultiFile)
+  CORBA::Boolean VISU_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
+                                 const SALOMEDS::TMPFile & theStream,
+                                 const char* theURL,
+                                 bool isMultiFile)
   {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Load - myMutex = "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      SALOMEDS::Study_var aStudy = theComponent->GetStudy(); 
-      SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder(); 
-      TCollection_AsciiString aTmpDir =
-       isMultiFile?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir();
-      VisuTmpDir = aTmpDir.ToCString();
-      SALOMEDS::ListOfFileNames_var aSeq =
-       SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
-      myIsMultiFile = isMultiFile;
-      return true;
-    }
-    return myVisuGen->Load(theComponent,theStream,theURL,isMultiFile);
+    Mutex mt(myMutex);
+    SALOMEDS::Study_var aStudy = theComponent->GetStudy(); 
+    SALOMEDS::StudyBuilder_var  aStudyBuilder = aStudy->NewBuilder(); 
+    TCollection_AsciiString aTmpDir =
+      isMultiFile?TCollection_AsciiString((char*)theURL):SALOMEDS_Tool::GetTmpDir();
+    VisuTmpDir = aTmpDir.ToCString();
+    SALOMEDS::ListOfFileNames_var aSeq =
+      SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile);
+    myIsMultiFile = isMultiFile;
+    return true;
   }
 
-  bool VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
-                            const SALOMEDS::TMPFile & theStream,
-                            const char* theURL,
-                            bool isMultiFile) 
+  CORBA::Boolean VISU_Gen_i::LoadASCII(SALOMEDS::SComponent_ptr theComponent,
+                                      const SALOMEDS::TMPFile & theStream,
+                                      const char* theURL,
+                                      bool isMultiFile) 
   {
     return Load(theComponent, theStream, theURL, isMultiFile);
   }
@@ -227,272 +197,240 @@ namespace VISU{
                                           CORBA::Boolean isMultiFile,
                                           CORBA::Boolean isASCII) 
   {
-    if(myMutex){
-      CORBA::String_var aString("");
-      if(strcmp(aLocalPersistentID,"") != 0) {
-       Mutex mt(myMutex,qApp);
-       Storable* aStorable =
-         Storable::Create(theSObject,VisuTmpDir.c_str(),aLocalPersistentID);
-       if(aStorable != NULL) aString = aStorable->GetID();
-      }
-      return aString._retn();
+    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();
     }
-    return myVisuGen->LocalPersistentIDToIOR(theSObject, aLocalPersistentID, isMultiFile, isASCII);
+    return aString._retn();
   }
   //===========================================================================
   SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
                                      const char* theURL,
                                      bool isMultiFile)
   {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - myMutex = "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      TCollection_AsciiString aTmpDir = isMultiFile? strdup(theURL): SALOMEDS_Tool::GetTmpDir();
-      if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
-      int aCounter = 0;
-      TColStd_SequenceOfAsciiString aFileNames;
-      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;
-       Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in());
-       if(pResult){
-         const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
-         if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
-           const QFileInfo& aFileInfo = pResult->GetFileInfo();
-           QString aPrefix("");
-           if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
-           QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
-           static QString aCommand;
-           aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-           if(system(aCommand) == -1){
-             if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
-             continue;
-           }else
-             if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aCommand = "<<aCommand);
-           TCollection_AsciiString aString(strdup(aFileName.latin1()));
-           aFileNames.Append(aString);
-         }
+    Mutex mt(myMutex);
+    TCollection_AsciiString aTmpDir = isMultiFile? strdup(theURL): SALOMEDS_Tool::GetTmpDir();
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
+    int aCounter = 0;
+    TColStd_SequenceOfAsciiString aFileNames;
+    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())){
+       const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
+       if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
+         const QFileInfo& aFileInfo = pResult->GetFileInfo();
+         QString aPrefix("");
+         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+         QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
+         static QString aCommand;
+         aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
+
+         int aRes = system(aCommand);
+         if(aRes){
+           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
+           continue;
+         }else
+           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aCommand = "<<aCommand);
+
+         TCollection_AsciiString aString(strdup(aFileName.latin1()));
+         aFileNames.Append(aString);
        }
       }
-      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);
-      }
-      return aStreamFile._retn();
     }
-    return myVisuGen->Save(theComponent,theURL,isMultiFile);
+    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);
+    }
+    return aStreamFile._retn();
   }
 
   SALOMEDS::TMPFile* VISU_Gen_i::SaveASCII(SALOMEDS::SComponent_ptr theComponent,
-                                     const char* theURL,
-                                     bool isMultiFile) {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - myMutex = "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      CORBA::String_var aString = SALOMEDS_Tool::GetTmpDir();
-      TCollection_AsciiString aTmpDir = isMultiFile? (const Standard_CString)theURL: (const Standard_CString)aString.in();
-      if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
-      int aCounter = 0;
-      TColStd_SequenceOfAsciiString aFileNames;
-      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;
-       Result_i* pResult = dynamic_cast<Result_i*>(GetServant(anObj).in());
-       if(pResult){
-         const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
-         if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
-           const QFileInfo& aFileInfo = pResult->GetFileInfo();
-           QString aPrefix("");
-           if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
-           QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
-           static QString aCommand;
-           aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
-           
-           if(system(aCommand) == -1){
-             if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<<aCommand);
-             continue;
-           }else
-             if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
-           TCollection_AsciiString aString(strdup(aFileName.latin1()));
-           
-           HDFascii::ConvertFromHDFToASCII(strdup((aTmpDir + aString).ToCString()), true);
-           
-           aFileNames.Append(aString);
-         }
+                                          const char* theURL,
+                                          bool isMultiFile) 
+  {
+    Mutex mt(myMutex);
+    CORBA::String_var aString = SALOMEDS_Tool::GetTmpDir();
+    TCollection_AsciiString aTmpDir = isMultiFile? (const Standard_CString)theURL: (const Standard_CString)aString.in();
+    if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aTmpDir);
+    int aCounter = 0;
+    TColStd_SequenceOfAsciiString aFileNames;
+    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())){
+       const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
+       if(aSourceId == Result_i::eFile || aSourceId == Result_i::eRestoredFile){
+         const QFileInfo& aFileInfo = pResult->GetFileInfo();
+         QString aPrefix("");
+         if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL());
+         QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str();
+         static QString aCommand;
+         aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1());
+
+         int aRes = system(aCommand);
+         if(aRes){       
+           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Can't execute the command :"<<aCommand);
+           continue;
+         }else
+           if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<<aCommand);
+
+         TCollection_AsciiString aString(strdup(aFileName.latin1()));
+         
+         HDFascii::ConvertFromHDFToASCII(strdup((aTmpDir + aString).ToCString()), true);
+         
+         aFileNames.Append(aString);
        }
       }
-      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);
-      }
-      return aStreamFile._retn();
     }
-    return myVisuGen->Save(theComponent,theURL,isMultiFile);
+    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);
+    }
+    return aStreamFile._retn();
   }
 
   char* VISU_Gen_i::IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
                                           const char* IORString,
                                           CORBA::Boolean isMultiFile,
-                                          CORBA::Boolean isASCII) {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::IORToLocalPersistentID - myMutex = "<<myMutex);
-    if(myMutex){
-      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)){
-         Storable* pStorable = dynamic_cast<Storable*>(GetServant(anObj).in());
-         if(pStorable != NULL){
-           Mutex mt(myMutex,qApp);
-           aString = pStorable->ToString().c_str();
-           return aString._retn();
-         }
+                                          CORBA::Boolean isASCII) 
+  {
+    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();
        }
       }
-      return aString._retn();
     }
-    return myVisuGen->IORToLocalPersistentID(theSObject, IORString, isMultiFile, isASCII);
+    return aString._retn();
   }
 
   char* VISU_Gen_i::GetID(){
-    if(myMutex)
-      return Base_i::GetID();
-    return myVisuGen->GetID();
+    return Base_i::GetID();
   }
 
   void VISU_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy){
-    if(myMutex){
-      if(CORBA::is_nil(theStudy)) 
-       INFOS("VISU_Gen_i::SetCurrentStudy : CORBA::is_nil(theStudy)");
-      if(!CORBA::is_nil(theStudy)){
-       CORBA::String_var aName = theStudy->Name();
-       INFOS("VISU_Gen_i::SetCurrentStudy - StudyId = "<<theStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
-       myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
-      }
-    }else
-      myVisuGen->SetCurrentStudy(theStudy);
+    if(!CORBA::is_nil(theStudy)){
+      CORBA::String_var aName = theStudy->Name();
+      MESSAGE("VISU_Gen_i::SetCurrentStudy - StudyId = "<<theStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
+      myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
+    }else{
+      MESSAGE("VISU_Gen_i::SetCurrentStudy : CORBA::is_nil(theStudy)");
+    }
   }
+
   SALOMEDS::Study_ptr VISU_Gen_i::GetCurrentStudy(){
-    if(myMutex)
-      return SALOMEDS::Study::_duplicate(myStudyDocument);
-    return myVisuGen->GetCurrentStudy();
+    return SALOMEDS::Study::_duplicate(myStudyDocument);
   }
+
   ViewManager_ptr VISU_Gen_i::GetViewManager(){
-    //omni_mutex aMutex;
-    //omni_mutex_lock aMutexLock(aMutex);
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::GetViewManager : "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      ViewManager_i * aViewManager = new ViewManager_i(myStudyDocument);
-      return ViewManager::_duplicate(aViewManager->_this());
-    }
-    return myVisuGen->GetViewManager();
+    Mutex mt(myMutex);
+    ViewManager_i * aViewManager = new ViewManager_i(myStudyDocument);
+    return ViewManager::_duplicate(aViewManager->_this());
   }
 
   SALOMEDS::SObject_ptr VISU_Gen_i::ImportTables(const char* theFileName){
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return SALOMEDS::SObject::_nil();
-      Mutex mt(myMutex,qApp);
-      SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument);
-      return aRes._retn();
-    }
-    return myVisuGen->ImportTables(theFileName);
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return SALOMEDS::SObject::_nil();
+    Mutex mt(myMutex);
+    SALOMEDS::SObject_var aRes = VISU::ImportTables(theFileName,myStudyDocument);
+    return aRes._retn();
   }
 
   CORBA::Boolean VISU_Gen_i::ExportTableToFile(SALOMEDS::SObject_ptr theTable,
                                               const char* theFileName)
-    {
-      return VISU::ExportTableToFile(theTable, theFileName);
-    }
+  {
+    return VISU::ExportTableToFile(theTable, theFileName);
+  }
 
   Result_ptr VISU_Gen_i::ImportFile(const char* theFileName){
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil();
-      Mutex mt(myMutex,qApp);
-      aFileInfo.setFile(theFileName);
-      Result_i* pResult = new Result_i(myStudyDocument);
-      if(pResult->Create(theFileName) != NULL) 
-       return pResult->_this();
-      else{
-       pResult->_remove_ref();
-       return VISU::Result::_nil();
-      }
-     }
-    return myVisuGen->ImportFile(theFileName);
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Result::_nil();
+    Mutex mt(myMutex);
+    aFileInfo.setFile(theFileName);
+    Result_i* pResult = new Result_i(myStudyDocument);
+    if(pResult->Create(theFileName) != NULL)   
+      return pResult->_this();
+    else{
+      pResult->_remove_ref();
+      return VISU::Result::_nil();
+    }
   }
 
   Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil();
-      Mutex mt(myMutex,qApp);
-      VISU::Result_var aResult;
-      aFileInfo.setFile(theFileName);
-      Result_i* pResult = new Result_i(myStudyDocument,Result_i::eRestoredFile);
-      if(pResult->Create(theFileName) != NULL) 
-       aResult = pResult->_this();
-      return aResult._retn();
-    }
-    return myVisuGen->CopyAndImportFile(theFileName);
+    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);
+    if(pResult->Create(theFileName) != NULL) 
+      aResult = pResult->_this();
+    return aResult._retn();
   }
 
   Result_ptr VISU_Gen_i::ImportMed(SALOMEDS::SObject_ptr theMedSObject){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::ImportMed : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = new Result_i(myStudyDocument);
-      if(pResult->Create(theMedSObject) != NULL)
-       return pResult->_this();
-      else{
-       pResult->_remove_ref();
-       return VISU::Result::_nil();
-      }
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Result::_nil();
+    Mutex mt(myMutex);
+    Result_i* pResult = new Result_i(myStudyDocument);
+    if(pResult->Create(theMedSObject) != NULL)
+      return pResult->_this();
+    else{
+      pResult->_remove_ref();
+      return VISU::Result::_nil();
     }
-    return myVisuGen->ImportMed(theMedSObject);
   }
 
   Result_ptr VISU_Gen_i::ImportMedField(SALOME_MED::FIELD_ptr theField){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::ImportMedField : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = new Result_i(myStudyDocument);
-      if(pResult->Create(theField) != NULL)
-       return pResult->_this();
-      else{
-       pResult->_remove_ref();
-       return VISU::Result::_nil();
-      }
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Result::_nil();
+    Mutex mt(myMutex);
+    Result_i* pResult = new Result_i(myStudyDocument);
+    if(pResult->Create(theField) != NULL)
+      return pResult->_this();
+    else{
+      pResult->_remove_ref();
+      return VISU::Result::_nil();
     }
-    return myVisuGen->ImportMedField(theField);
   }
 
-  Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::MeshOnEntity : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+  Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, 
+                                   const char* theMeshName, 
+                                   VISU::Entity theEntity)
+  {
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Mesh::_nil();
+    Mutex mt(myMutex);
+    if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
       Mesh_i* aPresent = new Mesh_i(pResult);
       if(aPresent->Create(theMeshName,theEntity) != NULL)
        return aPresent->_this();
@@ -501,17 +439,17 @@ namespace VISU{
        return VISU::Mesh::_nil();
       }
     }
-    return myVisuGen->MeshOnEntity(theResult,theMeshName,theEntity);
   }
 
-  Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, 
+  Mesh_ptr VISU_Gen_i::FamilyMeshOnEntity(Result_ptr theResult, 
+                                         const char* theMeshName, 
                                          VISU::Entity theEntity, 
-                                         const char* theFamilyName){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::FamilyMeshOnEntity : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+                                         const char* theFamilyName)
+  {
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Mesh::_nil();
+    Mutex mt(myMutex);
+    if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
       Mesh_i* aPresent = new Mesh_i(pResult);
       if(aPresent->Create(theMeshName,theEntity,theFamilyName) != NULL)
        return aPresent->_this();
@@ -520,16 +458,16 @@ namespace VISU{
        return VISU::Mesh::_nil();
       }
     }
-    return myVisuGen->FamilyMeshOnEntity(theResult,theMeshName,theEntity,theFamilyName);
   }
 
-  Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, const char* theMeshName, 
-                                const char* theGroupName){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::GroupMesh : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Mesh::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
+  Mesh_ptr VISU_Gen_i::GroupMesh(Result_ptr theResult, 
+                                const char* theMeshName, 
+                                const char* theGroupName)
+  {
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Mesh::_nil();
+    Mutex mt(myMutex);
+    if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
       Mesh_i* aPresent = new Mesh_i(pResult);
       if(aPresent->Create(theMeshName,theGroupName) != NULL)
        return aPresent->_this();
@@ -538,161 +476,126 @@ namespace VISU{
        return VISU::Mesh::_nil();
       }
     }
-    return myVisuGen->GroupMesh(theResult,theMeshName,theGroupName);
   }
 
-  ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                            const char* theFieldName, CORBA::Double theIteration)
+  ScalarMap_ptr VISU_Gen_i::ScalarMapOnField(Result_ptr theResult, 
+                                            const char* theMeshName, 
+                                            VISU::Entity theEntity, 
+                                            const char* theFieldName, 
+                                            CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
-    return myVisuGen->ScalarMapOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::ScalarMap_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn();
   }
 
-  DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                    const char* theFieldName, CORBA::Double theIteration)
+  DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, 
+                                                    const char* theMeshName, 
+                                                    VISU::Entity theEntity, 
+                                                    const char* theFieldName, 
+                                                    CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::DeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->DeformedShapeOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::DeformedShape_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                    const char* theFieldName, CORBA::Double theIteration)
+  Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, 
+                                        const char* theMeshName, 
+                                        VISU::Entity theEntity, 
+                                        const char* theFieldName, 
+                                        CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::Vectors_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->VectorsOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::Vectors_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                    const char* theFieldName, CORBA::Double theIteration)
+  IsoSurfaces_ptr VISU_Gen_i::IsoSurfacesOnField(Result_ptr theResult, 
+                                                const char* theMeshName, 
+                                                VISU::Entity theEntity, 
+                                                const char* theFieldName, 
+                                                CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->IsoSurfacesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::IsoSurfaces_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                    const char* theFieldName, CORBA::Double theIteration)
+  StreamLines_ptr VISU_Gen_i::StreamLinesOnField(Result_ptr theResult, 
+                                                const char* theMeshName, 
+                                                VISU::Entity theEntity, 
+                                                const char* theFieldName, 
+                                                CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->StreamLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::StreamLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                                    const char* theFieldName, CORBA::Double theIteration)
+  CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, 
+                                            const char* theMeshName, 
+                                            VISU::Entity theEntity, 
+                                            const char* theFieldName, 
+                                            CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::CutPlanes_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->CutPlanesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::CutPlanes_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
-                                           const char* theFieldName, CORBA::Double theIteration)
+  CutLines_ptr VISU_Gen_i::CutLinesOnField(Result_ptr theResult, 
+                                          const char* theMeshName, 
+                                          VISU::Entity theEntity, 
+                                          const char* theFieldName, 
+                                          CORBA::Double theIteration)
   {
-    if(myMutex) return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
-    return myVisuGen->CutLinesOnField(theResult,theMeshName,theEntity,theFieldName,theIteration);
+    return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
   Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::CreateTable : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Table::_nil();
-      Mutex mt(myMutex,qApp);
-      Table_i* pPresent = new Table_i(myStudyDocument,theTableEntry);
-      if(pPresent->Create() != NULL)
-       return pPresent->_this();
-      else{
-       pPresent->_remove_ref();
-       return VISU::Table::_nil();
-      }
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Table::_nil();
+    Mutex mt(myMutex);
+    Table_i* pPresent = new Table_i(myStudyDocument,theTableEntry);
+    if(pPresent->Create() != NULL)
+      return pPresent->_this();
+    else{
+      pPresent->_remove_ref();
+      return VISU::Table::_nil();
     }
-    return myVisuGen->CreateTable(theTableEntry);
-  }
-
-  Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::CreateCurve : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Curve::_nil();
-      Mutex mt(myMutex,qApp);
-      PortableServer::POA_ptr aPOA = GetPOA();
-      Table_i* pTable = dynamic_cast<Table_i*>(aPOA->reference_to_servant(theTable));
-      Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow);
-      if(pPresent->Create() != NULL)
-       return pPresent->_this();
-      else{
-       pPresent->_remove_ref();
-       return VISU::Curve::_nil();
-      }
+  }
+
+  Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable, 
+                                   CORBA::Long theHRow, 
+                                   CORBA::Long theVRow)
+  {
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Curve::_nil();
+    Mutex mt(myMutex);
+    PortableServer::POA_ptr aPOA = GetPOA();
+    Table_i* pTable = dynamic_cast<Table_i*>(aPOA->reference_to_servant(theTable));
+    Curve_i* pPresent = new Curve_i(myStudyDocument,pTable,theHRow,theVRow);
+    if(pPresent->Create() != NULL)
+      return pPresent->_this();
+    else{
+      pPresent->_remove_ref();
+      return VISU::Curve::_nil();
     }
-    return myVisuGen->CreateCurve(theTable,theHRow,theVRow);
   }
+
   Container_ptr VISU_Gen_i::CreateContainer(){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::CreateContainer : "<<myMutex);
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Container::_nil();
-      Mutex mt(myMutex,qApp);
-      Container_i* pPresent = new Container_i(myStudyDocument);
-      if(pPresent->Create() != NULL)
-       return pPresent->_this();
-      else{
-       pPresent->_remove_ref();
-       return VISU::Container::_nil();
-      }
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Container::_nil();
+    Mutex mt(myMutex);
+    Container_i* pPresent = new Container_i(myStudyDocument);
+    if(pPresent->Create() != NULL)
+      return pPresent->_this();
+    else{
+      pPresent->_remove_ref();
+      return VISU::Container::_nil();
     }
-    return myVisuGen->CreateContainer();
   }
 
   Animation_ptr VISU_Gen_i::CreateAnimation(View3D_ptr theView3D){
-    if(myMutex){
-      if(myStudyDocument->GetProperties()->IsLocked()) return Animation::_nil();
-      Mutex mt(myMutex,qApp);
-      if(MYDEBUG) MESSAGE("VISU_Gen_i::CreateAnimation : "<<myMutex);
-      if(VISU_TimeAnimation* anAnim = new VISU_TimeAnimation(myStudyDocument,theView3D)){
-       return anAnim->_this();
-      }else
-       return VISU::Animation::_nil();
-       
-    }
-    return myVisuGen->CreateAnimation(theView3D);
+    if(myStudyDocument->GetProperties()->IsLocked()) 
+      return Animation::_nil();
+    Mutex mt(myMutex);
+    if(VISU_TimeAnimation_i* anAnim = new VISU_TimeAnimation_i(myStudyDocument,theView3D)){
+      return anAnim->_this();
+    }else
+      return VISU::Animation::_nil();
   }
 
   void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::Close : "<<myMutex);
-    if(myMutex){
-      //Mutex mt(myMutex,qApp);
-      //SALOMEDS::Study_var aStudy = theComponent->GetStudy(); 
-      //if(!aStudy->_is_nil()){
-      //       SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(theComponent);
-      //       aChildIter->InitEx(true);
-      //       for (int i = 0; aChildIter->More(); aChildIter->Next(),i++) {
-      //         SALOMEDS::SObject_var aSObject = aChildIter->Value();
-      //         if(MYDEBUG) MESSAGE("VISU_Gen_i::Close : aChildIter->Next() = "<<i);
-      //         CORBA::Object_var anObj = SObjectToObject(aSObject);
-      //         if(CORBA::is_nil(anObj)) continue;
-      //         PortableServer::ServantBase_var aServant = GetServant(anObj);
-      //         if(aServant.in() == NULL) continue;
-      //         if(VISU::Base_i* pBase = dynamic_cast<VISU::Base_i*>(aServant.in())){
-      //           VISU::VISUType aType = pBase->GetType();
-      //           switch(aType){
-      //           case VISU::TRESULT:
-      //             if(VISU::Result_i* pResult = dynamic_cast<VISU::Result_i*>(pBase)){
-      //               //Try remove its file and directory
-      //               if(pResult->GetSourceId() == Result_i::eRestoredFile){ 
-      //                 const QFileInfo& aFileInfo = pResult->GetFileInfo();
-      //                 static QString aCommand;
-      //                 aCommand.sprintf("rm %s",aFileInfo.filePath().latin1());
-      //                 if(system(aCommand) != -1 && MYDEBUG) MESSAGE("VISU_Gen_i::Close - "<<aCommand);
-      //                 aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",aFileInfo.dirPath().latin1());
-      //                 if(system(aCommand) != -1 && MYDEBUG) MESSAGE("VISU_Gen_i::Close - "<<aCommand);
-      //               }
-      //             }
-      //             break;
-      //           default:
-      //             break;
-      //           }
-      //         }
-      //       }
-      //}
-      return;
-    }
-    myVisuGen->Close(theComponent);
   }
 
   char* VISU_Gen_i::ComponentDataType(){
@@ -708,183 +611,170 @@ namespace VISU{
                                                   SALOMEDS::SObject_ptr theSObject,
                                                   CORBA::Object_ptr theObject,
                                                   const char* theName) 
-  throw (SALOME::SALOME_Exception) 
+    throw (SALOME::SALOME_Exception) 
   {
+    Unexpect aCatch(SalomeException);
     if(MYDEBUG) MESSAGE("VISU_Gen_i::PublishInStudy : "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      SALOMEDS::SObject_var aResultSO;
-      Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(theObject).in());
-      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();
-    }
-    return myVisuGen->PublishInStudy(theStudy, theSObject, theObject, theName);
+    Mutex mt(myMutex);
+    SALOMEDS::SObject_var aResultSO;
+    Result_i* aResultObj = dynamic_cast<Result_i*>(GetServant(theObject).in());
+    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) {
-    if(0 && MYDEBUG) MESSAGE("VISU_Gen_i::CanCopy : "<<myMutex);
-    if(myMutex){
-      //Mutex mt(myMutex,qApp);
-      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())){
-               const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
-               if(aSourceId == Result_i::eComponent || aSourceId == Result_i::eRestoredComponent)
-                 if((pResult->GetFileInfo()).filePath() == "MED") 
-                   return false;
-               return true;
-             }
+    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())){
+             const Result_i::TSourceId& aSourceId = pResult->GetSourceId();
+             if(aSourceId == Result_i::eComponent || aSourceId == Result_i::eRestoredComponent)
+               if((pResult->GetFileInfo()).filePath() == "MED") 
+                 return false;
+             return true;
            }
          }
        }
-      }catch (...){
-       INFOS("Unknown exception was accured!");
       }
-      return false;
+    }catch (...){
+      INFOS("Unknown exception was accured!");
     }
-    return myVisuGen->CanCopy(theObject);
+    return false;
   }
 
   SALOMEDS::TMPFile* VISU_Gen_i::CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
+    Mutex mt(myMutex);
+    theObjectID = 0;
+    SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile;
+    SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames;
 
-      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(...) {
-       aStreamFile->length(1);
-       aStreamFile[0] = strdup("E")[0];
-       return aStreamFile._retn();
-      }
-      if (CORBA::is_nil(aCorbaObj)) {
-       return NULL;
-      }
-
-      Storable* pStorable = dynamic_cast<Storable*>(GetServant(aCorbaObj).in());
-      if (!pStorable) {
+    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(...) {
+      aStreamFile->length(1);
+      aStreamFile[0] = strdup("E")[0];
+      return aStreamFile._retn();
+    }
+    if (CORBA::is_nil(aCorbaObj)) {
+      return NULL;
+    }
+    
+    Storable* pStorable = dynamic_cast<Storable*>(GetServant(aCorbaObj).in());
+    if (!pStorable) {
+      return NULL;
+    }
+    CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir();
+    
+    string aStr = pStorable->ToString().c_str();
+    ofstream stmOut2((string(aTmpDir) + string("copy_persistent")).c_str(),ios::out);
+    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())) + "_";
+      const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
+      aFileName += aFileInfo.fileName().latin1();
+      static QString aCommand;
+      aCommand.sprintf("cp %s %s",
+                      aFileInfo.filePath().latin1(),
+                      (string(aTmpDir) + aFileName).c_str());
+      if(system(aCommand) == -1) {
+       if(MYDEBUG) MESSAGE("VISU_Gen_i::Copy - Cann't execute the command :"<<aCommand);
        return NULL;
       }
-      CORBA::String_var aTmpDir = SALOMEDS_Tool::GetTmpDir();
-
-      string aStr = pStorable->ToString().c_str();
-      ofstream stmOut2((string(aTmpDir) + string("copy_persistent")).c_str(),ios::out);
-      stmOut2<<aStr<<endl;
-      stmOut2.close();
-
-      Result_i* aResultObj = dynamic_cast<Result_i*>(aPOA->reference_to_servant(aCorbaObj));
-      if (aResultObj) {
-       string aFileName = string(SALOMEDS_Tool::GetNameFromPath(theObject->GetStudy()->URL())) + "_";
-       const QFileInfo& aFileInfo = aResultObj->GetFileInfo();
-       aFileName += aFileInfo.fileName().latin1();
-       static QString aCommand;
-       aCommand.sprintf("cp %s %s",
-                        aFileInfo.filePath().latin1(),
-                        (string(aTmpDir) + aFileName).c_str());
-       if(system(aCommand) == -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, aSeq.in(), false);
-      SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
-
-      // Assign an ID = 1 the the type VISU::Result
-      theObjectID = 1;
-
-
-      SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU");
-      return aStreamFile._retn();
+      
+      aSeq->length(2);
+      aSeq[0] = "copy_persistent";
+      aSeq[1] = aFileName.c_str();
+    } else {
+      aSeq->length(1);
+      aSeq[0] = "copy_persistent";
     }
-    return myVisuGen->CopyFrom(theObject, theObjectID);
+    aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aSeq.in(), false);
+    SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aSeq.in(), true);
+    
+    // Assign an ID = 1 the the type VISU::Result
+    theObjectID = 1;
+    
+    
+    SALOMEDS::SComponent_var aSComponent = theObject->GetStudy()->FindComponent("VISU");
+    return aStreamFile._retn();
   }
 
   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(0 && MYDEBUG) MESSAGE("VISU_Gen_i::CanPaste : "<<myMutex);
-    if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1) return false;
+    if (strcmp(theComponentName, ComponentDataType()) != 0 || theObjectID != 1) 
+      return false;
     return true;
   }
 
   SALOMEDS::SObject_ptr VISU_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
                                              CORBA::Long theObjectID,
-                                             SALOMEDS::SObject_ptr theObject) {
-    if(MYDEBUG) MESSAGE("VISU_Gen_i::PasteInto : "<<myMutex);
-    if(myMutex){
-      Mutex mt(myMutex,qApp);
-      SALOMEDS::SObject_var aResultSO;
-      if (theObjectID != 1) return aResultSO._retn();
-
-      CORBA::String_var aTmpDir = (const char*)SALOMEDS_Tool::GetTmpDir();
-      SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
-
-      ifstream stmIn((string(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);
-      aString[aLength] = 0;
-      myIsMultiFile = false;
-
-      string aFileName(aTmpDir.in());
-      if(aSeq->length() > 1) aFileName += aSeq[1].in();
-
-      SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
-      SALOMEDS::Study_var aStudy = theObject->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);
-      else 
-       aResultSO = SALOMEDS::SObject::_duplicate(theObject);
-
-      //Just for Result::Restore to find the Comment attribute :(
-      SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment");
-
-      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, aSeqToRm.in(), true);
-
-      anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
-      SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
-      CORBA::String_var anIORValue(aStorable->GetID());
-      anIOR->SetValue(anIORValue);
+                                             SALOMEDS::SObject_ptr theObject) 
+  {
+    Mutex mt(myMutex);
+    SALOMEDS::SObject_var aResultSO;
+    if (theObjectID != 1) 
       return aResultSO._retn();
-    }
-    return myVisuGen->PasteInto(theStream,theObjectID,theObject);
+    
+    CORBA::String_var aTmpDir = (const char*)SALOMEDS_Tool::GetTmpDir();
+    SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
+    
+    ifstream stmIn((string(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);
+    aString[aLength] = 0;
+    myIsMultiFile = false;
+    
+    string aFileName(aTmpDir.in());
+    if(aSeq->length() > 1) aFileName += aSeq[1].in();
+    
+    SALOMEDS::SComponent_var aComponent = theObject->GetFatherComponent();
+    SALOMEDS::Study_var aStudy = theObject->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);
+    else 
+      aResultSO = SALOMEDS::SObject::_duplicate(theObject);
+    
+    //Just for Result::Restore to find the Comment attribute :(
+    SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeComment");
+    
+    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, aSeqToRm.in(), true);
+    
+    anAttr = aStudyBuilder->FindOrCreateAttribute(aResultSO, "AttributeIOR");
+    SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
+    CORBA::String_var anIORValue(aStorable->GetID());
+    anIOR->SetValue(anIORValue);
+    return aResultSO._retn();
   }
 
-};
\ No newline at end of file
+};
index 2b4dfc34f4c98f5cfbe2930e8c8322b99f43c7fe..99572fae16bbb470a0bd2bc9053fd34749af0b8e 100644 (file)
@@ -21,18 +21,14 @@ namespace VISU{
                     public virtual ::Engines_Component_i,
                     public virtual Base_i
   {
-    VISU_Gen_var myVisuGen;
     SALOMEDS::Study_var myStudyDocument;
     VISU_Gen_i();
     VISU_Gen_i(const VISU::VISU_Gen_i &);
   public:
-    VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA, 
-              SALOME_NamingService* theNamingService, QMutex* theMutex);
-    VISU_Gen_i(CORBA::ORB_ptr orb,
-              PortableServer::POA_ptr poa,
-              PortableServer::ObjectId * contId, 
-              const char *instanceName, 
-              const char *interfaceName);
+    VISU_Gen_i(CORBA::ORB_ptr theORB, 
+              PortableServer::POA_ptr thePOA, 
+              SALOME_NamingService* theNamingService, 
+              QMutex* theMutex);
     virtual ~VISU_Gen_i();
 
     virtual char* GetID();
@@ -66,14 +62,15 @@ namespace VISU{
       typedef typename TPrs3d_i::TInterface TPrs3d;
       typename TPrs3d::_var_type aPrs3d;
       if(myStudyDocument->GetProperties()->IsLocked()) return TPrs3d::_nil();
-      Mutex mt(myMutex,qApp);
-      Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
-      if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
-       TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
-       if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) != NULL)
-         return aPresent->_this();
-       else
-         aPresent->_remove_ref();
+      Mutex mt(myMutex);
+      if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
+       if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
+         TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
+         if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) != NULL)
+           return aPresent->_this();
+         else
+           aPresent->_remove_ref();
+       }
       }
       return TPrs3d::_nil();
     }
@@ -139,6 +136,14 @@ namespace VISU{
     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
                                    CORBA::Long theObjectID,
                                    SALOMEDS::SObject_ptr theObject);
+    /*! SAN & VSR : Test QT_EVENT 
+      >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+    */
+    virtual void CreateTestView();
+    virtual void ShowTestObject();
+    /*! SAN & VSR : Test QT_EVENT
+      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+    */
   };
 }
 #endif 
index 57cfc08ae2c517ae4ee4cb1a1d734adc0a997062..4d51d172e79268ac15379d6705f0ac8420e40ffc 100644 (file)
@@ -77,7 +77,6 @@ VISU::Storable* VISU::IsoSurfaces_i::Create(const char* theMeshName, VISU::Entit
 
 
 VISU::Storable* VISU::IsoSurfaces_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   DoHook();
   SetNbSurfaces(VISU::Storable::FindValue(theMap,"myNbSurface").toInt());
index 8d026d81b21f640357fb3a3a9f2115d684d26d22..d3e70ff17840b411963564513973d97bcc4f2343 100644 (file)
@@ -72,8 +72,7 @@ namespace VISU{
 
     virtual void ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
     virtual void SetMapScale(double theMapScale = 1.0);
   };
index e52fa832f8563436787da1559becdda8b6021101..c556d1739c6429d4c7016662f9283174a636950b 100644 (file)
@@ -71,11 +71,11 @@ void VISU::Mesh_i::SameAs(const Mesh_i* theOrigin){
 
 int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, Entity theEntity, const char* theFamilyName){
   try{
-    INFOS("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
+    MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theEntity = "<<theEntity<<"; theFamilyName = '"<<theFamilyName<<"'");
     float aSize = INCMEMORY*
       theResult->GetInput()->GetMeshOnEntitySize(theMeshName,(VISU::TEntity)theEntity,theFamilyName);
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-    INFOS("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+    MESSAGE("Mesh_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     return aResult;
   }catch(std::runtime_error& exc){
     INFOS("Follow exception was accured :\n"<<exc.what());
@@ -95,7 +95,7 @@ VISU::Storable* VISU::Mesh_i::Create(const char* theMeshName, Entity theEntity,
 
 int VISU::Mesh_i::IsPossible(Result_i* theResult, const char* theMeshName, const char* theGroupName){
   try{
-    INFOS("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
+    MESSAGE("Mesh_i::IsPossible - theMeshName = '"<<theMeshName<<"'; theGroupName = '"<<theGroupName<<"'");
     float aSize = INCMEMORY*
       theResult->GetInput()->GetMeshOnGroupSize(theMeshName,theGroupName);
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
@@ -119,7 +119,6 @@ VISU::Storable* VISU::Mesh_i::Create(const char* theMeshName, const char* theGro
 
 
 VISU::Storable* VISU::Mesh_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   Prs3d_i::Restore(theMap);
 
@@ -242,26 +241,25 @@ VISU::Storable* VISU::Mesh_i::Build(int theRestoring){
 
 
 VISU_Actor* VISU::Mesh_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
-  throw (std::runtime_error&)
 {
   VISU_MeshAct* anActor = VISU_MeshAct::New();
   try{
     VISU::Prs3d_i::CreateActor(anActor,theIO);
     UpdateActor(anActor);
-  }catch(std::runtime_error& exc){
+  }catch (...) {
     anActor->Delete();
-    throw exc;
+    throw ;
   }
   return anActor;
 }
  
 
-void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::Mesh_i::UpdateActor(VISU_Actor* theActor) {
   if(VISU_MeshAct* anActor = dynamic_cast<VISU_MeshAct*>(theActor)){
     if(MYDEBUG) MESSAGE("Mesh_i::UpdateActor");
     VISU::Prs3d_i::UpdateActor(anActor);
     anActor->SetRepresentation(myPresentType);
-    anActor->GetProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
+    anActor->GetSurfaceProperty()->SetColor(myCellColor.R, myCellColor.G, myCellColor.B);
     anActor->GetEdgeProperty()->SetColor(myLinkColor.R, myLinkColor.G, myLinkColor.B);
     anActor->GetNodeProperty()->SetColor(myNodeColor.R, myNodeColor.G, myNodeColor.B);
   }
index 56d23d536455ed19ffa1e71bb9515a969c4e89c4..5ae8a364d1d07966112cac4ce5e1cec2f92c6b8b 100644 (file)
@@ -87,12 +87,11 @@ namespace VISU{
     static const string myComment;
     virtual QString GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
-      throw (std::runtime_error&);
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual void UpdateActor(VISU_Actor* theActor);
   };
 }
 
index ea2ae269c50e6caf018344c37aaa8a2e34906be7..9a71122e5e8036b9ae58e39effee308c4c478a19 100644 (file)
@@ -51,7 +51,7 @@ VISU::Prs3d_i::Prs3d_i(Result_i* theResult, SALOMEDS::SObject_ptr theSObject) :
   myAddToStudy = true;
   myPipeLine = NULL;
   CORBA::String_var aName = myStudy->Name();
-  INFOS("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
+  if(MYDEBUG) MESSAGE("Prs3d_i - this = "<<this<<"; StudyId = "<<myStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
 }
 
 void VISU::Prs3d_i::SameAs(const Prs3d_i* theOrigin)
@@ -61,13 +61,12 @@ void VISU::Prs3d_i::SameAs(const Prs3d_i* theOrigin)
 }
 
 VISU::Prs3d_i::~Prs3d_i() {
-  INFOS("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
+  if(MYDEBUG) MESSAGE("~Prs3d_i() - this = "<<this<<"; GetReferenceCount() = "<<myPipeLine->GetReferenceCount());
   myPipeLine->Delete();
   myResult->Destroy();
 }
 
 void VISU::Prs3d_i::CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO)
-  throw (std::runtime_error&)
 {
   try{
     Update();
@@ -81,41 +80,23 @@ void VISU::Prs3d_i::CreateActor(VISU_Actor* theActor, const Handle(SALOME_Intera
     }
     theActor->SetPipeLine(GetPipeLine());
     theActor->SetPrs3d(this);
-  }catch(std::runtime_error& ex){
+  }catch(std::bad_alloc& ex){
+    throw std::runtime_error("CreateActor >> No enough memory");
     throw ex;
-  }catch(...){
+  } catch(std::exception& ex){
+    throw ex;
+  }catch(...) {
     throw std::runtime_error("CreateActor >> unexpected exception was caught!!!");
-  }
+  } 
 }
 
-void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) throw (std::runtime_error&){
-  try{
-    vtkGeometryFilter* aGeometryFilter = vtkGeometryFilter::New();
-    vtkDataSet *aDataSet = theActor->GetMapper()->GetInput();
-    aGeometryFilter->SetInput(aDataSet);
-    vtkPolyData* aPolyData = aGeometryFilter->GetOutput();
-    aPolyData->Update();
-    static int INCMEMORY = 7;
-    float aSize = INCMEMORY*aPolyData->GetActualMemorySize()*1024.0;
-    int isPoss = VISU_PipeLine::CheckAvailableMemory(aSize);
-    INFOS("UpdateActor - aSize = "<<aSize<<"; isPoss = "<<isPoss);
-    aPolyData->Delete();
-    if (aSize <= 0)
-      throw std::runtime_error("Prs3d_i::UpdateActor >> Actor is empty !!!");
-    if(!isPoss) 
-      throw std::runtime_error("Prs3d_i::UpdateActor >> There is no enough memory !!!");
-
-    theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
-    theActor->Modified();
-  }catch(std::runtime_error& ex){
-    throw ex;
-  }catch(...){
-    throw std::runtime_error("Prs3d_i::UpdateActor >> unexpected exception was caught!!!");
-  }
+void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) {
+  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor() - this = "<<this);
+  theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+  theActor->Modified();
 }
 
 VISU::Storable* VISU::Prs3d_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   myName = VISU::Storable::FindValue(theMap,"myName").latin1();
   return this;
@@ -125,7 +106,8 @@ void VISU::Prs3d_i::ToStream(std::ostringstream& theStr){
   Storable::DataToStream( theStr, "myName",   myName.c_str() );
 }
 
-void VISU::Prs3d_i::Update() throw (std::runtime_error&){
+void VISU::Prs3d_i::Update() {
+  if(MYDEBUG) MESSAGE("Prs3d_i::Update() - this = "<<this);
   try{
     myPipeLine->Update();
   }catch(...){
index 5c125b41bf14ab2873074a2b8f469aa382c91b54..cd7115aad98e0e1579c77b96004f9220cac77f61 100644 (file)
@@ -58,12 +58,11 @@ namespace VISU{
     VISU_PipeLine *myPipeLine;
     SALOMEDS::SObject_var mySObject;
 
-    void CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO = NULL) 
-      throw (std::runtime_error&);
+    void CreateActor(VISU_Actor* theActor, const Handle(SALOME_InteractiveObject)& theIO = NULL);
     virtual VISU_PipeLine* GetPipeLine();
 
   public:
-    virtual void Update() throw(std::runtime_error&);
+    virtual void Update() ;
     VISU_PipeLine* GetPL();
 
     void GetBounds(float aBounds[6]);
@@ -71,13 +70,13 @@ namespace VISU{
     virtual const char* GetComment() const = 0;
     virtual QString GenerateName() = 0;
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
     virtual void ToStream(std::ostringstream& theStr);
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) 
-      throw (std::runtime_error&) = 0;
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) = 0;
+
+    virtual void UpdateActor(VISU_Actor* theActor) ;
 
     Result_i* GetResult() const { return myResult;}
     virtual SALOMEDS::SObject_var GetSObject();
@@ -86,7 +85,6 @@ namespace VISU{
   template<class TPrs3d>
   Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
                    const string& thePrefix, const Storable::TRestoringMap& theMap)
-    throw(std::logic_error&)
   {
     VISU::Result_i* pResult = GetResult(theSObject);
     if(pResult != NULL){
index da77ebabaae23d0981e713980fde31d9af447094..321696a102c96837606b2331b70ff8f35e1c6bc1 100644 (file)
@@ -54,6 +54,6 @@ QString VISU::PrsObject_i::GetEntry() {
   if(!CORBA::is_nil(aSObject.in()))
     anEntry = aSObject->GetID();
   else
-    INFOS("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
+    MESSAGE("PrsObject_i::GetEntry - Cannot find SObject in the Study with StudyId = "<<myStudy->StudyId()<<" !!!");
   return anEntry.in();
 }
index f378c2c17eb89330a3b49b57adf2f4be27ffe0c6..3fcdc2b1432ab76a7253956a0146c7996e63c961 100644 (file)
@@ -134,7 +134,7 @@ VISU::Result_i::Result_i(SALOMEDS::Study_ptr theStudy, const TSourceId& aSourceI
   myInput = NULL;
   myIsDone = 0;
   CORBA::String_var aName = theStudy->Name();
-  INFOS("Result_i::Result_i - this = "<<this<<"; StudyId = "<<
+  MESSAGE("Result_i::Result_i - this = "<<this<<"; StudyId = "<<
        theStudy->StudyId()<<"; Name = '"<<aName.in()<<"'");
 }
 
@@ -148,7 +148,7 @@ int VISU::Result_i::IsPossible(){
   try{
     float aSize = myInput->GetSize();
     bool aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-    INFOS("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
+    MESSAGE("Result_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<float(aResult));
     return aResult;
   }catch(std::runtime_error& exc){
     INFOS("Follow exception was accured :\n"<<exc.what());
@@ -240,7 +240,6 @@ CORBA::Boolean VISU::Result_i::BuildAll(){
 }
 
 VISU::Storable* VISU::Result_i::Build(SALOMEDS::SObject_ptr theSObject) 
-     throw (std::runtime_error&)
 {
   SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
   aStudyBuilder->NewCommand();  // There is a transaction
@@ -398,7 +397,7 @@ VISU::Storable* VISU::Result_i::Create(const char* theFileName){
       static QString aCommand;
       aCommand.sprintf("cp %s %s",myFileInfo.absFilePath().latin1(),aTmpDir.get());
       if(system(aCommand) == -1){
-       INFOS("Create - Can't execute the command :"<<aCommand);
+       MESSAGE("Create - Can't execute the command :"<<aCommand);
        return NULL;
       }
       if(MYDEBUG) MESSAGE("Result_i::Create - aCommand = "<<aCommand);
@@ -421,6 +420,7 @@ VISU::Storable* VISU::Result_i::Create(SALOMEDS::SObject_ptr theMedSObject){
   try{
     myInput = CreateMEDConvertor(theMedSObject);
     if(myInput == NULL) return NULL;
+    mySourceId = eComponent;
     string aCompDataType = GetComponentDataType(theMedSObject);
     myFileInfo.setFile(aCompDataType.c_str());
     myName = ::GenerateName("aResult").latin1();
@@ -439,6 +439,7 @@ VISU::Storable* VISU::Result_i::Create(SALOME_MED::FIELD_ptr theField){
   try{
     myInput = CreateMEDFieldConvertor(theField);
     if(myInput == NULL) return NULL;
+    mySourceId = eComponent;
     string aCompDataType = "MED";
     myFileInfo.setFile(aCompDataType.c_str());
     myInitFileName = aCompDataType;
@@ -455,7 +456,6 @@ VISU::Storable* VISU::Result_i::Create(SALOME_MED::FIELD_ptr theField){
 
 VISU::Storable* VISU::Result_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                        const Storable::TRestoringMap& theMap, const string& thePrefix)
-     throw(std::logic_error&)
 {
   if(MYDEBUG)  MESSAGE("Result_i::Restore - "<<thePrefix);
   try{
@@ -560,7 +560,6 @@ void VISU::Result_i::ToStream(std::ostringstream& theStr){
 
 VISU::Storable* VISU::Result_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                        const string& thePrefix, const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Result_i* pResult = new VISU::Result_i(aStudy);
@@ -583,13 +582,13 @@ const SALOMEDS::Study_var& VISU::Result_i::GetStudyDocument() const { return myS
 const SALOMEDS::SComponent_var& VISU::Result_i::GetSComponent() const { return mySComponent;}
 
 VISU::Result_i::~Result_i() {
-  INFOS("Result_i::~Result_i() - this = "<<this);
+  MESSAGE("Result_i::~Result_i() - this = "<<this);
   if(GetSourceId() == eRestoredFile){ 
     static QString aCommand;
     aCommand.sprintf("rm %s",myFileInfo.filePath().latin1());
-    INFOS("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+    MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
     aCommand.sprintf("rmdir --ignore-fail-on-non-empty %s",myFileInfo.dirPath().latin1());
-    INFOS("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
+    MESSAGE("Result_i::~Result_i - system("<<aCommand<<") = "<<system(aCommand));
   }
   if(myInput) delete myInput;
 }
index 1da66a466b71422095696fb8cfe27e5d8c6532f8..471917179103dcdce64b9ac10f6611adec33d748 100644 (file)
@@ -59,8 +59,7 @@ namespace VISU{
     QFileInfo myFileInfo;
 
   protected:
-    virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil()) 
-      throw (std::runtime_error&);
+    virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil()) ;
 
   public:
     virtual int IsPossible();
@@ -69,11 +68,11 @@ namespace VISU{
     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 string& thePrefix)
-      throw(std::logic_error&);
+                             const Storable::TRestoringMap& theMap, const string& thePrefix);
+
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+                            const string& thePrefix, const Storable::TRestoringMap& theMap);
+
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
     static const string myComment;
index e29cdbf8e2dcdde1d9dcf81e73c6992773b95c83..a668d043c807246d55b3ad416b4a3f1e6a78eb6b 100644 (file)
@@ -52,7 +52,7 @@ int VISU::ScalarMap_i::IsPossible(Result_i* theResult, const char* theMeshName,
     bool aResult = true;
     if(isMemoryCheck){
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-      INFOS("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+      MESSAGE("ScalarMap_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
     return aResult;
   }catch(std::runtime_error& exc){
@@ -294,7 +294,6 @@ VISU::Storable* VISU::ScalarMap_i::Create(const char* theMeshName, VISU::Entity
 
 
 VISU::Storable* VISU::ScalarMap_i::Restore(const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   DoHook();
   myMeshName = VISU::Storable::FindValue(theMap,"myMeshName").latin1();
@@ -485,7 +484,7 @@ void VISU::ScalarMap_i::DoHook(){
   myScalarMapPL = dynamic_cast<VISU_ScalarMapPL*>(myPipeLine);
 }
 
-void VISU::ScalarMap_i::Update() throw(std::runtime_error&){
+void VISU::ScalarMap_i::Update() {
   VISU::Prs3d_i::Update();
 }
 
@@ -494,7 +493,6 @@ void VISU::ScalarMap_i::SetMapScale(double theMapScale){
 }
 
 VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
-  throw (std::runtime_error&)
 {
   VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
   try{
@@ -503,14 +501,14 @@ VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject
     anActor->SetRepresentation(2);
     anActor->myFieldName = myFieldName;
     UpdateActor(anActor);
-  }catch(std::runtime_error& exc){
+  }catch(...) {
     anActor->Delete();
-    throw exc
+    throw std::runtime_error("CreateActor error")
   }
   return anActor;
 }
 
-void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::ScalarMap_i::UpdateActor(VISU_Actor* theActor) {
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
     VISU::Prs3d_i::UpdateActor(theActor);
     VISU_ScalarBarActor *aScalarBar = anActor->GetScalarBar();
index 593213f0531e06dfb87ec374456529162d9d7f2b..a42b55f0525d77ceeb10b84b323dcc507eca5799 100644 (file)
@@ -164,13 +164,12 @@ namespace VISU{
     virtual const char* GetComment() const;
     virtual QString GenerateName();
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
+
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+                            const string& thePrefix, const Storable::TRestoringMap& theMap);
 
-    virtual void Update() throw(std::runtime_error&);
+    virtual void Update() ;
     virtual void SetMapScale(double theMapScale = 1.0);
 
     const VISU::TField*  GetField() const { return myField;}
@@ -181,9 +180,9 @@ namespace VISU{
 
     virtual int GetIteration() { return myIteration; }
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
-      throw (std::runtime_error&);
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual void UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
index bb50cc01a6b0330872d1a443cb873a9023e68363..85fd5da7c75963ed0e72767eb4ad8e53533ab44d 100644 (file)
@@ -50,7 +50,7 @@ int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName
     VISU_Convertor::TOutput *anOutput = 
       theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
     bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
-    INFOS("StreamLines_i::IsPossible - aResult = "<<aResult);
+    MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
     return aResult;
   }catch(std::runtime_error& exc){
     INFOS("Follow exception was accured :\n"<<exc.what());
@@ -94,7 +94,6 @@ VISU::Storable* VISU::StreamLines_i::Create(const char* theMeshName, VISU::Entit
 
 
 VISU::Storable* VISU::StreamLines_i::Restore(const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   DoHook();
   VISU::Storable* aStorable = DeformedShape_i::Restore(theMap);
@@ -234,19 +233,18 @@ void VISU::StreamLines_i::DoHook(){
 }
 
 
-void VISU::StreamLines_i::Update() throw(std::runtime_error&){
+void VISU::StreamLines_i::Update() {
   SetSource();
   VISU::DeformedShape_i::Update();
 }
 
 
 VISU_Actor* VISU::StreamLines_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
-  throw (std::runtime_error&)
 {
   return VISU::DeformedShape_i::CreateActor(theIO);
 }
 
 
-void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::StreamLines_i::UpdateActor(VISU_Actor* theActor) {
   VISU::DeformedShape_i::UpdateActor(theActor);
 }
index cfcbc474da1e8fc821972a0a317ded808e78a608..05d6cb46ed26fc7ee1cfd34fb163ce227a113fc2 100644 (file)
@@ -85,14 +85,13 @@ namespace VISU{
     virtual const char* GetComment() const;
     virtual QString GenerateName();
     
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
     
-    virtual void Update() throw(std::runtime_error&);
+    virtual void Update() ;
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
-      throw (std::runtime_error&);
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual void UpdateActor(VISU_Actor* theActor);
 
     virtual QString GetSourceEntry() { return QString(mySourceEntry.c_str()); }
   };
index 0779e845318f18f1198776f4d1cb78be77d51553..0c683dc3bf98503b26ae309d2d45bdde33ec8abc 100644 (file)
@@ -79,7 +79,7 @@ VISU::Table_i::Table_i( SALOMEDS::Study_ptr theStudy, const char* theObjectEntry
 */
 VISU::Table_i::~Table_i()
 {
-  INFOS("Table_i::~Table_i");
+  MESSAGE("Table_i::~Table_i");
 }
 /*!
   Gets number of rows in table
@@ -92,7 +92,7 @@ CORBA::Long VISU::Table_i::GetNbRows()
     SALOMEDS::GenericAttribute_var        anAttr;
     if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfInteger" ) ) {
       SALOMEDS::AttributeTableOfInteger_var anInt =  SALOMEDS::AttributeTableOfInteger::_narrow( anAttr );
-      return anInt->GetNbRows();
+       return anInt->GetNbRows();
     }
     else if ( Builder->FindAttribute( SO, anAttr, "AttributeTableOfReal" ) ) {
       SALOMEDS::AttributeTableOfReal_var aReal =  SALOMEDS::AttributeTableOfReal::_narrow( anAttr );
@@ -128,6 +128,21 @@ VISU::Storable* VISU::Table_i::Create()
 {
   // generate name ... 
   myName = GetTableTitle(); 
+
+  // mpv (PAL 5357): if name attribute already exist at this label, use it as name of table
+  if ( myName == "" )
+    if ( !mySObj->_is_nil() ) {
+      CutLines_i* pCutLines = NULL;
+      CORBA::Object_var anObj = SObjectToObject(mySObj);
+      if(!CORBA::is_nil(anObj)){
+       VISU::CutLines_var aCutLines = VISU::CutLines::_narrow(anObj);
+         if(!aCutLines->_is_nil())
+           pCutLines = dynamic_cast<CutLines_i*>(GetServant(aCutLines).in());
+       }
+      if (!pCutLines)
+       if (mySObj->GetName()) myName = mySObj->GetName();
+    }
+
   if ( myName == "" )
     myName = GenerateName();
   // ... and build the object
@@ -165,14 +180,15 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
                                          GetName(),
                                          "",
                                          aComment.latin1(), 
-                                         true );
+                                         pCutLines );
        // create SObject referenced to real table object
        mySObj = SALOMEDS::SObject::_duplicate(myStudy->FindObjectID( anEntry.c_str() ));
        if(pCutLines) {
          pCutLines->BuildTableOfReal(mySObj);
        }
-       SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
-       Builder->Addreference( refSO, SO );
+       // mpv (PAL5357): reference attributes are unnecessary now
+       //SALOMEDS::SObject_var refSO = Builder->NewObject( mySObj );
+       //Builder->Addreference( refSO, SO );
       }
     return this;
   }
@@ -182,7 +198,6 @@ VISU::Storable* VISU::Table_i::Build( int theRestoring )
   Restores table object from stream
 */
 VISU::Storable* VISU::Table_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
-     throw( std::logic_error& )
 {
   if(MYDEBUG) MESSAGE(GetComment());
   myName = (const char*)(VISU::Storable::FindValue(theMap,"myName"));
@@ -205,7 +220,6 @@ void VISU::Table_i::ToStream( std::ostringstream& theStr )
 */
 VISU::Storable* VISU::Table_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                       const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pResent = new VISU::Table_i( aStudy, "" );
@@ -284,7 +298,7 @@ VISU::Curve_i::Curve_i(SALOMEDS::Study_ptr theStudy, Table_i* theTable, CORBA::L
 */
 VISU::Curve_i::~Curve_i()
 {
-  INFOS("Curve_i::~Curve_i");
+  MESSAGE("Curve_i::~Curve_i");
 }
 /*!
   Creates curve object
@@ -574,7 +588,6 @@ Plot2d_Curve* VISU::Curve_i::CreatePresentation()
   Restores curve object from stream
 */
 VISU::Storable* VISU::Curve_i::Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO)
-     throw( std::logic_error& )
 {
   if(MYDEBUG) MESSAGE(GetComment());
   mySObj = SALOMEDS::SObject::_duplicate(theSO);
@@ -617,7 +630,6 @@ const char* VISU::Curve_i::GetTableID() {
 */
 VISU::Storable* VISU::Curve_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                       const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Table_i* pTable = GetTable(aStudy, theSObject->GetFather());
@@ -659,7 +671,7 @@ VISU::Container_i::Container_i( SALOMEDS::Study_ptr theStudy )
 */
 VISU::Container_i::~Container_i()
 {
-  INFOS("Container_i::~Container_i");
+  MESSAGE("Container_i::~Container_i");
   myCurves.clear();
 }
 /*!
@@ -861,7 +873,6 @@ VISU::Curve_i* VISU::Container_i::GetCurve( CORBA::Long theIndex )
   Restores container data from the stream
 */
 VISU::Storable* VISU::Container_i::Restore( const Storable::TRestoringMap& theMap )
-     throw( std::logic_error& )
 {
   if(MYDEBUG) MESSAGE(GetComment());
   myName = VISU::Storable::FindValue( theMap, "myName" ).latin1(); 
@@ -884,7 +895,6 @@ void VISU::Container_i::ToStream( std::ostringstream& theStr )
 */
 VISU::Storable* VISU::Container_i::Restore(SALOMEDS::SObject_ptr theSObject, 
                                           const string& thePrefix, const Storable::TRestoringMap& theMap)
-  throw(std::logic_error&)
 {
   SALOMEDS::Study_var aStudy = theSObject->GetStudy();
   VISU::Container_i* pResent = new VISU::Container_i( aStudy );
index 25f9c4d9a9b6aca42c92a14dcf4cc838c450a9ca..136ce6ac8a5063541614275e618556eff67bfd1f 100644 (file)
@@ -64,11 +64,9 @@ namespace VISU{
 
   public:
     virtual Storable* Create();
-    virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO)
-      throw(std::logic_error&);
+    virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr SO);
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+                            const string& thePrefix, const Storable::TRestoringMap& theMap);
     virtual void ToStream( std::ostringstream& theStr );
     static const string myComment;
     virtual const char* GetComment() const;
@@ -122,11 +120,11 @@ namespace VISU{
 
   public:
     virtual Storable* Create();
-    virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO)
-      throw(std::logic_error&);
+    virtual Storable* Restore( const Storable::TRestoringMap& theMap, SALOMEDS::SObject_ptr theSO);
+
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+                            const string& thePrefix, const Storable::TRestoringMap& theMap);
+
     virtual void ToStream( std::ostringstream& theStr );
     static const string myComment;
     virtual const char* GetComment() const;
@@ -170,11 +168,11 @@ namespace VISU{
     
   public:
     virtual Storable* Create();
-    virtual Storable* Restore( const Storable::TRestoringMap& theMap )
-      throw(std::logic_error&);
+    virtual Storable* Restore( const Storable::TRestoringMap& theMap );
+
     static Storable* Restore(SALOMEDS::SObject_ptr theSObject, 
-                            const string& thePrefix, const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+                            const string& thePrefix, const Storable::TRestoringMap& theMap);
+
     virtual void ToStream( std::ostringstream& theStr );
     static const string myComment;
     virtual const char* GetComment() const;
index 381061681e5d4cc9a8ecce1c934a608dea8be602..bd00adca6dfbcc5b0ce3e00db8c311ccfcfdc577 100644 (file)
@@ -21,6 +21,8 @@
 #include "VISU_ScalarBarActor.hxx"
 #include "VISU_Actor.h"
 
+#include "SALOME_Event.hxx"
+
 #include "VTKViewer_ViewFrame.h"
 
 #include "QAD_Config.h"
@@ -30,9 +32,10 @@ using namespace std;
 //QWaitCondition myCondition;
 static int MYDELAY = 1;
 
+
 //************************************************************************
-VISU_TimeAnimation::VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D) {
-  myStudy = theStudy;
+VISU_TimeAnimation::VISU_TimeAnimation(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D) {
+  myStudy = SALOMEDS::Study::_duplicate(theStudy);
   myIsActive = false;
   myFrame = 0;
   mySpeed = 1;
@@ -67,9 +70,6 @@ void VISU_TimeAnimation::addField(SALOMEDS::SObject_ptr theField) {
   FieldData aNewData;
   aNewData.myField = SALOMEDS::SObject::_duplicate(theField);
   aNewData.myNbFrames = 0;
-  aNewData.myPrs = 0;
-  aNewData.myActors = 0;
-  aNewData.myTiming = 0;
   aNewData.myPrsType = VISU::TSCALARMAP;
   VISU::Storable::TRestoringMap aMap = getMapOfValue(aNewData.myField);
   aNewData.myNbTimes = VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
@@ -90,26 +90,23 @@ void VISU_TimeAnimation::addField(SALOMEDS::SObject_ptr theField) {
 
 //************************************************************************
 void VISU_TimeAnimation::clearData(FieldData& theData) {
-  if (theData.myTiming) {
-    free(theData.myTiming);
-    theData.myTiming = 0;
-  }
+  theData.myTiming.clear();
   vtkRenderer* aRen = myView->getRenderer();
-  if (theData.myActors) {
-    for (int i = 0; i < theData.myNbFrames; i++) {
-      if (theData.myActors[i] != 0) {
-       theData.myActors[i]->RemoveFromRender(aRen);
-       theData.myActors[i]->Delete();
+  if (!theData.myActors.empty()) {
+    for (int i = 0, iEnd = theData.myActors.size(); i < iEnd; i++) {
+      if (theData.myActors.at(i) != 0) {
+       theData.myActors.at(i)->RemoveFromRender(aRen);
+       theData.myActors.at(i)->Delete();
       }
     }
-    free(theData.myActors);
-    theData.myActors = 0;
+    theData.myActors.clear();
   }
-  if (theData.myPrs) {
-    for (int i = 0; i < theData.myNbFrames; i++) 
-      theData.myPrs[i]->_remove_ref();
-    free(theData.myPrs);
-    theData.myPrs = 0;
+  if (!theData.myPrs.empty()) {
+    for (int i = 0, iEnd = theData.myPrs.size(); i < iEnd; i++) 
+      if (theData.myPrs.at(i) != 0) {
+       theData.myPrs.at(i)->_remove_ref();
+      }
+    theData.myPrs.clear();
   }  
   theData.myNbFrames = 0;
   myView->update();
@@ -128,8 +125,8 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
   aData.myNbFrames = aData.myNbTimes;
     //VISU::Storable::FindValue(aMap,"myNbTimeStamps").toLong();
 
-  aData.myPrs = (VISU::ScalarMap_i**) malloc(aData.myNbTimes * sizeof(VISU::ScalarMap_i*));
-  aData.myTiming = (double*) malloc(aData.myNbTimes * sizeof(double));
+  aData.myPrs.resize(aData.myNbTimes,NULL);
+  aData.myTiming.resize(aData.myNbTimes);
 
   SALOMEDS::ChildIterator_var anIter = myStudy->NewChildIterator(aData.myField);
   SALOMEDS::SObject_var aTimeStamp;
@@ -144,10 +141,10 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
     aTimeStamp = anIter->Value();
     if (aTimeStamp->_is_nil()) continue;
 
-    aData.myTiming[i] = getTimeValue(aTimeStamp);
+    aData.myTiming.at(i) = getTimeValue(aTimeStamp);
     if (isRangeDefined()) {
-      if (aData.myTiming[i] < myMinVal) continue;
-      if (aData.myTiming[i] > myMaxVal) break;
+      if (aData.myTiming.at(i) < myMinVal) continue;
+      if (aData.myTiming.at(i) > myMaxVal) break;
     }
 
     VISU::Storable::TRestoringMap aTimeMap = getMapOfValue(aTimeStamp);
@@ -164,7 +161,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::ScalarMap_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
       
@@ -175,7 +172,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::IsoSurfaces_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
     
@@ -186,7 +183,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::CutPlanes_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
       
@@ -197,7 +194,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::DeformedShape_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
       
@@ -208,7 +205,7 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::Vectors_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
       
@@ -219,60 +216,61 @@ void VISU_TimeAnimation::generatePresentations(CORBA::Long theFieldNum) {
                         aFieldName.latin1(), aTimeStampId);
        //VISU::StreamLines_var aTmp = aPresent->_this();
        //aPresent->_remove_ref();
-       aData.myPrs[i] = aPresent;
+       aData.myPrs.at(i) = aPresent;
       }
       break;
     }
-    if (aData.myPrs[i]->GetMin() < aMin) aMin = aData.myPrs[i]->GetMin();
-    if (aData.myPrs[i]->GetMax() > aMax) aMax = aData.myPrs[i]->GetMax();
+    if (aData.myPrs.at(i)->GetMin() < aMin) aMin = aData.myPrs.at(i)->GetMin();
+    if (aData.myPrs.at(i)->GetMax() > aMax) aMax = aData.myPrs.at(i)->GetMax();
     i++;
   }
   aData.myNbFrames = i;
   QString aFixRange = QAD_CONFIG->getSetting("Visu:SBImposeRange");
   if (aFixRange.compare("true") != 0) {
     for (i = 0; i < aData.myNbFrames; i++) 
-      aData.myPrs[i]->SetRange(aMin, aMax);
+      aData.myPrs.at(i)->SetRange(aMin, aMax);
     if(aData.myPrsType == VISU::TISOSURFACE)
       for (i = 0; i < aData.myNbFrames; i++) 
-       if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs[i]))
+       if(VISU::IsoSurfaces_i* aPrs = dynamic_cast<VISU::IsoSurfaces_i*>(aData.myPrs.at(i)))
           aPrs->SetSubRange(aMin, aMax);
   }
 }
 
 
 //************************************************************************
-CORBA::Boolean VISU_TimeAnimation::generateFrames() {
+CORBA::Boolean VISU_TimeAnimation::generateFrames(){
   if (!myView) {
     MESSAGE("Viewer is nod defined for animation");
     return false;
   }
+
   myLastError = QString("Frame(s) for ");
   bool aNoError = true;
-  VISU::Mutex mt(myMutex,qApp,MYDELAY);
   clearView();
   vtkRenderer* aRen = myView->getRenderer();
+
   for (int i = 0; i < getNbFields(); i++) {
     FieldData& aData = myFieldsLst[i];
-    aData.myActors = (VISU_Actor**) malloc(aData.myNbFrames * sizeof(VISU_Actor*));
+    aData.myActors.resize(aData.myNbFrames,NULL);
     for (long j = 0; j < aData.myNbFrames; j++) {
       VISU_Actor* aActor = NULL;
       try{
-       aActor = aData.myPrs[j]->CreateActor();
+       aActor = aData.myPrs.at(j)->CreateActor();
        myView->AddActor(aActor);
        if(j == 0)
          aActor->VisibilityOn();
        else
          aActor->VisibilityOff();
-      }catch(std::runtime_error& exc){
+      }catch(...){ //catch(std::runtime_error& exc){
        aNoError = false;
-       myLastError += QString("%1 ").arg(aData.myTiming[j]);
+       myLastError += QString("%1 ").arg(aData.myTiming.at(j));
       }
-      aData.myActors[j] = aActor;
+      aData.myActors.at(j) = aActor;
     }
   }
   myFrame = 0;
   myLastError += QString(" timestamp(s) cannot be created.");
-  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+  emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
   myView->Repaint();
   return aNoError;
 }
@@ -283,22 +281,21 @@ void VISU_TimeAnimation::clearView() {
     MESSAGE("Viewer is nod defined for animation");
     return;
   }
-  VISU::Mutex mt(myMutex,qApp,MYDELAY);
   vtkRenderer* aRen = myView->getRenderer();
   for (int i = 0; i < getNbFields(); i++) {
     FieldData& aData = myFieldsLst[i];
-    if (aData.myActors) {
-      for (int i = 0; i < aData.myNbFrames; i++) {
-       if (aData.myActors[i] != 0) {
-         aData.myActors[i]->RemoveFromRender(aRen);
-         aData.myActors[i]->Delete();
+    if (!aData.myActors.empty()) {
+      for (int i = 0, iEnd = aData.myActors.size(); i < iEnd; i++) {
+       if (aData.myActors.at(i) != 0) {
+         aData.myActors.at(i)->RemoveFromRender(aRen);
+         aData.myActors.at(i)->Delete();
        }
       } 
-      free(aData.myActors);
-      aData.myActors = 0;
+      aData.myActors.clear();
     }
   }
-  myView->update();
+  myView->getRW()->getRenderWindow()->Render();
+  //myView->update();
 }
 
 //************************************************************************
@@ -320,14 +317,14 @@ void VISU_TimeAnimation::nextFrame() {
   if (myFrame < (myFieldsLst[0].myNbFrames-1)) {
     int i;
     for (i = 0; i < getNbFields(); i++) 
-      if (myFieldsLst[i].myActors[myFrame] != 0)
-       myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
     myFrame++;
     for (i = 0; i < getNbFields(); i++) 
-      if (myFieldsLst[i].myActors[myFrame] != 0)
-       myFieldsLst[i].myActors[myFrame]->VisibilityOn(); 
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOn(); 
 
-    emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+    emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     myView->Repaint();
   }
 }
@@ -338,14 +335,14 @@ void VISU_TimeAnimation::prevFrame() {
   if (myFrame > 0) {
     int i;
     for (i = 0; i < getNbFields(); i++) 
-      if (myFieldsLst[i].myActors[myFrame] != 0)
-       myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
     myFrame--;
     for (i = 0; i < getNbFields(); i++) 
-      if (myFieldsLst[i].myActors[myFrame] != 0)
-       myFieldsLst[i].myActors[myFrame]->VisibilityOn();    
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();    
 
-    emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+    emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     myView->Repaint();
   }
 }
@@ -355,15 +352,18 @@ void VISU_TimeAnimation::firstFrame() {
   stopAnimation();
   int i;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+    if(!myFieldsLst[i].myActors.empty())
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
   myFrame = 0;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOn();    
-
-  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
-  myView->Repaint();
+    if(!myFieldsLst[i].myActors.empty())
+      if (myFieldsLst[i].myActors.at(myFrame) != 0)
+       myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();    
+  if(!myFieldsLst[0].myTiming.empty()){
+    emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
+    myView->Repaint();
+  }
 }
 
 //************************************************************************
@@ -371,14 +371,14 @@ void VISU_TimeAnimation::lastFrame() {
   stopAnimation();
   int i;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+    if (myFieldsLst[i].myActors.at(myFrame) != 0)
+      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
   myFrame = myFieldsLst[0].myNbFrames-1;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOn();
+    if (myFieldsLst[i].myActors.at(myFrame) != 0)
+      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
     
-  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+  emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
   myView->Repaint();
 }
 
@@ -393,13 +393,13 @@ void VISU_TimeAnimation::gotoFrame(CORBA::Long theFrame) {
   qApp->syncX();
   int i;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOff();
+    if (myFieldsLst[i].myActors.at(myFrame) != 0)
+      myFieldsLst[i].myActors.at(myFrame)->VisibilityOff();
   myFrame = theFrame;
   for (i = 0; i < getNbFields(); i++) 
-    if (myFieldsLst[i].myActors[myFrame] != 0)
-      myFieldsLst[i].myActors[myFrame]->VisibilityOn();
-  emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+    if (myFieldsLst[i].myActors.at(myFrame) != 0)
+      myFieldsLst[i].myActors.at(myFrame)->VisibilityOn();
+  emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
   myView->Repaint();
   qApp->flushX(); 
   qApp->processEvents(3);
@@ -413,7 +413,7 @@ VISU::ScalarMap_ptr VISU_TimeAnimation::getPresentation(CORBA::Long theField, CO
     return VISU::ScalarMap::_nil();
   if ((theFrame < 0) || (theFrame > (myFieldsLst[theField].myNbFrames - 1)))
     return VISU::ScalarMap::_nil();
-  return myFieldsLst[theField].myPrs[theFrame]->_this();
+  return myFieldsLst[theField].myPrs.at(theFrame)->_this();
 }
 
 
@@ -429,34 +429,32 @@ void VISU_TimeAnimation::run() {
     MESSAGE("Viewer is nod defined for animation");
     return;
   }
-
   double k=1;
   double aOneVal;
   bool isDumping = !myDumpPath.isEmpty();
   aOneVal = (myFieldsLst[0].myNbFrames > 2) ?
-    myFieldsLst[0].myTiming[1] - myFieldsLst[0].myTiming[0] : 1;
-
+    myFieldsLst[0].myTiming.at(1) - myFieldsLst[0].myTiming.at(0) : 1;
   qApp->lock();      
   while (myIsActive) {
-    emit frameChanged(myFrame, myFieldsLst[0].myTiming[myFrame]);
+    emit frameChanged(myFrame, myFieldsLst[0].myTiming.at(myFrame));
     for (int i = 0; i < getNbFields(); i++) {
       FieldData& aData = myFieldsLst[i];
       if (myFrame > 0) {
-       if (aData.myActors[myFrame-1] != 0) 
-         aData.myActors[myFrame-1]->VisibilityOff();
+       if (aData.myActors.at(myFrame-1) != 0) 
+         aData.myActors.at(myFrame-1)->VisibilityOff();
       } else { 
-       if (aData.myActors[aData.myNbFrames-1] != 0)
-         aData.myActors[aData.myNbFrames-1]->VisibilityOff();
+       if (aData.myActors.at(aData.myNbFrames-1) != 0)
+         aData.myActors.at(aData.myNbFrames-1)->VisibilityOff();
       }
-      if (aData.myActors[myFrame] != 0) {
-       aData.myActors[myFrame]->VisibilityOn();
+      if (aData.myActors.at(myFrame) != 0) {
+       aData.myActors.at(myFrame)->VisibilityOn();
       }
     }
     myView->Repaint(false);
     if (isDumping) {
       QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
       QString aFile(myDumpPath);
-      QString aName = QString("%1").arg(myFieldsLst[0].myTiming[myFrame]);
+      QString aName = QString("%1").arg(myFieldsLst[0].myTiming.at(myFrame));
       int aPos = -1;
       while ((aPos = aName.find(".")) > -1 )
        aName.replace(aPos, 1, "_");
@@ -472,17 +470,16 @@ void VISU_TimeAnimation::run() {
          break;        
        case 1:
          if (myFieldsLst[0].myNbFrames > 2)
-           k = (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal;
+           k = (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal;
          else
            k = 1;
          break;        
        default:
          k = (myFrame < (myFieldsLst[0].myNbFrames-1))? 
-           (myFieldsLst[0].myTiming[myFrame+1] - myFieldsLst[0].myTiming[myFrame])/aOneVal : 1;
+           (myFieldsLst[0].myTiming.at(myFrame+1) - myFieldsLst[0].myTiming.at(myFrame))/aOneVal : 1;
        }
       } else
        k = 1;
-      
       qApp->unlock();
       msleep((int)(1000.*k/mySpeed));
       qApp->lock();
@@ -548,3 +545,171 @@ double VISU_TimeAnimation::getTimeValue(SALOMEDS::SObject_var theTimeStamp) {
 void VISU_TimeAnimation::setSpeed(CORBA::Long theSpeed) { 
   mySpeed = (theSpeed<1)? 1 : theSpeed; 
 }
+
+
+//========================================================================
+VISU_TimeAnimation_i::VISU_TimeAnimation_i(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D){
+  myAnim = new VISU_TimeAnimation(theStudy,theView3D);
+}
+
+
+VISU_TimeAnimation_i::~VISU_TimeAnimation_i(){
+  delete myAnim;
+}
+
+
+void VISU_TimeAnimation_i::addField(SALOMEDS::SObject_ptr theField){
+  myAnim->addField(theField);
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::generateFrames(){
+  return ProcessEvent(new TMemFunEvent<VISU_TimeAnimation,bool>(myAnim,&VISU_TimeAnimation::generateFrames));
+}
+
+
+void VISU_TimeAnimation_i::generatePresentations(CORBA::Long theFieldNum){
+  myAnim->generatePresentations(theFieldNum);
+}
+
+
+void VISU_TimeAnimation_i::clearView(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::clearView));
+}
+
+
+void VISU_TimeAnimation_i::stopAnimation(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::stopAnimation));
+}
+
+
+void VISU_TimeAnimation_i::startAnimation(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::startAnimation));
+}
+
+
+void VISU_TimeAnimation_i::nextFrame(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::nextFrame));
+}
+
+
+void VISU_TimeAnimation_i::prevFrame(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::prevFrame));
+}
+
+
+void VISU_TimeAnimation_i::firstFrame(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::firstFrame));
+}
+
+
+void VISU_TimeAnimation_i::lastFrame(){
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_TimeAnimation>(myAnim,&VISU_TimeAnimation::lastFrame));
+}
+
+
+void VISU_TimeAnimation_i::gotoFrame(CORBA::Long theFrame){
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_TimeAnimation,CORBA::Long>(myAnim,&VISU_TimeAnimation::gotoFrame,theFrame));
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getNbFields(){
+  return myAnim->getNbFields();
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getNbFrames(){
+  return myAnim->getNbFrames();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isRunning(){
+  return myAnim->isRunning();
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getCurrentFrame(){
+  return myAnim->getCurrentFrame();
+}
+
+
+VISU::ScalarMap_ptr VISU_TimeAnimation_i::getPresentation(CORBA::Long theField, CORBA::Long theFrame){
+  return myAnim->getPresentation(theField,theFrame);
+}
+
+
+void VISU_TimeAnimation_i::setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType){
+  myAnim->setPresentationType(theFieldNum,theType);
+}
+
+
+VISU::VISUType VISU_TimeAnimation_i::getPresentationType(CORBA::Long theFieldNum){
+  return myAnim->getPresentationType(theFieldNum);
+}
+
+
+void VISU_TimeAnimation_i::setSpeed(CORBA::Long theSpeed){
+  myAnim->setSpeed(theSpeed);
+}
+
+
+CORBA::Long VISU_TimeAnimation_i::getSpeed(){
+  return myAnim->getSpeed();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isProportional(){
+  return myAnim->isProportional();
+}
+
+
+void VISU_TimeAnimation_i::setAnimationRange(CORBA::Double theMin, CORBA::Double theMax){
+  myAnim->setAnimationRange(theMin,theMax);
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMinRange(){
+  return myAnim->getMinRange();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMaxRange(){
+  return myAnim->getMaxRange();
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isRangeDefined(){
+  return myAnim->isRangeDefined();
+}
+
+
+void VISU_TimeAnimation_i::dumpTo(const char* thePath){
+  myAnim->dumpTo(thePath);
+}
+
+
+CORBA::Boolean VISU_TimeAnimation_i::isCycling(){
+  return myAnim->isCycling();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMinTime(){
+  return myAnim->getMinTime();
+}
+
+
+CORBA::Double VISU_TimeAnimation_i::getMaxTime(){
+  return myAnim->getMaxTime();
+}
+
+
+void VISU_TimeAnimation_i::setProportional(CORBA::Boolean theProp){
+  myAnim->setProportional(theProp);
+}
+
+
+void VISU_TimeAnimation_i::setCycling(CORBA::Boolean theCycle){
+  myAnim->setCycling(theCycle);
+}
+
+
index 0331f2f773b52e8bd94c2f763a7c31aa44330f74..01de4065dbb2f9767086998e5618a55145b99e30 100644 (file)
 
 #include "VISUConfig.hh"
 
-class VTKViewer_ViewFrame;
-class VISU_Actor;
+#include <vector>
 
 #include <qobject.h>
 #include <qvaluelist.h>
 #include <qthread.h>
 
+class VTKViewer_ViewFrame;
+class VISU_Actor;
+
 namespace VISU{
   class Result_i;
   class ScalarMap_i;
@@ -29,15 +31,13 @@ struct FieldData
   SALOMEDS::SObject_var myField; // field label
   long myNbTimes;                // number of Timestamps
   long myNbFrames;               // number of created Frames
-  VISU::ScalarMap_i** myPrs;         // Presentations
-  VISU_Actor** myActors;         // Actors
-  double* myTiming;              // time values
+  std::vector<VISU::ScalarMap_i*> myPrs;         // Presentations
+  std::vector<VISU_Actor*> myActors;         // Actors
+  std::vector<double> myTiming;              // time values
 };
 
 
-class VISU_TimeAnimation: public QObject, public QThread,
-                          public virtual POA_VISU::Animation,
-                          public virtual VISU::Base_i
+class VISU_TimeAnimation: public QObject, public QThread
 {
   Q_OBJECT;
  public:
@@ -45,7 +45,7 @@ class VISU_TimeAnimation: public QObject, public QThread,
   static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject);
   static double getTimeValue(SALOMEDS::SObject_var theTimestamp);
   
-  VISU_TimeAnimation(SALOMEDS::Study_var theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+  VISU_TimeAnimation(SALOMEDS::Study_ptr theStudy, VISU::View3D_ptr theView3D = VISU::View3D::_nil());
   ~VISU_TimeAnimation();
   
   virtual VISU::VISUType GetType() { return VISU::TNONE;};
@@ -130,4 +130,64 @@ class VISU_TimeAnimation: public QObject, public QThread,
   VTKViewer_ViewFrame* myView;
 };
 
+
+class VISU_TimeAnimation_i: public virtual POA_VISU::Animation,
+                            public virtual VISU::Base_i
+{
+  VISU_TimeAnimation* myAnim;
+public:
+  VISU_TimeAnimation_i(SALOMEDS::Study_ptr theStudy, 
+                       VISU::View3D_ptr theView3D = VISU::View3D::_nil());
+  ~VISU_TimeAnimation_i();
+
+  virtual VISU::VISUType GetType(){ return VISU::TNONE;}
+
+  virtual void addField(SALOMEDS::SObject_ptr theField);
+
+  virtual CORBA::Boolean generateFrames();
+  virtual void generatePresentations(CORBA::Long theFieldNum);
+  
+  virtual void clearView();
+
+  virtual void stopAnimation();
+  virtual void startAnimation();
+  virtual void nextFrame();
+  virtual void prevFrame();
+  virtual void firstFrame();
+  virtual void lastFrame();
+  virtual void gotoFrame(CORBA::Long theFrame);
+
+  virtual CORBA::Long getNbFields();
+  virtual CORBA::Long getNbFrames();
+  virtual CORBA::Boolean isRunning();
+  virtual CORBA::Long getCurrentFrame();
+
+  virtual VISU::ScalarMap_ptr getPresentation(CORBA::Long theField, CORBA::Long theFrame);
+
+  virtual void setPresentationType(CORBA::Long theFieldNum, VISU::VISUType theType);
+  virtual VISU::VISUType getPresentationType(CORBA::Long theFieldNum);
+
+  virtual void setSpeed(CORBA::Long theSpeed);
+  virtual CORBA::Long getSpeed();
+
+  virtual CORBA::Boolean isProportional();
+
+  virtual void setAnimationRange(CORBA::Double theMin, CORBA::Double theMax);
+
+  virtual CORBA::Double getMinRange();
+  virtual CORBA::Double getMaxRange();
+  virtual CORBA::Boolean isRangeDefined();
+
+  virtual void dumpTo(const char* thePath);
+
+  virtual CORBA::Boolean isCycling();
+
+  virtual CORBA::Double getMinTime();
+  virtual CORBA::Double getMaxTime();
+
+  virtual void setProportional(CORBA::Boolean theProp);
+  virtual void setCycling(CORBA::Boolean theCycle);
+};
+
+
 #endif  //VISU_TIMEANIMATION_H
index 2e271160de83142acb568e2b3307e1b73420a574..4cb92b29557ccf78aa7f4a5aed5d2310c170238e 100644 (file)
@@ -52,7 +52,7 @@ int VISU::Vectors_i::IsPossible(Result_i* theResult, const char* theMeshName, VI
       float aSize = INCMEMORY*
        theResult->GetInput()->GetTimeStampSize(theMeshName,(VISU::TEntity)theEntity,theFieldName,theIteration);
       aResult = VISU_PipeLine::CheckAvailableMemory(aSize);
-      INFOS("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
+      MESSAGE("Vectors_i::IsPossible - CheckAvailableMemory = "<<float(aSize)<<"; aResult = "<<aResult);
     }
   }catch(std::runtime_error& exc){
     INFOS("Follow exception was accured :\n"<<exc.what());
@@ -98,7 +98,6 @@ VISU::Storable* VISU::Vectors_i::Create(const char* theMeshName, VISU::Entity th
 
 
 VISU::Storable* VISU::Vectors_i::Restore(const Storable::TRestoringMap& theMap)
-     throw(std::logic_error&)
 {
   DoHook();
   SetGlyphType(VISU::Vectors::GlyphType(VISU::Storable::FindValue(theMap,"myTypeGlyph").toInt()));
@@ -164,7 +163,6 @@ VISU_PipeLine* VISU::Vectors_i::GetPipeLine(){
 
 
 VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
-  throw (std::runtime_error&)
 {
   VISU_VectorsAct* anActor = VISU_VectorsAct::New();
   try{
@@ -174,15 +172,15 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)&
     anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
     UpdateActor(anActor);
-  }catch(std::runtime_error& exc){
+  }catch(...){
     anActor->Delete();
-    throw exc;
+    throw ;
   }
   return anActor;
 }
 
 
-void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&){
+void VISU::Vectors_i::UpdateActor(VISU_Actor* theActor) {
   if(VISU_VectorsAct* anActor = dynamic_cast<VISU_VectorsAct*>(theActor)){
     VISU::DeformedShape_i::UpdateActor(anActor);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
index fce5d7b01821c362c991c781911f928340162e8e..40b45a43fadae718bbb78ef4444831e626697228 100644 (file)
@@ -73,16 +73,15 @@ namespace VISU{
 
     virtual void ToStream(std::ostringstream& theStr);
 
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap)
-      throw(std::logic_error&);
+    virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
     static const string myComment;
     virtual const char* GetComment() const;
     virtual QString GenerateName();
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL)
-      throw (std::runtime_error&);
-    virtual void UpdateActor(VISU_Actor* theActor) throw(std::runtime_error&);
+    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
+    virtual void UpdateActor(VISU_Actor* theActor) ;
   };
 }
 #endif
index 61da0aab79dcf841e14f67ec72cb56edc9bbee9a..1ec6ddfbfb34859f81dcbb5d57ddb1be864443e0 100644 (file)
@@ -43,6 +43,8 @@
 #include "VISU_ScalarBarActor.hxx"
 #include "VISU_Actor.h"
 
+#include "SALOME_Event.hxx"
+
 #include "QAD_Application.h"
 #include "QAD_Desktop.h"
 #include "QAD_Tools.h"
@@ -78,6 +80,67 @@ static int MYDELAY = 1;
 
 namespace VISU{
   //===========================================================================
+  typedef TVoidMemFunEvent<QAD_StudyFrame> TFrameActionEvent;
+
+  template<class TObject>
+  class TSetBackgroundEvent: public SALOME_Event{
+    TObject* myView;
+    const SALOMEDS::Color& myColor;
+  public:
+    TSetBackgroundEvent(TObject* theView, const SALOMEDS::Color& theColor):
+      myView(theView), myColor(theColor)
+    {}
+    virtual void Execute(){
+      int aColor[3];
+      aColor[0] = int(255.0*myColor.R);
+      aColor[1] = int(255.0*myColor.G);
+      aColor[2] = int(255.0*myColor.B);
+      QColor aNewColor(aColor[0],aColor[1],aColor[2]);
+      myView->setBackgroundColor(aNewColor);
+    }
+  };
+
+
+  class TSavePictureEvent: public SALOME_Event{
+    QWidget* myWidget;
+    const char* myFileName;
+  public:
+    typedef CORBA::Boolean TResult;
+    TResult myResult;
+    TSavePictureEvent(QWidget* theWidget, const char* theFileName):
+      myWidget(theWidget),
+      myFileName(theFileName),
+      myResult(false)
+    {}
+    virtual void Execute(){
+      if(myWidget){
+       QPixmap px = QPixmap::grabWindow(myWidget->winId());
+       if (!QString(myFileName).isNull()) {
+         QString fmt = QAD_Tools::getFileExtensionFromPath(myFileName).upper();
+         if (fmt.isEmpty())
+           fmt = QString("BMP"); // default format
+         if (fmt == "JPG")
+           fmt = "JPEG";
+         myResult = px.save(myFileName, fmt.latin1());
+       }
+      }
+    }
+  };
+
+
+  void RepaintView(QAD_StudyFrame* theStudyFrame);
+  class TRepaintViewEvent: public SALOME_Event{
+    QAD_StudyFrame* myStudyFrame;
+  public:
+    TRepaintViewEvent(QAD_StudyFrame* theStudyFrame):
+      myStudyFrame(theStudyFrame)
+    {}
+    virtual void Execute(){
+      RepaintView(myStudyFrame);
+    }
+  };
+  
+
   VTKViewer_ViewFrame* GetViewFrame(QAD_StudyFrame* theStudyFrame){
     return dynamic_cast<VTKViewer_ViewFrame*>(theStudyFrame->getRightFrame()->getViewFrame());
   }
@@ -87,11 +150,15 @@ namespace VISU{
   vtkCamera* GetCamera(QAD_StudyFrame* theStudyFrame){
     return GetRenderer(theStudyFrame)->GetActiveCamera();
   }
+
+
   void RepaintView(QAD_StudyFrame* theStudyFrame){
     GetRenderer(theStudyFrame)->ResetCameraClippingRange();
     GetViewFrame(theStudyFrame)->getRW()->getRenderWindow()->Render();
     //GetViewFrame(theStudyFrame)->Repaint();
   }
+
+
   VISU_Actor* UpdateViewer(QAD_StudyFrame* theStudyFrame, int theDisplaing, Prs3d_i* thePrs){
     VTKViewer_ViewFrame* vf = GetViewFrame(theStudyFrame);
     if (!vf) return NULL;
@@ -213,126 +280,153 @@ namespace VISU{
       }
     }
   }
-  //===========================================================================
-  /*
-  #include <qthread.h> 
-  class TViewManager: public QThread{
-  public:
-    TViewManager(SALOMEDS::Study_ptr theStudy) : myStudyDocument(theStudy) {};
-    virtual void run(){
-      qApp->lock();
-      QAD_Desktop* aDesktop = QAD_Application::getDesktop();
-      QAD_Study* aStudy = aDesktop->findStudy(myStudyDocument);
-      if(!aStudy){
-       CORBA::String_var aName = myStudyDocument->Name();
-       aFileInfo.setFile(aName.in());
+
+  QAD_Study* CheckStudy( SALOMEDS::Study_ptr theStudy ) {
+    QAD_Desktop* aDesktop = QAD_Application::getDesktop();
+    QAD_Study* aStudy = aDesktop->findStudy(theStudy);
+    if(!aStudy){
+      CORBA::String_var aName = theStudy->Name();
+      aFileInfo.setFile(aName.in());
+      if (aFileInfo.exists()) 
        aStudy = aDesktop->loadStudy(aFileInfo.baseName());
+      else 
+       aStudy = aDesktop->loadStudy(aName.in());
+      if (!aStudy) {
+       MESSAGE("CheckStudy()::ERROR: Can't load study");
       }
-      qApp->unlock();
     }
-    SALOMEDS::Study_ptr myStudyDocument;
-  };
-  */
+    return aStudy;
+  }
+  //===========================================================================
   ViewManager_i::ViewManager_i(SALOMEDS::Study_ptr theStudy) {
     if(MYDEBUG) MESSAGE("ViewManager_i::ViewManager_i");
-    Mutex mt(myMutex,qApp,MYDELAY);
     myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
-    //TViewManager* aTViewManager = new TViewManager(theStudy);
-    //aTViewManager->start();
-    QAD_Desktop* aDesktop = QAD_Application::getDesktop();
-    QAD_Study* aStudy = aDesktop->findStudy(theStudy);
-    if(!aStudy){
-       CORBA::String_var aName = theStudy->Name();
-       aFileInfo.setFile(aName.in());
-       if (aFileInfo.exists()) 
-         aStudy = aDesktop->loadStudy(aFileInfo.baseName());
-       else aStudy = aDesktop->loadStudy(aName.in());
-       if (!aStudy)
-         MESSAGE("ViewManager_i::ERROR: Can't load study");
-    }
   }
 
 
-  VISU::View3D_ptr ViewManager_i::Create3DView(){
-    Mutex mt(myMutex,qApp,MYDELAY);
-    if(MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
-    VISU::View3D_i* pView = new View3D_i(myStudyDocument);
-    if(pView->Create(1) != NULL) 
-      return VISU::View3D::_duplicate(pView->_this());
-    return VISU::View3D::_nil();
+  VISU::View_ptr ViewManager_i::GetCurrentView(){
+    class TEvent: public SALOME_Event{
+      SALOMEDS::Study_ptr myStudyDocument;
+    public:
+      TEvent( SALOMEDS::Study_ptr theStudy):
+       myStudyDocument(theStudy)
+      {}
+      virtual void Execute(){
+       if(QAD_Study* aStudy = QAD_Application::getDesktop()->findStudy( myStudyDocument )){
+         if ( QAD_StudyFrame* aStudyFrame = aStudy->getActiveStudyFrame() ) {
+           if(MYDEBUG) 
+             MESSAGE("GetCurrentView::Execute - TypeView = "<<aStudyFrame->getTypeView());
+           if ( aStudyFrame->getTypeView() == VIEW_VTK ) {
+             VISU::View3D_i* pView = new View3D_i(myStudyDocument);
+             if(pView->Create(0)) 
+               myResult = pView->_this();
+           } else if ( aStudyFrame->getTypeView() == VIEW_PLOT2D ) {
+             VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
+             if(pView->Create(0)) 
+               myResult = pView->_this();
+           }
+         }
+       }
+      }
+      typedef VISU::View_var TResult;
+      TResult myResult;
+    };
+    TEvent* ve = new TEvent( myStudyDocument );
+    ve->process();
+    TEvent::TResult aResult = ve->myResult;
+    ve->release();
+    return aResult._retn();
   }
+  
+  
+  class TCreateViewEvent: public SALOME_Event{
+  public:
+    TCreateViewEvent( SALOMEDS::Study_ptr theStudy):
+      myStudyDocument(theStudy)
+    {};
+  protected:
+    SALOMEDS::Study_ptr myStudyDocument;
+  };
 
 
-  VISU::View_ptr ViewManager_i::GetCurrentView(){
-    Mutex mt(myMutex,qApp,MYDELAY);
-    QAD_Study* Study = QAD_Application::getDesktop()->findStudy( myStudyDocument );
-    if(MYDEBUG) MESSAGE("ViewManager_i::GetCurrent3DView - Study = "<<Study);
-    QAD_StudyFrame* StudyFrame;
-    if ( Study && ( StudyFrame = Study->getActiveStudyFrame() ) ) {
-      if(MYDEBUG) 
-       MESSAGE("ViewManager_i::GetCurrent3DView - TypeView = "<<StudyFrame->getTypeView());
-      if ( StudyFrame->getTypeView() == VIEW_VTK ) {
-       VISU::View3D_i* pView = new View3D_i(myStudyDocument);
-       if(pView->Create(0) != NULL) 
-         return VISU::View3D::_duplicate(pView->_this());
-      }
-      else if ( StudyFrame->getTypeView() == VIEW_PLOT2D ) {
-       VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
-       if(pView->Create(0) != NULL) 
-         return VISU::XYPlot::_duplicate(pView->_this());
+  template<class TViewFrame>
+  class TCreateViewFrameEvent: public TCreateViewEvent{
+  public:
+    typedef typename TViewFrame::TInterface TInterface;
+    typedef typename TInterface::_ptr_type TResult;
+    TResult myResult;
+    TCreateViewFrameEvent(SALOMEDS::Study_ptr theStudy):
+      TCreateViewEvent(theStudy),
+      myResult(TInterface::_nil())
+    {}
+    virtual void Execute(){
+      if(CheckStudy(myStudyDocument)){
+       TViewFrame* pView = new TViewFrame(myStudyDocument);
+       if(pView->Create(1)) 
+         myResult = pView->_this();
       }
     }
-    return VISU::View::_nil();
-  }
+  };
+
 
+  VISU::View3D_ptr ViewManager_i::Create3DView(){
+    if(MYDEBUG) MESSAGE("ViewManager_i::Create3DView");
+    return ProcessEvent(new TCreateViewFrameEvent<VISU::View3D_i>(myStudyDocument));
+  }
 
+  
   VISU::XYPlot_ptr ViewManager_i::CreateXYPlot(){
     if(MYDEBUG) MESSAGE("ViewManager_i::CreateXYPlot");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    VISU::XYPlot_i* pView = new XYPlot_i(myStudyDocument);
-    if(pView->Create(1) != NULL) 
-      return VISU::XYPlot::_duplicate(pView->_this());
-    return VISU::XYPlot::_nil();
+    return ProcessEvent(new TCreateViewFrameEvent<VISU::XYPlot_i>(myStudyDocument));
   }
 
 
   VISU::TableView_ptr ViewManager_i::CreateTableView(VISU::Table_ptr theTable){
+    class TEvent: public TCreateViewEvent{
+      Table_ptr myTable;
+    public:
+      TEvent(SALOMEDS::Study_ptr theStudy,
+            Table_ptr theTable):
+       TCreateViewEvent(theStudy),
+       myTable(theTable)
+      {}
+      virtual void Execute(){
+       if ( CheckStudy( myStudyDocument ) ) {
+         VISU::TableView_i* pView = new TableView_i(myStudyDocument);
+         if(pView->Create(myTable) != NULL) 
+           myResult = pView->_this();
+       }
+      }
+      typedef VISU::TableView_var TResult;
+      TResult myResult;
+    };
     if(MYDEBUG) MESSAGE("ViewManager_i::CreateTableView");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    VISU::TableView_i* pView = new TableView_i(myStudyDocument);
-    if(pView->Create(VISU::Table::_duplicate(theTable)) != NULL) 
-      return VISU::TableView::_duplicate(pView->_this());
-    return VISU::TableView::_nil();
+    TEvent* ve = new TEvent(myStudyDocument,theTable);
+    ve->process();
+    TEvent::TResult aResult = ve->myResult;
+    ve->release();
+    return aResult._retn();
   }
 
 
   void ViewManager_i::Destroy(View_ptr theView){
-    if(MYDEBUG) MESSAGE("ViewManager_i::Destroy - "<<theView->_is_nil());
-    if(theView->_is_nil()) return;
-    CORBA::Object_var aView = VISU::View::_narrow(theView);
-    if(!CORBA::is_nil(aView)){
-      if(MYDEBUG) MESSAGE("ViewManager_i::Destroy - VISU::View"<<(!CORBA::is_nil(aView)));
-      VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(aView).in());
-      if(MYDEBUG) MESSAGE("ViewManager_i::Destroy - dynamic_cast"<<pView);
-      if(pView) {
-       pView->Close();
-       pView->_remove_ref();
+    class TEvent: public SALOME_Event{
+      View_ptr myView;
+    public:
+      TEvent(View_ptr theView):
+       myView(theView)
+      {}
+      virtual void Execute(){
+       if(!CORBA::is_nil(myView)){
+         if(VISU::View_i* pView = dynamic_cast<VISU::View_i*>(VISU::GetServant(myView).in())) {
+           pView->Close();
+           pView->_remove_ref();
+         }
+       }
       }
-      //if(pView) delete pView;
-      return;
-    }
-  }
-
-
-  void ViewManager_i::ProcessEvents() {
-    while (true) {
-      qApp->lock();
-      qApp->syncX();
-      qApp->flushX(); 
-      qApp->processEvents();
-      qApp->unlock();
-      //sleep(1);
-    }
+    };
+    if(MYDEBUG) MESSAGE("ViewManager_i::Destroy - "<<theView->_is_nil());
+    ProcessVoidEvent(new TEvent(theView));
   }
 
 
@@ -340,14 +434,7 @@ namespace VISU{
   View_i::View_i(SALOMEDS::Study_ptr theStudy) {
     if(MYDEBUG) MESSAGE("View_i::View_i");
     CORBA::String_var aName = theStudy->Name();
-    QAD_Desktop* aDesktop = QAD_Application::getDesktop();
-    myStudy = aDesktop->findStudy(theStudy);
-    if(!myStudy){
-      aFileInfo.setFile(aName.in());
-      if ( aFileInfo.exists() )
-       myStudy = aDesktop->loadStudy(aFileInfo.baseName());
-      else myStudy = aDesktop->loadStudy(aName.in());
-    }
+    myStudy = CheckStudy(theStudy);
     if(MYDEBUG) MESSAGE("View_i::View_i - isStudyOpened = "<<myStudy<<"; aName = "<<aName.in());
   }
 
@@ -372,342 +459,302 @@ namespace VISU{
   const char* View_i::GetComment() const { return "";}
   void View_i::ToStream(std::ostringstream& theStr) {}
 
-  const char* View_i::GetEntry(){ 
+  string View_i::GetEntry(){ 
     SALOMEDS::SObject_var aSObject = myStudy->getStudyDocument()->FindObjectIOR(GetID());
     CORBA::String_var anEntry = aSObject->GetID();
-    string aString(anEntry);
-    if(MYDEBUG) MESSAGE("Result_i::GetEntry - "<<aString);
-    return aString.c_str();
+    return string(anEntry.in());
   }
+
+
   //===========================================================================
   XYPlot_i::XYPlot_i(SALOMEDS::Study_ptr theStudy) : View_i(theStudy) {
     if(MYDEBUG) MESSAGE("XYPlot_i::XYPlot_i");
   }
+
   Storable* XYPlot_i::Create(int theNew){
-    if(MYDEBUG) MESSAGE("XYPlot_i::Create");
-    Mutex mt(myMutex,qApp,MYDELAY);
     if(theNew)
       myStudyFrame = myStudy->newWindow3d("",VIEW_PLOT2D);
     else
       myStudyFrame = myStudy->getActiveStudyFrame();
     myView = dynamic_cast<Plot2d_ViewFrame*>(myStudyFrame->getRightFrame()->getViewFrame());
-    Update();
+    myView->Repaint();
     return this;
   } 
+
+
   void XYPlot_i::Update() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Update");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = (const char*)(myStudyFrame->title());
-    myView->Repaint();
+    ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::Repaint));
   }
+
+
   void XYPlot_i::Close(){
-    if(MYDEBUG) MESSAGE("XYPlot_i::Close");
-    Mutex mt(myMutex,qApp,MYDELAY);
     myStudyFrame->close();
   }
+
   XYPlot_i::~XYPlot_i() {
     if(MYDEBUG) MESSAGE("XYPlot_i::~XYPlot_i");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->close();
   }
+
+
   void XYPlot_i::SetTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = theTitle;
-    myStudyFrame->setCaption(myName.c_str());
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
+                    (myStudyFrame,&QAD_StudyFrame::setCaption,QString(theTitle)));
   }
   char* XYPlot_i::GetTitle() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetTitle");
-    Mutex mt(myMutex,qApp);
-    myName = (const char*)(myStudyFrame->title());
-    return CORBA::string_dup(myName.c_str());
+    return CORBA::string_dup(myStudyFrame->title().latin1());
   }
 
+
   void XYPlot_i::SetSubTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetSubTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setTitle(theTitle);
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<Plot2d_ViewFrame,const QString&,QString>
+                    (myView,&Plot2d_ViewFrame::setTitle,QString(theTitle)));
   }
   char* XYPlot_i::GetSubTitle() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetSubTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
     return CORBA::string_dup(myView->getTitle());
   }
 
+
   void XYPlot_i::SetCurveType(VISU::XYPlot::CurveType theType){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetCurveType");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setCurveType(theType);
+    ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+                    (myView,&Plot2d_ViewFrame::setCurveType,theType,true));
   }
   VISU::XYPlot::CurveType XYPlot_i::GetCurveType(){
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetCurveType");
-    Mutex mt(myMutex,qApp);
     return (VISU::XYPlot::CurveType)myView->getCurveType();
   }
 
+
   void XYPlot_i::SetMarkerSize(CORBA::Long theSize){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetMarkerSize");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setMarkerSize(theSize);
+    ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,int,bool>
+                    (myView,&Plot2d_ViewFrame::setMarkerSize,theSize,true));
   }
   CORBA::Long XYPlot_i::GetMarkerSize(){
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetMarkerSize");
-    Mutex mt(myMutex,qApp);
     return myView->getMarkerSize();
   }
 
+
+  class TEnbleGridEvent: public SALOME_Event{
+  public:
+    typedef void (Plot2d_ViewFrame::* TFun)(bool, const int, bool, const int, bool = true);
+    TEnbleGridEvent(Plot2d_ViewFrame* theView, TFun theFun,
+                   CORBA::Boolean theMajor, CORBA::Long theNumMajor, 
+                   CORBA::Boolean theMinor, CORBA::Long theNumMinor):
+      myView(theView), myFun(theFun),
+      myMajor(theMajor), myNumMajor(theNumMajor),
+      myMinor(theMinor), myNumMinor(theNumMinor)
+    {}
+    virtual void Execute(){
+      (myView->*myFun)(myMajor,myNumMajor,myMinor,myNumMinor);
+    }
+  protected:
+    Plot2d_ViewFrame* myView;
+    TFun myFun;
+    CORBA::Boolean myMajor, myNumMajor;
+    CORBA::Boolean myMinor, myNumMinor;
+  };
+
+
   void XYPlot_i::EnableXGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor, 
-                            CORBA::Boolean theMinor, CORBA::Long theNumMinor){
-    if(MYDEBUG) MESSAGE("XYPlot_i::EnableXGrid");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setXGrid(theMajor,theNumMajor,theMinor,theNumMinor);
+                            CORBA::Boolean theMinor, CORBA::Long theNumMinor)
+  {
+    ProcessVoidEvent(new TEnbleGridEvent(myView,&Plot2d_ViewFrame::setXGrid,
+                                        theMajor,theNumMajor,theMinor,theNumMinor));
   }
   void XYPlot_i::EnableYGrid(CORBA::Boolean theMajor, CORBA::Long theNumMajor, 
-                            CORBA::Boolean theMinor, CORBA::Long theNumMinor){
-    if(MYDEBUG) MESSAGE("XYPlot_i::EnableYGrid");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setYGrid(theMajor,theNumMajor,theMinor,theNumMinor);
+                            CORBA::Boolean theMinor, CORBA::Long theNumMinor)
+  {
+    ProcessVoidEvent(new TEnbleGridEvent(myView,&Plot2d_ViewFrame::setYGrid,
+                                        theMajor,theNumMajor,theMinor,theNumMinor));
   }
 
+
+  class TSetScaleModeEvent: public SALOME_Event{
+  public:
+    typedef void (Plot2d_ViewFrame::* TFun)(const int, bool = true);
+    TSetScaleModeEvent(Plot2d_ViewFrame* theView, TFun theFun, int theScaling):
+      myView(theView), myFun(theFun), myScaling(theScaling)
+    {}
+    virtual void Execute(){
+      (myView->*myFun)(myScaling);
+    }
+  protected:
+    Plot2d_ViewFrame* myView;
+    TFun myFun;
+    int myScaling;
+  };
+
+
   void XYPlot_i::SetHorScaling(VISU::Scaling theScaling){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetHorScaling");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    if(theScaling == VISU::LOGARITHMIC)
-      myView->setHorScaleMode(1);
-    else
-      myView->setHorScaleMode(0);
+    ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setHorScaleMode,
+                                           theScaling == VISU::LOGARITHMIC));
   }
   VISU::Scaling XYPlot_i::GetHorScaling(){
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetHorScaling");
-    Mutex mt(myMutex,qApp,MYDELAY);
     return (VISU::Scaling)myView->getHorScaleMode();
   }
 
+
   void XYPlot_i::SetVerScaling(VISU::Scaling theScaling){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetVerScaling");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    if(theScaling == VISU::LOGARITHMIC)
-      myView->setVerScaleMode(1);
-    else
-      myView->setVerScaleMode(0);
+    ProcessVoidEvent(new TSetScaleModeEvent(myView,&Plot2d_ViewFrame::setVerScaleMode,
+                                           theScaling == VISU::LOGARITHMIC));
   }
   VISU::Scaling XYPlot_i::GetVerScaling(){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetVerScaling");
-    Mutex mt(myMutex,qApp);
     return (VISU::Scaling)myView->getVerScaleMode();
   }
 
+
+  class TSetTitleEvent: public SALOME_Event{
+  public:
+    typedef void (Plot2d_ViewFrame::* TFun)(bool, const QString&, bool = true);
+    TSetTitleEvent(Plot2d_ViewFrame* theView, TFun theFun, const char* theTitle):
+      myView(theView), myFun(theFun), myTitle(theTitle)
+    {}
+    virtual void Execute(){
+      (myView->*myFun)(true,myTitle);
+    }
+  protected:
+    Plot2d_ViewFrame* myView;
+    TFun myFun;
+    const char* myTitle;
+  };
+
+
   void XYPlot_i::SetXTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetXTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setXTitle(true,theTitle);
+    ProcessVoidEvent(new TSetTitleEvent(myView,&Plot2d_ViewFrame::setXTitle,theTitle));
   }
   char* XYPlot_i::GetXTitle() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetXTitle");
-    Mutex mt(myMutex,qApp);
     return CORBA::string_dup(myView->getXTitle());
   }
 
+
   void XYPlot_i::SetYTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetYTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->setYTitle(true,theTitle);
+    ProcessVoidEvent(new TSetTitleEvent(myView,&Plot2d_ViewFrame::setYTitle,theTitle));
   }
   char* XYPlot_i::GetYTitle() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetYTitle");
-    Mutex mt(myMutex,qApp);
     return CORBA::string_dup(myView->getYTitle());
   }
 
+
   void XYPlot_i::ShowLegend(CORBA::Boolean theShowing){
-    if(MYDEBUG) MESSAGE("XYPlot_i::ShowLegend");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->showLegend(theShowing);
+    ProcessVoidEvent(new TVoidMemFun2ArgEvent<Plot2d_ViewFrame,bool,bool>
+                    (myView,&Plot2d_ViewFrame::showLegend,theShowing,true));
   }
 
+
   void XYPlot_i::SetBackground(const SALOMEDS::Color& theColor){
-    if(MYDEBUG) MESSAGE("XYPlot_i::SetBackground");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    int aColor[3];
-    aColor[0] = (int)(255.0*theColor.R);
-    aColor[1] = (int)(255.0*theColor.G);
-    aColor[2] = (int)(255.0*theColor.B);
-    QColor aNewColor(aColor[0],aColor[1],aColor[2]);
-    myView->setBackgroundColor(aNewColor);
+    ProcessVoidEvent(new TSetBackgroundEvent<Plot2d_ViewFrame>(myView,theColor));
   }
   SALOMEDS::Color XYPlot_i::GetBackground() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::GetBackground");
-    Mutex mt(myMutex,qApp);
     SALOMEDS::Color aColor;
     aColor.R = myView->backgroundColor().red()/255.0;
     aColor.G = myView->backgroundColor().green()/255.0;
     aColor.B = myView->backgroundColor().blue()/255.0;
     return aColor;
   }
+
   void XYPlot_i::Minimize() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Minimize");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showMinimized();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame,&QAD_StudyFrame::showMinimized));
   }
+
   void XYPlot_i::Restore() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Restore");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showNormal();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame, &QAD_StudyFrame::showNormal));
   }
+
   void XYPlot_i::Maximize() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Maximize");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showMaximized();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame, &QAD_StudyFrame::showMaximized));
   }
-  void XYPlot_i::Display(PrsObject_ptr thePrsObj) {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Display"); 
-    Mutex mt(myMutex,qApp,MYDELAY);
-    CORBA::Object_ptr anObj = thePrsObj;
-    // is it Curve ?
-    if(Curve_i* aCurve =  dynamic_cast<Curve_i*>(VISU::GetServant(anObj).in())) {
-      UpdatePlot2d(myView,eDisplay,aCurve);
-    }
-    // is it Container ?
-    if(Container_i* aContainer =  dynamic_cast<Container_i*>(VISU::GetServant(anObj).in())) {
-      int nbCurves = aContainer->GetNbCurves();
-      for ( int i = 1; i <= nbCurves; i++ ) {
-       VISU::Curve_i* aCurve = aContainer->GetCurve( i );
-       if ( aCurve && aCurve->IsValid() ) {
-         UpdatePlot2d(myView,eDisplay,aCurve);
-       }
+
+
+  class TXYPlotViewEvent: public SALOME_Event{
+    QAD_Study* myStudy;
+    Plot2d_ViewFrame* myView;
+    PrsObject_ptr myPrsObj;
+    int myDisplaing;
+  public:
+    TXYPlotViewEvent(QAD_Study* theStudy, 
+                    Plot2d_ViewFrame* theView, 
+                    PrsObject_ptr thePrsObj, 
+                    int theDisplaing):
+      myStudy(theStudy),
+      myView(theView), 
+      myPrsObj(thePrsObj), 
+      myDisplaing(theDisplaing)
+    {}
+    virtual void Execute(){
+      // is it Curve ?
+      if(Curve_i* aCurve =  dynamic_cast<Curve_i*>(VISU::GetServant(myPrsObj).in())) {
+       UpdatePlot2d(myView,myDisplaing,aCurve);
       }
-      myView->Repaint();
-    }
-    // is it Table ?
-    if(Table_i* aTable =  dynamic_cast<Table_i*>(VISU::GetServant(anObj).in())) {
-      SALOMEDS::SObject_var TableSO = myStudy->getStudyDocument()->FindObjectID( aTable->GetEntry() );
-      if ( !TableSO->_is_nil() ) {
-       SALOMEDS::ChildIterator_var Iter = myStudy->getStudyDocument()->NewChildIterator( TableSO );
-         for ( ; Iter->More(); Iter->Next() ) {
-         CORBA::Object_var childObject = VISU::SObjectToObject( Iter->Value() );
-         if( !CORBA::is_nil( childObject ) ) {
-           CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
-           if( !CORBA::is_nil( aCurve ) )
-             UpdatePlot2d(myView,eDisplay,dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aCurve).in()));
+      // is it Container ?
+      if(Container_i* aContainer =  dynamic_cast<Container_i*>(VISU::GetServant(myPrsObj).in())) {
+       int nbCurves = aContainer->GetNbCurves();
+       for ( int i = 1; i <= nbCurves; i++ ) {
+         VISU::Curve_i* aCurve = aContainer->GetCurve( i );
+         if ( aCurve && aCurve->IsValid() ) {
+           UpdatePlot2d(myView,myDisplaing,aCurve);
          }
        }
        myView->Repaint();
       }
-    }
-  }
-  void XYPlot_i::Erase(PrsObject_ptr thePrsObj) {
-    if(MYDEBUG) MESSAGE("XYPlot_i::Erase"); 
-    Mutex mt(myMutex,qApp,MYDELAY);
-    CORBA::Object_ptr anObj = thePrsObj;
-    // is it Curve ?
-    if(Curve_i* aCurve =  dynamic_cast<Curve_i*>(VISU::GetServant(anObj).in())) {
-      UpdatePlot2d(myView,eErase,aCurve);
-    }
-    // is it Container ?
-    if(Container_i* aContainer =  dynamic_cast<Container_i*>(VISU::GetServant(anObj).in())) {
-      int nbCurves = aContainer->GetNbCurves();
-      for ( int i = 1; i <= nbCurves; i++ ) {
-       VISU::Curve_i* aCurve = aContainer->GetCurve( i );
-       if ( aCurve && aCurve->IsValid() ) {
-         UpdatePlot2d(myView,eErase,aCurve);
-       }
-      }
-      myView->Repaint();
-    }
-    // is it Table ?
-    if(Table_i* aTable =  dynamic_cast<Table_i*>(VISU::GetServant(anObj).in())) {
-      SALOMEDS::SObject_var TableSO = myStudy->getStudyDocument()->FindObjectID( aTable->GetEntry() );
-      if ( !TableSO->_is_nil() ) {
-       SALOMEDS::ChildIterator_var Iter = myStudy->getStudyDocument()->NewChildIterator( TableSO );
+      // is it Table ?
+      if(Table_i* aTable =  dynamic_cast<Table_i*>(VISU::GetServant(myPrsObj).in())) {
+       SALOMEDS::Study_var aStudy = myStudy->getStudyDocument();
+       SALOMEDS::SObject_var TableSO = aStudy->FindObjectID( aTable->GetEntry() );
+       if ( !TableSO->_is_nil() ) {
+         SALOMEDS::ChildIterator_var Iter = aStudy->NewChildIterator( TableSO );
          for ( ; Iter->More(); Iter->Next() ) {
-         CORBA::Object_var childObject = VISU::SObjectToObject( Iter->Value() );
-         if( !CORBA::is_nil( childObject ) ) {
-           CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
-           if( !CORBA::is_nil( aCurve ) )
-             UpdatePlot2d(myView,eErase,dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aCurve).in()));
+           CORBA::Object_var childObject = VISU::SObjectToObject( Iter->Value() );
+           if( !CORBA::is_nil( childObject ) ) {
+             CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
+             if( !CORBA::is_nil( aCurve ) )
+               UpdatePlot2d(myView,myDisplaing,dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aCurve).in()));
+           }
          }
+         myView->Repaint();
        }
-       myView->Repaint();
       }
     }
+  };
+
+
+  void XYPlot_i::Display(PrsObject_ptr thePrsObj) {
+    ProcessVoidEvent(new TXYPlotViewEvent(myStudy,myView,thePrsObj,eDisplay));
   }
-  void XYPlot_i::EraseAll() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::EraseAll");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->EraseAll();
+
+
+  void XYPlot_i::Erase(PrsObject_ptr thePrsObj) {
+    ProcessVoidEvent(new TXYPlotViewEvent(myStudy,myView,thePrsObj,eErase));
   }
+
+
   void XYPlot_i::DisplayOnly(PrsObject_ptr thePrsObj) {
-    if(MYDEBUG) MESSAGE("XYPlot_i::DisplayOnly"); 
-    Mutex mt(myMutex,qApp,MYDELAY);
-    CORBA::Object_ptr anObj = thePrsObj;
-    // is it Curve ?
-    if(Curve_i* aCurve =  dynamic_cast<Curve_i*>(VISU::GetServant(anObj).in())) {
-      UpdatePlot2d(myView,eDisplayOnly,aCurve);
-    }
-    // is it Container ?
-    if(Container_i* aContainer =  dynamic_cast<Container_i*>(VISU::GetServant(anObj).in())) {
-      int nbCurves = aContainer->GetNbCurves();
-      for ( int i = 1; i <= nbCurves; i++ ) {
-       VISU::Curve_i* aCurve = aContainer->GetCurve( i );
-       if ( aCurve && aCurve->IsValid() ) {
-         UpdatePlot2d(myView,eDisplayOnly,aCurve);
-       }
-      }
-      myView->Repaint();
-    }
-    // is it Table ?
-    if(Table_i* aTable =  dynamic_cast<Table_i*>(VISU::GetServant(anObj).in())) {
-      SALOMEDS::SObject_var TableSO = myStudy->getStudyDocument()->FindObjectID( aTable->GetEntry() );
-      if ( !TableSO->_is_nil() ) {
-       SALOMEDS::ChildIterator_var Iter = myStudy->getStudyDocument()->NewChildIterator( TableSO );
-         for ( ; Iter->More(); Iter->Next() ) {
-         CORBA::Object_var childObject = VISU::SObjectToObject( Iter->Value() );
-         if( !CORBA::is_nil( childObject ) ) {
-           CORBA::Object_ptr aCurve = VISU::Curve::_narrow( childObject );
-           if( !CORBA::is_nil( aCurve ) )
-             UpdatePlot2d(myView,eDisplayOnly,dynamic_cast<VISU::Curve_i*>( VISU::GetServant(aCurve).in()));
-         }
-       }
-       myView->Repaint();
-      }
-    }
+    ProcessVoidEvent(new TXYPlotViewEvent(myStudy,myView,thePrsObj,eDisplayOnly));
+  }
+
+
+  void XYPlot_i::EraseAll() {
+    ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::EraseAll));
   }
+
+
   void XYPlot_i::FitAll() {
-    if(MYDEBUG) MESSAGE("XYPlot_i::FitAll");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myView->fitAll();
+    ProcessVoidEvent(new TVoidMemFunEvent<Plot2d_ViewFrame>(myView,&Plot2d_ViewFrame::fitAll));
   }
+
+
   CORBA::Boolean XYPlot_i::SavePicture(const char* theFileName) {
-    if(MYDEBUG) MESSAGE("XYPlot_i::SavePicture");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    if (!myView->getViewWidget())
-      return false;
-
-    QApplication::setOverrideCursor( Qt::waitCursor );
-    QPixmap px = QPixmap::grabWindow(myView->getViewWidget()->winId());
-    QApplication::restoreOverrideCursor();
-    
-    if (!QString(theFileName).isNull()) {
-      QApplication::setOverrideCursor( Qt::waitCursor );
-      QString fmt = QAD_Tools::getFileExtensionFromPath(theFileName).upper();
-      if (fmt.isEmpty())
-       fmt = QString("BMP"); // default format
-      if (fmt == "JPG")
-       fmt = "JPEG";
-      bool bOk = px.save(theFileName, fmt.latin1());
-      QApplication::restoreOverrideCursor();
-      return bOk;
-    }
-    return false;
+    TSavePictureEvent* ve = new TSavePictureEvent(myView->getViewWidget(),theFileName);
+    ve->process();
+    TSavePictureEvent::TResult aResult = ve->myResult;
+    ve->release();
+    return aResult;
   }
 
+
   //===========================================================================
   TableView_i::TableView_i(SALOMEDS::Study_ptr theStudy) : View_i(theStudy) {}
-  Storable* TableView_i::Create(VISU::Table_var theTable){
+  Storable* TableView_i::Create(VISU::Table_ptr theTable){
     if(MYDEBUG) MESSAGE("TableView_i::Create - "<<(!theTable->_is_nil()));
-    Mutex mt(myMutex,qApp,MYDELAY);
     if(!theTable->_is_nil()){
-      VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(theTable.in()).in());
+      VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(theTable).in());
       if(MYDEBUG) MESSAGE("TableView_i::Create - dynamic_cast = "<<table);
       if(table != NULL) {
        SALOMEDS::SObject_var aSObject = myStudy->getStudyDocument()->FindObjectID(table->GetObjectEntry());
@@ -718,36 +765,36 @@ namespace VISU{
                                          SALOMEGUI_TableDlg::ttAuto, 
                                          Qt::Vertical);
          myView->show();
-         myName = (myView->caption()).latin1();
          return this;
        }
       }
     }
     return NULL;
   }
+
+
+  TableView_i::~TableView_i() {
+    if(MYDEBUG) MESSAGE("TableView_i::~TableView_i");
+    delete myView;
+  }
+
+
   void TableView_i::SetTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("TableView_i::SetTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = theTitle;
-    myView->setCaption(myName.c_str());
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<SALOMEGUI_TableDlg,const QString&,QString>
+                    (myView,&SALOMEGUI_TableDlg::setCaption,QString(theTitle)));
   }
+
+
   char* TableView_i::GetTitle() {
-    if(MYDEBUG) MESSAGE("TableView_i::GetTitle");
-    Mutex mt(myMutex,qApp);
-    myName = (myView->caption()).latin1();
-    return CORBA::string_dup(myName.c_str());
+    return CORBA::string_dup(myView->caption().latin1());
   }
+
+
   void TableView_i::Close(){
-    if(MYDEBUG) MESSAGE("TableView_i::Close");
-    Mutex mt(myMutex,qApp,MYDELAY);
     myView->close();
   }
-  TableView_i::~TableView_i() {
-    if(MYDEBUG) MESSAGE("TableView_i::~TableView_i");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    Close();
-    delete myView;
-  }
+
+
   //===========================================================================
   int View3D_i::myNbViewParams = 0;
   const string View3D_i::myComment = "VIEW3D";
@@ -766,131 +813,86 @@ namespace VISU{
       myStudyFrame = myStudy->newWindow3d("",VIEW_VTK);
     else
       myStudyFrame = myStudy->getActiveStudyFrame();
+    return this;
+  }
 
-    //GetViewFrame(myStudyFrame)->GetScale(myScaleFactor);
-
-    return this; //Build(false);
-  }
-
-//   Storable* View3D_i::Build(int theRestoring){
-//     if(MYDEBUG) MESSAGE("View3D_i::Build");
-//     if(theRestoring){
-//       myStudyFrame->setTitle(myName.c_str());
-//       SetBackground(myColor);
-//       SetPointOfView(myPosition);
-//       SetViewUp(myViewUp);
-//       SetFocalPoint(myFocalPnt);
-//       SetParallelScale(myParallelScale);
-//       ScaleView(VISU::View3D::XAxis,myScaleFactor[0]);
-//       ScaleView(VISU::View3D::YAxis,myScaleFactor[1]);
-//       ScaleView(VISU::View3D::ZAxis,myScaleFactor[2]);
-//       RepaintView(myStudyFrame);
-//     }else{
-//       Update();
-      
-//       SALOMEDS::SComponent_var aSComponent = FindOrCreateVisuComponent(myStudyDocument);
-//       CORBA::String_var aSComponentEntry = aSComponent->GetID(), anIOR(GetID());
-//       string anEntry = CreateAttributes(myStudyDocument,aSComponentEntry,"",anIOR,myName.c_str(),"",GetComment());
-      
-//     }
-//     return this;
-//   }
 
   void View3D_i::Update(){
-    if(MYDEBUG) MESSAGE("View3D_i::Update");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = (const char*)myStudyFrame->title();
-//     myColor = GetBackground();
-//     GetCamera(myStudyFrame)->GetPosition(myPosition);
-//     GetCamera(myStudyFrame)->GetViewUp(myViewUp);
-//     GetCamera(myStudyFrame)->GetFocalPoint(myFocalPnt);
-//     myParallelScale = GetCamera(myStudyFrame)->GetParallelScale();
-    //RepaintView(myStudyFrame);
-
-    //GetViewFrame(myStudyFrame)->GetScale(myScaleFactor);
-
-    VTKViewer_ViewFrame* vf =  GetViewFrame(myStudyFrame);
-    vtkRenderer* Renderer = vf->getRenderer();
-    vtkActorCollection* theActors = Renderer->GetActors();
-    theActors->InitTraversal();
-    vtkActor *actor;
-    while(actor = theActors->GetNextActor()){
-      if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(actor)){
-       VISU::Prs3d_i* aPrs3d  = anActor->GetPrs3d();
-       if(anActor->GetVisibility() && aPrs3d){
-         aPrs3d->Update();
-         aPrs3d->UpdateActor(anActor);
+    class TEvent: public SALOME_Event{
+      QAD_StudyFrame* myStudyFrame;
+    public:
+      TEvent(QAD_StudyFrame* theStudyFrame):
+       myStudyFrame(theStudyFrame)
+      {}
+      virtual void Execute(){
+       VTKViewer_ViewFrame* vf =  GetViewFrame(myStudyFrame);
+       vtkRenderer* Renderer = vf->getRenderer();
+       vtkActorCollection* theActors = Renderer->GetActors();
+       theActors->InitTraversal();
+       vtkActor *actor;
+       while(actor = theActors->GetNextActor()){
+         if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(actor)){
+           VISU::Prs3d_i* aPrs3d  = anActor->GetPrs3d();
+           if(anActor->GetVisibility() && aPrs3d){
+             aPrs3d->Update();
+             aPrs3d->UpdateActor(anActor);
+           }
+         }
        }
+       RepaintView(myStudyFrame);
       }
-    }
+    };
+    ProcessVoidEvent(new TEvent(myStudyFrame));
   }
 
+
   CORBA::Boolean View3D_i::SavePicture(const char* theFileName) {
-    if(MYDEBUG) MESSAGE("View3D_i::SavePicture");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    if (!myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget())
-      return false;
-
-    QApplication::setOverrideCursor( Qt::waitCursor );
-    QPixmap px = QPixmap::grabWindow(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget()->winId());
-    QApplication::restoreOverrideCursor();
-    
-    if (!QString(theFileName).isNull()) {
-      QApplication::setOverrideCursor( Qt::waitCursor );
-      QString fmt = QAD_Tools::getFileExtensionFromPath(theFileName).upper();
-      if (fmt.isEmpty())
-       fmt = QString("BMP"); // default format
-      if (fmt == "JPG")
-       fmt = "JPEG";
-      bool bOk = px.save(theFileName, fmt.latin1());
-      QApplication::restoreOverrideCursor();
-      return bOk;
-    }
-    return false;
+    TSavePictureEvent* ve = new TSavePictureEvent(myStudyFrame->getRightFrame()->getViewFrame()->getViewWidget(),theFileName);
+    ve->process();
+    TSavePictureEvent::TResult aResult = ve->myResult;
+    ve->release();
+    return aResult;
   }
 
-  CORBA::Boolean View3D_i::SaveViewParams(const char* theName){
-    if(MYDEBUG)  MESSAGE("View3D_i::SaveViewPoint");
-    Mutex mt(myMutex,qApp,MYDELAY);
+
+  bool View3D_i::SaveViewParams(QAD_StudyFrame* theStudyFrame, const char* theName){
+    QAD_Study* aStudy = theStudyFrame->getStudy();
+    SALOMEDS::Study_var aStudyDoc = aStudy->getStudyDocument();
     if ( theName ) {
       SALOMEDS::Study::ListOfSObject_var aList = 
-       myStudy->getStudyDocument()->FindObjectByName(theName,"VISU");
+       aStudyDoc->FindObjectByName(theName,"VISU");
       SALOMEDS::GenericAttribute_var anAttr;
       int iEnd = aList->length();
       for(int i = 0; i < iEnd; i++){
        SALOMEDS::SObject_var anObj = aList[i];
        CORBA::String_var aString = anObj->GetID();
        string anEntry(aString);
-       if(MYDEBUG)  MESSAGE("View3D_i::SaveViewPoint - anEntry = "<<anEntry);
+       if(MYDEBUG)  MESSAGE("View3D_i::SaveViewParams - anEntry = "<<anEntry);
        if(anObj->FindAttribute(anAttr, "AttributeComment")){
          SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
          aString = aCmnt->Value();
          string aComm(aString);
          if(MYDEBUG)  MESSAGE("View3D_i::SaveViewPoint - aComm = "<<aComm);
          if(aComm.compare(View3D_i::myComment) >= 0){
-           aCmnt->SetValue(ToString().c_str());
-           return 1;
+           aCmnt->SetValue(ToString(theStudyFrame).c_str());
+           return true;
          }
        }
       }
     }
-    QString newName;
-    if ( theName )
-      newName = QString( theName );
-    else
-      newName = QString( GenerateViewParamsName() );
-    SALOMEDS::SComponent_var aSComponent = 
-      FindOrCreateVisuComponent(myStudy->getStudyDocument());
-    CORBA::String_var aSComponentEntry = aSComponent->GetID(), anIOR(GetID());
-    string anEntry = CreateAttributes(myStudy->getStudyDocument(),aSComponentEntry,"","",newName.latin1(),"",ToString().c_str());
-    return 1;
+    SALOMEDS::SComponent_var aSComponent = FindOrCreateVisuComponent(aStudyDoc);
+    CORBA::String_var aSComponentEntry = aSComponent->GetID();
+    string anEntry = CreateAttributes(aStudyDoc,aSComponentEntry.in(),"","",theName,"",ToString(theStudyFrame).c_str());
+    return true;
+  }
+  CORBA::Boolean View3D_i::SaveViewParams(const char* theName){
+    return SaveViewParams(myStudyFrame,theName);
   }
 
-  CORBA::Boolean View3D_i::RestoreViewParams(const char* theName){
-    if(MYDEBUG)  MESSAGE("View3D_i::RestoreViewPoint - "<<theName);
-    Mutex mt(myMutex,qApp,MYDELAY);
+
+  bool View3D_i::RestoreViewParams(QAD_StudyFrame* theStudyFrame, const char* theName){
     SALOMEDS::Study::ListOfSObject_var aList = 
-      myStudy->getStudyDocument()->FindObjectByName(theName,"VISU");
+      theStudyFrame->getStudy()->getStudyDocument()->FindObjectByName(theName,"VISU");
     SALOMEDS::GenericAttribute_var anAttr;
     int iEnd = aList->length();
     if(MYDEBUG)  MESSAGE("View3D_i::RestoreViewPoint - iEnd = "<<iEnd);
@@ -907,17 +909,40 @@ namespace VISU{
        Storable::StrToMap(strIn,aMap);
        if ( Storable::FindValue( aMap,"myComment").compare( View3D_i::myComment.c_str() ) >= 0 ) {
          if(MYDEBUG)  MESSAGE("View3D_i::RestoreViewPoint - aComm = "<<strIn);
-         return Restore( aMap ) != NULL;
+         Restore(theStudyFrame,aMap);
+         return true;
        }
       }
     }
-    return 0;
+    return false;
   }
 
-  Storable* View3D_i::Restore(const Storable::TRestoringMap& theMap) throw(std::logic_error&) {
-    //    if(MYDEBUG)  MESSAGE("View3D_i::Restore");
-    //myName = VISU::Storable::FindValue(theMap,"myName").latin1();
-    
+
+  CORBA::Boolean View3D_i::RestoreViewParams(const char* theName){
+    class TEvent: public SALOME_Event{
+      QAD_StudyFrame* myStudyFrame;
+      const char* myName;
+    public:
+      TEvent(QAD_StudyFrame* theStudyFrame,
+            const char* theName):
+       myStudyFrame(theStudyFrame),
+       myName(theName)
+      {}
+      virtual void Execute(){
+       myResult = RestoreViewParams(myStudyFrame,myName);
+      }
+      typedef CORBA::Boolean TResult;
+      TResult myResult;
+    };
+    TEvent* ve = new TEvent(myStudyFrame,theName);
+    ve->process();
+    TEvent::TResult aResult = ve->myResult;
+    ve->release();
+    return aResult;
+  }
+
+
+  void View3D_i::Restore(QAD_StudyFrame* theStudyFrame, const Storable::TRestoringMap& theMap){
     SALOMEDS::Color aColor;  
     aColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
     aColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
@@ -945,112 +970,96 @@ namespace VISU{
     aScaleFactor[1] = VISU::Storable::FindValue(theMap,"myScaleFactor[1]").toDouble();
     aScaleFactor[2] = VISU::Storable::FindValue(theMap,"myScaleFactor[2]").toDouble();
     
-    //myStudyFrame->setTitle(myName.c_str());
-    SetBackground(aColor);
-    SetPointOfView(aPosition);
-    SetViewUp(aViewUp);
-    SetFocalPoint(aFocalPnt);
-    SetParallelScale(aParallelScale);
-    ScaleView(VISU::View3D::XAxis,aScaleFactor[0]);
-    ScaleView(VISU::View3D::YAxis,aScaleFactor[1]);
-    ScaleView(VISU::View3D::ZAxis,aScaleFactor[2]);
-    RepaintView(myStudyFrame);
-    return this;
+    SetBackground(theStudyFrame,aColor);
+    SetPointOfView(theStudyFrame,aPosition);
+    SetViewUp(theStudyFrame,aViewUp);
+    SetFocalPoint(theStudyFrame,aFocalPnt);
+    SetParallelScale(theStudyFrame,aParallelScale);
+    ScaleView(theStudyFrame,VISU::View3D::XAxis,aScaleFactor[0]);
+    ScaleView(theStudyFrame,VISU::View3D::YAxis,aScaleFactor[1]);
+    ScaleView(theStudyFrame,VISU::View3D::ZAxis,aScaleFactor[2]);
   }
     
 
-  void View3D_i::ToStream(std::ostringstream& theStr) {
+  string View3D_i::ToString(QAD_StudyFrame* theStudyFrame){
+    ostringstream strOut;
+    Storable::DataToStream( strOut, "myComment", myComment.c_str() );
+    ToStream(theStudyFrame,strOut);
+    strOut<<ends;
+    if(MYDEBUG) MESSAGE("View3D_i::ToString - "<<strOut.str());
+    return strOut.str(); 
+  }
+  void View3D_i::ToStream(QAD_StudyFrame* theStudyFrame, std::ostringstream& theStr) {
     Storable::DataToStream(theStr,"myType",VISU::TVIEW3D);
     
     float backint[3];  
-    GetRenderer(myStudyFrame)->GetBackground(backint);
+    GetRenderer(theStudyFrame)->GetBackground(backint);
     Storable::DataToStream(theStr,"myColor.R",backint[0]);
     Storable::DataToStream(theStr,"myColor.G",backint[1]);
     Storable::DataToStream(theStr,"myColor.B",backint[2]);
     
     double aPosition[3];
-    GetPointOfView(myStudyFrame,aPosition);
+    GetPointOfView(theStudyFrame,aPosition);
     Storable::DataToStream(theStr,"myPosition[0]",aPosition[0]);
     Storable::DataToStream(theStr,"myPosition[1]",aPosition[1]);
     Storable::DataToStream(theStr,"myPosition[2]",aPosition[2]);
     
     double aFocalPnt[3];
-    GetFocalPoint(myStudyFrame,aFocalPnt);
+    GetFocalPoint(theStudyFrame,aFocalPnt);
     Storable::DataToStream(theStr,"myFocalPnt[0]",aFocalPnt[0]);
     Storable::DataToStream(theStr,"myFocalPnt[1]",aFocalPnt[1]);
     Storable::DataToStream(theStr,"myFocalPnt[2]",aFocalPnt[2]);
     
     double aViewUp[3];
-    GetCamera(myStudyFrame)->GetViewUp(aViewUp);
+    GetCamera(theStudyFrame)->GetViewUp(aViewUp);
     Storable::DataToStream(theStr,"myViewUp[0]",aViewUp[0]);
     Storable::DataToStream(theStr,"myViewUp[1]",aViewUp[1]);
     Storable::DataToStream(theStr,"myViewUp[2]",aViewUp[2]);
     
-    Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(myStudyFrame));
+    Storable::DataToStream(theStr,"myParallelScale",GetParallelScale(theStudyFrame));
     
     double aScaleFactor[3];
-    GetViewFrame(myStudyFrame)->GetScale(aScaleFactor);
+    GetViewFrame(theStudyFrame)->GetScale(aScaleFactor);
     Storable::DataToStream(theStr,"myScaleFactor[0]",aScaleFactor[0]);
     Storable::DataToStream(theStr,"myScaleFactor[1]",aScaleFactor[1]);
     Storable::DataToStream(theStr,"myScaleFactor[2]",aScaleFactor[2]);
   }
+  void View3D_i::ToStream(std::ostringstream& theStr) {
+    ToStream(myStudyFrame,theStr);
+  }
 
 
-//   Storable* VISU::View3DRestore(SALOMEDS::SComponent_var& theSComponent, SALOMEDS::Study_var& theStudy,
-//                             const char* thePrefix, const Storable::TRestoringMap& theMap)
-//     {
-//       try{
-//     View3D_i* pView3D = new View3D_i(theStudy);
-//     return pView3D->Restore(theMap);
-//       }catch(std::logic_error& exc){
-//     MESSAGE("Follow exception was accured :\n"<<exc.what());
-//       }catch(...){
-//     MESSAGE("Unknown exception was accured!");
-//       }
-//       return NULL;
-//     }
-  
   void View3D_i::Close(){
-    if(MYDEBUG) MESSAGE("View3D_i::Close");
-    Mutex mt(myMutex,qApp,MYDELAY);
     myStudyFrame->close();
   }
 
   View3D_i::~View3D_i() {
     if(MYDEBUG) MESSAGE("View3D_i::~View3D_i");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->close();
   }
 
   //-------------------- View interface --------------------
   void View3D_i::SetTitle(const char* theTitle){
-    if(MYDEBUG) MESSAGE("View3D_i::SetTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = theTitle;
-    myStudyFrame->setTitle(myName.c_str());
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<QAD_StudyFrame,const QString&,QString>
+                    (myStudyFrame,&QAD_StudyFrame::setTitle,QString(theTitle)));
   }
   char* View3D_i::GetTitle() {
-    if(MYDEBUG) MESSAGE("View3D_i::GetTitle");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myName = (const char*)myStudyFrame->title();
-    return CORBA::string_dup(myName.c_str());
+    return CORBA::string_dup(myStudyFrame->title().latin1());
   }
 
+
   void View3D_i::SetBackground(QAD_StudyFrame* theStudyFrame, const SALOMEDS::Color& theColor) {
     int aColor[3];
-    aColor[0] = (int)(255.0*theColor.R);
-    aColor[1] = (int)(255.0*theColor.G);
-    aColor[2] = (int)(255.0*theColor.B);
+    aColor[0] = int(255.0*theColor.R);
+    aColor[1] = int(255.0*theColor.G);
+    aColor[2] = int(255.0*theColor.B);
     QColor aNewColor(aColor[0],aColor[1],aColor[2]);
     GetViewFrame(theStudyFrame)->setBackgroundColor(aNewColor);
   }
   void View3D_i::SetBackground(const SALOMEDS::Color& theColor) {
-    if(MYDEBUG) MESSAGE("View3D_i::SetBackground");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //myColor.R = theColor.R;  myColor.G = theColor.G;  myColor.B = theColor.B;
-    SetBackground(myStudyFrame,theColor);
+    ProcessVoidEvent(new TSetBackgroundEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),theColor));
   }
 
+
   SALOMEDS::Color View3D_i::GetBackground(QAD_StudyFrame* theStudyFrame) { 
     SALOMEDS::Color aColor;
     float backint[3];  
@@ -1059,160 +1068,219 @@ namespace VISU{
     return aColor;
   }
   SALOMEDS::Color View3D_i::GetBackground() { 
-    if(MYDEBUG) MESSAGE("View3D_i::GetBackground");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //myColor = GetBackground(myStudyFrame);
-    return GetBackground(myStudyFrame); //myColor;
+    return GetBackground(myStudyFrame);
   }
 
+
   void View3D_i::Minimize() {
-    if(MYDEBUG) MESSAGE("View3D_i::Minimize");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showMinimized();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame,&QAD_StudyFrame::showMinimized));
   }
   void View3D_i::Restore() {
-    if(MYDEBUG) MESSAGE("View3D_i::Restore");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showNormal();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame, &QAD_StudyFrame::showNormal));
   }
   void View3D_i::Maximize() {
-    if(MYDEBUG) MESSAGE("View3D_i::Maximize");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    myStudyFrame->showMaximized();
+    ProcessVoidEvent(new TFrameActionEvent(myStudyFrame, &QAD_StudyFrame::showMaximized));
   }
+
+
   //===========================================================================
+  class TUpdateViewerEvent: public SALOME_Event{
+    QAD_StudyFrame* myStudyFrame;
+    Prs3d_i* myPrs3d;
+    int myDisplaing;
+  public:
+    TUpdateViewerEvent(QAD_StudyFrame* theStudyFrame,
+                      Prs3d_i* thePrs3d,
+                      int theDisplaing):
+      myStudyFrame(theStudyFrame),
+      myPrs3d(thePrs3d),
+      myDisplaing(theDisplaing)
+    {}
+    virtual void Execute(){
+      UpdateViewer(myStudyFrame,myDisplaing,myPrs3d);
+    }
+  };
+
   void View3D_i::EraseAll() {
     if(MYDEBUG) MESSAGE("View3D_i::EraseAll");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    UpdateViewer(myStudyFrame,eEraseAll);
+    ProcessVoidEvent(new TUpdateViewerEvent(myStudyFrame,NULL,eEraseAll));
   }
+
   void View3D_i::DisplayAll() {
     if(MYDEBUG) MESSAGE("View3D_i::DisplayAll");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    UpdateViewer(myStudyFrame,eDisplayAll);
+    ProcessVoidEvent(new TUpdateViewerEvent(myStudyFrame,NULL,eDisplayAll));
   }
+
   void View3D_i::Erase(PrsObject_ptr thePrsObj) {
     if(MYDEBUG) MESSAGE("View3D_i::Erase");
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Object_ptr anObj = thePrsObj;
-    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in()))
-      UpdateViewer(myStudyFrame,eErase,aPrs);
+    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+      ProcessVoidEvent(new TUpdateViewerEvent(myStudyFrame,aPrs,eErase));
+    }
   }
+
   void View3D_i::Display(PrsObject_ptr thePrsObj) {
     if(MYDEBUG) MESSAGE("View3D_i::Display"); 
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Object_ptr anObj = thePrsObj;
-    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in()))
-      UpdateViewer(myStudyFrame,eDisplay,aPrs);
+    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+      ProcessVoidEvent(new TUpdateViewerEvent(myStudyFrame,aPrs,eDisplay));
+    }
   }
+
   void View3D_i::DisplayOnly(PrsObject_ptr thePrsObj) {
     if(MYDEBUG) MESSAGE("View3D_i::DisplayOnly");
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Object_ptr anObj = thePrsObj;
-    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in()))
-      UpdateViewer(myStudyFrame,eDisplayOnly,aPrs);
+    if(Prs3d_i* aPrs =  dynamic_cast<Prs3d_i*>(VISU::GetServant(anObj).in())){
+      ProcessVoidEvent(new TUpdateViewerEvent(myStudyFrame,aPrs,eDisplayOnly));
+    }
   }
 
   //-------------------- View3D interface --------------------
   void View3D_i::FitAll() { 
-    if(MYDEBUG) MESSAGE("View3D_i::FitAll");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    GetViewFrame(myStudyFrame)->onViewFitAll();
+    ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFitAll));
     Update();
   }
+
+
   void View3D_i::SetView(VISU::View3D::ViewType theType) {
-    if(MYDEBUG) MESSAGE("View3D_i::SetView");
-    Mutex mt(myMutex,qApp,MYDELAY);
     switch(theType){
-    case VISU::View3D::FRONT : GetViewFrame(myStudyFrame)->onViewFront(); break;
-    case VISU::View3D::BACK : GetViewFrame(myStudyFrame)->onViewBack(); break;
-    case VISU::View3D::LEFT : GetViewFrame(myStudyFrame)->onViewLeft(); break;
-    case VISU::View3D::RIGHT : GetViewFrame(myStudyFrame)->onViewRight(); break;
-    case VISU::View3D::TOP : GetViewFrame(myStudyFrame)->onViewTop(); break;
-    case VISU::View3D::BOTTOM : GetViewFrame(myStudyFrame)->onViewBottom(); break;
+    case VISU::View3D::FRONT : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewFront));
+      break;
+    case VISU::View3D::BACK : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBack));
+      break;
+    case VISU::View3D::LEFT : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewLeft));
+      break;
+    case VISU::View3D::RIGHT : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewRight));
+      break;
+    case VISU::View3D::TOP : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewTop));
+      break;
+    case VISU::View3D::BOTTOM : 
+      ProcessVoidEvent(new TVoidMemFunEvent<VTKViewer_ViewFrame>(GetViewFrame(myStudyFrame),&VTKViewer_ViewFrame::onViewBottom));
+      break;
     }
     Update();
   }
 
+
+  class TSet3DViewParamEvent: public SALOME_Event{
+  public:
+    typedef void (*TFun)(QAD_StudyFrame* theStudyFrame, const CORBA::Double theParam[3]);
+    TSet3DViewParamEvent(TFun theFun,
+                        QAD_StudyFrame* theStudyFrame,
+                        const CORBA::Double theParam[3]):
+      myFun(theFun),
+      myStudyFrame(theStudyFrame),
+      myParam(theParam)
+    {}
+    virtual void Execute(){
+      myFun(myStudyFrame,myParam);
+    }
+  private:
+    TFun myFun;
+    QAD_StudyFrame* myStudyFrame;
+    const CORBA::Double* myParam;
+  };
+
+
   void View3D_i::SetPointOfView(QAD_StudyFrame* theStudyFrame, const CORBA::Double thePosition[3]) {
     GetCamera(theStudyFrame)->SetPosition(thePosition);
   }
-  void View3D_i::SetPointOfView(const VISU::View3D::XYZ theCoord) {
+  void View3D_i::SetPointOfView(const VISU::View3D::XYZ thePosition) {
     if(MYDEBUG) MESSAGE("View3D_i::SetPointOfView");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //VISU::View3D::XYZ_copy(myPosition,theCoord);
-    SetPointOfView(myStudyFrame, theCoord);
+    ProcessVoidEvent(new TSet3DViewParamEvent(&SetPointOfView,myStudyFrame,thePosition));
   }
 
+
   void View3D_i::GetPointOfView(QAD_StudyFrame* theStudyFrame, CORBA::Double thePosition[3]) { 
     GetCamera(theStudyFrame)->GetPosition(thePosition);
   }
   VISU::View3D::XYZ_slice* View3D_i::GetPointOfView() { 
     if(MYDEBUG) MESSAGE("View3D_i::GetPointOfView");
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Double aPosition[3];
     GetPointOfView(myStudyFrame,aPosition);
     return VISU::View3D::XYZ_dup(aPosition);
   }
 
+
   void View3D_i::SetViewUp(QAD_StudyFrame* theStudyFrame, const CORBA::Double theViewUp[3]) {
     GetCamera(theStudyFrame)->SetViewUp(theViewUp);
   }
-  void View3D_i::SetViewUp(const VISU::View3D::XYZ theDir) {
+  void View3D_i::SetViewUp(const VISU::View3D::XYZ theViewUp) {
     if(MYDEBUG) MESSAGE("View3D_i::SetViewUp");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //VISU::View3D::XYZ_copy(myViewUp,theDir);
-    SetViewUp(myStudyFrame, theDir);
+    ProcessVoidEvent(new TSet3DViewParamEvent(&SetViewUp,myStudyFrame,theViewUp));
   }
 
+
   void View3D_i::GetViewUp(QAD_StudyFrame* theStudyFrame, CORBA::Double theViewUp[3]) { 
     GetCamera(theStudyFrame)->GetViewUp(theViewUp);
   }
   VISU::View3D::XYZ_slice* View3D_i::GetViewUp() { 
     if(MYDEBUG) MESSAGE("View3D_i::GetViewUp");
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Double aViewUp[3];
     GetCamera(myStudyFrame)->GetViewUp(aViewUp);
     return VISU::View3D::XYZ_dup(aViewUp);
   }
 
+
   void View3D_i::SetFocalPoint(QAD_StudyFrame* theStudyFrame, const CORBA::Double theFocalPnt[3]) {
     GetCamera(theStudyFrame)->SetFocalPoint(theFocalPnt);
   }
   void View3D_i::SetFocalPoint(const VISU::View3D::XYZ theCoord) {
     if(MYDEBUG) MESSAGE("View3D_i::SetFocalPoint");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //VISU::View3D::XYZ_copy(myFocalPnt,theCoord);
-    SetFocalPoint(myStudyFrame,theCoord);
+    ProcessVoidEvent(new TSet3DViewParamEvent(&SetFocalPoint,myStudyFrame,theCoord));
   }
 
+
   void View3D_i::GetFocalPoint(QAD_StudyFrame* theStudyFrame, CORBA::Double theFocalPnt[3]) { 
     GetCamera(theStudyFrame)->GetFocalPoint(theFocalPnt);
   }
   VISU::View3D::XYZ_slice* View3D_i::GetFocalPoint() { 
     if(MYDEBUG) MESSAGE("View3D_i::GetFocalPoint");
-    Mutex mt(myMutex,qApp,MYDELAY);
     CORBA::Double aFocalPnt[3];
     GetFocalPoint(myStudyFrame,aFocalPnt);
     return VISU::View3D::XYZ_dup(aFocalPnt);
   }
 
+
+  class TSetViewParamEvent: public SALOME_Event{
+  public:
+    typedef void (*TFun)(QAD_StudyFrame* theStudyFrame, CORBA::Double theParam);
+    TSetViewParamEvent(TFun theFun,
+                      QAD_StudyFrame* theStudyFrame,
+                      CORBA::Double theParam):
+      myFun(theFun),
+      myStudyFrame(theStudyFrame),
+      myParam(theParam)
+    {}
+    virtual void Execute(){
+      myFun(myStudyFrame,myParam);
+    }
+  private:
+    TFun myFun;
+    QAD_StudyFrame* myStudyFrame;
+    CORBA::Double myParam;
+  };
+
+
   void View3D_i::SetParallelScale(QAD_StudyFrame* theStudyFrame, CORBA::Double theScale) {
     GetCamera(theStudyFrame)->SetParallelScale(theScale);
   }
   void View3D_i::SetParallelScale(CORBA::Double theScale) {
     if(MYDEBUG) MESSAGE("View3D_i::SetParallelScale");
-    Mutex mt(myMutex,qApp,MYDELAY);
-    //myParallelScale = theScale;
-    SetParallelScale(myStudyFrame, theScale);
+    ProcessVoidEvent(new TSetViewParamEvent(&SetParallelScale,myStudyFrame,theScale));
   }
 
+
   CORBA::Double View3D_i::GetParallelScale(QAD_StudyFrame* theStudyFrame) { 
     return GetCamera(theStudyFrame)->GetParallelScale();
   }
   CORBA::Double View3D_i::GetParallelScale() { 
     if(MYDEBUG) MESSAGE("View3D_i::GetParallelScale");
-    Mutex mt(myMutex,qApp);
     return GetParallelScale(myStudyFrame);
   }
 
@@ -1223,18 +1291,110 @@ namespace VISU{
     aScaleFactor[theAxis] = theParam;
     aViewFrame->SetScale(aScaleFactor);
   }
+  
+  void SetScaleView(QAD_StudyFrame* theStudyFrame, const CORBA::Double theScale[3]){
+    double aScale[3] = {theScale[0], theScale[1], theScale[2]};
+    GetViewFrame(theStudyFrame)->SetScale(aScale);
+  }
   void View3D_i::ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam) {
     if(MYDEBUG) MESSAGE("View3D_i::ScaleView");
-    Mutex mt(myMutex,qApp);
-    //myScaleFactor[theAxis] = theParam;
-    ScaleView(myStudyFrame,theAxis,theParam);
+    double aScale[3];
+    GetViewFrame(myStudyFrame)->GetScale(aScale);
+    aScale[theAxis] = theParam;
+    ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myStudyFrame,aScale));
   }
   void View3D_i::RemoveScale() {
     if(MYDEBUG) MESSAGE("View3D_i::RemoveScale");
-    Mutex mt(myMutex,qApp);
-    double aScaleFactor[]={1,1,1};
-    //myScaleFactor[0] = myScaleFactor[0] = myScaleFactor[0] = 1.0;
-    GetViewFrame(myStudyFrame)->SetScale(aScaleFactor);
+    double aScale[3] = {1.0, 1.0, 1.0};
+    ProcessVoidEvent(new TSet3DViewParamEvent(&SetScaleView,myStudyFrame,aScale));
   }
   //===========================================================================
-}
+};
+
+
+/*! SAN & VSR : Test QT_EVENT 
+  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+*/
+#include "VISU_Gen_i.hh"
+#include "QAD_Config.h"
+#include <vtkPolyDataMapper.h>
+#include <vtkSphereSource.h>
+#include <vtkProperty.h>
+
+namespace VISU{
+  class TestViewEvent : public SALOME_Event {
+  public:
+    virtual void Execute(){
+      QAD_Desktop* desktop = QAD_Application::getDesktop();
+      QAD_Study*   aStudy = desktop->getActiveStudy();
+      if ( !aStudy ) {
+       QString defViewer = QAD_CONFIG->getSetting( "Viewer::DefaultViewer" );
+       int dv = defViewer.toInt();
+       QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( VIEW_VTK ) );
+       desktop->createStudy();
+       if ( !defViewer.isEmpty() ) {
+         QAD_CONFIG->addSetting( "Viewer::DefaultViewer", QString::number( dv ) );
+       }
+      }
+      else {
+       aStudy->newWindow3d( "", VIEW_VTK );
+      }
+    }
+  };
+
+  void VISU_Gen_i::CreateTestView() {
+    TestViewEvent* ve = new TestViewEvent();
+    ve->process();
+    ve->release();
+  }
+
+
+  class TestObjectEvent : public SALOME_Event {
+  public:
+    virtual void Execute(){
+      float aRadius = 150.0 * random() / RAND_MAX + 10.;
+      float aX = 1000.0 * random() / RAND_MAX - 500.;
+      float aY = 1000.0 * random() / RAND_MAX - 500.;
+      float aZ = 1000.0 * random() / RAND_MAX - 500.;
+      float aR = (float)random() / RAND_MAX;
+      float aG = (float)random() / RAND_MAX;
+      float aB = (float)random() / RAND_MAX;
+
+      vtkSphereSource* aSource = vtkSphereSource::New();
+      aSource->SetRadius( aRadius );
+      aSource->SetCenter( aX, aY, aZ );
+  
+      vtkProperty* prop = vtkProperty::New();
+      prop->SetColor( aR, aG, aB );
+  
+      vtkPolyDataMapper* aMapper = vtkPolyDataMapper::New();
+      aMapper->SetInput( aSource->GetOutput() );
+      
+      vtkActor* sphere = vtkActor::New();
+      sphere->SetMapper( aMapper );
+      sphere->SetProperty( prop );
+
+      QAD_Desktop* desktop = QAD_Application::getDesktop();
+      QAD_Study*   aStudy = desktop->getActiveStudy();
+      if ( !aStudy )
+       return ;
+      QAD_StudyFrame* sf = desktop->getActiveStudy()->getActiveStudyFrame();
+      VTKViewer_ViewFrame* vf = GetViewFrame( sf );
+      if ( !vf )
+       return;
+      sphere->SetVisibility( true );
+      vf->getRenderer()->AddActor(sphere);
+      vf->Repaint();
+    }
+  };
+
+  void VISU_Gen_i::ShowTestObject() {
+    TestObjectEvent* ve = new TestObjectEvent();
+    ve->process();
+    ve->release();
+    return;
+  }
+  /*! SAN & VSR : Test QT_EVENT
+    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+  */
+};
index 9463e7542aded12f9c97d891445886c4821a6696..b399434dcf78c01cae1bebf3dccc79441c0a8ef0 100644 (file)
@@ -51,12 +51,11 @@ namespace VISU{
     virtual ~ViewManager_i() {};
     virtual VISU::VISUType GetType() { return VISU::TVIEWMANAGER;};
 
-    virtual View3D_ptr Create3DView();
-    virtual View_ptr   GetCurrentView();
+    virtual View3D_ptr    Create3DView();
+    virtual View_ptr      GetCurrentView();
     virtual TableView_ptr CreateTableView(VISU::Table_ptr theTable);
-    virtual XYPlot_ptr CreateXYPlot();
-    virtual void Destroy(View_ptr theView);
-    virtual void ProcessEvents();
+    virtual XYPlot_ptr    CreateXYPlot();
+    virtual void          Destroy(View_ptr theView);
 
   protected:
     SALOMEDS::Study_var myStudyDocument;
@@ -68,7 +67,6 @@ namespace VISU{
   {
   protected:
     QAD_Study* myStudy;
-    string myName;
   public:
     View_i(SALOMEDS::Study_ptr theStudy);
     virtual ~View_i();
@@ -90,7 +88,7 @@ namespace VISU{
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
   public:
-    virtual const char* View_i::GetEntry();
+    virtual std::string View_i::GetEntry();
   };
 
   //===========================================================================
@@ -98,6 +96,7 @@ namespace VISU{
                    public virtual View_i
   {
   public:
+    typedef VISU::XYPlot TInterface;
     XYPlot_i(SALOMEDS::Study_ptr theStudy);
     virtual ~XYPlot_i();
     virtual VISU::VISUType GetType() { return VISU::TXYPLOT;};
@@ -160,6 +159,7 @@ namespace VISU{
                       public virtual View_i
   {
   public:
+    typedef VISU::TableView TInterface;
     TableView_i(SALOMEDS::Study_ptr theStudy);
     virtual ~TableView_i();
     virtual VISU::VISUType GetType() { return VISU::TTABLEVIEW;};
@@ -171,7 +171,7 @@ namespace VISU{
   protected:
     SALOMEGUI_TableDlg* myView;
   public:
-    virtual Storable* Create(VISU::Table_var theTable);
+    virtual Storable* Create(VISU::Table_ptr theTable);
   };
 
   //===========================================================================
@@ -179,6 +179,7 @@ namespace VISU{
                    public virtual View_i
   {
   public:
+    typedef VISU::View3D TInterface;
     View3D_i(SALOMEDS::Study_ptr theStudy);
     virtual ~View3D_i();
     virtual VISU::VISUType GetType() { return VISU::TVIEW3D;};
@@ -237,29 +238,29 @@ namespace VISU{
     virtual void ScaleView(VISU::View3D::Axis theAxis, CORBA::Double theParam);
     virtual void RemoveScale();
 
-    virtual QString GenerateViewParamsName();
+    static std::string ToString(QAD_StudyFrame* theStudyFrame);
+    static void ToStream(QAD_StudyFrame* theStudyFrame, std::ostringstream& theStr);
+    static bool SaveViewParams(QAD_StudyFrame* theStudyFrame, const char* theName);
     virtual CORBA::Boolean SaveViewParams(const char* theName);
+    static QString GenerateViewParamsName();
+
+    static void Restore(QAD_StudyFrame* theStudyFrame, const Storable::TRestoringMap& theMap);
+    static bool RestoreViewParams(QAD_StudyFrame* theStudyFrame, const char* theName);
     virtual CORBA::Boolean RestoreViewParams(const char* theName);
 
     virtual void Close();
+
   protected:
     QAD_StudyFrame* myStudyFrame;
-    //SALOMEDS::Color myColor;
-    //CORBA::Double myPosition[3], myFocalPnt[3], myViewUp[3], myParallelScale, myScaleFactor[3];
-
-    //Storable* Build(int theRestoring);
     static int myNbViewParams;
 
   public:
     virtual Storable* Create(int theNew);
-    virtual Storable* Restore(const Storable::TRestoringMap& theMap) throw(std::logic_error&);
     virtual void ToStream(std::ostringstream& theStr);
     virtual const char* GetComment() const;
     static const string myComment;
     QAD_StudyFrame* GetStudyFrame() const { return myStudyFrame;}
   };
-  //Storable* View3DRestore(SALOMEDS::SComponent_var& theSComponent, SALOMEDS::Study_var& theStudy,
-  //                     const char* thePrefix, const Storable::TRestoringMap& theMap);
 
   VTKViewer_ViewFrame* GetViewFrame(QAD_StudyFrame* theStudyFrame);
   vtkRenderer* GetRenderer(QAD_StudyFrame* theStudyFrame);