Salome HOME
Add c_str() function to avoid compilation errors.
[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(VisuGUI* theModule, 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   VisuGUI* myModule;
108   VISU_TimeAnimation* myAnimator;
109   QListBox* myFieldLst;
110   QComboBox* myTypeCombo;
111   QPushButton* myPropBtn;
112   QPushButton* myArrangeBtn;
113   QCheckBox* myUseRangeChk;
114   QtxDblSpinBox* myMinVal;
115   QtxDblSpinBox* myMaxVal;
116 };
117
118
119 class VisuGUI_TimeAnimationDlg: public QDialog
120 {
121     Q_OBJECT
122  public:
123     VisuGUI_TimeAnimationDlg(VisuGUI* theModule, _PTR(Study) theStudy);
124     ~VisuGUI_TimeAnimationDlg();
125
126     void addField(_PTR(SObject) theField);
127     void clearView();
128
129     void restoreFromStudy(_PTR(SObject) theAnimation);
130
131  protected:
132     virtual void closeEvent(QCloseEvent* theEvent);
133     void stopAnimation();
134
135  private slots:
136    void onTypeChange(int index);
137    void onPlayPressed();
138    void onBackPressed();
139    void onForvardPressed();
140    void onLastPressed();
141    void onFirstPressed();
142    void onSetupDlg();
143    void onWindowChanged(int index);
144    void createFrames();
145    void onSpeedChange(double theSpeed);
146    void onExecution(long theNewFrame, double theTime);
147    void onBrowse();
148    void onStop();
149    void saveToStudy();
150    void publishToStudy();
151
152  private:
153     QSlider* mySlider;
154     QComboBox* myTypeCombo;
155     QPushButton* myPropBtn;
156     QToolButton* myPlayBtn;
157     QLabel* myTimeLbl;
158     QPushButton* mySetupBtn;
159     QPushButton* myGenBtn;
160
161     QFrame* myPlayFrame;
162     _PTR(Study) myStudy;
163     VisuGUI* myModule;
164
165     VISU_TimeAnimation* myAnimator;
166     QCheckBox* mySaveCheck;
167     QLineEdit* myPathEdit;
168     bool isClosing;
169     QCloseEvent* myEvent;
170
171     QPushButton* myPublishBtn;
172     QPushButton* mySaveBtn;
173 };
174
175 #endif  //VISUGUI_TIMEANIMATION_H