Salome HOME
Now 'Erase', 'Display' and 'Display Only' items allways present in popup-menu of...
[modules/visu.git] / src / VISUGUI / VisuGUI.cxx
index be5ed4bc12eb45ee475ce0c60c96024d5ae4ff13..1caadb31a5c1a0622dbe87aac7b9ff0266fa069d 100644 (file)
 //  Module : VISU
 //  $Header$
 
+#include "VisuGUI.h"
+
+// STL Includes
 #include <exception>
 #include <typeinfo>
 #include <vector>
 
+// QT Includes
 #include <qptrlist.h>
 #include <qptrvector.h>
 #include <qcolordialog.h>
 
+// VTK Includes
 #include <vtkRenderer.h>
 #include <vtkRenderWindow.h>
 #include <vtkActorCollection.h>
 
+// SALOME Includes
 #include "SALOME_LifeCycleCORBA.hxx"
 
 #include "SUIT_ResourceMgr.h"
@@ -55,6 +61,7 @@
 
 #include "SPlot2d_ViewModel.h"
 #include "SPlot2d_SetupPlot2dDlg.h"
+#include "Plot2d_SetupCurveDlg.h"
 
 #include "OB_Browser.h"
 
@@ -66,6 +73,7 @@
 #include "SalomeApp_Study.h"
 #include "SalomeApp_SelectionMgr.h"
 #include "SalomeApp_Selection.h"
+#include "SalomeApp_Preferences.h"
 
 #include "VISUConfig.hh"
 #include "VISU_Gen_i.hh"
 #include "VISU_Result_i.hh"
 #include "VISU_View_i.hh"
 #include "VISU_ViewManager_i.hh"
+#include "VISU_Plot3D_i.hh"
 
 #include "VISU_Actor.h"
 
-#include "VisuGUI.h"
+#include "VisuGUI_Prs3dTools.h"
 #include "VisuGUI_Tools.h"
+
 #include "VisuGUI_PopupTools.h"
 #include "VisuGUI_NameDlg.h"
 #include "VisuGUI_FileDlg.h"
 #include "VisuGUI_TimeAnimation.h"
 #include "VisuGUI_EditContainerDlg.h"
 #include "VisuGUI_NonIsometricDlg.h"
+#include "VisuGUI_ClippingDlg.h"
+#include "VisuGUI_Plot3DDlg.h"
+#include "VisuGUI_CubeAxesDlg.h"
+#include "VisuGUI_OffsetDlg.h"
 
 #include "VISU_ScalarMap_i.hh"
 #include "VisuGUI_ScalarBarDlg.h"
 
 #include "utilities.h"
 
+#include "VisuGUI_ActionsDef.h"
+
 using namespace VISU;
 
 #ifdef _DEBUG_
@@ -153,41 +169,41 @@ OnImportFromFile()
 
   QFileInfo aFileInfo =
     SUIT_FileDlg::getFileName(GetDesktop(this),
-                             "",
-                             aFilter,
-                             tr("MEN_IMPORT_FROM_FILE"),
-                             true);
-  if(aFileInfo.exists()){
+                              "",
+                              aFilter,
+                              tr("MEN_IMPORT_FROM_FILE"),
+                              true);
+  if(aFileInfo.exists()) {
     application()->putInfo( "Importing From File " + aFileInfo.filePath() + "..." );
 
     VISU::Result_var aResult;
-    bool anIsBuild = aResourceMgr->booleanValue("Visu:BuildResult",false);
-    if(VisuGUI_FileDlg::IsBuild){
+    bool anIsBuild = aResourceMgr->booleanValue("VISU", "full_med_loading", false);
+    if (VisuGUI_FileDlg::IsBuild) {
       aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
-      if(!CORBA::is_nil(aResult.in()))
-       if(Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())){
-         if(!aRes->IsPossible())
-           SUIT_MessageBox::warn1(GetDesktop(this),
-                                  tr("WRN_VISU"),
-                                  tr("ERR_CANT_BUILD_PRESENTATION"),
-                                  tr("BUT_OK") );
-         else
-           aRes->BuildAll();
-       }
-    }else{
-      aResourceMgr->setValue("Visu:BuildResult",false);
+      if (!CORBA::is_nil(aResult.in()))
+        if (Result_i* aRes = dynamic_cast<Result_i*>(GetServant(aResult).in())) {
+          if (!aRes->IsPossible())
+            SUIT_MessageBox::warn1(GetDesktop(this),
+                                   tr("WRN_VISU"),
+                                   tr("ERR_CANT_BUILD_PRESENTATION"),
+                                   tr("BUT_OK"));
+          else
+            aRes->BuildAll();
+        }
+    } else {
+      aResourceMgr->setValue("VISU", "full_med_loading", false);
       aResult = GetVisuGen(this)->ImportFile(aFileInfo.filePath());
-      aResourceMgr->setValue("Visu:BuildResult",anIsBuild);
+      aResourceMgr->setValue("VISU", "full_med_loading", anIsBuild);
     }
 
-    if(CORBA::is_nil(aResult.in())) {
+    if (CORBA::is_nil(aResult.in())) {
       SUIT_MessageBox::warn1(GetDesktop(this),
-                            tr("WRN_VISU"),
-                            tr("ERR_ERROR_IN_THE_FILE"),
-                            tr("BUT_OK") );
+                             tr("WRN_VISU"),
+                             tr("ERR_ERROR_IN_THE_FILE"),
+                             tr("BUT_OK"));
     }else{
-      application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
-      updateObjBrowser();
+      application()->putInfo(aFileInfo.filePath() + tr("INF_DONE"));
+      UpdateObjBrowser(this);
     }
   }
 }
@@ -209,16 +225,27 @@ OnExploreMEDFile()
 
   QFileInfo aFileInfo =
     SUIT_FileDlg::getFileName(GetDesktop(this),
-                             "",
-                             aFilter,
-                             tr("MEN_EXPLORE_MED_FILE"),
-                             true);
+                              "",
+                              aFilter,
+                              tr("MEN_EXPLORE_MED_FILE"),
+                              true);
   if(aFileInfo.exists()){
     application()->putInfo( tr("MEN_EXPLORE_MED_FILE") + " " + aFileInfo.filePath() + "..." );
     std::string aStudyName = aStudy->Name();
-    aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
+    try
+    {
+      aGen->readStructFileWithFieldType(aFileInfo.filePath(),aStudyName.c_str());
+    }
+    catch(...)
+    {
+      SUIT_MessageBox::warn1(GetDesktop(this),
+                             tr("WRN_VISU"),
+                             tr("ERR_ERROR_IN_THE_FILE"),
+                             tr("BUT_OK"));
+    }
     application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
-    updateObjBrowser();
+    getApp()->updateObjectBrowser(true); // as need to update MED tree
+    getApp()->updateActions();
   }
 }
 
@@ -236,23 +263,23 @@ OnImportTableFromFile()
 
   QFileInfo aFileInfo =
     SUIT_FileDlg::getFileName(GetDesktop(this),
-                             "",
-                             aFilter,
-                             tr("MEN_IMPORT_TABLE"),
-                             true);
-  if(aFileInfo.exists()){
+                              "",
+                              aFilter,
+                              tr("MEN_IMPORT_TABLE"),
+                              true);
+  if (aFileInfo.exists()) {
     application()->putInfo( tr("MEN_IMPORT_TABLE") + " " + aFileInfo.filePath() + " ..." );
 
     CORBA::Object_var anObject = GetVisuGen(this)->ImportTables(aFileInfo.filePath());
 
-    if(CORBA::is_nil(anObject.in())) {
+    if (CORBA::is_nil(anObject.in())) {
       SUIT_MessageBox::warn1(GetDesktop(this),
-                            tr("WRN_VISU"),
-                            tr("ERR_ERROR_IN_THE_FILE"),
-                            tr("BUT_OK") );
-    }else{
+                             tr("WRN_VISU"),
+                             tr("ERR_ERROR_IN_THE_FILE"),
+                             tr("BUT_OK"));
+    } else {
       application()->putInfo(aFileInfo.filePath()+tr("INF_DONE"));
-      updateObjBrowser();
+      UpdateObjBrowser(this);
     }
   }
 }
@@ -262,239 +289,198 @@ VisuGUI::
 OnExportTableToFile()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnExportTableToFile()");
-}
 
-void 
-CreateCurves( SalomeApp_Module* theModule,
-             VISU::CutLines_i* thePrs,
-             QDialog* theDlg,
-             const bool theCreate = true )
-{
-  if ( !thePrs )
-    return;
-  VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg );
-  if ( !aCutDlg )
-    return;
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
 
-  _PTR(Study)     aStudy = GetCStudy( GetAppStudy( theModule ) );
-  _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry() );
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
 
-  if ( !theCreate && aSObject ){
-    // Remove old Table
-    _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-    for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
-      _PTR(SObject) aTblObj = aIter->Value();
-      if ( aTblObj ) {
-       _PTR(GenericAttribute) anAttr;
-       if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
-         aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
-         break;
-       }
+  if (aListIO.Extent() > 0) {
+    const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+    if (anIO->hasEntry()) {
+      _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
+      if (!aSObj) return;
+
+      // find table attribute
+      bool isTOR = true;
+      _PTR(GenericAttribute) anAttr;
+
+      if (!aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
+        isTOR = false;
+        if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
+          // if the current SObject is a table title
+          // we take a father contaning the table
+          aSObj = aSObj->GetFather();
+
+          if (aSObj->FindAttribute(anAttr, "AttributeTableOfReal")) {
+            isTOR = true;
+          } else {
+            if (!aSObj->FindAttribute(anAttr, "AttributeTableOfInteger")) {
+              return;
+            }
+          }
+        }
       }
-    }
-  }
 
-  if ( aCutDlg->isGenerateTable() ) {
-    GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
-    if ( aCutDlg->isGenerateCurves() ) {
-      if( aSObject ) {
-       _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
-       for ( _PTR(ChildIterator) aIter = aStudy->NewChildIterator( aSObject ); aIter->More(); aIter->Next() ) {
-         _PTR(SObject) aTblObj = aIter->Value();
-         if ( aTblObj ) {
-           _PTR(GenericAttribute) anAttr;
-           if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
-             CreatePlot( theModule, aTblObj );
-           }
-         }
+      // get table title in order to have default name of the file
+      QString aTitle;
+      if (isTOR) {
+        _PTR(AttributeTableOfReal) aTabAttr (anAttr);
+        if (!aTabAttr) return;
+        aTitle = aTabAttr->GetTitle().c_str();
+      } else {
+       _PTR(AttributeTableOfInteger) aTabAttr (anAttr);
+       if (!aTabAttr) return;
+        aTitle = aTabAttr->GetTitle().c_str();
+      }
+      aTitle.simplifyWhiteSpace();
+      aTitle = aTitle.replace(QRegExp(" "), "_");
+
+      // get default path for the file
+      SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
+      QString aDir = aResourceMgr->stringValue("VISU","OutputDir","");
+      if (aDir.isEmpty()) {
+        aDir = aResourceMgr->stringValue("VISU","InputDir","");
+        if (aDir.isEmpty()) {
+          aDir = getenv("CSF_PATHData");
+        }
+      }
+      QString aPath = Qtx::addSlash(aDir) + aTitle;
+
+      // get name for the file
+      QStringList aFilter;
+      aFilter.append("Table Files (*.xls)");
+
+      QFileInfo aFileInfo =
+        SUIT_FileDlg::getFileName(GetDesktop(this),
+                                  aPath,
+                                  aFilter,
+                                  tr("MEN_EXPORT_TABLE"), // "Export Table To File"
+                                  false);
+
+      // export
+      QString aFile = aFileInfo.filePath();
+      if (!aFile.isEmpty()) {
+        application()->putInfo(tr("MEN_EXPORT_TABLE") + " " + aFile + " ...");
+       aDir = Qtx::dir(aFile, true);
+        aResourceMgr->setValue("VISU", "OutputDir", aDir);
+
+       try {
+         GetVisuGen(this)->ExportTableToFile(GetSObject(aSObj), aFile.latin1());
+          application()->putInfo(aFile + " " + tr("INF_DONE"));
+       } catch(std::exception& ex) {
+         INFOS(ex.what());
+         SUIT_MessageBox::warn1(GetDesktop(this),
+                                 tr("WRN_VISU"),
+                                tr("ERR_ERROR_DURING_EXPORT") + " " + tr(ex.what()),
+                                tr("BUT_OK"));
+       } catch(...) {
+         INFOS(tr("ERR_ERROR_DURING_EXPORT"));
+         SUIT_MessageBox::warn1(GetDesktop(this),
+                                 tr("WRN_VISU"),
+                                tr("ERR_ERROR_DURING_EXPORT"),
+                                tr("BUT_OK") );
        }
       }
     }
   }
 }
 
