]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Improvement of the Slider & Sweep panels management. Now it will be possible to chang...
authorapo <apo@opencascade.com>
Wed, 4 Jun 2008 15:31:46 +0000 (15:31 +0000)
committerapo <apo@opencascade.com>
Wed, 4 Jun 2008 15:31:46 +0000 (15:31 +0000)
15 files changed:
resources/Makefile.am
resources/Visu_slider_panel.png [new file with mode: 0644]
resources/Visu_sweep_panel.png [new file with mode: 0644]
src/VISUGUI/Makefile.am
src/VISUGUI/VISU_images.ts
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_ActionsDef.h
src/VISUGUI/VisuGUI_CacheDlg.cxx [deleted file]
src/VISUGUI/VisuGUI_CacheDlg.h [deleted file]
src/VISUGUI/VisuGUI_Slider.cxx
src/VISUGUI/VisuGUI_Slider.h
src/VISUGUI/VisuGUI_Sweep.cxx
src/VISUGUI/VisuGUI_Sweep.h

index a3c7f490f61a0894d7db4474810dafdf062764b8..6f4c1ddded21bc4f2dda3a168d5db4a64cd032bb 100644 (file)
@@ -72,6 +72,8 @@ Visu_scalars.png \
 Visu_scaling.png \
 Visu_selectall.png \
 Visu_selection_panel.png \
+Visu_slider_panel.png \
+Visu_sweep_panel.png \
 Visu_selectionactor.png \
 Visu_selectioncell.png \
 Visu_selectionedge.png \
diff --git a/resources/Visu_slider_panel.png b/resources/Visu_slider_panel.png
new file mode 100644 (file)
index 0000000..8129a9e
Binary files /dev/null and b/resources/Visu_slider_panel.png differ
diff --git a/resources/Visu_sweep_panel.png b/resources/Visu_sweep_panel.png
new file mode 100644 (file)
index 0000000..bcc9203
Binary files /dev/null and b/resources/Visu_sweep_panel.png differ
index e0544ae6db12b9b9b9ee17e0dc2e98a0dbd0ff9f..6fd19625d4a26dbfdd8704b950fcd992bf52c4d7 100644 (file)
@@ -74,7 +74,6 @@ dist_libVISU_la_SOURCES= \
        VisuGUI_Slider.cxx \
        VisuGUI_Sweep.cxx \
        VisuGUI_InputPane.cxx \
-       VisuGUI_CacheDlg.cxx \
        VisuGUI_FieldFilter.cxx \
        VisuGUI_ViewExtender.cxx \
        VisuGUI_ClippingPlaneMgr.cxx \
@@ -112,7 +111,6 @@ MOC_FILES= \
        VisuGUI_Slider_moc.cxx \
        VisuGUI_Sweep_moc.cxx \
        VisuGUI_InputPane_moc.cxx \
-       VisuGUI_CacheDlg_moc.cxx \
        VisuGUI_ViewExtender_moc.cxx \
        VisuGUI_ClippingPlaneMgr_moc.cxx \
        VisuGUI_SegmentationMgr_moc.cxx
index cbae951c36fcd0a7297fd506ccedbe41591ea883..7157c48cb2db542202203843d78ecfc4d64361ed 100644 (file)
             <source>ICON_SELECTION_PANEL</source>
             <translation>Visu_selection_panel.png</translation>
         </message>
+        <message><source>ICON_SLIDER_PANEL</source><translation>Visu_slider_panel.png</translation></message>
+        <message><source>ICON_SWEEP_PANEL</source><translation>Visu_sweep_panel.png</translation></message>
         <message>
             <source>ICON_SLIDER_AVI</source>
             <translation>Visu_slider_avi.png</translation>
index 580e1a2e11868d9f902658444b08a02e752d125f..dc9c0784b596afa7f7b1d32a916a2bb867ad1177 100644 (file)
@@ -96,10 +96,8 @@ number of time stamps or number of components is not the same!</translation>
             <source>UNITS_LBL</source>
             <translation>Units</translation>
         </message>
-        <message>
-            <source>VISU_3DCACHE_PROPS</source>
-            <translation>3D Cache properties</translation>
-        </message>
+        <message><source>VISU_3DCACHE_PREFERENCES</source><translation>3D Cache</translation></message>
+        <message><source>VISU_ANIMATION_PREFERENCES</source><translation>Animation</translation></message>
         <message>
             <source>VISU_COLORS_AND_LABELS</source>
             <translation>Colors &amp;&amp; Labels</translation>
@@ -873,8 +871,8 @@ Please, refer to the documentation.</translation>
             <translation>Arrange Actors</translation>
         </message>
         <message>
-            <source>MEN_CACHE_PROPERTIES</source>
-            <translation>Properties</translation>
+            <source>MEN_MANAGE_CACHE</source>
+            <translation>Manage</translation>
         </message>
         <message>
             <source>MEN_CELL_COLOR</source>
@@ -1196,21 +1194,11 @@ Please, refer to the documentation.</translation>
             <source>MEN_WIREFRAME</source>
             <translation>Wireframe</translation>
         </message>
-        <message>
-            <source>TOOL_IMPORT</source>
-            <translation>Import Toolbar</translation>
-        </message>
-        <message>
-            <source>TOOL_REPRESENTATION</source>
-            <translation>Representation Toolbar</translation>
-        </message>
-        <message>
-            <source>TOOL_SELECTION</source>
-            <translation>Selection Toolbar</translation>
-        </message>
-        <message>
-            <source>TOOL_VISUALISATION</source>
-            <translation>Visualization Toolbar</translation>
+        <message><source>TOOL_IMPORT</source><translation>Import</translation></message>
+        <message><source>TOOL_REPRESENTATION</source><translation>Representation</translation></message>
+        <message><source>TOOL_SELECTION</source><translation>Selection</translation></message>
+        <message><source>TOOL_NAVIGATION</source><translation>Navigation</translation></message>
+        <message><source>TOOL_VISUALISATION</source><translation>Visualization</translation>
         </message>
         <message>
             <source>USE_BUILD_PROGRESS</source>
