New lua versions
[ryzomcore.git] / studio / src / plugins / object_viewer / scene / animation_dialog.h
blob81a7527defbf10e4ccb8f2bff0d6f8dbb43c3c98
1 /*
2 Object Viewer Qt
3 Copyright (C) 2010 Dzmitry Kamiahin <dnk-88@tut.by>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef ANIMATION_DIALOG_H
21 #define ANIMATION_DIALOG_H
23 #include <nel/misc/types_nl.h>
24 #include "ui_animation_form.h"
26 // Qt includes
27 #include <QtCore/QTimeLine>
29 // STL includes
31 // NeL includes
32 #include "nel/3d/animation_time.h"
34 // Project includes
36 namespace NLQT
39 /**
40 @class CAnimationDialog
41 @brief Animation model control dialog.
42 @details The dialogue doesn't affect on the model itself, but only calculates the current time of animations
43 that can be obtained through a class method getTime().
44 The user can influence on the duration of the animation, but he doesn't know the total time for all the animations in the playlist.
45 Therefore, the class provides a slot that requires a total duration of the animated object animations and set it.
47 class CAnimationDialog: public QDockWidget
49 Q_OBJECT
51 public:
52 /// Constructor, sets the default length of time from 0 to 99
53 CAnimationDialog(QWidget *parent = 0);
54 ~CAnimationDialog();
56 /// Get the current time animations
57 /// @return Returns the current time animations, which can then be use in class CObjectViewer
58 NL3D::TAnimationTime getTime ();
60 public Q_SLOTS:
61 /// Find the total time of the playlist and sets its
62 void changeAnimLength();
64 /// Updates animation status for the selected current object
65 /// @param name - the name of the selected object
66 void setCurrentShape(const QString &name);
68 private Q_SLOTS:
69 void start();
70 void play();
71 void stop();
72 void end();
73 void changeFrame(int frame);
74 void changeStartAnim(int start);
75 void changeEndAnim(int end);
76 void updateAnim(int frame);
77 void setInPlace(bool state);
78 void setIncPos(bool state);
79 void finish();
80 void setModePlayList();
81 void setModeMixer();
83 private:
85 static const int _frameRate = 50;
86 QTimeLine *_timeLine;
87 Ui::CAnimationDialog _ui;
89 friend class CMainWindow;
90 }; /* CAnimationDialog */
92 } /* namespace NLQT */
94 #endif // ANIMATION_DIALOG_H