Salome HOME
Display, Erase, DisplayOnly implementation
authorvsv <vsv@opencascade.com>
Wed, 22 Jun 2005 11:10:20 +0000 (11:10 +0000)
committervsv <vsv@opencascade.com>
Wed, 22 Jun 2005 11:10:20 +0000 (11:10 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h [new file with mode: 0644]

index c3b0bbfef4b58f9272ba13bc93287d8acc0d1360..ba67d34805897add9d37997a06c9125a0afff60c 100644 (file)
 
 #include "utilities.h"
 
+#include "VisuGUI_ActionsDef.h"
+
 using namespace VISU;
 
 #ifdef _DEBUG_
@@ -602,52 +604,66 @@ VisuGUI::
 OnDisplayPrs()
 {
   if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
+
+  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 (SVTK_ViewWindow* vw = GetViewWindow( this )) {
+         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 (SVTK_ViewWindow* vw = GetViewWindow( this )) {
+    vw->getRenderer()->ResetCameraClippingRange();
+    vw->Repaint();
+  }
+  QApplication::restoreOverrideCursor();
 }
 
 void
 VisuGUI::
 OnDisplayOnlyPrs()
 {
+  OnEraseAll();
+  OnDisplayPrs();
 }
 
-void VisuGUI::ErasePrs (CORBA::Object_ptr theObject)
+void VisuGUI::ErasePrs (CORBA::Object_ptr theObject, bool theUpdate)
 {
   if (MYDEBUG) MESSAGE("ErasePrs");
 
@@ -674,8 +690,10 @@ void VisuGUI::ErasePrs (CORBA::Object_ptr theObject)
     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();
+       if (theUpdate) {
+         if (SVTK_ViewWindow* vw = GetViewWindow( this ))
+           vw->Repaint();
+       }
       }
     }
     } // switch (aType)
@@ -687,9 +705,21 @@ VisuGUI::
 OnErasePrs()
 {
   if(MYDEBUG) MESSAGE("OnErasePrs");
+
+  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 );
-  ErasePrs(anObject);
+  for ( SALOME_ListIteratorOfListIO it( aList ); it.More(); it.Next() ) {
+    anIO = it.Value();
+    CORBA::Object_var anObject = GetSelectedObj( GetAppStudy(this), anIO->getEntry() );
+    ErasePrs(anObject, false);
+  }
+  if (SVTK_ViewWindow* vw = GetViewWindow( this ))
+    vw->Repaint();
+  QApplication::restoreOverrideCursor();
 }
 
 template<class TPrs3d_i, class TDlg>
@@ -817,23 +847,6 @@ OnDeletePrs()
   aStudyBuilder->CommitCommand();
 }
 
-void
-VisuGUI::
-OnDisplayManyPrs()
-{
-}
-
-void
-VisuGUI::
-OnEraseManyPrs()
-{
-}
-
-void
-VisuGUI::
-OnDisplayOnlyManyPrs()
-{
-}
 
 void
 VisuGUI::
@@ -842,8 +855,8 @@ OnEraseAll()
   SVTK_ViewWindow* vw = GetViewWindow();
   if (!vw) return;
 
-  /*jfa tmp:GetActiveStudy()->unHighlightAll();
-  if (vtkRenderer *aRen = GetRenderer()) {
+  vw->unHighlightAll();
+  if (vtkRenderer *aRen = vw->getRenderer()) {
     vtkActor *anActor;
     vtkActorCollection *anActColl = aRen->GetActors();
     for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
@@ -854,7 +867,7 @@ OnEraseAll()
        }
     }
     vw->Repaint();
-  }*/
+  }
 }
 
 void VisuGUI::ChangeRepresentation (VISU::PresentationType theType)
@@ -1809,47 +1822,47 @@ createActions()
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
 
   // Create actions