-template<class TPrs3d_i>
-TPrs3d_i*
-CreatePrs3d(SalomeApp_Module* theModule,
-           SALOMEDS::SObject_var theTimeStamp,
-           const char* theMeshName,
-           VISU::Entity theEntity,
-           const char* theFieldName,
-           int theTimeId)
-{
-  VISU::Result_var aResult;
-  if(CheckResult(theModule,theTimeStamp,aResult)){
-    QApplication::setOverrideCursor(Qt::waitCursor);
-    typedef typename TPrs3d_i::TInterface TPrs3d;
-    typename TPrs3d::_var_type aPrs3d =
-      GetVisuGen(theModule)->template Prs3dOnField<TPrs3d_i>
-      (aResult,theMeshName,theEntity,theFieldName,theTimeId);
-    QApplication::restoreOverrideCursor();
-    if(!CORBA::is_nil(aPrs3d.in()))
-      return dynamic_cast<TPrs3d_i*>(VISU::GetServant(aPrs3d.in()).in());
-  }
-  SUIT_MessageBox::warn1(GetDesktop(theModule),
-                        QObject::tr("WRN_VISU"),
-                        QObject::tr("ERR_CANT_BUILD_PRESENTATION"),
-                        QObject::tr("BUT_OK") );
-  return NULL;
-}
+void
+VisuGUI::
+OnImportMedField()
+{
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+  if (CheckLock(aCStudy))
+    return;
+  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
 
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
 
-template<class TPrs3d_i, class TDlg, int IsDlgModal>
-bool
-CreatePrs3d(SalomeApp_Module* theModule,
-           SALOMEDS::SObject_var theTimeStamp,
-           const Handle(SALOME_InteractiveObject)& theIO)
-{
-  using namespace VISU;
-  Storable::TRestoringMap aMap = getMapOfValue(theTimeStamp);
-  bool isExist;
-  QString aType = Storable::FindValue(aMap,"myType",&isExist);
-  if(!isExist || aType.toInt() != TTIMESTAMP )
-    return false;
-  QString aMeshName = Storable::FindValue(aMap,"myMeshName",&isExist).latin1();
-  QString anEntity = Storable::FindValue(aMap,"myEntityId",&isExist).latin1();
-  QString aFieldName = Storable::FindValue(aMap,"myFieldName",&isExist).latin1();
-  QString aTimeStampId = Storable::FindValue(aMap,"myTimeStampId",&isExist).latin1();
-  TPrs3d_i* aPrs3d =
-    CreatePrs3d<TPrs3d_i>(theModule,
-                         theTimeStamp,
-                         aMeshName.latin1(),
-                         (Entity)anEntity.toInt(),
-                         aFieldName.latin1(),
-                         aTimeStampId.toInt());
-  if(aPrs3d){
-    SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
-    int aValue = aResourceMgr->integerValue("Visu:BuildDefaultPrs3d",0);
-    if(!aValue){
-      if(TDlg* aDlg = new TDlg(GetDesktop(theModule))){ // dialog box in creation mode
-       aDlg->initFromPrsObject(aPrs3d);
-       if(IsDlgModal)
-         if(aDlg->exec() && (aDlg->storeToPrsObject(aPrs3d))) {
-           // Optionally, create table and curves for cut lines
-           CreateCurves( theModule, dynamic_cast<VISU::CutLines_i*>( aPrs3d ), aDlg, true ); // in creation mode
-           delete aDlg;
-         } else {
-           DeletePrs3d(theModule,aPrs3d,theIO);
-           delete aDlg;
-           return false;
-         }
-       else{
-         aDlg->show();
-         return true;
-       }
+  SALOME_ListIteratorOfListIO It (aListIO);
+  QApplication::setOverrideCursor(Qt::waitCursor);
+  for (; It.More(); It.Next()) {
+    Handle(SALOME_InteractiveObject) anIO = It.Value();
+    SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
+    if (!aSObject->_is_nil()) {
+      CORBA::Object_var anObject = VISU::SObjectToObject(aSObject);
+      if (!CORBA::is_nil(anObject)) {
+        SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
+        if (!CORBA::is_nil(aMED.in()))
+          GetVisuGen(this)->ImportMed(aSObject);
+        SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject);
+        if (!CORBA::is_nil(aField.in()))
+          GetVisuGen(this)->ImportMedField(aField);
+      } else {
+        SALOMEDS::SObject_var aSFather = aSObject->GetFather();
+        SALOMEDS::GenericAttribute_var anAttr;
+        aSFather->FindAttribute(anAttr, "AttributeName");
+        SALOMEDS::AttributeName_var aName = SALOMEDS::AttributeName::_narrow(anAttr);
+        CORBA::String_var aValue = aName->Value();
+        if (strcmp(aValue.in(), "MEDFIELD") == 0)
+          GetVisuGen(this)->ImportMed(aSObject);
       }
     }
-    PublishInView(theModule,aPrs3d);
-    return true;
   }
-  return false;
+  UpdateObjBrowser(this, true);
+  QApplication::restoreOverrideCursor();
 }
 
-
-template<class TPrs3d_i, class TDlg, int IsDlgModal>
 void
-CreatePrs3d(SalomeApp_Module* theModule)
+CreateCurves( SalomeApp_Module* theModule,
+              VISU::CutLines_i* thePrs,
+              QDialog* theDlg,
+              const bool theCreate = true )
 {
-  if(CheckLock(GetCStudy(GetAppStudy(theModule))))
-    return;
-
-  SALOMEDS::SObject_var aTimeStampSObj;
-  Handle(SALOME_InteractiveObject) anIO;
-  if(!CheckTimeStamp(theModule,aTimeStampSObj,&anIO))
-    return;
-
-  if(!CreatePrs3d<TPrs3d_i,TDlg,IsDlgModal>(theModule,aTimeStampSObj,anIO))
+  if ( !thePrs )
     return;
-
-  theModule->application()->putInfo(QObject::tr("INF_DONE"));
-  theModule->updateObjBrowser();
-
-  if(SVTK_ViewWindow* aView = GetViewWindow(theModule))
-    aView->onFitAll();
-}
-
-void VisuGUI::CreateMesh (const Handle(SALOME_InteractiveObject)& theIO)
-{
-  _PTR(Study) aStudy = GetCStudy(GetAppStudy(this));
-  //if (CheckLock(aStudy))
-  //  return;
-
-  SALOMEDS::SObject_var aResultSObj =
-    GetDSStudy(aStudy)->FindObjectID(theIO->getEntry());
-
-  // Get VISU::Result
-  VISU::Result_var aResult;
-  VISU::Result_i* pResult = CheckResult(this, aResultSObj, aResult);
-  if (pResult == NULL)
+  VisuGUI_CutLinesDlg* aCutDlg = dynamic_cast<VisuGUI_CutLinesDlg*>( theDlg );
+  if ( !aCutDlg )
     return;
 
-  Storable::TRestoringMap aMap = getMapOfValue(aResultSObj);
-  bool isExist;
-  string aComment = Storable::FindValue(aMap,"myComment",&isExist).latin1();
-  if (!isExist)
-    return;
+  _PTR(Study)   aStudy = GetCStudy( GetAppStudy( theModule ) );
+  _PTR(SObject) aSObject = aStudy->FindObjectID( thePrs->GetEntry().latin1() );
 
-  CORBA::Object_var aMesh;
-  string aMeshName = Storable::FindValue(aMap,"myMeshName").latin1();
-#ifdef CHECKTIME
-  Utils_Timer timer;
-  timer.Start();
-#endif
-  if (aComment == "ENTITY") {
-    VISU::Entity anEntity = (VISU::Entity)Storable::FindValue(aMap,"myId").toInt();
-    if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),anEntity))
-      aMesh = GetVisuGen(this)->MeshOnEntity(aResult,aMeshName.c_str(),anEntity);
-  } else if (aComment == "FAMILY") {
-    VISU::Entity anEntity = (VISU::Entity)Storable::FindValue(aMap,"myEntityId").toInt();
-    string aFamilyName = Storable::FindValue(aMap,"myName").latin1();
-    if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),anEntity,aFamilyName.c_str()))
-      aMesh = GetVisuGen(this)->FamilyMeshOnEntity(aResult,aMeshName.c_str(),anEntity,aFamilyName.c_str());
-  } else if (aComment == "GROUP") {
-    string aGroupName = Storable::FindValue(aMap,"myName").latin1();
-    if (VISU::Mesh_i::IsPossible(pResult,aMeshName.c_str(),aGroupName.c_str()))
-      aMesh = GetVisuGen(this)->GroupMesh(aResult,aMeshName.c_str(),aGroupName.c_str());
+  if ( !theCreate && aSObject ) {
+    // Remove old Table
+    _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+    _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
+    for (; aIter->More(); aIter->Next()) {
+      _PTR(SObject) aTblObj = aIter->Value();
+      if ( aTblObj ) {
+        _PTR(GenericAttribute) anAttr;
+        if (aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+          aBuilder->RemoveObjectWithChildren( aIter->Value() ); // We should have only one child
+          break;
+        }
+      }
+    }
   }
-#ifdef CHECKTIME
-  timer.Stop();
-  MESSAGE("VisuGUI::CreateMesh() - CREATE MESH");
-  timer.Show();
-#endif
 
-  QApplication::restoreOverrideCursor();
-  VISU::Mesh_i* pPresent = NULL;
-  if (!CORBA::is_nil(aMesh))
-    pPresent = dynamic_cast<VISU::Mesh_i*>(VISU::GetServant(aMesh).in());
-  if (pPresent == NULL) {
-    SUIT_MessageBox::warn1 (GetDesktop(this),
-                            tr("VISU_WARNING"),
-                           tr("ERR_CANT_BUILD_PRESENTATION"),
-                           tr("BUT_OK"));
-    return;
+  if ( aCutDlg->isGenerateTable() ) {
+    GetVisuGen( theModule )->CreateTable( thePrs->GetEntry() );
+    if ( aCutDlg->isGenerateCurves() ) {
+      if ( aSObject ) {
+        _PTR(StudyBuilder) aBuilder = aStudy->NewBuilder();
+        _PTR(ChildIterator) aIter = aStudy->NewChildIterator(aSObject);
+        for (; aIter->More(); aIter->Next()) {
+          _PTR(SObject) aTblObj = aIter->Value();
+          if ( aTblObj ) {
+            _PTR(GenericAttribute) anAttr;
+            if ( aTblObj->FindAttribute( anAttr, "AttributeName" ) ) {
+              CreatePlot( theModule, aTblObj );
+            }
+          }
+        }
+      }
+    }
   }
 
-  if (SVTK_ViewWindow* aView = GetViewWindow(this)){
-    try {
-#ifdef CHECKTIME
-      Utils_Timer timer;
-      timer.Start();
-#endif
-      PublishInView(this, pPresent);
-      aView->onFitAll();
-#ifdef CHECKTIME
-      timer.Stop();
-      MESSAGE("VisuGUI::CreateMesh() - DISPLAY MESH");
-      timer.Show();
-#endif
-      application()->putInfo(QObject::tr("INF_DONE"));
-    } catch (std::runtime_error& exc) {
-      INFOS(exc.what());
-      SUIT_MessageBox::warn1 (GetDesktop(this),
-                              tr("VISU_WARNING"),
-                              tr("ERR_CANT_CREATE_ACTOR") + " " + tr(exc.what()),
-                              tr("BUT_OK"));
-    }
+  if (!theCreate && aSObject) {
+    UpdateObjBrowser(theModule);
   }
 }
 
@@ -507,13 +493,15 @@ OnCreateMesh()
     return;
 
   // Get selected SObject
-  SALOMEDS::SObject_var aResultSObj;
   Handle(SALOME_InteractiveObject) anIO;
   CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
   if (anIO.IsNull() || !anIO->hasEntry())
     return;
 
-  CreateMesh(anIO);
+  // create a VTK view window if it does not exist
+  GetViewWindow( this, /*create=*/true );
+
+  CreateMesh(this, anIO);
 }
 
 void
@@ -524,6 +512,9 @@ OnCreateManyMesh()
   if (CheckLock(aStudy))
     return;
 
+  // create a VTK view window if it does not exist
+  GetViewWindow( this, /*create=*/true );
+
   // Get selected SObject
   SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
   SALOME_ListIO aListIO;
@@ -534,7 +525,7 @@ OnCreateManyMesh()
     if (anIO.IsNull() || !anIO->hasEntry())
       return;
 
-    CreateMesh(anIO);
+    CreateMesh(this, anIO);
   }
 }
 
@@ -571,14 +562,14 @@ void
 VisuGUI::
 OnCreateCutPlanes()
 {
-  CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,1>(this);
+  CreatePrs3d<VISU::CutPlanes_i,VisuGUI_CutPlanesDlg,0>(this);
 }
 
 void
 VisuGUI::
 OnCreateCutLines()
 {
-  CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,1>(this);
+  CreatePrs3d<VISU::CutLines_i,VisuGUI_CutLinesDlg,0>(this);
 }
 
 void
@@ -588,13 +579,20 @@ OnCreateStreamLines()
   CreatePrs3d<VISU::StreamLines_i,VisuGUI_StreamLinesDlg,1>(this);
 }
 
+void
+VisuGUI::
+OnCreatePlot3D()
+{
+  CreatePrs3d<VISU::Plot3D_i,VisuGUI_Plot3DDlg,0>(this);
+}
+
 void
 VisuGUI::
 OnCreatePlot2dView()
 {
   CheckLock(GetCStudy(GetAppStudy(this)));
   GetVisuGen( this )->CreateContainer();
-  updateObjBrowser();
+  UpdateObjBrowser(this);
 }
 
 void
@@ -602,292 +600,229 @@ VisuGUI::
 OnDisplayPrs()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
+
+  SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
+
+  QApplication::setOverrideCursor(Qt::waitCursor);
+  SALOME_ListIO aList;
+  SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
+  mgr->selectedObjects(aList);
+
   Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
-  if ( !CORBA::is_nil( anObject ) ) {
-    // is it Prs3d object ?
-    VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
-    if(aPrsObject){
-      if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
-      UpdateViewer( this, aPrsObject );
-      if (SVTK_ViewWindow* vw = GetViewWindow( this )) {
-       vw->getRenderer()->ResetCameraClippingRange();
-       vw->Repaint();
-       vw->highlight(anIO, 1);
+  for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    anIO = it.Value();
+    CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
+    if ( !CORBA::is_nil( anObject ) ) {
+      // is it Prs3d object ?
+      VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+      if(aPrsObject){
+        if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Prs3d object");
+        UpdateViewer( this, aPrsObject );
+        if ( vw ) {
+          vw->highlight(anIO, 1);
+        }
+        continue;
+      }
+      // is it Curve ?
+      VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
+      if(aCurve){
+        if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
+        PlotCurve( this, aCurve, VISU::eDisplay );
+        continue;
+      }
+      // is it Container ?
+      VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
+      if(aContainer){
+        if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
+        PlotContainer( this, aContainer, VISU::eDisplay );
+        continue;
+      }
+      // is it Table ?
+      VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
+      if(aTable){
+        if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
+        PlotTable( this, aTable, VISU::eDisplay );
+        continue;
       }
-      return;
-    }
-    // is it Curve ?
-    VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
-    if(aCurve){
-      if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs : Curve object");
-      PlotCurve( this, aCurve, VISU::eDisplay );
-      return;
-    }
-    // is it Container ?
-    VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(anObject).in());
-    if(aContainer){
-      if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Container object");
-      PlotContainer( this, aContainer, VISU::eDisplay );
-      return;
-    }
-    // is it Table ?
-    VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(anObject).in());
-    if(aTable){
-      if(MYDEBUG) MESSAGE("VisuGUI::DisplayPrs : Table object");
-      PlotTable( this, aTable, VISU::eDisplay );
-      return;
     }
   }
+  if ( vw ) {
+    vw->getRenderer()->ResetCameraClippingRange();
+    vw->Repaint();
+  }
+  QApplication::restoreOverrideCursor();
 }
 
 void
 VisuGUI::
 OnDisplayOnlyPrs()
 {
+  OnEraseAll();
+  OnDisplayPrs();
 }
 
-void VisuGUI::ErasePrs (CORBA::Object_ptr theObject)
+void
+VisuGUI::
+OnErasePrs()
 {
-  if (MYDEBUG) MESSAGE("ErasePrs");
+  if(MYDEBUG) MESSAGE("OnErasePrs");
 
-  if ( !CORBA::is_nil( theObject ) ) {
-    VISU::Base_var aBase = VISU::Base::_narrow(theObject);
-    if ( CORBA::is_nil( aBase ) ) return;
-    VISU::VISUType aType = aBase->GetType();
-    switch (aType){
-    case VISU::TCURVE:{
-      if(VISU::Curve_i* aCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aBase).in()))
-       PlotCurve(this, aCurve, VISU::eErase );
-      break;
-    }
-    case VISU::TCONTAINER:{
-      if(VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aBase).in()))
-       PlotContainer(this, aContainer, VISU::eErase );
-      break;
-    }
-    case VISU::TTABLE:{
-      if(VISU::Table_i* aTable = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aBase).in()))
-       PlotTable(this, aTable, VISU::eErase );
-      break;
-    }
-    default:{
-      if(VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aBase).in())){
-       ErasePrs3d( this, aPrsObject );
-       if (SVTK_ViewWindow* vw = GetViewWindow( this ))
-         vw->Repaint();
-      }
-    }
-    } // switch (aType)
+  QApplication::setOverrideCursor(Qt::waitCursor);
+
+  SVTK_ViewWindow* vw = GetViewWindow( this );
+  if (vw)
+    vw->unHighlightAll();
+
+  SALOME_ListIO aList;
+  SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
+  mgr->selectedObjects(aList);
+
+  Handle(SALOME_InteractiveObject) anIO;
+  for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    anIO = it.Value();
+    CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
+    ErasePrs( this, anObject, false );
   }
+
+  if (vw)
+    vw->Repaint();
+
+  QApplication::restoreOverrideCursor();
 }
 
+
 void
 VisuGUI::
-OnErasePrs()
+OnEditScalarMap()
 {
-  if(MYDEBUG) MESSAGE("OnErasePrs");
   Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj( this, &anIO );
-  ErasePrs(anObject);
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg,1>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
+  }
 }
 
-template<class TPrs3d_i, class TDlg>
+
 void
-EditPrs3d (SalomeApp_Module* theModule, VISU::Prs3d_i* thePrs3d)
+VisuGUI::
+OnEditDeformedShape()
 {
-  TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d);
-  if (aPrsObject) {
-    //TDlg* aDlg = new TDlg (GetDesktop(theModule), false, true);
-    TDlg* aDlg = new TDlg (GetDesktop(theModule));
-    aDlg->initFromPrsObject(aPrsObject);
-    if (aDlg->exec()) {
-      if (!(aDlg->storeToPrsObject(aPrsObject))) {
-       delete aDlg;
-        return;
-      }
-      RecreateActor(theModule, aPrsObject);
-      if (SVTK_ViewWindow* vw = GetViewWindow(theModule)) {
-       //if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
-          vw->getRenderer()->ResetCameraClippingRange();
-          vw->Repaint();
-       //}
-      }
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg,1>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
     }
-    delete aDlg;
   }
 }
 
+
 void
 VisuGUI::