@@ -2190,7 +2178,7 @@ Please, provide non-empty resulting presentation.</translation>
         </message>
         <message>
             <source>TOOL_VISUALISATION</source>
-            <translation>Visualization Toolbar</translation>
+            <translation>Visualization</translation>
         </message>
         <message>
             <source>TOT_DESK_FILE_SAVE_GUI_STATE</source>
@@ -2861,6 +2849,7 @@ Please, provide non-empty resulting presentation.</translation>
         <name>VisuGUI_Sweep</name>
 
         <message><source>TITLE</source><translation>Sweep</translation></message>
+        <message><source>MEN_SWEEP_PANE</source><translation>Sweep</translation></message>
 
         <message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
         <message><source>START_SWEEP_POSITION</source><translation>0 %</translation></message>
@@ -2886,6 +2875,7 @@ Please, provide non-empty resulting presentation.</translation>
         <name>VisuGUI_Slider</name>
 
         <message><source>TITLE</source><translation>Slider</translation></message>
+        <message><source>MEN_SLIDER_PANE</source><translation>Slider</translation></message>
 
         <message><source>NAVIGATION_TAB</source><translation>Navigation</translation></message>
         <message><source>IS_CYCLED</source><translation>Cycled</translation></message>
@@ -2899,7 +2889,6 @@ Please, provide non-empty resulting presentation.</translation>
         <message><source>AVAILABLE_MEMORY</source><translation>Free:</translation></message>
 
         <message><source>SPEED</source><translation>Speed</translation></message>
-
     </context>
     <context>
         <name>VisuGUI_StreamLinesDlg</name>
index a7b7c0fef1e878159e1980d4d4a92a67d7ecfe88..b101ecff9405e4fe59d17465215b2ba149d793cc 100644 (file)
 #include "VisuGUI_Displayer.h"
 #include "VisuGUI_BuildProgressDlg.h"
 #include "VisuGUI_TransparencyDlg.h"
-#include "VisuGUI_CacheDlg.h"
 #include "VisuGUI_InputPanel.h"
 
 #include "VISU_ScalarMap_i.hh"
@@ -175,10 +174,11 @@ static int MYDEBUG = 0;
 VisuGUI
 ::VisuGUI():
   SalomeApp_Module( "VISU" ),
-  mySlider( NULL ),
   myDisplayer( 0 ),
   myInputPanel( 0 ),
-  mySelectionPanel( 0 )
+  mySelectionPanel( 0 ),
+  mySlider( NULL ),
+  mySweep( NULL )
 {
 }
 
@@ -1642,7 +1642,7 @@ void
 VisuGUI
 ::OnSweep()
 {
-  new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
+  mySweep->show();
 }
 
 //----------------------------------------------------------------------------
@@ -1993,6 +1993,10 @@ VisuGUI
 {
   SalomeApp_Module::initialize( theApp );
 
+  mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
+
+  mySweep = new VisuGUI_Sweep( this, getApp()->desktop(), getApp()->selectionMgr() );
+
   createActions();
   createMenus();
   createToolBars();
@@ -2344,6 +2348,10 @@ VisuGUI
                 tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
                 this, SLOT(OnSwitchSelectionMode()));
 
+  // Defenition of the actions for the "Navigation" tool bar
+  registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
+  registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
+
   createAction( VISU_SHOW_ANIMATION, tr("MEN_SHOW_ANIMATION"), QIcon(),
                 tr("MEN_SHOW_ANIMATION"), "", 0, aParent, false,
                 this, SLOT(OnShowAnimation()));
@@ -2353,9 +2361,9 @@ VisuGUI
                 tr("MEN_PLOT3D_FROM_CUTPLANE"), "", 0, aParent, false,
                 this, SLOT(OnPlot3dFromCutPlane()));
 
-  createAction( VISU_CACHE_PROPERTIES, tr("MEN_CACHE_PROPERTIES"), QIcon(),
-                tr("MEN_CACHE_PROPERTIES"), "", 0, aParent, false,
-                this, SLOT(OnCacheProperties()));
+  createAction( VISU_MANAGE_CACHE, tr("MEN_MANAGE_CACHE"), QIcon(),
+                tr("MEN_MANAGE_CACHE"), "", 0, aParent, false,
+                this, SLOT( OnManageCache() ) );
 
   aPixmap = aResourceMgr->loadPixmap("VISU",tr("ICON_MULTIPR_VIEW_FULL"));
   createAction( VISU_MULTIPR_FULL_RES, tr("MEN_MULTIPR_VIEW_FULL_RES"), QIcon(aPixmap),
@@ -2449,6 +2457,11 @@ VisuGUI
   createTool( VISU_CELL_SELECTION, aToolId );
   createTool( VISU_POINT_SELECTION, aToolId );
   createTool( VISU_GAUSS_POINT_SELECTION, aToolId );
+
+  aToolId = createTool( tr( "TOOL_NAVIGATION" ) );
+  createTool( VISU_SLIDER_PANEL, aToolId );
+  createTool( separator(), aToolId );
+  createTool( VISU_SWEEP_PANEL, aToolId );
 }
 
 void