-  createAction( 112, "", QIconSet(), tr("MEN_IMPORT_FROM_FILE"), "", (CTRL + Key_I), aParent, false,
+  createAction( VISU_IMPORT_FROM_FILE, "", 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,
+  createAction( VISU_EXPLORE_MED, "", QIconSet(), tr("MEN_EXPLORE_MED_FILE"), "", (CTRL + Key_M), aParent, false,
                this, SLOT(OnExploreMEDFile()));
-  createAction( 199, "", QIconSet(), tr("MEN_IMPORT_TABLE"), "", 0, aParent, false,
+  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,
+  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,
+  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,
+  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,
+  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,
+  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,
+  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,
+  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(""));
-  createAction( 4020, tr("MEN_CREATE_PLOT2D"), QIconSet(aPixmap), tr("MEN_CREATE_PLOT2D"), "", 0, aParent, false,
+  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,
+  createAction( VISU_DELETE, tr("MEN_DELETE_OBJ"), QIconSet(aPixmap), tr("MEN_DELETE_OBJ"), "", 0, aParent, false,
                this, SLOT(OnDeleteObject()));
 
   //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
@@ -1857,67 +1870,55 @@ createActions()
                //this, SLOT(OnRenameTable()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4023, tr("MEN_SHOW_TABLE"), QIconSet(aPixmap), tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
+  createAction( VISU_SHOW_TABLE, tr("MEN_SHOW_TABLE"), QIconSet(aPixmap), tr("MEN_SHOW_TABLE"), "", 0, aParent, false,
                this, SLOT(OnShowTable()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4024, tr("MEN_CREATE_CURVES"), QIconSet(aPixmap), tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
+  createAction( VISU_CREATE_CURVES, tr("MEN_CREATE_CURVES"), QIconSet(aPixmap), tr("MEN_CREATE_CURVES"), "", 0, aParent, false,
                this, SLOT(OnPlotData()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4025, tr("MEN_EXPORT_TABLE"), QIconSet(aPixmap), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
+  createAction( VISU_EXPORT_TABLE, tr("MEN_EXPORT_TABLE"), QIconSet(aPixmap), tr("MEN_EXPORT_TABLE"), "", 0, aParent, false,
                this, SLOT(OnExportTableToFile()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4026, tr("MEN_CREATE_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_PRS"), "", 0, aParent, false,
+  createAction( VISU_CREATE_PRS, tr("MEN_CREATE_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_PRS"), "", 0, aParent, false,
                this, SLOT(OnCreateMesh()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4027, tr("MEN_CREATE_MANY_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
+  createAction( VISU_CREATE_MANY_PRS, tr("MEN_CREATE_MANY_PRS"), QIconSet(aPixmap), tr("MEN_CREATE_MANY_PRS"), "", 0, aParent, false,
                this, SLOT(OnCreateManyMesh()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4030, tr("MEN_ERASE"), QIconSet(aPixmap), tr("MEN_ERASE"), "", 0, aParent, false,
+  createAction( VISU_ERASE, tr("MEN_ERASE"), QIconSet(aPixmap), tr("MEN_ERASE"), "", 0, aParent, false,
                this, SLOT(OnErasePrs()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4031, tr("MEN_DISPLAY"), QIconSet(aPixmap), tr("MEN_DISPLAY"), "", 0, aParent, false,
+  createAction( VISU_DISPLAY, tr("MEN_DISPLAY"), QIconSet(aPixmap), tr("MEN_DISPLAY"), "", 0, aParent, false,
                this, SLOT(OnDisplayPrs()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4032, tr("MEN_DISPLAY_ONLY"), QIconSet(aPixmap), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
+  createAction( VISU_DISPLAY_ONLY, tr("MEN_DISPLAY_ONLY"), QIconSet(aPixmap), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
                this, SLOT(OnDisplayOnlyPrs()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4033, tr("MEN_DELETE_PRS"), QIconSet(aPixmap), tr("MEN_DELETE_PRS"), "", 0, aParent, false,
+  createAction( VISU_DELETE_PRS, tr("MEN_DELETE_PRS"), QIconSet(aPixmap), tr("MEN_DELETE_PRS"), "", 0, aParent, false,
                this, SLOT(OnDeletePrs()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4034, tr("MEN_DISPLAY"), QIconSet(aPixmap), tr("MEN_DISPLAY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayManyPrs()));
-
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4035, tr("MEN_ERASE"), QIconSet(aPixmap), tr("MEN_ERASE"), "", 0, aParent, false,
-               this, SLOT(OnEraseManyPrs()));
-
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4036, tr("MEN_DISPLAY_ONLY"), QIconSet(aPixmap), tr("MEN_DISPLAY_ONLY"), "", 0, aParent, false,
-               this, SLOT(OnDisplayOnlyManyPrs()));
-
-  aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4037, tr("MEN_COPY_PRS"), QIconSet(aPixmap), tr("MEN_COPY_PRS"), "", 0, aParent, false,
+  createAction( VISU_COPY_PRS, tr("MEN_COPY_PRS"), QIconSet(aPixmap), tr("MEN_COPY_PRS"), "", 0, aParent, false,
                this, SLOT(OnCopyPresentation()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4040, tr("MEN_CURVE_PROPS"), QIconSet(aPixmap), tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
+  createAction( VISU_CURVE_PROPS, tr("MEN_CURVE_PROPS"), QIconSet(aPixmap), tr("MEN_CURVE_PROPS"), "", 0, aParent, false,
                this, SLOT(OnCurveProperties()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4041, tr("MEN_RENAME"), QIconSet(aPixmap), tr("MEN_RENAME"), "", 0, aParent, false,
+  createAction( VISU_RENAME, tr("MEN_RENAME"), QIconSet(aPixmap), tr("MEN_RENAME"), "", 0, aParent, false,
                this, SLOT(OnRename()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4042, tr("MEN_EDIT_CONTAINER"), QIconSet(aPixmap), tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
+  createAction( VISU_EDIT_CONTAINER, tr("MEN_EDIT_CONTAINER"), QIconSet(aPixmap), tr("MEN_EDIT_CONTAINER"), "", 0, aParent, false,
                this, SLOT(OnEditContainer()));
 
   //aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
@@ -1925,112 +1926,112 @@ createActions()
                //this, SLOT(OnRenameContainer()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4044, tr("MEN_CLEAR_CONTAINER"), QIconSet(aPixmap), tr("MEN_CLEAR_CONTAINER"), "", 0, aParent, false,
+  createAction( VISU_CLEAR_CONTAINER, tr("MEN_CLEAR_CONTAINER"), QIconSet(aPixmap), 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_VIEW_PARAMS, tr("MEN_SAVE_VIEWPARAMS"), QIconSet(aPixmap),
                 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(aPixmap),
                 tr("MEN_RESTORE_VIEWPARAMS"), "", 0, aParent, false,
                this, SLOT(OnRestoreViewParams()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4048, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(aPixmap),
+  createAction( VISU_DELETE_VIEW_PARAMS, tr("MEN_DELETE_VIEWPARAMS"), QIconSet(aPixmap),
                 tr("MEN_DELETE_VIEWPARAMS"), "", 0, aParent, false,
                this, SLOT(OnDeleteViewParams()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4050, tr("MEN_POINTS"), QIconSet(aPixmap), tr("MEN_POINTS"), "", 0, aParent, false,
+  createAction( VISU_POINTS, tr("MEN_POINTS"), QIconSet(aPixmap), tr("MEN_POINTS"), "", 0, aParent, false,
                this, SLOT(OnMakePoints()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4051, tr("MEN_WIREFRAME"), QIconSet(aPixmap), tr("MEN_WIREFRAME"), "", 0, aParent, false,
+  createAction( VISU_WIREFRAME, tr("MEN_WIREFRAME"), QIconSet(aPixmap), tr("MEN_WIREFRAME"), "", 0, aParent, false,
                this, SLOT(OnMakeWireframe()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4052, tr("MEN_SURFACE"), QIconSet(aPixmap), tr("MEN_SURFACE"), "", 0, aParent, false,
+  createAction( VISU_SURFACE, tr("MEN_SURFACE"), QIconSet(aPixmap), tr("MEN_SURFACE"), "", 0, aParent, false,
                this, SLOT(OnMakeSurface()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4053, tr("MEN_INSIDEFRAME"), QIconSet(aPixmap), tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
+  createAction( VISU_INSIDEFRAME, tr("MEN_INSIDEFRAME"), QIconSet(aPixmap), tr("MEN_INSIDEFRAME"), "", 0, aParent, false,
                this, SLOT(OnMakeInsideframe()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4054, tr("MEN_SURFACEFRAME"), QIconSet(aPixmap), tr("MEN_SURFACEFRAME"), "", 0, aParent, false,
+  createAction( VISU_SURFACEFRAME, 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,
+  createAction( VISU_SHRINK, tr("MEN_SHRINK"), QIconSet(aPixmap), tr("MEN_SHRINK"), "", 0, aParent, false,
                this, SLOT(OnMakeShrink()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4056, tr("MEN_UNSHRINK"), QIconSet(aPixmap), tr("MEN_UNSHRINK"), "", 0, aParent, false,
+  createAction( VISU_UNSHRINK, tr("MEN_UNSHRINK"), QIconSet(aPixmap), tr("MEN_UNSHRINK"), "", 0, aParent, false,
                this, SLOT(OnMakeShrink()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4057, tr("MEN_CELL_COLOR"), QIconSet(aPixmap), tr("MEN_CELL_COLOR"), "", 0, aParent, false,
+  createAction( VISU_CELL_COLOR, tr("MEN_CELL_COLOR"), QIconSet(aPixmap), tr("MEN_CELL_COLOR"), "", 0, aParent, false,
                this, SLOT(OnChangeColor()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4058, tr("MEN_COLOR"), QIconSet(aPixmap), tr("MEN_COLOR"), "", 0, aParent, false,
+  createAction( VISU_COLOR, tr("MEN_COLOR"), QIconSet(aPixmap), tr("MEN_COLOR"), "", 0, aParent, false,
                this, SLOT(OnChangeColor()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4059, tr("MEN_EDGE_COLOR"), QIconSet(aPixmap), tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
+  createAction( VISU_EDGE_COLOR, tr("MEN_EDGE_COLOR"), QIconSet(aPixmap), tr("MEN_EDGE_COLOR"), "", 0, aParent, false,
                this, SLOT(OnChangeWireframeColor()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4060, tr("MEN_OPACITY"), QIconSet(aPixmap), tr("MEN_OPACITY"), "", 0, aParent, false,
+  createAction( VISU_OPACITY, tr("MEN_OPACITY"), QIconSet(aPixmap), tr("MEN_OPACITY"), "", 0, aParent, false,
                this, SLOT(OnChangeOpacity()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4061, tr("MEN_LINE_WIDTH"), QIconSet(aPixmap), tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
+  createAction( VISU_LINE_WIDTH, tr("MEN_LINE_WIDTH"), QIconSet(aPixmap), tr("MEN_LINE_WIDTH"), "", 0, aParent, false,
                this, SLOT(OnChangeLines()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4062, tr("MEN_EDIT_PRS"), QIconSet(aPixmap), tr("MEN_EDIT_PRS"), "", 0, aParent, false,
+  createAction( VISU_EDIT_PRS, tr("MEN_EDIT_PRS"), QIconSet(aPixmap), tr("MEN_EDIT_PRS"), "", 0, aParent, false,
                this, SLOT(OnEditPrs()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4063, tr("MEN_CREATE_TABLE"), QIconSet(aPixmap), tr("MEN_CREATE_TABLE"), "", 0, aParent, false,
+  createAction( VISU_CREATE_TABLE, 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,
+  createAction( VISU_SWEEP, tr("MEN_SWEEP"), QIconSet(aPixmap), tr("MEN_SWEEP"), "", 0, aParent, false,
                this, SLOT(OnSweep()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4065, tr("MEN_SELECTION_INFO"), QIconSet(aPixmap),
+  createAction( VISU_SELECTION_INFO, tr("MEN_SELECTION_INFO"), QIconSet(aPixmap),
                 tr("MEN_SELECTION_INFO"), "", 0, aParent, false,
                this, SLOT(OnSelectionInfo()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4066, tr("MEN_ANIMATION"), QIconSet(aPixmap), tr("MEN_ANIMATION"), "", 0, aParent, false,
+  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),
+  createAction( VISU_ERASE_ALL, tr("MEN_ERASE_ALL"), QIconSet(aPixmap),
                 tr("MEN_ERASE_ALL"), "", 0, aParent, false,
                this, SLOT(OnEraseAll()));
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4071, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
+  createAction( VISU_GLOBAL_SELECTION, tr("MEN_GLOBAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_GLOBAL_SELECTION"), "", 0, aParent, false,
                //this, SLOT(OnEraseAll()));
                this);
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4072, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
+  createAction( VISU_PARTIAL_SELECTION, tr("MEN_PARTIAL_SELECTION"), QIconSet(aPixmap),
                 tr("MEN_PARTIAL_SELECTION"), "", 0, aParent, false,
                //this, SLOT(OnEraseAll()));
                this);
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr(""));
-  createAction( 4073, tr("MEN_SCALING"), QIconSet(aPixmap),
+  createAction( VISU_SCALING, tr("MEN_SCALING"), QIconSet(aPixmap),
                 tr("MEN_SCALING"), "", 0, aParent, false,
                this, SLOT(OnScaling()));
 }
@@ -2042,33 +2043,33 @@ 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
+  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_STREAM_LINES, aMenuId, 10 ); // stream lines
+  createMenu( VISU_CUT_LINES, aMenuId, 10 ); // cut lines
 
   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
 }
 
 void
@@ -2076,13 +2077,13 @@ 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_STREAM_LINES, aToolId );
+  createTool( VISU_CUT_LINES, aToolId );
 }
 
 void
@@ -2094,71 +2095,71 @@ createPopupMenus()
 
   // 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 );
+  mgr->insert( action(  VISU_IMPORT_FROM_FILE ), -1, -1, -1 ); // import MED
+  mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
+  mgr->insert( action(  VISU_IMPORT_TABLE ), -1, -1, -1 ); // import tables
+  mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
+  mgr->insert( action(  VISU_PLOT2D ), -1, -1, -1 ); // create Plot2d
+  mgr->setRule( action( VISU_PLOT2D ), 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_DELETE ), -1, -1, -1 ); // delete object
+  mgr->setRule( action( VISU_DELETE ), 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->insert( action(  VISU_SCALAR_MAP ), -1, -1, -1 ); // scalar bar
+  mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
+  mgr->insert( action(  VISU_ISO_SURFACES ), -1, -1, -1 ); // iso surface
+  mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
+  mgr->insert( action(  VISU_CUT_PLANES ), -1, -1, -1 ); // cut planes
+  mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
+  mgr->insert( action(  VISU_CUT_LINES ), -1, -1, -1 ); // cut lines
+  mgr->setRule( action( VISU_CUT_LINES ), 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 );
+  mgr->insert( action(  VISU_DEFORMED_SHAPE ), -1, -1, -1 ); // deformed shape
+  mgr->setRule( action( VISU_DEFORMED_SHAPE ), aRule, true );
+  mgr->insert( action(  VISU_VECTORS ), -1, -1, -1 ); // vectors
+  mgr->setRule( action( VISU_VECTORS ), aRule, true );
+  mgr->insert( action(  VISU_STREAM_LINES ), -1, -1, -1 ); // stream lines
+  mgr->setRule( action( VISU_STREAM_LINES ), 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( action(  VISU_SHOW_TABLE ), -1, -1, -1 ); // show table
+  mgr->setRule( action( VISU_SHOW_TABLE ), aRule, true );
+  mgr->insert( action(  VISU_CREATE_CURVES ), -1, -1, -1 ); // create curves
+  mgr->setRule( action( VISU_CREATE_CURVES ), aRule, true );
+  mgr->insert( action(  VISU_EXPORT_TABLE ), -1, -1, -1 ); // export table
+  mgr->setRule( action( VISU_EXPORT_TABLE ), aRule, true );
   mgr->insert( separator(), -1, -1, -1 );
-  aRule = "(client='ObjectBrowser' and selcount=1 and ((type='VISU::TTABLE' and nbChildren>0) "
+  aRule = "(client='ObjectBrowser' and selcount>0 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 );
+  mgr->insert( action(  VISU_ERASE ), -1, -1, -1 ); // erase
+  mgr->setRule( action( VISU_ERASE ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=1"), true );
+  mgr->insert( action(  VISU_DISPLAY ), -1, -1, -1 ); // display
+  mgr->setRule( action( VISU_DISPLAY ), aRule.arg(""), true );// TODO: aRule.arg(" and isVisible=0"), true );
+  mgr->insert( action(  VISU_DISPLAY_ONLY ), -1, -1, -1 ); // display only
+  mgr->setRule( action( VISU_DISPLAY_ONLY ), 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 );
+  mgr->insert( action(  VISU_DELETE_PRS ), -1, -1, -1 ); // delete presentation
+  mgr->setRule( action( VISU_DELETE_PRS ), aRule, true );
 
   // View parameters
-  mgr->insert ( action( 4046 ), -1, -1, -1 ); // save view params
+  mgr->insert ( action( VISU_VIEW_PARAMS ), -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_VIEW_PARAMS ), "selcount=0", true ); //jfa tmp
+  mgr->insert ( action( VISU_RESTORE_VIEW_PARAMS ), -1, -1, -1 ); // restore view params
+  mgr->setRule( action( VISU_RESTORE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
+  mgr->insert ( action( VISU_DELETE_VIEW_PARAMS ), -1, -1, -1 ); // delete view params
+  mgr->setRule( action( VISU_DELETE_VIEW_PARAMS ), "selcount=1 and type='VISU::TVIEW3D'", true );
 
   // 3D presentations commands
   QString aPrsType = " and $type in {'VISU::TMESH' 'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' "
@@ -2172,39 +2173,39 @@ createPopupMenus()
   aRule = "selcount=1";
 
   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 +
+  mgr->insert( action(  VISU_POINTS ), parentId, -1, -1 ); // points
+  mgr->setRule( action( VISU_POINTS ), 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 +
+  mgr->insert( action(  VISU_WIREFRAME ), parentId, -1, -1 ); // wireframe
+  mgr->setRule( action( VISU_WIREFRAME ), 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 +
+  mgr->insert( action(  VISU_SURFACE ), parentId, -1, -1 ); // surface
+  mgr->setRule( action( VISU_SURFACE ), 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 +
+  mgr->insert( action(  VISU_INSIDEFRAME ), parentId, -1, -1 ); // insideframe
+  mgr->setRule( action( VISU_INSIDEFRAME ), 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 +
+  mgr->insert( action(  VISU_SURFACEFRAME ), parentId, -1, -1 ); // surfaceframe
+  mgr->setRule( action( VISU_SURFACEFRAME ), 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 );
+  mgr->insert( action(  VISU_SHRINK ), parentId, -1, -1 ); // shrink
+  mgr->setRule( action( VISU_SHRINK ), aRule + aShrinkType + " and isShrunk=0", true );
+  mgr->insert( action(  VISU_UNSHRINK ), parentId, -1, -1 ); // unshrink
+  mgr->setRule( action( VISU_UNSHRINK ), 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'"
+  mgr->insert( action(  VISU_CELL_COLOR ), parentId, -1, -1 ); // cell color
+  mgr->setRule( action( VISU_CELL_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
+  mgr->insert( action(  VISU_EDGE_COLOR ), parentId, -1, -1 ); // edge color
+  mgr->setRule( action( VISU_EDGE_COLOR ), aRule + " and type='VISU::TMESH' and representation='VISU::SURFACEFRAME'", true );
+  mgr->insert( action(  VISU_COLOR ), parentId, -1, -1 ); // color
+  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->insert( action(  VISU_OPACITY ), parentId, -1, -1 ); // opacity
+  mgr->setRule( action( VISU_OPACITY ), aRule + aShrinkType + " and hasActor=1", true );
+  mgr->insert( action(  VISU_LINE_WIDTH ), parentId, -1, -1 ); // line width
+  mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
 
   // rename command
   QString aCurveType = "$type in {'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'}";
@@ -2212,64 +2213,54 @@ createPopupMenus()
              "'VISU::TCUTPLANES' 'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
 
   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 );
+  mgr->insert ( action( VISU_RENAME ), -1, -1, -1 ); // rename
+  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 );
+  mgr->insert ( action( VISU_COPY_PRS ), -1, -1, -1 ); // copy
+  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->insert( action(  VISU_CURVE_PROPS ), -1, -1, -1 ); // curve properties
+  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(  VISU_EDIT_CONTAINER ), -1, -1, -1 ); // edit container
+  mgr->setRule( action( VISU_EDIT_CONTAINER ), 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 );
+  mgr->insert( action(  VISU_CLEAR_CONTAINER ), -1, -1, -1 ); // clear container
+  mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
 
   aRule = "selcount=1 and ";
-  mgr->insert( action(  4062 ), -1, -1, -1 ); // edit prs
-  mgr->setRule( action( 4062 ), aRule + aPrsType, true );
+  mgr->insert( action(  VISU_EDIT_PRS ), -1, -1, -1 ); // edit prs
+  mgr->setRule( action( VISU_EDIT_PRS ), aRule + aPrsType, 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->insert( action(  VISU_CREATE_TABLE ), -1, -1, -1 ); // create table
+  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 );
+  mgr->insert ( action( VISU_SWEEP ), -1, -1, -1 ); // sweep
+  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 );
+  mgr->insert( action(  VISU_SELECTION_INFO ), -1, -1, -1 ); // Selection info
+  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->insert( action(  VISU_ANIMATION ), -1, -1, -1 ); // animation
+  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->insert( action(  VISU_CREATE_PRS ), -1, -1, -1 ); // create presentation
+  mgr->setRule( action( VISU_CREATE_PRS ), aRule + " and selcount=1", true );
+  mgr->insert( action(  VISU_CREATE_MANY_PRS ), -1, -1, -1 ); // create presentations
+  mgr->setRule( action( VISU_CREATE_MANY_PRS ), aRule + " and selcount>1", true );
 }
 
 void
index b953d445ea9b08638dc4af00d2b0065046bcb903..5458d83aaa581a067ea0cc5bc1b67383113a4cb6 100644 (file)
@@ -86,9 +86,6 @@ protected slots:
   void OnDisplayPrs();
   void OnDisplayOnlyPrs();
   void OnErasePrs();
-  void OnDisplayManyPrs();
-  void OnEraseManyPrs();
-  void OnDisplayOnlyManyPrs();
   void OnEraseAll();
 
   void OnMakeSurfaceframe();
@@ -129,7 +126,7 @@ protected slots:
 protected:
   virtual SalomeApp_Selection* createSelection() const;
 
-  void ErasePrs (CORBA::Object_ptr theObject);
+  void ErasePrs (CORBA::Object_ptr theObject, bool theUpdate = true);
   void ChangeRepresentation (VISU::PresentationType theType);
   void CreateMesh (const Handle(SALOME_InteractiveObject)& theIO);
 
diff --git a/src/VISUGUI/VisuGUI_ActionsDef.h b/src/VISUGUI/VisuGUI_ActionsDef.h
new file mode 100644 (file)
index 0000000..027f60c
--- /dev/null
@@ -0,0 +1,65 @@
+#ifndef VISUGUI_ACTIONSDEF
+#define VISUGUI_ACTIONSDEF
+
+#define VISU_IMPORT_FROM_FILE       112
+#define VISU_EXPLORE_MED            113
+#define VISU_IMPORT_TABLE           199
+
+#define VISU_SCALAR_MAP             4011
+#define VISU_DEFORMED_SHAPE         4012
+#define VISU_VECTORS                4013
+#define VISU_ISO_SURFACES           4014
+#define VISU_CUT_PLANES             4015
+#define VISU_STREAM_LINES           4016
+#define VISU_CUT_LINES              4018
+#define VISU_PLOT2D                 4020
+
+#define VISU_DELETE                 4021
+#define VISU_SHOW_TABLE             4023
+#define VISU_CREATE_CURVES          4024
+#define VISU_EXPORT_TABLE           4025
+
+#define VISU_CREATE_PRS             4026
+#define VISU_CREATE_MANY_PRS        4027
+#define VISU_ERASE                  4030
+#define VISU_DISPLAY                4031
+#define VISU_DISPLAY_ONLY           4032
+#define VISU_DELETE_PRS             4033
+
+#define VISU_COPY_PRS               4037
+#define VISU_CURVE_PROPS            4040
+#define VISU_RENAME                 4041
+#define VISU_EDIT_CONTAINER         4042
+#define VISU_CLEAR_CONTAINER        4044
+
+#define VISU_VIEW_PARAMS            4046
+#define VISU_RESTORE_VIEW_PARAMS    4047
+#define VISU_DELETE_VIEW_PARAMS     4048
+
+#define VISU_POINTS                 4050
+#define VISU_WIREFRAME              4051
+#define VISU_SURFACE                4052
+#define VISU_INSIDEFRAME            4053
+#define VISU_SURFACEFRAME           4054
+#define VISU_SHRINK                 4055
+#define VISU_UNSHRINK               4056
+
+#define VISU_CELL_COLOR             4057
+#define VISU_COLOR                  4058
+#define VISU_EDGE_COLOR             4059
+#define VISU_OPACITY                4060
+#define VISU_LINE_WIDTH             4061
+
+#define VISU_EDIT_PRS               4062
+#define VISU_CREATE_TABLE           4063
+#define VISU_SWEEP                  4064
+#define VISU_SELECTION_INFO         4065
+#define VISU_ANIMATION              4066
+
+#define VISU_ERASE_ALL              4070
+#define VISU_GLOBAL_SELECTION       4071
+#define VISU_PARTIAL_SELECTION      4072
+#define VISU_SCALING                4073
+
+
+#endif