Salome HOME
Fix of issue 0020593: EDF 885 VISU: Unchecking Filter by Scalar does not remove white...
[modules/visu.git] / src / VISUGUI / VisuGUI_Slider.h
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  VISU VISUGUI : GUI of VISU component
23 //  File   : VisuGUI_Slider.h
24 //  Author : Oleg UVAROV
25 //  Module : VISU
26 //
27 #ifndef VisuGUI_Slider_HeaderFile
28 #define VisuGUI_Slider_HeaderFile
29
30 #include <QWidget>
31 #include <QPixmap>
32
33 #include <vector>
34
35 #include "SALOMEconfig.h"
36 #include CORBA_SERVER_HEADER(VISU_Gen)
37
38 namespace VISU
39 {
40   class ColoredPrs3dHolder_i;
41 }
42
43 class QComboBox;
44 class QLabel;
45 class QLineEdit;
46 class QToolButton;
47 class QSlider;
48 class QSpinBox;
49 class QCheckBox;
50 class QRadioButton;
51 class QMainWindow;
52 class QTimer;
53 class QAction;
54
55 class QtxDoubleSpinBox;
56 class LightApp_SelectionMgr;
57 class VisuGUI;
58
59 class VisuGUI_Slider : public QWidget
60 {
61   Q_OBJECT;
62
63 public:
64   VisuGUI_Slider( VisuGUI* theModule, 
65                   QMainWindow* theParent,
66                   LightApp_SelectionMgr* theSelectionMgr );
67
68   virtual ~VisuGUI_Slider();
69   
70   QAction* toggleViewAction();
71
72 public slots:
73   virtual void     onSelectionChanged();
74
75   virtual void     onTimeStampActivated( int );
76
77   virtual void     onFirst();
78   virtual void     onPrevious();
79   virtual void     onPlay( bool );
80   virtual void     onNext();
81   virtual void     onLast();
82
83   virtual void     onValueChanged( int );
84
85   virtual void     onSpeedChanged( int );
86
87   virtual void     onTimeout();
88
89   virtual void     onToggleView( bool );
90
91   void onMemoryModeChanged( bool );
92   void onMemorySizeChanged( double );
93
94 protected slots:
95   void onModuleDeactivated();
96   void onModuleActivated();
97
98 protected:
99   virtual void     enableControls( bool );
100   virtual void     updateMemoryState();
101   virtual bool     checkHolderList();
102
103 private:
104   LightApp_SelectionMgr* mySelectionMgr;
105   VISU::ViewManager_var  myViewManager;
106   VisuGUI*               myModule;
107
108   QSlider*         mySlider;
109   QLabel*          myFirstTimeStamp;
110   QLabel*          myLastTimeStamp;
111
112   QWidget* myPlayTab;
113
114   QToolButton*     myIsCycled;
115   QToolButton*     myFirstButton;
116   QToolButton*     myPreviousButton;
117   QToolButton*     myPlayButton;
118   QToolButton*     myNextButton;
119   QToolButton*     myLastButton;
120
121   QComboBox*       myTimeStampStrings;
122   QComboBox*       myTimeStampIndexes;
123
124   QSlider*         mySpeedSlider;
125
126   QRadioButton*     myMinimalMemoryButton;
127   QRadioButton*     myLimitedMemoryButton;
128   QtxDoubleSpinBox* myLimitedMemory;
129
130   QLineEdit*      myUsedMemory;
131   QLineEdit*      myFreeMemory;
132
133   typedef std::vector<VISU::ColoredPrs3dHolder_var> THolderList;
134   THolderList     myHolderList;
135   
136   QTimer*         myTimer;
137   QPixmap         myPlayPixmap;
138   QPixmap         myPausePixmap;
139   QAction*        myToggleViewAction;
140 };
141
142 #endif