@@ -2864,7 +2877,7 @@ void VisuGUI::contextMenuPopup( const QString& theClient, QMenu* theMenu, QStrin
 
   if(VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase){
     if(aBase->GetType() == VISU::TCOLOREDPRS3DCACHE)
-      theMenu->addAction( action( VISU_CACHE_PROPERTIES ) );
+      theMenu->addAction( action( VISU_MANAGE_CACHE ) );
   }
 
   theMenu->addSeparator();
@@ -2967,10 +2980,6 @@ VisuGUI
 {
   bool aResult = SalomeApp_Module::activateModule( theStudy );
 
-  if ( !mySlider ) {
-    mySlider = new VisuGUI_Slider( this, getApp()->desktop(), getApp()->selectionMgr() );
-  }
-
   studyActivated();
   setMenuShown( true );
   setToolShown( true );
@@ -3276,58 +3285,88 @@ void VisuGUI::createPreferences()
   addPreference( tr( "Generate data table" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_data_table" );
   addPreference( tr( "Generate curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "generate_curves" );
 
-  // TAB: "Sweep, Animation"
-  int srangeTab = addPreference( tr( "Sweep, Animation" ) );
-
-  // group: "Sweeping preferences"
-  int sweepGr = addPreference( tr( "VISU_SWEEPING_PREF" ), srangeTab );
-  setPreferenceProperty( sweepGr, "columns", 2 );
-
-  int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
-  QStringList sweep_modes;
-  sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
-  sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
-  sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
-  indices.clear();
-  indices.append( 0 );
-  indices.append( 1 );
-  indices.append( 2 );
-  setPreferenceProperty( modeSw, "strings", sweep_modes );
-  setPreferenceProperty( modeSw, "indexes", indices );
-
-  int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGr,
-                                  LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
-  int nbcycles   = addPreference( tr( "VISU_NB_CYCLES" ), sweepGr,
-                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
-  int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGr,
-                                  LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
-  int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGr, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
-  QStringList ranges;
-  ranges.append( tr( "PERIOD_PI" ) );
-  ranges.append( tr( "PERIOD_2PI" ) );
-  indices.clear();
-  indices.append( 0 );
-  indices.append( 1 );
-  setPreferenceProperty( rangeSw, "strings", ranges );
-  setPreferenceProperty( rangeSw, "indexes", indices );
-
-  setPreferenceProperty( timestep, "min",  0.1 );
-  setPreferenceProperty( timestep, "step", 0.1 );
-  setPreferenceProperty( timestep, "max",  1000 );
-  setPreferenceProperty( nbcycles, "max",  100  );
-  setPreferenceProperty( nbsteps,  "max",  200  );
-
-  // group: "Animation preferences"
-  int animationGr = addPreference( tr( "Animation preferences" ), srangeTab );
-  setPreferenceProperty( animationGr, "columns", 3 );
+  // TAB: "Sweep, Animation, 3D Cache"
+  int animationTab = addPreference( tr( "Animation" ) );
+  {
+    // group: "3D Cache System prefereces"
+    {
+      int cacheGroup = addPreference( tr( "VISU_3DCACHE_PREFERENCES" ), animationTab );
+      setPreferenceProperty( cacheGroup, "columns", 2 );
+      
+      int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGroup,
+                                      LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
+      
+      modes.clear();
+      modes.append( tr( "VISU_MINIMAL" ) );
+      modes.append( tr( "VISU_LIMITED" ) );
+      setPreferenceProperty( memory_mode, "strings", modes );
+      
+      indices.clear();
+      indices.append( 0 );
+      indices.append( 1 );
+      setPreferenceProperty( memory_mode, "indexes", indices );
+      
+      int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGroup,
+                                       LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
+      setPreferenceProperty( memory_limit, "min", 1 );
+      setPreferenceProperty( memory_limit, "max", 5000 );
+      setPreferenceProperty( memory_limit, "step", 10 );
+    }
 
-  int speed = addPreference( tr( "Speed" ), animationGr, LightApp_Preferences::IntSpin, "VISU", "speed" );
-  addPreference( tr( "Cycled animation" ), animationGr, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
-  addPreference( tr( "Use proportional timing" ), animationGr, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
-  addPreference( tr( "Clean memory at each frame" ), animationGr, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+    // group: "Animation preferences"
+    {
+      int animationGroup = addPreference( tr( "VISU_ANIMATION_PREFERENCES" ), animationTab );
+      setPreferenceProperty( animationGroup, "columns", 3 );
+      
+      int speed = addPreference( tr( "Speed" ), animationGroup, LightApp_Preferences::IntSpin, "VISU", "speed" );
+      addPreference( tr( "Cycled animation" ), animationGroup, LightApp_Preferences::Bool, "VISU", "cycled_animation" );
+      addPreference( tr( "Use proportional timing" ), animationGroup, LightApp_Preferences::Bool, "VISU", "use_proportional_timing" );
+      addPreference( tr( "Clean memory at each frame" ), animationGroup, LightApp_Preferences::Bool, "VISU", "clean_memory_at_each_frame" );
+      
+      setPreferenceProperty( speed, "min", 1 );
+      setPreferenceProperty( speed, "max", 99 );
+    }
 
-  setPreferenceProperty( speed, "min", 1 );
-  setPreferenceProperty( speed, "max", 99 );
+    // group: "Sweeping preferences"
+    {
+      int sweepGroup = addPreference( tr( "VISU_SWEEPING_PREF" ), animationTab );
+      setPreferenceProperty( sweepGroup, "columns", 2 );
+      
+      int modeSw = addPreference( tr( "VISU_SWEEPING_MODES" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_modes" );
+      QStringList sweep_modes;
+      sweep_modes.append( tr( "VISU_LINEAR_SWEEP" ) );
+      sweep_modes.append( tr( "VISU_COS_SWEEP" ) );
+      sweep_modes.append( tr( "VISU_SIN_SWEEP" ) );
+      indices.clear();
+      indices.append( 0 );
+      indices.append( 1 );
+      indices.append( 2 );
+      setPreferenceProperty( modeSw, "strings", sweep_modes );
+      setPreferenceProperty( modeSw, "indexes", indices );
+      
+      int timestep   = addPreference( tr( "VISU_TIME_STEP" ), sweepGroup,
+                                     LightApp_Preferences::DblSpin, "VISU", "sweeping_time_step" );
+      int nbcycles   = addPreference( tr( "VISU_NB_CYCLES" ), sweepGroup,
+                                     LightApp_Preferences::IntSpin, "VISU", "sweeping_number_cycles" );
+      int nbsteps    = addPreference( tr( "VISU_NB_STEPS" ),  sweepGroup,
+                                     LightApp_Preferences::IntSpin, "VISU", "sweeping_number_steps" );
+      int rangeSw = addPreference( tr( "VISU_IS2PI" ), sweepGroup, LightApp_Preferences::Selector, "VISU", "sweeping_is2PI" );
+      QStringList ranges;
+      ranges.append( tr( "PERIOD_PI" ) );
+      ranges.append( tr( "PERIOD_2PI" ) );
+      indices.clear();
+      indices.append( 0 );
+      indices.append( 1 );
+      setPreferenceProperty( rangeSw, "strings", ranges );
+      setPreferenceProperty( rangeSw, "indexes", indices );
+      
+      setPreferenceProperty( timestep, "min",  0.1 );
+      setPreferenceProperty( timestep, "step", 0.1 );
+      setPreferenceProperty( timestep, "max",  1000 );
+      setPreferenceProperty( nbcycles, "max",  100  );
+      setPreferenceProperty( nbsteps,  "max",  200  );
+    }
+  }
 
   // TAB: Representation ; group: "Representation properties"
   int representationTab = addPreference( tr( "Representation" ) );
@@ -3420,31 +3459,6 @@ void VisuGUI::createPreferences()
 
   addPreference( tr( "VISU_DISP_ONLY" ), representGr,
                  LightApp_Preferences::Bool, "VISU", "display_only" );
-
-  // TAB: 3D Cache ; group: "Cache properties"
-  int cacheTab = addPreference( tr( "3D Cache" ) );
-
-  int cacheGr = addPreference( tr( "VISU_3DCACHE_PROPS" ), cacheTab );
-  setPreferenceProperty( cacheGr, "columns", 2 );
-
-  int memory_mode = addPreference( tr( "VISU_MEMORY_MODE" ), cacheGr,
-                                  LightApp_Preferences::Selector, "VISU", "cache_memory_mode" );
-
-  modes.clear();
-  modes.append( tr( "VISU_MINIMAL" ) );
-  modes.append( tr( "VISU_LIMITED" ) );
-  setPreferenceProperty( memory_mode, "strings", modes );
-
-  indices.clear();
-  indices.append( 0 );
-  indices.append( 1 );
-  setPreferenceProperty( memory_mode, "indexes", indices );
-
-  int memory_limit = addPreference( tr( "VISU_MEMORY_LIMIT" ), cacheGr,
-                                   LightApp_Preferences::IntSpin, "VISU", "cache_memory_limit" );
-  setPreferenceProperty( memory_limit, "min", 1 );
-  setPreferenceProperty( memory_limit, "max", 5000 );
-  setPreferenceProperty( memory_limit, "step", 10 );
 }
 
 void VisuGUI::preferencesChanged( const QString& a, const QString& b)
@@ -3644,25 +3658,9 @@ void VisuGUI::OnPlot3dFromCutPlane()
  }
 }
 
-void VisuGUI::OnCacheProperties()
+void VisuGUI::OnManageCache()
 {
-  VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects(this);
-  if(aSelectionInfo.empty())
-    return;
-
-  VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
-  _PTR(SObject) aSObject = aSelectionItem.myObjectInfo.mySObject;
-
-  CORBA::Object_var anObject = VISU::ClientSObjectToObject(aSObject);
-  if( CORBA::is_nil( anObject ) )
-    return;
-
-  VISU::ColoredPrs3dCache_var aCache = VISU::GetInterface<VISU::ColoredPrs3dCache>(anObject);
-  if( CORBA::is_nil( aCache ) )
-    return;
-
-  VisuGUI_CacheDlg* aDlg = new VisuGUI_CacheDlg( aCache, this );
-  aDlg->exec();
+  mySlider->show();
 }
 
 
index 92ba9595f24380b315a0fbb463f861ec1fd9efa5..fbe7ef558149a23cd4a724e3c9c9a168fb8bc5e9 100644 (file)
 
 class SUIT_ViewManager;
 class SVTK_ViewWindow;
-class VisuGUI_Slider;
 class VisuGUI_InputPanel;
 class VisuGUI_SelectionPanel;
+class VisuGUI_Slider;
+class VisuGUI_Sweep;
 
 namespace VISU
 {
@@ -180,7 +181,7 @@ protected slots:
   void OnArrangeActors();
   void OnPlot3dFromCutPlane();
 
-  void OnCacheProperties();
+  void OnManageCache();
 
   // MULTIPR
   void OnMultiprViewFullRes();
@@ -207,6 +208,7 @@ private:
   VisuGUI_InputPanel*     myInputPanel;
   VisuGUI_SelectionPanel* mySelectionPanel;
   VisuGUI_Slider*         mySlider;
+  VisuGUI_Sweep*          mySweep; 
 
   LightApp_Displayer*     myDisplayer;
   VISU::TViewToPrs3d      myScalarBarsMap;
index 7ea0936e286a7f35ce74103977900ab6c99e6914..22633b45cce4288c05bae6ef3bdc52453adc581b 100644 (file)
 
 #define VISU_PLOT3D_FROM_CUTPLANE   4085
 
-#define VISU_CACHE_PROPERTIES       4090
+#define VISU_MANAGE_CACHE           4090
 
 // MULTIPR
 #define VISU_MULTIPR_FULL_RES       4095
 #define VISU_POINT_SELECTION        4103
 #define VISU_GAUSS_POINT_SELECTION  4104
 
+#define VISU_SLIDER_PANEL           4200
+#define VISU_SWEEP_PANEL            4300
+
 #endif
diff --git a/src/VISUGUI/VisuGUI_CacheDlg.cxx b/src/VISUGUI/VisuGUI_CacheDlg.cxx
deleted file mode 100644 (file)
index 638d94a..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : VisuGUI_CacheDlg.cxx
-//  Author : Oleg UVAROV
-//  Module : VISU
-
-#include "VisuGUI_CacheDlg.h"
-
-#include "VisuGUI_Tools.h"
-
-#include "VISU_PipeLine.hxx"
-
-#include "SUIT_Desktop.h"
-#include "SUIT_MessageBox.h"
-#include "SUIT_Session.h"
-#include "SUIT_ResourceMgr.h"
-
-#include "SalomeApp_Module.h"
-
-#include "LightApp_Application.h"
-
-#include "QtxDoubleSpinBox.h"
-
-#include <QButtonGroup>
-#include <QGroupBox>
-#include <QLabel>
-#include <QLayout>
-#include <QLineEdit>
-#include <QPushButton>
-#include <QRadioButton>
-
-using namespace std;
-
-VisuGUI_CacheDlg::VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var theCache,
-                                   SalomeApp_Module* theModule )
-  : QDialog( VISU::GetDesktop( theModule ), Qt::WindowTitleHint | Qt::WindowSystemMenuHint ),
-    myCache( theCache )
-{
-  setModal( true );
-  setWindowTitle( tr( "CACHE_TITLE" ) );
-  setAttribute( Qt::WA_DeleteOnClose );
-
-  QVBoxLayout* aTopLayout = new QVBoxLayout( this );
-  aTopLayout->setSpacing( 6 );
-  aTopLayout->setMargin( 6 );
-  //aTopLayout->setAutoAdd( true );
-
-  long aMb = 1024 * 1024;
-  bool isLimitedMemory = myCache->GetMemoryMode() == VISU::ColoredPrs3dCache::LIMITED;
-  double aLimitedMemory = myCache->GetLimitedMemory();
-  double aFreeMemory = (double)VISU_PipeLine::GetAvailableMemory( 2048 * aMb ) / (double)aMb;
-  double anUsedMemory = myCache->GetMemorySize();
-  double aLimitedMemoryMax = 
-#ifdef WNT
-         max
-#else
-         std::max
-#endif
-         (anUsedMemory + aFreeMemory, aLimitedMemory);
-
-  // Settings
-  QButtonGroup* aMemoryGroup = new QButtonGroup(  this );
-  QGroupBox* aGB = new QGroupBox( tr( "MEMORY_MODE" ), this );
-  aTopLayout->addWidget( aGB );
-  QGridLayout* aGridLay = new QGridLayout( aGB );
-  //aMemoryGroup->setRadioButtonExclusive( true );
-
-  myLimitedMemoryButton = new QRadioButton( tr( "LIMITED_MEMORY" ), aGB );
-  myLimitedMemoryButton->setChecked( isLimitedMemory );
-  aGridLay->addWidget( myLimitedMemoryButton, 0, 0 );
-
-  myMimimalMemoryButton = new QRadioButton( tr( "MINIMAL_MEMORY" ), aGB );
-  myMimimalMemoryButton->setChecked( !isLimitedMemory );
-  aGridLay->addWidget( myMimimalMemoryButton, 1, 0 );
-
-  myLimitedMemory = new QtxDoubleSpinBox( 1.0, aLimitedMemoryMax, 10.0, aGB );
-  myLimitedMemory->setSuffix( " Mb" );
-  myLimitedMemory->setValue( aLimitedMemory );
-  myLimitedMemory->setEnabled( isLimitedMemory );
-  aGridLay->addWidget( myLimitedMemory, 0, 1 );
-  
-
-  connect( myLimitedMemoryButton, SIGNAL( toggled( bool ) ), myLimitedMemory, SLOT( setEnabled( bool ) ) );
-
-  // Current state
-  QGroupBox* aStateGroup = new QGroupBox( tr( "MEMORY STATE" ), this );
-  aTopLayout->addWidget( aStateGroup );
-  //aStateGroup->setColumnLayout( 0, Qt::Vertical );
-  //aStateGroup->layout()->setSpacing( 0 );
-  //aStateGroup->layout()->setMargin( 0 );
-
-  QGridLayout* aStateLayout = new QGridLayout( aStateGroup );
-  aStateLayout->setSpacing(6);
-  aStateLayout->setMargin(6);
-
-  QLabel* aUsedMemoryLabel = new QLabel( tr( "USED_BY_CACHE" ), aStateGroup );
-  myUsedMemory = new QLineEdit( aStateGroup );
-  myUsedMemory->setText( QString::number( anUsedMemory ) + " Mb" );
-  myUsedMemory->setReadOnly( true );
-  myUsedMemory->setEnabled( false );
-  QPalette aPal = myUsedMemory->palette();
-  aPal.setColor( myUsedMemory->foregroundRole(), Qt::black );
-  myUsedMemory->setPalette( aPal );
-  //myUsedMemory->setPaletteForegroundColor( Qt::black );
-
-  QLabel* aFreeMemoryLabel = new QLabel( tr( "FREE" ), aStateGroup );
-  myFreeMemory = new QLineEdit( aStateGroup );
-  myFreeMemory->setText( QString::number( aFreeMemory ) + " Mb" );
-  myFreeMemory->setReadOnly( true );
-  myFreeMemory->setEnabled( false );
-  aPal = myFreeMemory->palette();
-  aPal.setColor( myFreeMemory->foregroundRole(), Qt::black );
-  myFreeMemory->setPalette( aPal );
-  //myFreeMemory->setPaletteForegroundColor( Qt::black );
-
-  aStateLayout->addWidget( aUsedMemoryLabel, 0, 0 );
-  aStateLayout->addWidget( myUsedMemory, 0, 1 );
-  aStateLayout->addWidget( aFreeMemoryLabel, 1, 0 );
-  aStateLayout->addWidget( myFreeMemory, 1, 1 );
-
-  // Ok / Cancel
-  QGroupBox* GroupButtons = new QGroupBox( this );
-  aTopLayout->addWidget( GroupButtons );
-  //GroupButtons->setColumnLayout(0, Qt::Vertical );
-  //GroupButtons->layout()->setSpacing( 0 );
-  //GroupButtons->layout()->setMargin( 0 );
-  QGridLayout* GroupButtonsLayout = new QGridLayout( GroupButtons );
-  GroupButtonsLayout->setAlignment( Qt::AlignTop );
-  GroupButtonsLayout->setSpacing( 6 );
-  GroupButtonsLayout->setMargin( 11 );
-
-  QPushButton* buttonOk = new QPushButton( tr( "BUT_OK" ), GroupButtons );
-  buttonOk->setAutoDefault( TRUE );
-  buttonOk->setDefault( TRUE );
-  GroupButtonsLayout->addWidget( buttonOk, 0, 0 );
-  GroupButtonsLayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Expanding, QSizePolicy::Minimum ), 0, 1 );
-
-  QPushButton* buttonCancel = new QPushButton( tr( "BUT_CANCEL" ) , GroupButtons );
-  buttonCancel->setAutoDefault( TRUE );
-  GroupButtonsLayout->addWidget( buttonCancel, 0, 2 );
-
-  QPushButton* buttonHelp = new QPushButton( tr( "BUT_HELP" ) , GroupButtons );
-  buttonHelp->setAutoDefault( TRUE );
-  GroupButtonsLayout->addWidget( buttonHelp, 0, 3 );
-
-  connect( buttonOk,     SIGNAL( clicked() ), this, SLOT( accept() ) );
-  connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
-  connect( buttonHelp,   SIGNAL( clicked() ), this, SLOT( onHelp() ) );
-}
-
-VisuGUI_CacheDlg::~VisuGUI_CacheDlg()
-{
-}
-
-bool VisuGUI_CacheDlg::isLimitedMemory()
-{
-  return myLimitedMemoryButton->isChecked();
-}
-
-double VisuGUI_CacheDlg::getLimitedMemory()
-{
-  return myLimitedMemory->value();
-}
-
-void VisuGUI_CacheDlg::accept()
-{
-  if( isLimitedMemory() )
-  {
-    myCache->SetMemoryMode( VISU::ColoredPrs3dCache::LIMITED );
-    myCache->SetLimitedMemory( (float)getLimitedMemory() );
-  }
-  else
-    myCache->SetMemoryMode( VISU::ColoredPrs3dCache::MINIMAL );
-
-
-  QDialog::accept();
-}
-
-void VisuGUI_CacheDlg::onHelp()
-{
-  QString aHelpFileName;// = "types_of_gauss_points_presentations_page.html";
-  LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
-  if (app)
-    app->onHelpContextModule(app->activeModule() ?
-                            app->moduleName(app->activeModule()->moduleName()) : QString(""), aHelpFileName);
-  else {
-    SUIT_MessageBox::warning(0, tr("WRN_WARNING"),
-                             tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
-                             arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(aHelpFileName),
-                             tr("BUT_OK"));
-  }
-}
diff --git a/src/VISUGUI/VisuGUI_CacheDlg.h b/src/VISUGUI/VisuGUI_CacheDlg.h
deleted file mode 100644 (file)
index 59fc1d8..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-//  VISU VISUGUI : GUI of VISU component
-//
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
-//
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
-//
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
-//
-//  File   : VisuGUI_CacheDlg.h
-//  Author : Oleg UVAROV
-//  Module : VISU
-
-#ifndef VISUGUI_CACHEDLG_H
-#define VISUGUI_CACHEDLG_H
-
-#include "SALOMEconfig.h"
-#include CORBA_SERVER_HEADER(VISU_Gen)
-
-#include <QDialog>
-
-class QLineEdit;
-class QRadioButton;
-class QtxDoubleSpinBox;
-
-class SalomeApp_Module;
-
-class VisuGUI_CacheDlg : public QDialog
-{
-  Q_OBJECT
-
-public:
-  VisuGUI_CacheDlg( VISU::ColoredPrs3dCache_var aCache,
-                   SalomeApp_Module* theModule );
-  virtual ~VisuGUI_CacheDlg();
-
-public:
-  bool            isLimitedMemory();
-  double          getLimitedMemory();
-
-protected slots:
-  virtual void    accept();
-
-  void            onHelp();
-
-private:
-  VISU::ColoredPrs3dCache_var myCache;
-
-  QRadioButton*   myMimimalMemoryButton;
-  QRadioButton*   myLimitedMemoryButton;
-  QtxDoubleSpinBox*  myLimitedMemory;
-
-  QLineEdit*      myUsedMemory;
-  QLineEdit*      myFreeMemory;
-};
-
-#endif
index 0abea289dae139caf420bcebdf9ecacacc8542d3..c03e6694b3bb13dc97d8a51fb07e63a5980c8d0d 100644 (file)
@@ -69,6 +69,7 @@
 #include <QCheckBox>
 #include <QRadioButton>
 #include <QTimer>
+#include <QAction>
 
 /*!
   Constructor
@@ -89,6 +90,8 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
   QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
 
   QTabWidget* aTabWidget = new QTabWidget( this );
+  aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
+
   aVBoxLayout->addWidget( aTabWidget );
 
   {
@@ -158,10 +161,6 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
        myTimeStampStrings->setFocusPolicy( Qt::StrongFocus );
        aGridLayout->addWidget( myTimeStampStrings, 2, 3, 1, 2 );
       }
-      //{
-      //       QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );     
-      //       aGridLayout->addItem( aSpacerItem, 3, 0 );
-      //}
     }
 
     aTabWidget->addTab( aParent, tr( "NAVIGATION_TAB" ) );
@@ -238,10 +237,6 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
        
        aVBoxLayout->addLayout( aHBoxLayout );
       }
-      //{
-      //       QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );     
-      //       aVBoxLayout->addItem( aSpacerItem );
-      //}
       
       aTabWidget->addTab( aParent, tr( "PROPERTIES_TAB" ) );
     }
@@ -254,6 +249,9 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
 
 
   //----------------------------------------------------------------------------
+  myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
+  myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
+
   myTimer = new QTimer( this );
 
   // Common
@@ -288,27 +286,46 @@ VisuGUI_Slider::VisuGUI_Slider( VisuGUI* theModule,
   QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
   theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
   aQtxDockWidget->setWidget( this );
-  aQtxDockWidget->show();
+  
+  myToggleViewAction = aQtxDockWidget->toggleViewAction();
+  myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PANEL" ) ) ) );
+  myToggleViewAction->setToolTip( tr( "MEN_SLIDER_PANE" ) );
+  myToggleViewAction->setText( tr( "MEN_SLIDER_PANE" ) );
+  myToggleViewAction->setCheckable( true );
+
+  connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
+  //myToggleViewAction->setChecked( false );
 }
 
-/*!
-  Destructor
-*/
+
+//----------------------------------------------------------------------------
 VisuGUI_Slider::~VisuGUI_Slider()
 {
 }
 
+
+//----------------------------------------------------------------------------
+QAction* VisuGUI_Slider::toggleViewAction()
+{
+  return myToggleViewAction;
+}
+
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onModuleDeactivated()
 {
   setHidden( true );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onModuleActivated()
 {
   setHidden( false );
 }
 
 
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onMemoryModeChanged( bool )
 {
   using namespace VISU;
@@ -325,12 +342,14 @@ void VisuGUI_Slider::onMemoryModeChanged( bool )
 }
 
 
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onMemorySizeChanged( double )
 {
   onMemoryModeChanged( myLimitedMemoryButton->isChecked() );
 }
 
 
+//----------------------------------------------------------------------------
 bool VisuGUI_Slider::checkHolderList()
 {
   THolderList aHolderList;
@@ -345,6 +364,8 @@ bool VisuGUI_Slider::checkHolderList()
   return myHolderList.empty();
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::enableControls( bool on )
 {
   setEnabled( on );
@@ -422,6 +443,8 @@ void VisuGUI_Slider::enableControls( bool on )
 
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::updateMemoryState()
 {
   if( checkHolderList() )
@@ -443,6 +466,8 @@ void VisuGUI_Slider::updateMemoryState()
   myFreeMemory->updateGeometry();
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onSelectionChanged()
 {
   //cout << "VisuGUI_Slider::onSelectionChanged()" << endl;
@@ -482,18 +507,24 @@ void VisuGUI_Slider::onSelectionChanged()
   updateMemoryState();
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onTimeStampActivated( int value )
 {
   mySlider->setValue( value );
   onValueChanged( value );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onFirst()
 {
   int value = mySlider->minimum();
   mySlider->setValue( value );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onPrevious()
 {
   int value = mySlider->value() - 1;
@@ -501,12 +532,13 @@ void VisuGUI_Slider::onPrevious()
     mySlider->setValue( value );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onPlay( bool on )
 {
-  SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   if( on )
   {
-    myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
+    myPlayButton->setIcon( myPlayPixmap );
 
     int delay = int(5000.0 / double(mySpeedSlider->value()));
     myTimer->start( delay );
@@ -514,10 +546,22 @@ void VisuGUI_Slider::onPlay( bool on )
   else
   {
     myTimer->stop();
-    myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+    myPlayButton->setIcon( myPausePixmap );
+  }
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Slider::onToggleView( bool on )
+{
+  if ( !on ) {
+    onPlay( on );
+    hide();
   }
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onNext()
 {
   int value = mySlider->value() + 1;
@@ -525,12 +569,16 @@ void VisuGUI_Slider::onNext()
     mySlider->setValue( value );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onLast()
 {
   int value = mySlider->maximum();
   mySlider->setValue( value );
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onValueChanged( int value )
 {
   if( checkHolderList() ){
@@ -584,6 +632,8 @@ void VisuGUI_Slider::onValueChanged( int value )
   updateMemoryState();
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onSpeedChanged( int value )
 {
   if(myPlayButton->isChecked()){
@@ -592,6 +642,8 @@ void VisuGUI_Slider::onSpeedChanged( int value )
   }
 }
 
+
+//----------------------------------------------------------------------------
 void VisuGUI_Slider::onTimeout()
 {
   int value = mySlider->value();
@@ -600,3 +652,6 @@ void VisuGUI_Slider::onTimeout()
   else
     myPlayButton->setChecked( false );
 }
+
+
+//----------------------------------------------------------------------------
index 97397c5bfaede0eda799b3d58a701a3df428f3f9..5adc197f80cc82721e33530c3b90845ae51e0288 100644 (file)
@@ -29,6 +29,7 @@
 #define VisuGUI_Slider_HeaderFile
 
 #include <QWidget>
+#include <QPixmap>
 
 #include <vector>
 
@@ -50,6 +51,7 @@ class QCheckBox;
 class QRadioButton;
 class QMainWindow;
 class QTimer;
+class QAction;
 
 class QtxDoubleSpinBox;
 class LightApp_SelectionMgr;
@@ -65,6 +67,8 @@ public:
                  LightApp_SelectionMgr* theSelectionMgr );
 
   virtual ~VisuGUI_Slider();
+  
+  QAction* toggleViewAction();
 
 public slots:
   virtual void     onSelectionChanged();
@@ -83,6 +87,8 @@ public slots:
 
   virtual void     onTimeout();
 
+  virtual void     onToggleView( bool );
+
   void onMemoryModeChanged( bool );
   void onMemorySizeChanged( double );
 
@@ -127,6 +133,9 @@ private:
   THolderList     myHolderList;
   
   QTimer*         myTimer;
+  QPixmap         myPlayPixmap;
+  QPixmap         myPausePixmap;
+  QAction*        myToggleViewAction;
 };
 
 #endif
index 3ad6ac654b669423f23d2a781adcfdd6c595143d..520f1796e5c4529ad00bb038e0f7d91cde04362f 100644 (file)
@@ -55,6 +55,7 @@
 #include <QCheckBox>
 #include <QRadioButton>
 #include <QTimer>
+#include <QAction>
 
 #include <vtkMath.h>
 
@@ -78,6 +79,7 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
   QVBoxLayout* aVBoxLayout = new QVBoxLayout( this );
 
   QTabWidget* aTabWidget = new QTabWidget( this );
+  aTabWidget->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
   aVBoxLayout->addWidget( aTabWidget );
 
   {
@@ -154,10 +156,6 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
        
        aVBoxLayout->addLayout( aHBoxLayout );
       }
-      //{
-      //       QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );     
-      //       aVBoxLayout->addItem( aSpacerItem );
-      //}
 
       aTabWidget->addTab( aNavigationTab, tr( "NAVIGATION_TAB" ) );
     }
@@ -210,9 +208,6 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
       myStepDelay = new QtxDoubleSpinBox( aPropertiesTab );
       myStepDelay->setValue( aResourceMgr->doubleValue("VISU", "sweeping_time_step", 0.1) );
       aGridLayout->addWidget( myStepDelay, 2, 1, 1, 1 );
-      
-      QSpacerItem* aSpacerItem = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );      
-      aGridLayout->addItem( aSpacerItem, 3, 0 );
     }
 
     aTabWidget->addTab( aPropertiesTab, tr( "PROPERTIES_TAB" ) );
@@ -228,12 +223,22 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
   QtxDockWidget* aQtxDockWidget = new QtxDockWidget( true, theParent );
   theParent->addDockWidget( Qt::BottomDockWidgetArea , aQtxDockWidget );
   aQtxDockWidget->setWidget( this );
-  aQtxDockWidget->show();
 
+  myToggleViewAction = aQtxDockWidget->toggleViewAction();
+  myToggleViewAction->setIcon( QIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_PANEL" ) ) ) );
+  myToggleViewAction->setToolTip( tr( "MEN_SWEEP_PANE" ) );
+  myToggleViewAction->setText( tr( "MEN_SWEEP_PANE" ) );
+  myToggleViewAction->setCheckable( true );
+
+  connect( myToggleViewAction, SIGNAL( toggled( bool ) ), this, SLOT( onToggleView( bool ) ) );
+  //myToggleViewAction->setChecked( false );
 
   //----------------------------------------------------------------------------
   myTimer = new QTimer( this );
 
+  myPlayPixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) );
+  myPausePixmap = aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) );
+
   connect( myTimer, SIGNAL( timeout() ), SLOT( onTimeout() ) );
 
   connect( myPlayButton, SIGNAL( toggled( bool ) ), SLOT( onPlay( bool ) ) );
@@ -253,8 +258,6 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule,
   onSelectionChanged();
   
   onModeChanged( mySweepMode->currentIndex() );
-
-  onPlay( true );
 }
 
 
@@ -263,6 +266,13 @@ VisuGUI_Sweep::~VisuGUI_Sweep()
 {}
 
 
+//----------------------------------------------------------------------------
+QAction* VisuGUI_Sweep::toggleViewAction()
+{
+  return myToggleViewAction;
+}
+
+
 //----------------------------------------------------------------------------
 void VisuGUI_Sweep::onModuleDeactivated()
 {
@@ -453,13 +463,23 @@ void VisuGUI_Sweep::onPlay( bool on )
 {
   SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
   if ( on ) {
-    myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PAUSE" ) ) );
+    myPlayButton->setIcon( myPlayPixmap );
     myTimer->start( int( myStepDelay->value() * 1000 ) );
     myPlayButton->setChecked( true );
   } else {
     myTimer->stop();
     myPlayButton->setChecked( false );
-    myPlayButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SLIDER_PLAY" ) ) );
+    myPlayButton->setIcon( myPausePixmap );
+  }
+}
+
+
+//----------------------------------------------------------------------------
+void VisuGUI_Sweep::onToggleView( bool on )
+{
+  if ( !on ) {
+    onPlay( on );
+    hide();
   }
 }
 
index 6d03d71a230346d71eaf04f177d49b514d32d074..169e9c8b4b7ccc7d18a4a363df5d7e4a0319320c 100644 (file)
@@ -29,6 +29,7 @@
 #define VisuGUI_Sweep_HeaderFile
 
 #include <QWidget>
+#include <QPixmap>
 
 class QComboBox;
 class QToolButton;
@@ -37,6 +38,7 @@ class QSpinBox;
 class QCheckBox;
 class QMainWindow;
 class QTimer;
+class QAction;
 
 class QtxIntSpinBox;
 class QtxDoubleSpinBox;
@@ -65,6 +67,8 @@ public:
 
   virtual ~VisuGUI_Sweep();
 
+  QAction* toggleViewAction();
+
 public slots:
   virtual void     onSelectionChanged();
 
@@ -90,6 +94,8 @@ public slots:
 
   virtual void     onTimeout();
 
+  virtual void     onToggleView( bool );
+
   void             onModuleDeactivated();
 
   void             onModuleActivated();
@@ -112,6 +118,9 @@ private:
   QtxDoubleSpinBox* myStepDelay;
 
   QTimer*           myTimer;
+  QPixmap           myPlayPixmap;
+  QPixmap           myPausePixmap;
+  QAction*          myToggleViewAction;
 
   VisuGUI*          myModule;