Salome HOME
Fix pb with labels of rotation spin boxes (bad update after switch from IJK pane...
[modules/visu.git] / src / VISUGUI / VisuGUI_TimeAnimation.h
1 //  VISU VISUGUI : GUI of VISU component
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : VisuGUI_TimeAnimation.h
8 //  Author : Vitaly SMETANNIKOV
9 //  Module : VISU
10
11 #ifndef VISUGUI_TIMEANIMATION_H
12 #define VISUGUI_TIMEANIMATION_H
13
14 #include "QtxDblSpinBox.h"
15
16 #include "SALOMEDSClient_Study.hxx"
17
18 #include <qdialog.h>
19 #include <qbuttongroup.h>
20 #include <qwidgetstack.h>
21
22 class VisuGUI;
23 class VISU_TimeAnimation;
24
25 namespace VISU {
26   class Prs3d_i;
27 }
28
29 class SVTK_ViewWindow;
30
31 class QtxDblSpinBox;
32
33 class QLabel;
34 class QSlider;
35 class QListBox;
36 class QCheckBox;
37 class QComboBox;
38 class QToolButton;
39
40 /*!
41  * Auxilliary class for presentations definition
42  */
43 class ArrangeDlg: public QDialog
44 {
45   Q_OBJECT
46  public:
47   enum { AutoMode, ManualMode };
48   enum { XAxis, YAxis, ZAxis };
49
50   ArrangeDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator);
51   ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow);
52   ~ArrangeDlg() {};
53
54   int getMode() const { return  myStackWgt->id(myStackWgt->visibleWidget()); }
55   double getDistance() const { return myDistVal->value(); }
56   int getAxis() const { return myAxisGrp->id(myAxisGrp->selected()); }
57
58  protected slots:
59   virtual void accept();
60   void onFieldChange(int);
61
62  private:
63   struct Offset {
64     float myOffset[3];
65   };
66
67
68   void init();
69   void acceptAnimation();
70   void acceptViewWindow();
71
72   VISU_TimeAnimation* myAnimator;
73   SVTK_ViewWindow   * myViewWindow;
74
75   QWidgetStack*       myStackWgt;
76   QButtonGroup*       myAxisGrp;
77   QtxDblSpinBox*      myDistVal;
78   QListBox*           myFieldLst;
79   QtxDblSpinBox*      myCoord[3];
80   QValueList<Offset>  myOffsets;
81
82   QCheckBox*          mySaveChk;
83
84   int               myCurrent;
85   QMap<VISU::Prs3d_i*, int> myPrsMap;
86 };
87
88
89 class SetupDlg: public QDialog {
90   Q_OBJECT
91
92  public:
93   SetupDlg(QWidget* theParent, VISU_TimeAnimation* theAnimator);
94   ~SetupDlg() {};
95
96  private slots:
97   void onFieldChange(int theIndex);
98   void onTypeChanged(int theIndex);
99   //  void onScalarBarDlg();
100   void onPreferencesDlg();
101   void onRangeCheck(bool theCheck);
102   void onMinValue(double theVal);
103   void onMaxValue(double theVal);
104   void onArrangeDlg();
105
106  private:
107   VISU_TimeAnimation* myAnimator;
108   QListBox* myFieldLst;
109   QComboBox* myTypeCombo;
110   QPushButton* myPropBtn;
111   QPushButton* myArrangeBtn;
112   QCheckBox* myUseRangeChk;
113   QtxDblSpinBox* myMinVal;
114   QtxDblSpinBox* myMaxVal;
115 };
116
117
118 class VisuGUI_TimeAnimationDlg: public QDialog
119 {
120     Q_OBJECT
121  public:
122     VisuGUI_TimeAnimationDlg(VisuGUI* theModule, _PTR(Study) theStudy);
123     ~VisuGUI_TimeAnimationDlg();
124
125     void addField(_PTR(SObject) theField);
126     void clearView();
127
128     void restoreFromStudy(_PTR(SObject) theAnimation);
129
130  protected:
131     virtual void closeEvent(QCloseEvent* theEvent);
132     void stopAnimation();
133
134  private slots:
135    void onTypeChange(int index);
136    void onPlayPressed();
137    void onBackPressed();
138    void onForvardPressed();
139    void onLastPressed();
140    void onFirstPressed();
141    void onSetupDlg();
142    void onWindowChanged(int index);
143    void createFrames();
144    void onSpeedChange(double theSpeed);
145    void onExecution(long theNewFrame, double theTime);
146    void onBrowse();
147    void onStop();
148    void saveToStudy();
149    void publishToStudy();
150
151  private:
152     QSlider* mySlider;
153     QComboBox* myTypeCombo;
154     QPushButton* myPropBtn;
155     QToolButton* myPlayBtn;
156     QLabel* myTimeLbl;
157     QPushButton* mySetupBtn;
158     QPushButton* myGenBtn;
159
160     QFrame* myPlayFrame;
161     _PTR(Study) myStudy;
162     VisuGUI* myModule;
163
164     VISU_TimeAnimation* myAnimator;
165     QCheckBox* mySaveCheck;
166     QLineEdit* myPathEdit;
167     bool isClosing;
168     QCloseEvent* myEvent;
169
170     QPushButton* myPublishBtn;
171     QPushButton* mySaveBtn;
172 };
173
174 #endif  //VISUGUI_TIMEANIMATION_H