-OnEditPrs()
+OnEditCutPlanes()
 {
-  if (CheckLock(GetCStudy(GetAppStudy(this))))
-    return;
-
   Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
-  if (CORBA::is_nil(anObject)) return;
-  PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
-  if (!aServant.in()) return;
-
-  VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
-  if (!aPrs3d) return;
-
-  switch (aPrs3d->GetType()) {
-  case VISU::TMESH:
-    break;
-  case VISU::TSCALARMAP:
-    EditPrs3d<VISU::ScalarMap_i, VisuGUI_ScalarBarDlg>(this, aPrs3d);
-    break;
-  case VISU::TDEFORMEDSHAPE:
-    EditPrs3d<VISU::DeformedShape_i, VisuGUI_DeformedShapeDlg>(this, aPrs3d);
-    break;
-  case VISU::TCUTPLANES:
-    EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg>(this, aPrs3d);
-    /*{
-      VISU::CutPlanes_i* aPrsObject = dynamic_cast<VISU::CutPlanes_i*>(aPrs3d);
-      if (aPrsObject) {
-       VisuGUI_CutPlanesDlg* aDlg =
-          new VisuGUI_CutPlanesDlg (GetDesktop(this), false, false);
-        aDlg->initFromPrsObject(aPrsObject);
-       aDlg->show();
-      }
-    }*/
-    break;
-  case VISU::TCUTLINES:
-    EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg>(this, aPrs3d);
-    /*{
-      VISU::CutLines_i* aPrsObject = dynamic_cast<VISU::CutLines_i*>(aPrs3d);
-      if (aPrsObject) {
-       VisuGUI_CutLinesDlg* aDlg =
-          new VisuGUI_CutLinesDlg (GetDesktop(this), false, false);
-        aDlg->initFromPrsObject(aPrsObject);
-       aDlg->show();
-      }
-    }*/
-    break;
-  case VISU::TISOSURFACE:
-    EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg>(this, aPrs3d);
-    break;
-  case VISU::TVECTORS:
-    EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg>(this, aPrs3d);
-    break;
-  case VISU::TSTREAMLINES:
-    EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg>(this, aPrs3d);
-    break;
-  default:
-    return;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::CutPlanes_i, VisuGUI_CutPlanesDlg,0>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
   }
-
-  if (SVTK_ViewWindow* vw = GetViewWindow())
-    vw->highlight(anIO, 1);
 }
 
+
 void
 VisuGUI::
-OnDeletePrs()
+OnEditCutLines()
 {
-  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
-  if (CheckLock(aCStudy))
-    return;
-  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
-
   Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
-  if (anIO.IsNull())
-    return;
-
-  // There is a transaction
-  SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
-  aStudyBuilder->NewCommand();
-
-  // is it Prs3d object ?
-  VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
-  if (aPrsObject) {
-    DeletePrs3d(this, aPrsObject, anIO);
-  }
-
-  // is it Curve object ?
-  VISU::Curve_i* aCurveObject = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
-  if (aCurveObject) {
-    //jfa tmp:DeleteCurve(this, aCurveObject, anIO);
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::CutLines_i, VisuGUI_CutLinesDlg,0>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
   }
-
-  aStudyBuilder->CommitCommand();
 }
 
+
 void
 VisuGUI::
-OnDisplayManyPrs()
+OnEditIsoSurfaces()
 {
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::IsoSurfaces_i, VisuGUI_IsoSurfacesDlg,1>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
+  }
 }
 
+
 void
 VisuGUI::
-OnEraseManyPrs()
+OnEditVectors()
 {
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::Vectors_i, VisuGUI_VectorsDlg,1>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
+  }
 }
 
+
 void
 VisuGUI::
-OnDisplayOnlyManyPrs()
+OnEditStreamLines()
 {
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::StreamLines_i, VisuGUI_StreamLinesDlg,1>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
+    }
+  }
 }
 
+
 void
 VisuGUI::
-OnEraseAll()
+OnEditPlot3D()
 {
-  SVTK_ViewWindow* vw = GetViewWindow();
-  if (!vw) return;
-
-  /*jfa tmp:GetActiveStudy()->unHighlightAll();
-  if (vtkRenderer *aRen = GetRenderer()) {
-    vtkActor *anActor;
-    vtkActorCollection *anActColl = aRen->GetActors();
-    for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
-      if (anActor->GetVisibility() > 0)
-       if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
-         anVISUActor = anVISUActor->GetParent();
-          anVISUActor->VisibilityOff();
-       }
+  Handle(SALOME_InteractiveObject) anIO;
+  if(VISU::Prs3d_i* aPrs3d = GetPrsToModify(this,&anIO)){
+    EditPrs3d<VISU::Plot3D_i, VisuGUI_Plot3DDlg,0>(this, aPrs3d);
+    if(SVTK_ViewWindow* aViewWindow = GetViewWindow()){
+      aViewWindow->highlight(anIO, 1);
     }
-    vw->Repaint();
-  }*/
+  }
 }
 
-void VisuGUI::ChangeRepresentation (VISU::PresentationType theType)
-{
-  SVTK_ViewWindow* vw = GetViewWindow();
-  if (!vw) return;
-
-  Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
-  if (CORBA::is_nil(anObject)) return;
-  PortableServer::ServantBase_var aServant = VISU::GetServant(anObject);
-  if (!aServant.in()) return;
 
-  VISU::Prs3d_i* aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aServant.in());
-  if (aPrs3d) {
-    if (VISU_Actor* anActor = GetActor(aPrs3d, vw)) {
-      switch (theType) {
-      case VISU::SHRINK:
-        if (anActor->IsShrunk())
-          anActor->UnShrink();
-        else
-          anActor->SetShrink();
-       break;
-      default:
-       if (VISU::Mesh_i* aMesh = dynamic_cast<VISU::Mesh_i*>(aPrs3d)) {
-         aMesh->SetPresentationType(theType);
-         RecreateActor(this, aMesh);
-       } else {
-         anActor->SetRepresentation(theType);
-        }
+void
+VisuGUI::
+OnEraseAll()
+{
+  if (SVTK_ViewWindow* vw = GetViewWindow()) {
+    vw->unHighlightAll();
+    if (vtkRenderer *aRen = vw->getRenderer()) {
+      vtkActor *anActor;
+      vtkActorCollection *anActColl = aRen->GetActors();
+      for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
+        if (anActor->GetVisibility() > 0)
+          if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
+            anVISUActor = anVISUActor->GetParent();
+            anVISUActor->VisibilityOff();
+          }
       }
       vw->Repaint();
     }
+  } else if (SPlot2d_Viewer* aPlot2d = GetPlot2dViewer(this, false)) {
+    aPlot2d->EraseAll();
   }
 }
 
@@ -895,42 +830,42 @@ void
 VisuGUI::
 OnMakeSurfaceframe()
 {
-  ChangeRepresentation(VISU::SURFACEFRAME);
+  ChangeRepresentation(this, VISU::SURFACEFRAME);
 }
 
 void
 VisuGUI::
 OnMakeInsideframe()
 {
-  ChangeRepresentation(VISU::INSIDEFRAME);
+  ChangeRepresentation(this, VISU::INSIDEFRAME);
 }
 
 void
 VisuGUI::
 OnMakeWireframe()
 {
-  ChangeRepresentation(VISU::WIREFRAME);
+  ChangeRepresentation(this, VISU::WIREFRAME);
 }
 
 void
 VisuGUI::
 OnMakeSurface()
 {
-  ChangeRepresentation(VISU::SHADED);
+  ChangeRepresentation(this, VISU::SHADED);
 }
 
 void
 VisuGUI::
 OnMakePoints()
 {
-  ChangeRepresentation(VISU::POINT);
+  ChangeRepresentation(this, VISU::POINT);
 }
 
 void
 VisuGUI::
 OnMakeShrink()
 {
-  ChangeRepresentation(VISU::SHRINK);
+  ChangeRepresentation(this, VISU::SHRINK);
 }
 
 void
@@ -959,16 +894,16 @@ OnChangeColor()
   if (aMesh) {
     switch (aRepresent) {
       case VISU::POINT :
-       anOldColor = aMesh->GetNodeColor();
-       break;
+        anOldColor = aMesh->GetNodeColor();
+        break;
       case VISU::WIREFRAME :
       case VISU::INSIDEFRAME :
-       anOldColor = aMesh->GetLinkColor();
-       break;
+        anOldColor = aMesh->GetLinkColor();
+        break;
       case VISU::SHADED :
       case VISU::SURFACEFRAME :
-       anOldColor = aMesh->GetCellColor();
-       break;
+        anOldColor = aMesh->GetCellColor();
+        break;
     }
   } else if (aDeformedShape) {
     anOldColor = aDeformedShape->GetColor();
@@ -986,17 +921,17 @@ OnChangeColor()
     aNewColor.B = aColorNew.blue()/255.;
     if (aMesh) {
       switch (aRepresent) {
-       case VISU::POINT :
-         aMesh->SetNodeColor(aNewColor);
-         break;
-       case VISU::WIREFRAME :
-       case VISU::INSIDEFRAME :
-         aMesh->SetLinkColor(aNewColor);
-         break;
-       case VISU::SHADED :
-       case VISU::SURFACEFRAME :
-         aMesh->SetCellColor(aNewColor);
-         break;
+        case VISU::POINT :
+          aMesh->SetNodeColor(aNewColor);
+          break;
+        case VISU::WIREFRAME :
+        case VISU::INSIDEFRAME :
+          aMesh->SetLinkColor(aNewColor);
+          break;
+        case VISU::SHADED :
+        case VISU::SURFACEFRAME :
+          aMesh->SetCellColor(aNewColor);
+          break;
       }
     } else {
       aDeformedShape->SetColor(aNewColor);
@@ -1102,8 +1037,8 @@ OnChangeLines()
   VisuGUI_CursorDlg* CursorDlg =
     new VisuGUI_CursorDlg (GetDesktop(this), tr("DLG_LINEWIDTH_TITLE"), TRUE);
 
-  CursorDlg->Comment1->setText("DLG_LINEWIDTH_CMT1");
-  CursorDlg->Comment2->setText("DLG_LINEWIDTH_CMT2");
+  CursorDlg->Comment1->setText(tr("DLG_LINEWIDTH_CMT1"));
+  CursorDlg->Comment2->setText(tr("DLG_LINEWIDTH_CMT2"));
   CursorDlg->SpinBox1->setMinValue(1);
   CursorDlg->SpinBox1->setMaxValue(10);
 
@@ -1132,12 +1067,12 @@ OnShowTable()
     if ( !CORBA::is_nil( aVisuObj ) && aVisuObj->GetType() == VISU::TTABLE ) {
       CORBA::Object_ptr aTable = VISU::Table::_narrow( anObject );
       if( !CORBA::is_nil( aTable ) ) {
-       VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
-       if ( table ) {
-         SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
-       }
+        VISU::Table_i* table = dynamic_cast<VISU::Table_i*>( VISU::GetServant(aTable).in() );
+        if ( table ) {
+          SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( table->GetObjectEntry() );
+        }
       }
-    } 
+    }
   } else {
     // possibly this is Table SObject
     SO = GetCStudy( GetAppStudy( this ) )->FindObjectID( anIO->getEntry() );
@@ -1147,11 +1082,11 @@ OnShowTable()
     return;
 
   VisuGUI_TableDlg* dlg = new VisuGUI_TableDlg( GetDesktop( this ),
-                                              SO, 
-                                              false, 
-                                              //SAL2670 Orientation of show tables
-                                              VisuGUI_TableDlg::ttAuto, 
-                                              Qt::Vertical );
+                                               SO,
+                                               false,
+                                               //SAL2670 Orientation of show tables
+                                               VisuGUI_TableDlg::ttAuto,
+                                               Qt::Vertical );
   dlg->show();
 }
 
@@ -1166,77 +1101,50 @@ OnCreateTable()
   VISU::CutLines_var aCutLines = VISU::CutLines::_narrow( anObject );
   if(!aCutLines->_is_nil() || IsSObjectTable(aSObject)) {
     GetVisuGen( this )->CreateTable( aSObject->GetID().c_str() );
-    updateObjBrowser();
+    UpdateObjBrowser(this);
   }
 }
 
 void
 VisuGUI::
-OnDeleteObject()
+OnDeleteObjects()
 {
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   if (CheckLock(aCStudy))
     return;
-  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
 
+  SALOME_ListIO aList;
+  SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
+  mgr->selectedObjects(aList);
+  int i = 0, nbSelected = aList.Extent();
+  if (nbSelected < 1) return;
+
+  const char* entries [nbSelected];
   Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
-  if (anIO.IsNull() || !anIO->hasEntry())
-    return;
+  for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
+    anIO = it.Value();
+    if (anIO->hasEntry())
+      entries[i++] = anIO->getEntry();
+  }
+  nbSelected = i;
+  if (nbSelected < 1) return;
 
-  SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(anIO->getEntry());
-  if (!aSObject->_is_nil()) {
-    SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
-    for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
-      SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
-      CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
-      ErasePrs(aChildObj);
-    }
-    SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
-    // There is a transaction
-    aStudyBuilder->NewCommand();
-    CORBA::Object_var anObj = VISU::SObjectToObject(aSObject);
-    if (!CORBA::is_nil(anObj)) {
-      VISU::Base_var aBase = VISU::Base::_narrow(anObj);
-      if (!CORBA::is_nil(aBase)) {
-        VISU::VISUType aType = aBase->GetType();
-        switch (aType) {
-        case VISU::TRESULT:
-          {
-            SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
-           for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
-              SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
-              CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
-              if (CORBA::is_nil(aChildObj)) continue;
-              VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj);
-              if (CORBA::is_nil(aPrs3d)) continue;
-              VISU::Prs3d_i* pPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
-              DeletePrs3d(this, pPrs3d, NULL);
-           }
-           break;
-         }
-        case VISU::TTABLE:
-          {
-            SALOMEDS::ChildIterator_var aChildIter = aStudy->NewChildIterator(aSObject);
-           for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()) {
-              SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
-              CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject);
-              if (CORBA::is_nil(aChildObj)) continue;
-              CORBA::Object_ptr aCurve = VISU::Curve::_narrow(aChildObj);
-              if (CORBA::is_nil(aCurve)) continue;
-              VISU::Curve_i* pCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
-              //jfa tmp:DeleteCurve(this, pCurve, NULL);
-            }
-            break;
-          }
-        }
-      }
+  // There is a transaction
+  _PTR(StudyBuilder) aStudyBuilder = aCStudy->NewBuilder();
+  aStudyBuilder->NewCommand();
+
+  for (i = 0; i < nbSelected; i++) {
+    _PTR(SObject) aSObject = aCStudy->FindObjectID(entries[i]);
+    if (aSObject) {
+      DeleteSObject(this, aCStudy, aSObject);
     }
-    aStudyBuilder->RemoveObjectWithChildren(aSObject);
-    aStudyBuilder->CommitCommand();
-    //jfa tmp:GetActiveStudy()->unHighlightAll();
-    updateObjBrowser(true);
   }
+
+  // Finish transaction
+  aStudyBuilder->CommitCommand();
+
+  //GetActiveStudy()->unHighlightAll();
+  UpdateObjBrowser(this, true);
 }
 
 void
@@ -1257,65 +1165,73 @@ OnPlotData()
       // Table (VISU object) is selected
       CORBA::Object_ptr aTbl = VISU::Table::_narrow( anObject );
       if( !CORBA::is_nil( aTbl ) ) {
-       VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
-       if ( table ) {
-         _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
-         if ( IsSObjectTable(SO) ) {
-           // get name of SObject
-           if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
-             aName = anAttr;
-             SOName = aName->Value();
-           }
-           SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
-           if ( dlg->exec() == QDialog::Accepted ) {
-             if ( !IsStudyLocked( aStudy ) ) {
-               // if study is not locked - create new container, create curves
-               // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
-               int horIndex;
-               QValueList<int> verIndices;
-               dlg->getCurvesSource( horIndex, verIndices );
-               if ( horIndex >= 0 && verIndices.count() > 0 ) {
-                 CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
-                 if( !CORBA::is_nil( aContainer ) ) {
-                   VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
-                   if ( pContainer ) {
-                     for ( int i = 0; i < verIndices.count(); i++ ) {
-                       CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
-                       if( !CORBA::is_nil( aNewCurve ) ) {
-                         VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
-                         if ( pCrv ) {
-                           bool isAuto;
-                           int  marker, line, lineWidth;
-                           QColor color;
-                           if ( dlg->getCurveAttributes( verIndices[i], isAuto, marker, line, lineWidth, color ) && !isAuto ) {
-                             SALOMEDS::Color c; c.R = color.red()/255.; c.G = color.green()/255.; c.B = color.blue()/255.;
-                             pCrv->SetColor( c );
-                             pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
-                             pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
-                           }
-                           pContainer->AddCurve( pCrv->_this() );
-                         }
-                       }
-                     }
-                     updateObjBrowser();
-                     PlotContainer( this, pContainer, VISU::eDisplay );
-                   }
-                 }
-               }
-             }
-             else {
-               // if study is locked just get curves info and plot them if current viewer is of VIEW_PLOT2D type
-               QPtrList<Plot2d_Curve> container;
-               dlg->getCurves( container );
-               if ( !container.isEmpty() ) {
-                 GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
-                 GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
-               }
-             }
-           }
-           delete dlg;
-         }
-       }
+        VISU::Table_i* table = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTbl).in());
+        if ( table ) {
+          _PTR(SObject) SO = aStudy->FindObjectID( table->GetObjectEntry() );
+          if ( IsSObjectTable(SO) ) {
+            // get name of SObject
+            if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
+              aName = anAttr;
+              SOName = QString( aName->Value().c_str() );
+            }
+            SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
+            if ( dlg->exec() == QDialog::Accepted ) {
+              if ( !IsStudyLocked( aStudy ) ) {
+                // if study is not locked - create new container, create curves and insert them
+                // into container, then plot container if current viewer is of VIEW_PLOT2D type
+                int horIndex;
+                QValueList<int> verIndices;
+                dlg->getCurvesSource( horIndex, verIndices );
+                if ( horIndex >= 0 && verIndices.count() > 0 ) {
+                  CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
+                  if( !CORBA::is_nil( aContainer ) ) {
+                    VISU::Container_i* pContainer =
+                      dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
+                    if ( pContainer ) {
+                      for ( int i = 0; i < verIndices.count(); i++ ) {
+                        CORBA::Object_var aNewCurve =
+                          GetVisuGen(this)->CreateCurve( table->_this(), horIndex+1, verIndices[i]+1 );
+                        if( !CORBA::is_nil( aNewCurve ) ) {
+                          VISU::Curve_i* pCrv =
+                            dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
+                          if ( pCrv ) {
+                            bool isAuto;
+                            int  marker, line, lineWidth;
+                            QColor color;
+                            if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
+                                                         line, lineWidth, color) && !isAuto ) {
+                              SALOMEDS::Color c;
+                              c.R = color.red()  /255.;
+                              c.G = color.green()/255.;
+                              c.B = color.blue() /255.;
+                              pCrv->SetColor( c );
+                              pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
+                              pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+                            }
+                            pContainer->AddCurve( pCrv->_this() );
+                          }
+                        }
+                      }
+                      UpdateObjBrowser(this);
+                      PlotContainer( this, pContainer, VISU::eDisplay );
+                    }
+                  }
+                }
+              }
+              else {
+                // if study is locked just get curves info and plot them
+                // if current viewer is of VIEW_PLOT2D type
+                QPtrList<Plot2d_Curve> container;
+                dlg->getCurves( container );
+                if ( !container.isEmpty() ) {
+                  GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+                  GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
+                }
+              }
+            }
+            delete dlg;
+          }
+        }
       }
     }
   }
