]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_TimeAnimation.h
Salome HOME
Merge from OCC_development_generic_2006
[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,
94            VisuGUI* theModule, 
95            VISU_TimeAnimation* theAnimator);
96   ~SetupDlg() {};
97
98  private slots:
99   void onFieldChange(int theIndex);
100   void onTypeChanged(int theIndex);
101   //  void onScalarBarDlg();
102   void onPreferencesDlg();
103   void onRangeCheck(bool theCheck);
104   void onMinValue(double theVal);
105   void onMaxValue(double theVal);
106   void onArrangeDlg();
107
108  private:
109   VisuGUI* myModule;
110   VISU_TimeAnimation* myAnimator;
111
112   QListBox* myFieldLst;
113   QComboBox* myTypeCombo;
114   std::vector<int> myComboId2TypeId;
115   std::map<int,int> myTypeId2ComboId;
116
117   QPushButton* myPropBtn;
118   QPushButton* myArrangeBtn;
119   QCheckBox* myUseRangeChk;
120   QtxDblSpinBox* myMinVal;
121   QtxDblSpinBox* myMaxVal;
122 };
123
124
125 class VisuGUI_TimeAnimationDlg: public QDialog
126 {
127     Q_OBJECT
128  public:
129     VisuGUI_TimeAnimationDlg(VisuGUI* theModule, _PTR(Study) theStudy);
130     ~VisuGUI_TimeAnimationDlg();
131
132     void addField(_PTR(SObject) theField);
133     void clearView();
134
135     void restoreFromStudy(_PTR(SObject) theAnimation);
136
137  protected:
138     virtual void closeEvent(QCloseEvent* theEvent);
139     virtual void showEvent(QShowEvent* theEvent);
140     void stopAnimation();
141
142  private slots:
143    void onTypeChange(int index);
144    void onPlayPressed();
145    void onBackPressed();
146    void onForvardPressed();
147    void onLastPressed();
148    void onFirstPressed();
149    void onSetupDlg();
150    void onWindowChanged(int index);
151    void createFrames();
152    void onSpeedChange(double theSpeed);
153    void onExecution(long theNewFrame, double theTime);
154    void onBrowse();
155    void onStop();
156    void saveToStudy();
157    void publishToStudy();
158
159  private:
160     QSlider* mySlider;
161     QComboBox* myTypeCombo;
162     QPushButton* myPropBtn;
163     QToolButton* myPlayBtn;
164     QLabel* myTimeLbl;
165     QPushButton* mySetupBtn;
166     QPushButton* myGenBtn;
167
168     QFrame* myPlayFrame;
169     SetupDlg* mySetupDlg;
170     _PTR(Study) myStudy;
171     VisuGUI* myModule;
172
173     VISU_TimeAnimation* myAnimator;
174     QCheckBox* mySaveCheck;
175     QComboBox* myPicsFormat;
176     QLineEdit* myPathEdit;
177     bool isClosing;
178     QCloseEvent* myEvent;
179
180     QPushButton* myPublishBtn;
181     QPushButton* mySaveBtn;
182 };
183
184 #endif  //VISUGUI_TIMEANIMATION_H