@@ -1325,57 +1241,62 @@ OnPlotData()
     if ( IsSObjectTable(SO) ) {
       // get name of SObject
       if ( SO->FindAttribute( anAttr, "AttributeName" ) ) {
-       aName = anAttr;
-       SOName = aName->Value();
+        aName = anAttr;
+        SOName = QString( aName->Value().c_str() );
       }
       SPlot2d_SetupPlot2dDlg* dlg = new SPlot2d_SetupPlot2dDlg( SO, GetDesktop( this ) );
       if ( dlg->exec() == QDialog::Accepted ) {
-       if ( !IsStudyLocked( aStudy ) ) {
-         // if study is not locked - create new table and container objects, create curves
-         // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
-         int horIndex;
-         QValueList<int> verIndices;
-         dlg->getCurvesSource( horIndex, verIndices );
-         if ( horIndex >= 0 && verIndices.count() > 0 ) {
-           CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
-           CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
-           if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
-             VISU::Table_i*     pTable     = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
-             VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
-
-             if ( pContainer && pTable ) {
-               for ( int i = 0; i < verIndices.count(); i++ ) {
-                 CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve( pTable->_this(), horIndex+1, verIndices[i]+1 );
-                 if( !CORBA::is_nil( aNewCurve ) ) {
-                   VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
-                   if ( pCrv ) {
-                     bool isAuto;
-                     int  marker, line, lineWidth;
-                     QColor color;
-                     if ( dlg->getCurveAttributes( verIndices[i], isAuto, marker, line, lineWidth, color ) && !isAuto ) {
-                       SALOMEDS::Color c; c.R = color.red()/255.; c.G = color.green()/255.; c.B = color.blue()/255.;
-                       pCrv->SetColor( c );
-                       pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
-                       pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
-                     }
-                     pContainer->AddCurve( pCrv->_this() );
-                   }
-                 }
-               }
-               updateObjBrowser();
-               PlotContainer( this, pContainer, VISU::eDisplay );
-             }
-           }
-         }
-       } else {
-         // if study is locked just get curves info and plot them
-         QPtrList<Plot2d_Curve> container;
-         dlg->getCurves( container );
-         if ( !container.isEmpty() ) {
-           GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
-           GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
-         }
-       }
+        if ( !IsStudyLocked( aStudy ) ) {
+          // if study is not locked - create new table and container objects, create curves
+          // and insert them into container, then plot container if current viewer is of VIEW_PLOT2D type
+          int horIndex;
+          QValueList<int> verIndices;
+          dlg->getCurvesSource( horIndex, verIndices );
+          if ( horIndex >= 0 && verIndices.count() > 0 ) {
+            CORBA::Object_var aTable = GetVisuGen(this)->CreateTable( SO->GetID().c_str() );
+            CORBA::Object_var aContainer = GetVisuGen(this)->CreateContainer();
+            if ( !CORBA::is_nil( aTable ) && !CORBA::is_nil( aContainer ) ) {
+              VISU::Table_i*     pTable     = dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
+              VISU::Container_i* pContainer = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
+
+              if ( pContainer && pTable ) {
+                for ( int i = 0; i < verIndices.count(); i++ ) {
+                  CORBA::Object_var aNewCurve = GetVisuGen(this)->CreateCurve
+                    ( pTable->_this(), horIndex+1, verIndices[i]+1 );
+                  if( !CORBA::is_nil( aNewCurve ) ) {
+                    VISU::Curve_i* pCrv = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aNewCurve).in());
+                    if ( pCrv ) {
+                      bool isAuto;
+                      int  marker, line, lineWidth;
+                      QColor color;
+                      if ( dlg->getCurveAttributes(verIndices[i], isAuto, marker,
+                                                   line, lineWidth, color) && !isAuto ) {
+                        SALOMEDS::Color c;
+                        c.R = color.red()/255.;
+                        c.G = color.green()/255.;
+                        c.B = color.blue()/255.;
+                        pCrv->SetColor( c );
+                        pCrv->SetMarker( ( VISU::Curve::MarkerType )marker );
+                        pCrv->SetLine( ( VISU::Curve::LineType )line, lineWidth );
+                      }
+                      pContainer->AddCurve( pCrv->_this() );
+                    }
+                  }
+                }
+                UpdateObjBrowser(this);
+                PlotContainer( this, pContainer, VISU::eDisplay );
+              }
+            }
+          }
+        } else {
+          // if study is locked just get curves info and plot them
+          QPtrList<Plot2d_Curve> container;
+          dlg->getCurves( container );
+          if ( !container.isEmpty() ) {
+            GetPlot2dViewer( this )->getActiveViewFrame()->displayCurves( container, true );
+            GetPlot2dViewer( this )->getActiveViewFrame()->setTitle( SOName );
+          }
+        }
       }
       delete dlg;
     }
@@ -1386,6 +1307,42 @@ void
 VisuGUI::
 OnCurveProperties()
 {
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+  if (aListIO.Extent() != 1) return;
+
+  SalomeApp_Study* aAppStudy = GetAppStudy(this);
+  const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+  CORBA::Object_var anObject = GetSelectedObj( aAppStudy, anIO->getEntry() );
+  if (CORBA::is_nil( anObject )) return;
+
+  VISU::Base_var aVisuObj = VISU::Base::_narrow(anObject);
+  if (!CORBA::is_nil(aVisuObj) && aVisuObj->GetType() == VISU::TCURVE) {
+    // Curve object
+    CORBA::Object_ptr aCurve = VISU::Curve::_narrow( anObject );
+    if( !CORBA::is_nil( aCurve ) ) {
+      VISU::Curve_i* aDSCurve = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
+      if ( aDSCurve && (!IsStudyLocked( GetCStudy(aAppStudy) )) ) {
+        Plot2d_SetupCurveDlg aDlg(GetDesktop( this ));
+
+        aDlg.setLine( (int)aDSCurve->GetLine(), aDSCurve->GetLineWidth() );
+        aDlg.setMarker( (int)aDSCurve->GetMarker() );
+        SALOMEDS::Color aColor = aDSCurve->GetColor();
+        aDlg.setColor( QColor( (int)(aColor.R*255.), (int)(aColor.G*255.), (int)(aColor.B*255.) ) );
+        if( aDlg.exec() == QDialog::Accepted ) {
+          aDSCurve->SetLine( (VISU::Curve::LineType)aDlg.getLine(), aDlg.getLineWidth() );
+          aDSCurve->SetMarker( (VISU::Curve::MarkerType)aDlg.getMarker());
+          SALOMEDS::Color newColor;
+          newColor.R = aDlg.getColor().red()/255.;
+          newColor.G = aDlg.getColor().green()/255.;
+          newColor.B = aDlg.getColor().blue()/255.;
+          aDSCurve->SetColor( newColor );
+          PlotCurve(this, aDSCurve, VISU::eDisplay);
+        }
+      }
+    }
+  }
 }
 
 void
@@ -1395,7 +1352,6 @@ OnClearContainer()
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   if (CheckLock(aCStudy))
     return;
-  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
   Handle(SALOME_InteractiveObject) anIO;
   CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
   if (anIO.IsNull() || CORBA::is_nil(anObject))
@@ -1408,8 +1364,8 @@ OnClearContainer()
     if (!CORBA::is_nil(aCnt)) {
       VISU::Container_i* container = dynamic_cast<VISU::Container_i*>(VISU::GetServant(aCnt).in());
       if (container && container->GetNbCurves() > 0) {
-       container->Clear();
-       updateObjBrowser();
+        container->Clear();
+        UpdateObjBrowser(this);
       }
     }
   }
@@ -1428,11 +1384,11 @@ OnEditContainer()
   VISU::Container_i* aContainer = dynamic_cast<VISU::Container_i*>(aServant.in());
   if (!aContainer) return;
 
-  VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (GetDesktop(this));
+  VisuGUI_EditContainerDlg* aDlg = new VisuGUI_EditContainerDlg (this);
   aDlg->initFromPrsObject(aContainer);
   if (aDlg->exec()) {
     aDlg->storeToPrsObject(aContainer);
-    updateObjBrowser(true);
+    UpdateObjBrowser(this, true);
   }
   delete aDlg;
 }
@@ -1444,7 +1400,6 @@ OnSaveViewParams()
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   if (CheckLock(aCStudy))
     return;
-  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
 
   SUIT_ViewManager* aViewMgr = getApp()->activeViewManager();
   if (aViewMgr->getType() != SVTK_Viewer::Type())
@@ -1462,7 +1417,7 @@ OnSaveViewParams()
     const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
     VISU::View3D_i::SaveViewParams(aViewMgr, anIO->getName());
   }
-  updateObjBrowser();
+  UpdateObjBrowser(this);
 }
 
 void
@@ -1486,38 +1441,6 @@ OnRestoreViewParams()
   VISU::View3D_i::RestoreViewParams(aViewMgr, aSObj->GetName().c_str());//jfa tmp
 }
 
-void
-VisuGUI::
-OnDeleteViewParams()
-{
-  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
-  if (CheckLock(aCStudy))
-    return;
-  SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
-
-  Handle(SALOME_InteractiveObject) anIO;
-  CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
-  _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
-  if (!aSObject) return;
-
-  VISU::VISUType aType = (VISU::VISUType)getValue(aSObject, "myType").toInt();
-  if (aType == VISU::TVIEW3D) {
-    SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
-    SALOME_ListIO aListIO, aNewListIO;
-    aSelectionMgr->selectedObjects(aListIO);
-    for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) {
-      if (it.Value()->getEntry() != anIO->getEntry()) {
-        aNewListIO.Append(it.Value());
-      }
-    }
-    aSelectionMgr->setSelectedObjects(aNewListIO);
-
-    aCStudy->NewBuilder()->RemoveObject(aSObject);
-
-    updateObjBrowser();
-  }
-}
-
 void
 VisuGUI::
 OnRename()
@@ -1533,10 +1456,11 @@ OnRename()
   if (!aSObj) return;
 
   //TEST DU PARENT == VISU
-  _PTR(GenericAttribute) anAttr;
-  if (aSObj->FindAttribute(anAttr, "AttributeName")) {
+  _PTR(StudyBuilder) aBuilder = aCStudy->NewBuilder();
+  _PTR(GenericAttribute) anAttr = aBuilder->FindOrCreateAttribute(aSObj, "AttributeName");
+  if (anAttr) {
     _PTR(AttributeName) aName (anAttr);
-    QString Name = VisuGUI_NameDlg::getName(GetDesktop(this), aName->Value());
+    QString Name = VisuGUI_NameDlg::getName( GetDesktop( this ), aName->Value().c_str() );
     if (!Name.isEmpty()) {
       QApplication::setOverrideCursor(Qt::waitCursor);
 
@@ -1552,7 +1476,7 @@ OnRename()
                 VISU::Curve_i* curve =
                   dynamic_cast<VISU::Curve_i*>(VISU::GetServant(aCurve).in());
                 if (curve)
-                 curve->SetName(Name.latin1());
+                  curve->SetName(Name.latin1());
               }
               break;
             }
@@ -1563,7 +1487,7 @@ OnRename()
                 VISU::Table_i* table =
                   dynamic_cast<VISU::Table_i*>(VISU::GetServant(aTable).in());
                 if (table)
-                 table->SetName(Name.latin1());
+                  table->SetName(Name.latin1());
               }
               break;
             }
@@ -1574,7 +1498,7 @@ OnRename()
                 VISU::Container_i* container =
                   dynamic_cast<VISU::Container_i*>(VISU::GetServant(aContainer).in());
                 if (container)
-                 container->SetName(Name.latin1());
+                  container->SetName(Name.latin1());
               }
               break;
             }
@@ -1586,16 +1510,22 @@ OnRename()
       }
 
       // rename the study object
-      //getApp()->activeStudy()->renameIObject(anIO, Name);
       aName->SetValue(Name.latin1()); // rename the SObject
       anIO->setName(Name.latin1()); // rename the InteractiveObject
-      updateObjBrowser(false);
+      UpdateObjBrowser(this, false);
 
       QApplication::restoreOverrideCursor();
     }
   }
 }
 
+void
+VisuGUI::
+OnClippingPlanes()
+{
+  new VisuGUI_ClippingDlg (this, "", false);
+}
+
 void
 VisuGUI::
 OnSweep()
@@ -1623,22 +1553,22 @@ OnSweep()
   // Get sweep parameters
   SUIT_ResourceMgr* aResourceMgr = GetResourceMgr();
 
-  double aTempoDbl = aResourceMgr->doubleValue("Visu:SweepTempo", 0.1);
+  double aTempoDbl = aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1);
   int aTemp = int(1.E6 * aTempoDbl);
 
-  int aCycles = aResourceMgr->integerValue("Visu:SweepCycles", 1);
-  int aSteps  = aResourceMgr->integerValue("Visu:SweepSteps", 40);
+  int aCycles = aResourceMgr->integerValue("VISU", "sweeping_number_cycles", 1);
+  int aSteps  = aResourceMgr->integerValue("VISU", "sweeping_time_step", 40);
 
   // Sweep
   QApplication::setOverrideCursor(Qt::waitCursor);
   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);
-       vw->getRenderWindow()->getRenderWindow()->Render();
-       usleep(aTemp);
+        float aPercents = float(i)/aSteps;
+        aPrsObject->SetMapScale(aPercents);
+        aPrsObject->UpdateActor(aActor);
+        vw->getRenderWindow()->getRenderWindow()->Render();
+        usleep(aTemp);
       }
     }
   } catch (std::exception& exc) {
@@ -1653,9 +1583,10 @@ void
 VisuGUI::
 OnTimeAnimation()
 {
-  _PTR(Study) aStudyDS = GetCStudy(GetAppStudy(this));
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   VisuGUI_TimeAnimationDlg* aAnimationDlg =
-    new VisuGUI_TimeAnimationDlg(GetDesktop(this), aStudyDS);
+//    new VisuGUI_TimeAnimationDlg(GetDesktop(this), aCStudy);
+    new VisuGUI_TimeAnimationDlg (this, aCStudy);
 
   SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
   SALOME_ListIO aListIO;
@@ -1665,18 +1596,18 @@ OnTimeAnimation()
   long aNbTimes = 0;
   SALOME_ListIteratorOfListIO It (aListIO);
   for (; It.More(); It.Next()) {
-    _PTR(SObject) aSObject = aStudyDS->FindObjectID(It.Value()->getEntry());
+    _PTR(SObject) aSObject = aCStudy->FindObjectID(It.Value()->getEntry());
     if (!aSObject) continue;
     if (getValue(aSObject, "myComment") == QString("FIELD")) {
       long aNumber = getValue(aSObject, "myNbTimeStamps").toLong();
       if (aNumber > 1) {
-       if (!isDefined) {
-         aNbTimes = aNumber;
-         aAnimationDlg->addField(aSObject);
-         isDefined = true;
-       } else if (aNbTimes == aNumber) {
-         aAnimationDlg->addField(aSObject);
-       }
+        if (!isDefined) {
+          aNbTimes = aNumber;
+          aAnimationDlg->addField(aSObject);
+          isDefined = true;
+        } else if (aNbTimes == aNumber) {
+          aAnimationDlg->addField(aSObject);
+        }
       }
     }
   }
@@ -1684,6 +1615,43 @@ OnTimeAnimation()
   else delete aAnimationDlg;
 }
 
+//************************************************************************
+void
+VisuGUI::
+OnShowAnimation()
+{
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+
+  if (aListIO.Extent() != 1)
+    return;
+
+  const Handle(SALOME_InteractiveObject)& anIO = aListIO.First();
+
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+
+  _PTR(SObject) aSObj = aCStudy->FindObjectID(anIO->getEntry());
+  if (!aSObj) return;
+
+  VISU::Storable::TRestoringMap aMap;
+  _PTR(GenericAttribute) anAttr;
+  if (!aSObj->FindAttribute(anAttr, "AttributeComment")) return;
+
+  _PTR(AttributeComment) aComment (anAttr);
+  string aComm = aComment->Value();
+  QString strIn (aComm.c_str());
+  VISU::Storable::StrToMap(strIn, aMap);
+  bool isExist;
+  VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+  if (aType != VISU::TANIMATION) return;
+
+  VisuGUI_TimeAnimationDlg* aAnimationDlg =
+    new VisuGUI_TimeAnimationDlg(this, aCStudy);
+  aAnimationDlg->restoreFromStudy(aSObj);
+  aAnimationDlg->show();
+}
+
 void
 VisuGUI::
 OnCopyPresentation()
@@ -1692,7 +1660,6 @@ OnCopyPresentation()
   if (CheckLock(aCStudy))
     return;
 
-  //VISU::Prs3d_i* aPrsObject = GetSelectedPrs3d();
   Handle(SALOME_InteractiveObject) anIO;
   CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
   if (CORBA::is_nil(anObject)) return;
@@ -1767,15 +1734,29 @@ OnCopyPresentation()
       UpdateViewer(this, aSameVectors);
     }
     break;
+  case VISU::TPLOT3D:
+    {
+      VISU::Plot3D_i* aPlot3DPrs = dynamic_cast<VISU::Plot3D_i*>(aPrsObject);
+      VISU::Plot3D_i* aSamePlot3D = new VISU::Plot3D_i(aPlot3DPrs->GetResult());
+      aSamePlot3D->SameAs(aPlot3DPrs);
+      UpdateViewer(this, aSamePlot3D);
+    }
+    break;
   }
-  updateObjBrowser();
+  UpdateObjBrowser(this);
 }
 
 void
 VisuGUI::
 OnSelectionInfo()
 {
-  (new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
+  if (GetViewWindow())
+    (new VisuGUI_SelectionDlg(GetDesktop(this)))->show();
+  else
+    SUIT_MessageBox::warn1(GetDesktop(this),
+                           tr("WRN_VISU"),
+                           tr("ERR_ACTIVATE_VIEW3D"),
+                           tr("BUT_OK") );
 }
 
 void
@@ -1788,6 +1769,165 @@ OnScaling()
   m_NonIsoDlg->show();
 }
 
+void
+VisuGUI::
+OnCubeAxes()
+{
+  //Show dialog that allows to select scale function and corresponding scale factor
+  VisuGUI_CubeAxesDlg* aDlg = new VisuGUI_CubeAxesDlg (GetDesktop(this));
+  aDlg->show();
+}
+
+void
+VisuGUI::
+OnMergeScalarBars()
+{
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+
+  SALOME_ListIteratorOfListIO It (aListIO);
+
+  // first find the bounds
+  double aMin, aMax; bool first = true;
+  for (; It.More(); It.Next()) {
+    Handle(SALOME_InteractiveObject)& anIO = It.Value();
+    std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
+    if (!aPrsList.empty()) {
+      for (int i = 0, n = aPrsList.size(); i < n; i++) {
+        VISU::Prs3d_i* aPrsObject = aPrsList[i];
+        if (aPrsObject) {
+          VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+          if (aScalar) {
+            if (first) {
+              first = false;
+              aMin = aScalar->GetMin(); aMax = aScalar->GetMax();
+            } else {
+              if (aScalar->GetMin() < aMin) aMin = aScalar->GetMin();
+              if (aScalar->GetMax() > aMax) aMax = aScalar->GetMax();
+            }
+          }
+        }
+      }
+    }
+  }
+
+  // set the computed range to every selected ScalarMap
+  bool update = false;
+  for (It.Initialize(aListIO); It.More(); It.Next() ) {
+    Handle(SALOME_InteractiveObject)& anIO = It.Value();
+    std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
+    if (!aPrsList.empty()) {
+      for (int i = 0, n = aPrsList.size(); i < n; i++) {
+        VISU::Prs3d_i* aPrsObject = aPrsList[i];
+        if(aPrsObject){
+          VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+          if (aScalar) {
+            aScalar->SetRange(aMin, aMax);
+            RecreateActor(this, aScalar);
+            update = true;
+          }
+        }
+      }
+    }
+  }
+  if (update) {
+    if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
+        vw->getRenderer()->ResetCameraClippingRange();
+        vw->Repaint();
+//}
+    }
+  }
+}
+
+void
+VisuGUI::
+OnFreeScalarBars()
+{
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+
+  SALOME_ListIteratorOfListIO It (aListIO);
+
+  // restore the source range for every ScalarMap
+  bool update = false;
+  for (; It.More(); It.Next()) {
+    Handle(SALOME_InteractiveObject)& anIO = It.Value();
+    std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
+    if (!aPrsList.empty()) {
+      for (int i = 0, n = aPrsList.size(); i < n; i++) {
+        VISU::Prs3d_i* aPrsObject = aPrsList[i];
+        if (aPrsObject) {
+          VISU::ScalarMap_i* aScalar = dynamic_cast<VISU::ScalarMap_i*>(aPrsObject);
+          if (aScalar) {
+            aScalar->SetSourceRange();
+            RecreateActor(this, aScalar);
+            update = true;
+          }
+        }
+      }
+    }
+  }
+  if (update) {
+    if (SVTK_ViewWindow* vw = GetViewWindow(this)) {
+//if (vw->getRenderer()->GetActors()->GetNumberOfItems() > 0) {
+        vw->getRenderer()->ResetCameraClippingRange();
+        vw->Repaint();
+//}
+    }
+  }
+}
+
+void
+VisuGUI::
+OnTranslatePrs()
+{
+  if(MYDEBUG) MESSAGE("VisuGUI::OnTranslatePrs");
+  VisuGUI_OffsetDlg* aDlg = new VisuGUI_OffsetDlg (this);
+
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+
+  SALOME_ListIteratorOfListIO It (aListIO);
+  for (; It.More(); It.Next()) {
+    Handle(SALOME_InteractiveObject)& anIO = It.Value();
+    if (anIO->hasEntry()) {
+      _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+      if (aSObject) {
+        CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+        if (!CORBA::is_nil(aCORBAObject)) {
+          PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject);
+          if (VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(aServant.in())) {
+            aDlg->addPresentation(aPrsObject);
+          }
+        }
+      }
+    }
+  }
+  if (aDlg->getPrsCount() > 0)
+    aDlg->show();
+  else
+    delete aDlg;
+}
+
+void
+VisuGUI::
+OnArrangeActors()
+{
+  SVTK_ViewWindow* vw = GetViewWindow();
+  if (vw) {
+    ArrangeDlg* aDlg = new ArrangeDlg (GetDesktop(this), vw);
+    aDlg->exec();
+    delete aDlg;
+  }
+}
+
+
 void
 VisuGUI::
 initialize( CAM_Application* theApp )
@@ -1809,230 +1949,298 @@ createActions()
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   // Create actions
-  createAction( 112, "", QIconSet(), tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
-               this, SLOT(OnImportFromFile()));
-  createAction( 113, "", QIconSet(), tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
-               this, SLOT(OnExploreMEDFile()));
-  createAction( 199, "", QIconSet(), tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
-               this, SLOT(OnImportTableFromFile()));
+  createAction( VISU_IMPORT_FROM_FILE, "", QIconSet(),
+                tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
+                this, SLOT(OnImportFromFile()));
+
+  createAction( VISU_EXPLORE_MED, "", QIconSet(),
+                tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
+                this, SLOT(OnExploreMEDFile()));
+
+  createAction( VISU_IMPORT_TABLE, "", QIconSet(),
+                tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
+                this, SLOT(OnImportTableFromFile()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALAR_MAP"));
-  createAction( 4011, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap), tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
-               this, SLOT(OnCreateScalarMap()));
+  createAction( VISU_SCALAR_MAP, tr("MEN_SCALAR_MAP"), QIconSet(aPixmap),
+                tr("MEN_SCALAR_MAP"), "", 0, aParent, false,
+                this, SLOT(OnCreateScalarMap()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_DEFORMED_SHAPE"));
-  createAction( 4012, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap), tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
-               this, SLOT(OnCreateDeformedShape()));
+  createAction( VISU_DEFORMED_SHAPE, tr("MEN_DEFORMED_SHAPE"), QIconSet(aPixmap),
+                tr("MEN_DEFORMED_SHAPE"), "", 0, aParent, false,
+                this, SLOT(OnCreateDeformedShape()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_VECTORS"));
-  createAction( 4013, tr("MEN_VECTORS"), QIconSet(aPixmap), tr("MEN_VECTORS"), "", 0, aParent, false,
-               this, SLOT(OnCreateVectors()));
+  createAction( VISU_VECTORS, tr("MEN_VECTORS"), QIconSet(aPixmap),
+                tr("MEN_VECTORS"), "", 0, aParent, false,
+                this, SLOT(OnCreateVectors()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ISO_SURFACES"));
-  createAction( 4014, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap), tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
-               this, SLOT(OnCreateIsoSurfaces()));
+  createAction( VISU_ISO_SURFACES, tr("MEN_ISO_SURFACES"), QIconSet(aPixmap),
+                tr("MEN_ISO_SURFACES"), "", 0, aParent, false,
+                this, SLOT(OnCreateIsoSurfaces()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_PLANES"));
-  createAction( 4015, tr("MEN_CUT_PLANES"), QIconSet(aPixmap), tr("MEN_CUT_PLANES"), "", 0, aParent, false,
-               this, SLOT(OnCreateCutPlanes()));
+  createAction( VISU_CUT_PLANES, tr("MEN_CUT_PLANES"), QIconSet(aPixmap),
+                tr("MEN_CUT_PLANES"), "", 0, aParent, false,
+                this, SLOT(OnCreateCutPlanes()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_STREAM_LINES"));
-  createAction( 4016, tr("MEN_STREAM_LINES"), QIconSet(aPixmap), tr("MEN_STREAM_LINES"), "", 0, aParent, false,
-               this, SLOT(OnCreateStreamLines()));
+  createAction( VISU_STREAM_LINES, tr("MEN_STREAM_LINES"), QIconSet(aPixmap),
+                tr("MEN_STREAM_LINES"), "", 0, aParent, false,
+                this, SLOT(OnCreateStreamLines()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUT_LINES"));
-  createAction( 4018, tr("MEN_CUT_LINES"), QIconSet(aPixmap), tr("MEN_CUT_LINES"), "", 0, aParent, false,
-               this, SLOT(OnCreateCutLines()));
+  createAction( VISU_CUT_LINES, tr("MEN_CUT_LINES"), QIconSet(aPixmap),
+                tr("MEN_CUT_LINES"), "", 0, aParent, false,
+                this, SLOT(OnCreateCutLines()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT_3D"));
+  createAction( VISU_PLOT_3D, tr("MEN_PLOT_3D"), QIconSet(aPixmap),
+                tr("MEN_PLOT_3D"), "", 0, aParent, false,
+                this, SLOT(OnCreatePlot3D()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4020, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap), tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
-               this, SLOT(OnCreatePlot2dView()));
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PLOT2D"));
+  createAction( VISU_PLOT2D, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap),
+                tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
+                this, SLOT(OnCreatePlot2dView()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4021, tr("MEN_DELETE_OBJ"), QIconSet(aPixmap), tr("MEN_DELETE_OBJ"), "", 0, aParent, false,
-               this, SLOT(OnDeleteObject()));
+  createAction( VISU_DELETE_OBJS, tr("MEN_DELETE_OBJS"), QIconSet(),
+                tr("MEN_DELETE_OBJS"), "", 0, aParent, false,
+                this, SLOT(OnDeleteObjects()));
 
-  //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  //createAction( 4022, tr("MEN_RENAME_TABLE"), QIconSet(aPixmap), tr("MEN_RENAME_TABLE"), "", 0, aParent, false,
-               //this, SLOT(OnRenameTable()));
+  createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(),
+                tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
+                this, SLOT(OnShowTable()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4023, tr("MEN_SHOW_TABLE"), QIconSet(aPixmap), tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
-               this, SLOT(OnShowTable()));
+  createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(),
+                tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
+                this, SLOT(OnPlotData()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4024, tr("MEN_CREATE_CURVES"), QIconSet(aPixmap), tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
-               this, SLOT(OnPlotData()));
+  createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(),
+                tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
+                this, SLOT(OnExportTableToFile()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4025, tr("MEN_EXPORT_TABLE"), QIconSet(aPixmap), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
-               this, SLOT(OnExportTableToFile()));
+  createAction( VISU_IMPORT_MED_STRUCTURE, tr("MEN_IMPORT_MED_STRUCTURE"), QIconSet(),
+                tr("MEN_IMPORT_MED_STRUCTURE"), "", 0, aParent, false,
+                this, SLOT(OnImportMedField()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4026, tr("MEN_CREATE_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_PRS"), "", 0, aParent, false,
-               this, SLOT(OnCreateMesh()));
+  createAction( VISU_IMPORT_MED_TIMESTAMP, tr("MEN_IMPORT_MED_TIMESTAMP"), QIconSet(),
+                tr("MEN_IMPORT_MED_TIMESTAMP"), "", 0, aParent, false,
+                this, SLOT(OnImportMedField()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4027, tr("MEN_CREATE_MANY_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
-               this, SLOT(OnCreateManyMesh()));
+  createAction( VISU_IMPORT_MED_FIELD, tr("MEN_IMPORT_MED_FIELD"), QIconSet(),
+                tr("MEN_IMPORT_MED_FIELD"), "", 0, aParent, false,
+                this, SLOT(OnImportMedField()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4030, tr("MEN_ERASE"), QIconSet(aPixmap), tr("MEN_ERASE"), "", 0, aParent, false,
-               this, SLOT(OnErasePrs()));
+  createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(),
+                tr("MEN_CREATE_PRS"), "", 0, aParent, false,
+                this, SLOT(OnCreateMesh()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4031, tr("MEN_DISPLAY"), QIconSet(aPixmap), tr("MEN_DISPLAY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayPrs()));
+  createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(),
+                tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
+                this, SLOT(OnCreateManyMesh()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4032, tr("MEN_DISPLAY_ONLY"), QIconSet(aPixmap), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayOnlyPrs()));
+  createAction( VISU_TRANSLATE_PRS, tr("MEN_TRANSLATE_PRS"), QIconSet(),
+                tr("MEN_TRANSLATE_PRS"), "", 0, aParent, false,
+                this, SLOT(OnTranslatePrs()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4033, tr("MEN_DELETE_PRS"), QIconSet(aPixmap), tr("MEN_DELETE_PRS"), "", 0, aParent, false,
-               this, SLOT(OnDeletePrs()));
+  createAction( VISU_MERGE_SCALAR_BARS, tr("MEN_MERGE_SCALAR_BARS"), QIconSet(),
+                tr("MEN_MERGE_SCALAR_BARS"), "", 0, aParent, false,
+                this, SLOT(OnMergeScalarBars()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4034, tr("MEN_DISPLAY"), QIconSet(aPixmap), tr("MEN_DISPLAY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayManyPrs()));
+  createAction( VISU_FREE_SCALAR_BARS, tr("MEN_FREE_SCALAR_BARS"), QIconSet(),
+                tr("MEN_FREE_SCALAR_BARS"), "", 0, aParent, false,
+                this, SLOT(OnFreeScalarBars()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4035, tr("MEN_ERASE"), QIconSet(aPixmap), tr("MEN_ERASE"), "", 0, aParent, false,
-               this, SLOT(OnEraseManyPrs()));
+  createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(),
+                tr("MEN_ERASE"), "", 0, aParent, false,
+                this, SLOT(OnErasePrs()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4036, tr("MEN_DISPLAY_ONLY"), QIconSet(aPixmap), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayOnlyManyPrs()));
+  createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(),
+                tr("MEN_DISPLAY"), "", 0, aParent, false,
+                this, SLOT(OnDisplayPrs()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4037, tr("MEN_COPY_PRS"), QIconSet(aPixmap), tr("MEN_COPY_PRS"), "", 0, aParent, false,
-               this, SLOT(OnCopyPresentation()));
+  createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(),
+                tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
+                this, SLOT(OnDisplayOnlyPrs()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4040, tr("MEN_CURVE_PROPS"), QIconSet(aPixmap), tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
-               this, SLOT(OnCurveProperties()));
+  createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(),
+                tr("MEN_COPY_PRS"), "", 0, aParent, false,
+                this, SLOT(OnCopyPresentation()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4041, tr("MEN_RENAME"), QIconSet(aPixmap), tr("MEN_RENAME"), "", 0, aParent, false,
-               this, SLOT(OnRename()));
+  createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(),
+                tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
+                this, SLOT(OnCurveProperties()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4042, tr("MEN_EDIT_CONTAINER"), QIconSet(aPixmap), tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
-               this, SLOT(OnEditContainer()));
+  createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(), tr("MEN_RENAME"), "", 0, aParent, false,
+                this, SLOT(OnRename()));
 
-  //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  //createAction( 4043, tr("MEN_RENAME_CONTAINER"), QIconSet(aPixmap), tr("MEN_RENAME_CONTAINER"), "", 0, aParent, false,
-               //this, SLOT(OnRenameContainer()));
+  createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(),
+                tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
+                this, SLOT(OnEditContainer()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4044, tr("MEN_CLEAR_CONTAINER"), QIconSet(aPixmap), tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
-               this, SLOT(OnClearContainer()));
+  createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(),
+                tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
+                this, SLOT(OnClearContainer()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4046, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(aPixmap),
+  createAction( VISU_SAVE_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
                 tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
-               this, SLOT(OnSaveViewParams()));
+                this, SLOT(OnSaveViewParams()));
+  createAction( VISU_SAVE_VIEW_PARAMS_1, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(),
+                tr("MEN_SAVE_VIEWPARAMS"), "", 0, aParent, false,
+                this, SLOT(OnSaveViewParams()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4047, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(aPixmap),
+  createAction( VISU_RESTORE_VIEW_PARAMS, tr("MEN_RESTORE_VIEWPARAMS"), QIconSet(),
                 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
-               this, SLOT(OnRestoreViewParams()));
+                this, SLOT(OnRestoreViewParams()));
+
+  //createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(),
+  //              tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
+  //              this, SLOT(OnDeleteObjects()));
+
+  createAction( VISU_ARRANGE_ACTORS, tr("MEN_ARRANGE_ACTORS"), QIconSet(),
+                tr("MEN_ARRANGE_ACTORS"), "", 0, aParent, false,
+                this, SLOT(OnArrangeActors()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_POINTS"));
+  createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap),
+                tr("MEN_POINTS"), "", 0, aParent, false,
+                this, SLOT(OnMakePoints()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_WIREFRAME"));
+  createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap),
+                tr("MEN_WIREFRAME"), "", 0, aParent, false,
+                this, SLOT(OnMakeWireframe()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SURFACE"));
+  createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap),
+                tr("MEN_SURFACE"), "", 0, aParent, false,
+                this, SLOT(OnMakeSurface()));
+
+  createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(),
+                tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
+                this, SLOT(OnMakeInsideframe()));
+
+  createAction( VISU_SURFACEFRAME, tr("MEN_SURFACEFRAME"), QIconSet(),
+                tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
+                this, SLOT(OnMakeSurfaceframe()));
+
+  createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(),
+                tr("MEN_SHRINK"), "", 0, aParent, false,
+                this, SLOT(OnMakeShrink()));
+
+  createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(),
+                tr("MEN_UNSHRINK"), "", 0, aParent, false,
+                this, SLOT(OnMakeShrink()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4048, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(aPixmap),
-                tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
-               this, SLOT(OnDeleteViewParams()));
+  createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(),
+                tr("MEN_CELL_COLOR"), "", 0, aParent, false,
+                this, SLOT(OnChangeColor()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4050, tr("MEN_POINTS"), QIconSet(aPixmap), tr("MEN_POINTS"), "", 0, aParent, false,
-               this, SLOT(OnMakePoints()));
+  createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(),
+                tr("MEN_COLOR"), "", 0, aParent, false,
+                this, SLOT(OnChangeColor()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4051, tr("MEN_WIREFRAME"), QIconSet(aPixmap), tr("MEN_WIREFRAME"), "", 0, aParent, false,
-               this, SLOT(OnMakeWireframe()));
+  createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(),
+                tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
+                this, SLOT(OnChangeWireframeColor()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4052, tr("MEN_SURFACE"), QIconSet(aPixmap), tr("MEN_SURFACE"), "", 0, aParent, false,
-               this, SLOT(OnMakeSurface()));
+  createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(),
+                tr("MEN_OPACITY"), "", 0, aParent, false,
+                this, SLOT(OnChangeOpacity()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4053, tr("MEN_INSIDEFRAME"), QIconSet(aPixmap), tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
-               this, SLOT(OnMakeInsideframe()));
+  createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(),
+                tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
+                this, SLOT(OnChangeLines()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4054, tr("MEN_SURFACEFRAME"), QIconSet(aPixmap), tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
-               this, SLOT(OnMakeSurfaceframe()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4055, tr("MEN_SHRINK"), QIconSet(aPixmap), tr("MEN_SHRINK"), "", 0, aParent, false,
-               this, SLOT(OnMakeShrink()));
+  createAction( VISU_EDIT_SCALARMAP, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditScalarMap()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4056, tr("MEN_UNSHRINK"), QIconSet(aPixmap), tr("MEN_UNSHRINK"), "", 0, aParent, false,
-               this, SLOT(OnMakeShrink()));
+  createAction( VISU_EDIT_DEFORMEDSHAPE, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditDeformedShape()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4057, tr("MEN_CELL_COLOR"), QIconSet(aPixmap), tr("MEN_CELL_COLOR"), "", 0, aParent, false,
-               this, SLOT(OnChangeColor()));
+  createAction( VISU_EDIT_CUTPLANES, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditCutPlanes()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4058, tr("MEN_COLOR"), QIconSet(aPixmap), tr("MEN_COLOR"), "", 0, aParent, false,
-               this, SLOT(OnChangeColor()));
+  createAction( VISU_EDIT_CUTLINES, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditCutLines()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4059, tr("MEN_EDGE_COLOR"), QIconSet(aPixmap), tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
-               this, SLOT(OnChangeWireframeColor()));
+  createAction( VISU_EDIT_ISOSURFACE, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditIsoSurfaces()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4060, tr("MEN_OPACITY"), QIconSet(aPixmap), tr("MEN_OPACITY"), "", 0, aParent, false,
-               this, SLOT(OnChangeOpacity()));
+  createAction( VISU_EDIT_VECTORS, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditVectors()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4061, tr("MEN_LINE_WIDTH"), QIconSet(aPixmap), tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
-               this, SLOT(OnChangeLines()));
+  createAction( VISU_EDIT_STREAMLINES, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditStreamLines()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4062, tr("MEN_EDIT_PRS"), QIconSet(aPixmap), tr("MEN_EDIT_PRS"), "", 0, aParent, false,
-               this, SLOT(OnEditPrs()));
+  createAction( VISU_EDIT_PLOT3D, tr("MEN_EDIT_PRS"), QIconSet(),
+                tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+                this, SLOT(OnEditPlot3D()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4063, tr("MEN_CREATE_TABLE"), QIconSet(aPixmap), tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
-               this, SLOT(OnCreateTable()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4064, tr("MEN_SWEEP"), QIconSet(aPixmap), tr("MEN_SWEEP"), "", 0, aParent, false,
-               this, SLOT(OnSweep()));
+  createAction( VISU_CREATE_TABLE, tr("MEN_CREATE_TABLE"), QIconSet(),
+                tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
+                this, SLOT(OnCreateTable()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4065, tr("MEN_SELECTION_INFO"), QIconSet(aPixmap),
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SWEEP"));
+  createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap),
+                tr("MEN_SWEEP"), "", 0, aParent, false,
+                this, SLOT(OnSweep()));
+
+  createAction( VISU_CLIPPING, tr("MEN_CLIPPING"), QIconSet(),
+                tr("MEN_CLIPPING"), "", 0, aParent, false,
+                this, SLOT(OnClippingPlanes()));
+
+  createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(),
                 tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
-               this, SLOT(OnSelectionInfo()));
+                this, SLOT(OnSelectionInfo()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4066, tr("MEN_ANIMATION"), QIconSet(aPixmap), tr("MEN_ANIMATION"), "", 0, aParent, false,
-               this, SLOT(OnTimeAnimation()));
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_TIMEANIMATION"));
+  createAction( VISU_ANIMATION, tr("MEN_ANIMATION"), QIconSet(aPixmap),
+                tr("MEN_ANIMATION"), "", 0, aParent, false,
+                this, SLOT(OnTimeAnimation()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4070, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_ERASE_ALL"));
+  createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
                 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
-               this, SLOT(OnEraseAll()));
+                this, SLOT(OnEraseAll()));
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4071, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_GLOBAL_SELECTION"));
+  createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
-               //this, SLOT(OnEraseAll()));
-               this);
+                //this, SLOT(OnEraseAll()));
+                this);
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4072, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_PARTIAL_SELECTION"));
+  createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
-               //this, SLOT(OnEraseAll()));
-               this);
+                //this, SLOT(OnEraseAll()));
+                this);
 
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4073, tr("MEN_SCALING"), QIconSet(aPixmap),
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_SCALING"));
+  createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(aPixmap),
                 tr("MEN_SCALING"), "", 0, aParent, false,
-               this, SLOT(OnScaling()));
+                this, SLOT(OnScaling()));
+
+  aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_CUBE_AXES"));
+  createAction( VISU_CUBE_AXES, tr("MEN_CUBE_AXES"), QIconSet(aPixmap),
+                tr("MEN_CUBE_AXES"), "", 0, aParent, false,
+                this, SLOT(OnCubeAxes()));
+
+  createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIconSet(),
+                tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
+                this, SLOT(OnShowAnimation()));
 }
 
 void
@@ -2041,34 +2249,36 @@ createMenus()
 {
   // Add actions to menus
   int aMenuId;
-  aMenuId = createMenu( tr( "MEN_FILE" ), -1 );
-  createMenu( separator(), aMenuId, 10 );
-  createMenu( 112, aMenuId, 10 ); // import from file
-  createMenu( 113, aMenuId, 10 ); // explore MED file
-  createMenu( 199, aMenuId, 10 ); // import table
+  aMenuId = createMenu( tr( "MEN_DESK_FILE" ), -1 );
+  createMenu( separator(), aMenuId, -1, 10 );
+  createMenu( VISU_IMPORT_FROM_FILE, aMenuId, 10 ); // import from file
+  createMenu( VISU_EXPLORE_MED, aMenuId, 10 ); // explore MED file
+  createMenu( VISU_IMPORT_TABLE, aMenuId, 10 ); // import table
 
   aMenuId = createMenu( tr( "MEN_VISUALIZATION" ), -1, -1, 30 );
-  createMenu( 4011, aMenuId, 10 ); // scalar map
-  createMenu( 4012, aMenuId, 10 ); // deformed shape
-  createMenu( 4013, aMenuId, 10 ); // vectors
-  createMenu( 4014, aMenuId, 10 ); // iso surfaces
-  createMenu( 4015, aMenuId, 10 ); // cut planes
-  createMenu( 4016, aMenuId, 10 ); // stream lines
-  createMenu( 4018, aMenuId, 10 ); // cut lines
+  createMenu( VISU_SCALAR_MAP, aMenuId, 10 ); // scalar map
+  createMenu( VISU_DEFORMED_SHAPE, aMenuId, 10 ); // deformed shape
+  createMenu( VISU_VECTORS, aMenuId, 10 ); // vectors
+  createMenu( VISU_ISO_SURFACES, aMenuId, 10 ); // iso surfaces
+  createMenu( VISU_CUT_PLANES, aMenuId, 10 ); // cut planes
+  createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
+  createMenu( VISU_STREAM_LINES, aMenuId, 10 ); // stream lines
+  createMenu( VISU_PLOT_3D, aMenuId, 10 ); // Plot3d
 
   aMenuId = createMenu( tr( "MEN_SELECTION" ), -1, -1, 30 );
-  createMenu( 4065, aMenuId, 10 ); // selection info
+  createMenu( VISU_SELECTION_INFO, aMenuId, 10 ); // selection info
 
   aMenuId = createMenu( tr( "MEN_REPRESENTATION" ), -1, -1, 30 );
   int parentId =
     createMenu( tr( "MEN_DISPLAY_SELECTION" ), aMenuId, 10 ); // display selection
-  createMenu( 4050, parentId, 10 ); //   points
-  createMenu( 4051, parentId, 10 ); //   wireframe
-  createMenu( 4052, parentId, 10 ); //   surface
-  createMenu( 4070, aMenuId, 10 ); // erase all
-  createMenu( 4071, aMenuId, 10 ); // global selection
-  createMenu( 4072, aMenuId, 10 ); // partial selection
-  createMenu( 4073, aMenuId, 10 ); // scaling
+  createMenu( VISU_POINTS, parentId, 10 ); //   points
+  createMenu( VISU_WIREFRAME, parentId, 10 ); //   wireframe
+  createMenu( VISU_SURFACE, parentId, 10 ); //   surface
+  createMenu( VISU_ERASE_ALL, aMenuId, 10 ); // erase all
+  createMenu( VISU_GLOBAL_SELECTION, aMenuId, 10 ); // global selection
+  createMenu( VISU_PARTIAL_SELECTION, aMenuId, 10 ); // partial selection
+  createMenu( VISU_SCALING, aMenuId, 10 ); // scaling
+  createMenu( VISU_CUBE_AXES, aMenuId, 10 ); // scaling
 }
 
 void
@@ -2076,13 +2286,24 @@ VisuGUI::
 createToolBars()
 {
   int aToolId = createTool(tr("TOOL_VISUALISATION"));
-  createTool( 4011, aToolId );
-  createTool( 4012, aToolId );
-  createTool( 4013, aToolId );
-  createTool( 4014, aToolId );
-  createTool( 4015, aToolId );
-  createTool( 4016, aToolId );
-  createTool( 4018, aToolId );
+  createTool( VISU_SCALAR_MAP, aToolId );
+  createTool( VISU_DEFORMED_SHAPE, aToolId );
+  createTool( VISU_VECTORS, aToolId );
+  createTool( VISU_ISO_SURFACES, aToolId );
+  createTool( VISU_CUT_PLANES, aToolId );
+  createTool( VISU_CUT_LINES, aToolId );
+  createTool( VISU_STREAM_LINES, aToolId );
+  createTool( VISU_PLOT_3D, aToolId );
+
+  aToolId = createTool(tr("TOOL_REPRESENTATION"));
+  createTool( VISU_POINTS, aToolId );
+  createTool( VISU_WIREFRAME, aToolId );
+  createTool( VISU_SURFACE, aToolId );
+  createTool( VISU_ERASE_ALL, aToolId );
+  createTool( VISU_GLOBAL_SELECTION, aToolId );
+  createTool( VISU_PARTIAL_SELECTION, aToolId );
+  createTool( VISU_SCALING, aToolId );
+  createTool( VISU_CUBE_AXES, aToolId );
 }
 
 void
@@ -2093,191 +2314,378 @@ createPopupMenus()
   QtxPopupMgr* mgr = popupMgr();
 
   // VISU root commands
-  QString aRule( "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'" );
-  mgr->insert( action(  112 ), -1, -1, -1 ); // import MED
-  mgr->setRule( action( 112 ), aRule, true );
-  mgr->insert( action(  199 ), -1, -1, -1 ); // import tables
-  mgr->setRule( action( 199 ), aRule, true );
-  mgr->insert( action(  4020 ), -1, -1, -1 ); // create Plot2d
-  mgr->setRule( action( 4020 ), aRule, true );
-  aRule = "client='ObjectBrowser' and selcount=1 and $type in {'VISU::TRESULT' 'VISU::TTABLE' 'VISU::TCONTAINER'}";
-  mgr->insert( action(  4021 ), -1, -1, -1 ); // delete object
-  mgr->setRule( action( 4021 ), aRule, true );
+  mgr->insert( action( VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED file
+  mgr->insert( action( VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables from file
+  mgr->insert( action( VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d View
+
+  //mgr->insert( action( VISU_IMPORT_MED ), -1, -1, -1 ); // import MED structure from MED module
+
+  // create
+  mgr->insert( action( VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
+  mgr->insert( action( VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
+  mgr->insert( action( VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
+  mgr->insert( action( VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
+  mgr->insert( action( VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
+  mgr->insert( action( VISU_VECTORS ), -1, -1, -1 ); // vectors
+  mgr->insert( action( VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
+  mgr->insert( action( VISU_PLOT_3D ), -1, -1, -1 ); // Plot3d
+
+  mgr->insert( action( VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
+  mgr->insert( action( VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
+
+  mgr->insert( action( VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
+
+  // edit
+  mgr->insert( action( VISU_EDIT_SCALARMAP ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_DEFORMEDSHAPE ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_CUTPLANES ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_CUTLINES ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_ISOSURFACE ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_VECTORS ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_STREAMLINES ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_PLOT3D ), -1, -1, -1 );
+  mgr->insert( action( VISU_EDIT_CONTAINER ), -1, -1, -1 );
+
+  // rename
+  mgr->insert( action( VISU_RENAME ), -1, -1, -1 );
+
+  // copy
+  mgr->insert( action( VISU_COPY_PRS ), -1, -1, -1 );
+
+  // delete
+  mgr->insert( action( VISU_CLEAR_CONTAINER ), -1, -1, -1 );
+
+  // table commands
+  //mgr->insert( action( VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
+  //mgr->insert( action( VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
+  //mgr->insert( action( VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
+
+  mgr->insert( separator(), -1, -1, -1 );
+
+  mgr->insert( action( VISU_ERASE ), -1, -1, -1 ); // erase
+  mgr->insert( action( VISU_DISPLAY ), -1, -1, -1 ); // display
+  mgr->insert( action( VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
+
+  // "Representation" submenu
+  int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 );
+  mgr->insert( action( VISU_POINTS )      , parentId, -1, -1 ); // points
+  mgr->insert( action( VISU_WIREFRAME )   , parentId, -1, -1 ); // wireframe
+  mgr->insert( action( VISU_SURFACE )     , parentId, -1, -1 ); // surface
+  mgr->insert( action( VISU_INSIDEFRAME ) , parentId, -1, -1 ); // insideframe
+  mgr->insert( action( VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
+  mgr->insert( action( VISU_SHRINK )      , parentId, -1, -1 ); // shrink
+  mgr->insert( action( VISU_UNSHRINK )    , parentId, -1, -1 ); // unshrink
+
+  // "Properties" submenu
+  parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 );
+  mgr->insert( action( VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
+  mgr->insert( action( VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
+  mgr->insert( action( VISU_COLOR )     , parentId, -1, -1 ); // color
+  mgr->insert( action( VISU_OPACITY )   , parentId, -1, -1 ); // opacity
+  mgr->insert( action( VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
+
+  mgr->insert( separator(), -1, -1, -1 );
+
+  // Other presentations management
+  mgr->insert( action( VISU_TRANSLATE_PRS ), -1, -1, -1 );
+  mgr->insert( action( VISU_CLIPPING ), -1, -1, -1 );
+
+  mgr->insert( action( VISU_MERGE_SCALAR_BARS ), -1, -1, -1 );
+  mgr->insert( action( VISU_FREE_SCALAR_BARS ), -1, -1, -1 );
+
+  mgr->insert( action( VISU_SWEEP ), -1, -1, -1 );
+  mgr->insert( action( VISU_ANIMATION ), -1, -1, -1 );
+
+  mgr->insert( separator(), -1, -1, -1 );
+
+  // view parameters commands
+  mgr->insert( action( VISU_SAVE_VIEW_PARAMS ), -1, -1, -1 ); // save view params
+  mgr->insert( action( VISU_SAVE_VIEW_PARAMS_1 ), -1, -1, -1 ); // save view params
+  mgr->insert( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
+  //mgr->insert( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
+
+  mgr->insert( action( VISU_ARRANGE_ACTORS ), -1, -1, -1 ); // arrange actors
+
+  mgr->insert( action( VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
+
+  mgr->insert( action( VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
+
+  // Rules
+
+  QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+                   "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'");
+
+  // VISU root commands
+  QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
+  mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
+  mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
+  mgr->setRule( action( VISU_PLOT2D ), aRule, true );
 
   // timestamp commands
   aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
-  mgr->insert( action(  4011 ), -1, -1, -1 ); // scalar bar
-  mgr->setRule( action( 4011 ), aRule, true );
-  mgr->insert( action(  4014 ), -1, -1, -1 ); // iso surface
-  mgr->setRule( action( 4014 ), aRule, true );
-  mgr->insert( action(  4015 ), -1, -1, -1 ); // cut planes
-  mgr->setRule( action( 4015 ), aRule, true );
-  mgr->insert( action(  4018 ), -1, -1, -1 ); // cut lines
-  mgr->setRule( action( 4018 ), aRule, true );
+  mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
+  mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
+  mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
+  mgr->setRule( action( VISU_CUT_LINES ), aRule, true );
+  mgr->setRule( action( VISU_PLOT_3D ), aRule, true );
   aRule += " and nbComponents>1";
-  mgr->insert( action(  4012 ), -1, -1, -1 ); // deformed shape
-  mgr->setRule( action( 4012 ), aRule, true );
-  mgr->insert( action(  4013 ), -1, -1, -1 ); // vectors
-  mgr->setRule( action( 4013 ), aRule, true );
-  mgr->insert( action(  4016 ), -1, -1, -1 ); // stream lines
-  mgr->setRule( action( 4016 ), aRule, true );
-
-  aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTABLE'";
-  //mgr->insert( action(  4022 ), -1, -1, -1 ); // rename table
-  //mgr->setRule( action( 4022 ), aRule, true );
-  mgr->insert( action(  4023 ), -1, -1, -1 ); // show table
-  mgr->setRule( action( 4023 ), aRule, true );
-  mgr->insert( action(  4024 ), -1, -1, -1 ); // create curves
-  mgr->setRule( action( 4024 ), aRule, true );
-  mgr->insert( action(  4025 ), -1, -1, -1 ); // export table
-  mgr->setRule( action( 4025 ), aRule, true );
-  mgr->insert( separator(), -1, -1, -1 );
-  aRule = "(client='ObjectBrowser' and selcount=1 and ((type='VISU::TTABLE' and nbChildren>0) "
-          "or (type='VISU::TCURVE'%1) or (type='VISU::TCONTAINER'))) "
-         " or (selcount>0 and $type in {"
-          "'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-         "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'})";
-  mgr->insert( action(  4030 ), -1, -1, -1 ); // erase
-  mgr->setRule( action( 4030 ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=1"), true );
-  mgr->insert( action(  4031 ), -1, -1, -1 ); // display
-  mgr->setRule( action( 4031 ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=0"), true );
-  mgr->insert( action(  4032 ), -1, -1, -1 ); // display only
-  mgr->setRule( action( 4032 ), aRule.arg(""), true );
-
-  aRule = "client='ObjectBrowser' and selcount=1 and $type in {'VISU::TTABLE' "
-          "'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::TMESH' 'VISU::TSCALARMAP' "
-          "'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
-          "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
-  mgr->insert( action(  4033 ), -1, -1, -1 ); // delete presentation
-  mgr->setRule( action( 4033 ), aRule, true );
-
-  // View parameters
-  mgr->insert ( action( 4046 ), -1, -1, -1 ); // save view params
-  //jfa tmp:mgr->setRule( action( 4046 ), "(client='VTKViewer' and selcount=0) or (selcount=1 and type='VISU::TVIEW3D')", true );
-  mgr->setRule( action( 4046 ), "selcount=0", true ); //jfa tmp
-  mgr->insert ( action( 4047 ), -1, -1, -1 ); // restore view params
-  mgr->setRule( action( 4047 ), "selcount=1 and type='VISU::TVIEW3D'", true );
-  mgr->insert ( action( 4048 ), -1, -1, -1 ); // delete view params
-  mgr->setRule( action( 4048 ), "selcount=1 and type='VISU::TVIEW3D'", true );
+  mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
+  mgr->setRule( action( VISU_VECTORS ), aRule, true );
+  mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
+
+  // display/erase commands
+  QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
+  QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
+  QString orCurveVisible   = "or (type='VISU::TCURVE' and isVisible)";
+  QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
+  QString aPrsVisible   = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
+  QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
+
+  QString anEraseRule = "selcount>0 and (" + aPrsVisible +
+    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + ")))";
+
+  QString aDisplayRule = "selcount>0 and (" + aPrsInvisible +
+    " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + ")))";
+
+  QString aDOnlyRule = "selcount>0 and (($type in {'VISU::TMESH' " + aPrsAll + "})"
+    " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
+    " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))))";
+
+  mgr->setRule( action( VISU_ERASE ), anEraseRule, true );
+  mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true );
+  mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule, true );
+
+  aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
+  mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule, true );
+
+  aRule = "selcount>1 and $type in {'VISU::TMESH' " + aPrsAll + "}";
+  mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule, true );
+  mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule, true );
+
+  // view parameters
+  aRule = "selcount=1 and type='VISU::TVIEW3D'";
+  mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true );
+  mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true );
+  mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
+  //mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
+
+  mgr->setRule( action( VISU_ARRANGE_ACTORS ), "client='VTKViewer' and selcount=0", true );
 
   // 3D presentations commands
-  QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-                     "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
+  QString aPrsType    = " and $type in {'VISU::TMESH' " + aPrsAll + "}";
   QString aInsideType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TDEFORMEDSHAPE'}";
   QString aSurfType   = " and $type in {'VISU::TMESH'}";
-  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES'}";
+  QString aShrinkType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' "
+                        "'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TPLOT3D'}";
   QString aLineType   = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES'}";
-  aRule = "selcount=1";
+                        "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'}";
 
-  int parentId = mgr->insert( tr( "MEN_REPRESENTATION" ), -1, -1 ); // "Representation" submenu
-  mgr->insert( action(  4050 ), parentId, -1, -1 ); // points
-  mgr->setRule( action( 4050 ), aRule + aPrsType +
-              " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
-  mgr->insert( action(  4051 ), parentId, -1, -1 ); // wireframe
-  mgr->setRule( action( 4051 ), aRule + aPrsType +
-              " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
-  mgr->insert( action(  4052 ), parentId, -1, -1 ); // surface
-  mgr->setRule( action( 4052 ), aRule + aPrsType +
-              " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}", true );
-  mgr->insert( action(  4053 ), parentId, -1, -1 ); // insideframe
-  mgr->setRule( action( 4053 ), aRule + aInsideType +
-              " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}", true );
-  mgr->insert( action(  4054 ), parentId, -1, -1 ); // surfaceframe
-  mgr->setRule( action( 4054 ), aRule + aSurfType +
-              " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}", true );
-  mgr->insert( action(  4055 ), parentId, -1, -1 ); // shrink
-  mgr->setRule( action( 4055 ), aRule + aShrinkType + " and isShrunk=0", true );
-  mgr->insert( action(  4056 ), parentId, -1, -1 ); // unshrink
-  mgr->setRule( action( 4056 ), aRule + aShrinkType + " and isShrunk=1", true );
-
-  parentId = mgr->insert( tr( "MEN_PROPERTIES" ), -1, -1 ); // "Properties" submenu
-  mgr->insert( action(  4057 ), parentId, -1, -1 ); // cell color
-  mgr->setRule( action( 4057 ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
-  mgr->insert( action(  4059 ), parentId, -1, -1 ); // edge color
-  mgr->setRule( action( 4059 ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
-  mgr->insert( action(  4058 ), parentId, -1, -1 ); // color
-  mgr->setRule( action( 4058 ), aRule + " and ((type='VISU::TMESH'"
-              " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
+  aRule = "selcount=1";
+  mgr->setRule( action( VISU_CLIPPING ), aRule + aPrsType, true );
+
+  // "Representation" submenu
+  QString aNotPoints = " and $representation in {'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
+  QString aNotWirefr = " and $representation in {'VISU::POINT' 'VISU::SHADED' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
+  QString aNotSurfac = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::INSIDEFRAME' 'VISU::SURFACEFRAME'}";
+  QString aNotInside = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::SURFACEFRAME'}";
+  QString aNotSurffr = " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}";
+
+  mgr->setRule( action( VISU_POINTS )      , aRule + aPrsType + aNotPoints, true );
+  mgr->setRule( action( VISU_WIREFRAME )   , aRule + aPrsType + aNotWirefr, true );
+  mgr->setRule( action( VISU_SURFACE )     , aRule + aPrsType + aNotSurfac, true );
+  mgr->setRule( action( VISU_INSIDEFRAME ) , aRule + aInsideType + aNotInside, true );
+  mgr->setRule( action( VISU_SURFACEFRAME ), aRule + aSurfType + aNotSurffr, true );
+
+  mgr->setRule( action( VISU_SHRINK )  , aRule + aShrinkType + " and isShrunk=0", true );
+  mgr->setRule( action( VISU_UNSHRINK ), aRule + aShrinkType + " and isShrunk=1", true );
+
+  // "Properties" submenu
+  mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
+  mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
+  mgr->setRule( action( VISU_COLOR ), aRule + " and ((type='VISU::TMESH'"
+               " and $representation in {'VISU::POINT' 'VISU::WIREFRAME' 'VISU::SHADED' 'VISU::INSIDEFRAME'}) "
                "or (type='VISU::TDEFORMEDSHAPE' and hasActor=1))", true );
-  mgr->insert( action(  4060 ), parentId, -1, -1 ); // opacity
-  mgr->setRule( action( 4060 ), aRule + aShrinkType + " and hasActor=1", true );
-  mgr->insert( action(  4061 ), parentId, -1, -1 ); // line width
-  mgr->setRule( action( 4061 ), aRule + aLineType + " and hasActor=1", true );
+  mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
+  mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
 
   // rename command
-  QString aCurveType = "$type in {'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'}";
-  aPrsType = "$type in {'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-             "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
+  QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
 
-  aRule = "selcount=1 and (type=VISU::TVIEW3D or " + aCurveType + " or " + aPrsType + ")";
-  mgr->insert ( action( 4041 ), -1, -1, -1 ); // rename
-  mgr->setRule( action( 4041 ), aRule, true );
+  aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
+  mgr->setRule( action( VISU_RENAME ), aRule, true );
 
   // copy presentation command
-  aRule = "selcount=1 and " + aPrsType;
-  mgr->insert ( action( 4037 ), -1, -1, -1 ); // copy
-  mgr->setRule( action( 4037 ), aRule, true );
+  aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
+  mgr->setRule( action( VISU_COPY_PRS ), aRule, true );
 
   // curve commands
   aRule = "selcount=1 and type='VISU::TCURVE'";
-  mgr->insert( action(  4040 ), -1, -1, -1 ); // curve properties
-  mgr->setRule( action( 4040 ), aRule, true );
-
-  aPrsType = "$type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
-             "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
-  aRule = "client='ObjectBrowser' and selcount>1";
-  mgr->insert( action(  4034 ), -1, -1, -1 ); // display many
-  mgr->setRule( action( 4034 ), aRule + " and (" + aCurveType + " or " + aPrsType + ")", true );
-  mgr->insert( action(  4035 ), -1, -1, -1 ); // erase many
-  mgr->setRule( action( 4035 ), aRule + " and (" + aCurveType + " or " + aPrsType + ")", true );
-  mgr->insert( action(  4036 ), -1, -1, -1 ); // display only many
-  mgr->setRule( action( 4036 ),  aRule + " and " + aCurveType, true );
+  mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
 
   // curve container commands
   aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
-  mgr->insert( action(  4042 ), -1, -1, -1 ); // edit container
-  mgr->setRule( action( 4042 ), aRule, true );
-  //mgr->insert( action(  4043 ), -1, -1, -1 ); // rename container
-  //mgr->setRule( action( 4043 ), aRule, true );
-  mgr->insert( action(  4044 ), -1, -1, -1 ); // clear container
-  mgr->setRule( action( 4044 ), aRule, true );
-
-  aRule = "selcount=1 and ";
-  mgr->insert( action(  4062 ), -1, -1, -1 ); // edit prs
-  mgr->setRule( action( 4062 ), aRule + aPrsType, true );
+  mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
+  mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
+
+  mgr->setRule( action( VISU_EDIT_SCALARMAP ),
+               "selcount=1 and type='VISU::TSCALARMAP'", true );
+  mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
+               "selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
+  mgr->setRule( action( VISU_EDIT_CUTPLANES ),
+               "selcount=1 and type='VISU::TCUTPLANES'", true );
+  mgr->setRule( action( VISU_EDIT_CUTLINES ),
+               "selcount=1 and type='VISU::TCUTLINES'", true );
+  mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
+               "selcount=1 and type='VISU::TISOSURFACE'", true );
+  mgr->setRule( action( VISU_EDIT_VECTORS ),
+               "selcount=1 and type='VISU::TVECTORS'", true );
+  mgr->setRule( action( VISU_EDIT_STREAMLINES ),
+               "selcount=1 and type='VISU::TSTREAMLINES'", true );
+  mgr->setRule( action( VISU_EDIT_PLOT3D ),
+               "selcount=1 and type='VISU::TPLOT3D'", true );
 
   aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
-  mgr->insert( action(  4063 ), -1, -1, -1 ); // create table
-  mgr->setRule( action( 4063 ), aRule, true );
+  mgr->setRule( action( VISU_CREATE_TABLE ), aRule, true );
 
-  aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TSCALARMAP'";
-  mgr->insert ( action( 4064 ), -1, -1, -1 ); // sweep
-  mgr->setRule( action( 4064 ), aRule, true );
+  aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
+  mgr->setRule( action( VISU_SWEEP ), aRule, true );
 
-  // Selection info popup item
-  aRule = "client='ObjectBrowser' and selcount=1" + aInsideType;
-  mgr->insert( action(  4065 ), -1, -1, -1 ); // Selection info
-  mgr->setRule( action( 4065 ), aRule, true );
+  // "Selection info" popup item
+  aRule = "client='VTKViewer' and selcount=1" + aInsideType;
+  mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
 
   aRule = "client='ObjectBrowser' and selcount>0 and $type in {'VISU::TFIELD'} and nbTimeStamps>1";
-  mgr->insert( action(  4066 ), -1, -1, -1 ); // animation
-  mgr->setRule( action( 4066 ), aRule, true );
+  mgr->setRule( action( VISU_ANIMATION ), aRule, true );
 
   aRule = "client='ObjectBrowser' and $type in {'VISU::TENTITY' 'VISU::TFAMILY' 'VISU::TGROUP'}";
-  mgr->insert( action(  4026 ), -1, -1, -1 ); // create presentation
-  mgr->setRule( action( 4026 ), aRule + " and selcount=1", true );
-  mgr->insert( action(  4027 ), -1, -1, -1 ); // create presentations
-  mgr->setRule( action( 4027 ), aRule + " and selcount>1", true );
+  mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
+  mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
+
+  //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
+  //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
+}
+
+//***************************************************************************
+void VisuGUI::contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle )
+{
+  SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+
+  OB_Browser* ob = getApp()->objectBrowser();
+  bool isOBClient = (ob && theClient == ob->popupClientType());
+
+  SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
+  SALOME_ListIO aListIO;
+  aSelectionMgr->selectedObjects(aListIO);
+
+  if (aListIO.Extent() < 1) return;
+
+  _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+
+  // Check if "Merge Scalar Range" can be applied
+  int nbPrs = 0;
+  SALOME_ListIteratorOfListIO It (aListIO);
+  for (; It.More(); It.Next()) {
+    Handle(SALOME_InteractiveObject)& anIO = It.Value();
+
+    if (!anIO.IsNull() && anIO->hasEntry()) {
+      _PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
+      CORBA::Object_var aCORBAObject = VISU::ClientSObjectToObject(aSObject);
+      if (CORBA::is_nil(aCORBAObject)) {
+        _PTR(GenericAttribute) anAttr;
+        if (aSObject->FindAttribute(anAttr, "AttributeComment")) {
+          _PTR(AttributeComment) aComment (anAttr);
+          string aComm = aComment->Value();
+          QString strIn (aComm.c_str());
+          VISU::Storable::TRestoringMap pMap;
+          VISU::Storable::StrToMap(strIn, pMap);
+          bool isExist;
+          VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(pMap,"myType",&isExist).toInt();
+          if (isExist && aType == VISU::TTIMESTAMP) {
+            _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(aSObject);
+            _PTR(SObject) aPrs;
+            for (; anIter->More(); anIter->Next()) {
+              aPrs = anIter->Value();
+              if (!aPrs) continue;
+              std::vector<VISU::Prs3d_i*> aSubList = GetPrs3dList(this, aPrs);
+              nbPrs += aSubList.size();
+            }
+          }
+        }
+      }
+    }
+  }
+
+  if (nbPrs > 1) {
+    theMenu->insertSeparator();
+    action( VISU_MERGE_SCALAR_BARS )->addTo(theMenu);
+    action( VISU_FREE_SCALAR_BARS  )->addTo(theMenu);
+  }
+
+  theMenu->insertSeparator();
+
+  // Check if some (nb > 0) removable objects selected
+  if (isOBClient && IsRemovableSelected(this)) {
+    action( VISU_DELETE_OBJS )->addTo(theMenu);
+  }
+
+  // Check single selection
+  if (aListIO.Extent() != 1) return;
+
+  Handle(SALOME_InteractiveObject) anIO;
+  VISU::Storable::TRestoringMap aMap;
+  CORBA::Object_var anObject = GetSelectedObj( this, &anIO, &aMap);
+
+  _PTR(SObject) SO = aCStudy->FindObjectID(anIO->getEntry());
+  bool isExist;
+  VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue(aMap,"myType",&isExist).toInt();
+
+  if (aType == VISU::TANIMATION) {
+    action( VISU_SHOW_ANIMATION )->addTo(theMenu);
+
+  } else if (isOBClient) {
+    if (IsSObjectTable(SO)) {
+      action( VISU_SHOW_TABLE )->addTo(theMenu);
+      action( VISU_CREATE_CURVES )->addTo(theMenu);
+      action( VISU_EXPORT_TABLE )->addTo(theMenu);
+      theMenu->insertSeparator();
+    } else {
+      if (!CORBA::is_nil(anObject)) {
+        SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
+        if (!CORBA::is_nil(aMED.in())) {
+          action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
+        }
+
+        SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
+        if (!CORBA::is_nil(aField)) {
+          action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
+        }
+      } else {
+        _PTR(SObject) aSFather = SO->GetFather();
+        if (aSFather) {
+          _PTR(GenericAttribute) anAttr;
+          aSFather->FindAttribute(anAttr, "AttributeName");
+          if (anAttr) {
+            _PTR(AttributeName) aName (anAttr);
+            std::string aValue = aName->Value();
+            if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
+              action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
+            }
+          }
+        }
+      }
+    }
+  }
 }
 
+
+//***************************************************************************
 void
 VisuGUI::
 windows( QMap<int, int>& theMap ) const
 {
   theMap.clear();
   theMap.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::DockLeft );
+  theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::DockBottom );
 }
 
 
@@ -2304,7 +2712,7 @@ VisuGUI::
 activateModule( SUIT_Study* theStudy )
 {
   SalomeApp_Module::activateModule( theStudy );
-
+  studyActivated();
   setMenuShown( true );
   setToolShown( true );
   return true;
@@ -2329,6 +2737,13 @@ createSelection() const
   return new VisuGUI_Selection( (SalomeApp_Module*)this );
 }
 
+//******************************************************************
+void VisuGUI::studyActivated()
+{
+  GetVisuGen(this)->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(this))));
+}
+
+/*
 extern "C" {
   CAM_Module*
   createModule()
@@ -2336,3 +2751,154 @@ extern "C" {
     return new VisuGUI();
   }
 }
+*/
+void VisuGUI::createPreferences()
+{
+  int sbarTab = addPreference( tr( "VISU_SCALAR_BAR" ) );
+
+  int fontGr = addPreference( tr( "VISU_FONT" ), sbarTab );
+  int tfont = addPreference( tr( "VISU_TITLE" ), fontGr, SalomeApp_Preferences::Font, "VISU", "scalar_bar_title_font" );
+  addPreference( tr( "VISU_TITLE" ), fontGr, SalomeApp_Preferences::Color, "VISU", "scalar_bar_title_color" );
+  int lfont = addPreference( tr( "VISU_LABELS" ), fontGr, SalomeApp_Preferences::Font, "VISU", "scalar_bar_label_font" );
+  addPreference( tr( "VISU_LABELS" ), fontGr, SalomeApp_Preferences::Color, "VISU", "scalar_bar_label_color" );
+
+  QStringList fam;
+  fam.append( tr( "VISU_FONT_ARIAL" ) );
+  fam.append( tr( "VISU_FONT_COURIER" ) );
+  fam.append( tr( "VISU_FONT_TIMES" ) );
+  int wflag = ( QtxListResourceEdit::FontItem::All & ( ~( QtxListResourceEdit::FontItem::Size | QtxListResourceEdit::FontItem::UserSize ) ) );
+
+  setPreferenceProperty( tfont, "families", fam );
+  setPreferenceProperty( tfont, "system", false );
+  setPreferenceProperty( tfont, "widget_flags", wflag );
+  setPreferenceProperty( lfont, "families", fam );
+  setPreferenceProperty( lfont, "system", false );
+  setPreferenceProperty( lfont, "widget_flags", wflag );
+
+  int colorsLabelsGr = addPreference( tr( "VISU_COLORS_AND_LABELS" ), sbarTab );
+
+  int numcol = addPreference( tr( "VISU_NB_COLORS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "VISU", "scalar_bar_num_colors" );
+  setPreferenceProperty( numcol, "min", 2 );
+  setPreferenceProperty( numcol, "max", 64 );
+
+  int numlab = addPreference( tr( "VISU_NB_LABELS" ), colorsLabelsGr, SalomeApp_Preferences::IntSpin, "VISU", "scalar_bar_num_labels" );
+  setPreferenceProperty( numlab, "min", 2 );
+  setPreferenceProperty( numlab, "max", 65 );
+
+  int orientGr = addPreference( tr( "VISU_ORIENTATION" ), sbarTab );
+  int orient = addPreference( tr( "VISU_ORIENTATION" ), orientGr, SalomeApp_Preferences::Selector, "VISU", "scalar_bar_orientation" );
+  QStringList orients;
+  orients.append( tr( "VISU_VERTICAL" ) );
+  orients.append( tr( "VISU_HORIZONTAL" ) );
+  QValueList<QVariant> indices;
+  indices.append( 0 );
+  indices.append( 1 );
+  setPreferenceProperty( orient, "strings", orients );
+  setPreferenceProperty( orient, "indexes", indices );
+
+  int posVSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_VERTICAL" ), sbarTab );
+  int xv = addPreference( tr( "VISU_X" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_x" );
+  int yv = addPreference( tr( "VISU_Y" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_y" );
+  int wv = addPreference( tr( "VISU_WIDTH" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_width" );
+  int hv = addPreference( tr( "VISU_HEIGHT" ), posVSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_vertical_height" );
+  setPreferenceProperty( xv, "step", 0.1 );
+  setPreferenceProperty( yv, "step", 0.1 );
+  setPreferenceProperty( wv, "step", 0.1 );
+  setPreferenceProperty( hv, "step", 0.1 );
+  setPreferenceProperty( xv, "min", 0.0 );
+  setPreferenceProperty( yv, "min", 0.0 );
+  setPreferenceProperty( wv, "min", 0.0 );
+  setPreferenceProperty( hv, "min", 0.0 );
+  setPreferenceProperty( xv, "max", 1.0 );
+  setPreferenceProperty( yv, "max", 1.0 );
+  setPreferenceProperty( wv, "max", 1.0 );
+  setPreferenceProperty( hv, "max", 1.0 );
+
+  int posHSizeGr = addPreference( tr( "VISU_ORIGIN_AND_SIZE" ) + " " + tr( "VISU_HORIZONTAL" ), sbarTab );
+  int xh = addPreference( tr( "VISU_X" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_x" );
+  int yh = addPreference( tr( "VISU_Y" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_y" );
+  int wh = addPreference( tr( "VISU_WIDTH" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_width" );
+  int hh = addPreference( tr( "VISU_HEIGHT" ), posHSizeGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_bar_horizontal_height" );
+  setPreferenceProperty( xh, "step", 0.1 );
+  setPreferenceProperty( yh, "step", 0.1 );
+  setPreferenceProperty( wh, "step", 0.1 );
+  setPreferenceProperty( hh, "step", 0.1 );
+  setPreferenceProperty( xh, "min", 0.0 );
+  setPreferenceProperty( yh, "min", 0.0 );
+  setPreferenceProperty( wh, "min", 0.0 );
+  setPreferenceProperty( hh, "min", 0.0 );
+  setPreferenceProperty( xh, "max", 1.0 );
+  setPreferenceProperty( yh, "max", 1.0 );
+  setPreferenceProperty( wh, "max", 1.0 );
+  setPreferenceProperty( hh, "max", 1.0 );
+
+  int srangeTab = addPreference( tr( "Scalar range, Sweep, MED import" ) );
+
+  int rangeGr = addPreference( tr( "VISU_SCALAR_RANGE" ), srangeTab );
+  setPreferenceProperty( rangeGr, "columns", 1 );
+
+  int mode = addPreference( tr( "VISU_SCALAR_MODE" ), rangeGr, SalomeApp_Preferences::Selector, "VISU", "scalar_bar_mode" );
+  QStringList modes;
+  modes.append( tr( "VISU_MODULUS" ) );
+  modes.append( tr( "VISU_COMPONENT" ) + tr("1") );
+  modes.append( tr( "VISU_COMPONENT" ) + tr("2") );
+  modes.append( tr( "VISU_COMPONENT" ) + tr("3") );
+  indices.clear();
+  indices.append( 0 );
+  indices.append( 1 );
+  indices.append( 2 );
+  indices.append( 3 );
+  setPreferenceProperty( mode, "strings", modes );
+  setPreferenceProperty( mode, "indexes", indices );
+
+  addPreference( tr( "VISU_LOGARITHMIC_SCALING" ), rangeGr, SalomeApp_Preferences::Bool, "VISU", "scalar_bar_logarithmic" );
+
+  int rangetype = addPreference( tr( "VISU_RANGE_TO_USE" ), rangeGr, SalomeApp_Preferences::Selector, "VISU", "scalar_range_type" );
+  QStringList types;
+  types.append( tr( "VISU_FIELD_RANGE" ) );
+  types.append( tr( "VISU_IMPOSED_RANGE" ) );
+  indices.clear();
+  indices.append( 0 );
+  indices.append( 1 );
+  setPreferenceProperty( rangetype, "strings", types );
+  setPreferenceProperty( rangetype, "indexes", indices );
+
+  int imposedGr = addPreference( tr( "VISU_MINMAX_IMPOSED_RANGE" ), srangeTab );
+
+  int min = addPreference( tr( "VISU_MIN" ), imposedGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_range_min" );
+  int max = addPreference( tr( "VISU_MAX" ), imposedGr, SalomeApp_Preferences::DblSpin, "VISU", "scalar_range_max" );
+  setPreferenceProperty( min, "step", 0.1 );
+  setPreferenceProperty( max, "step", 0.1 );
+
+  int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
+  setPreferenceProperty( sweepGr, "columns", 1 );
+
+  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr, SalomeApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+  int nbcycles   = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr, SalomeApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr, SalomeApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+  setPreferenceProperty( timestep, "min",  0.1 );
+  setPreferenceProperty( timestep, "step", 0.1 );
+  setPreferenceProperty( timestep, "max",  1000 );
+  setPreferenceProperty( nbcycles, "max",  100  );
+  setPreferenceProperty( nbsteps,  "max",  200  );
+
+  int importGr = addPreference( tr( "MED files import" ), srangeTab );
+  addPreference( tr( "Full MED loading" ), importGr, SalomeApp_Preferences::Bool, "VISU", "full_med_loading" );
+}
+
+void VisuGUI::preferencesChanged( const QString&, const QString& )
+{
+}
+
+SUIT_ViewManager*
+VisuGUI
+::getViewManager(const QString& theType,
+                const bool theIsCreate)
+{
+  return getApp()->getViewManager(theType,theIsCreate);
+}
+
+SalomeApp_Displayer* VisuGUI::displayer()
+{
+  return 0;
+}