New lua versions
[ryzomcore.git] / studio / src / plugins / object_viewer / scene / camera_control.h
blob50d10a23037909a88305496431b85d6da42ea1ae
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 CAMERA_CONTROL_H
21 #define CAMERA_CONTROL_H
23 // STL includes
25 // Qt includes
26 #include <QtCore/QSignalMapper>
27 #include <QtGui/QAction>
28 #include <QtGui/QComboBox>
29 #include <QtGui/QSpinBox>
30 #include <QtGui/QLabel>
31 #include <QtGui/QMenu>
32 #include <QtGui/QToolBar>
34 // NeL includes
35 #include <nel/3d/u_camera.h>
36 #include "nel/misc/vector.h"
38 // Project includes
40 namespace NLQT
43 class CCameraItem
45 public:
46 CCameraItem(const QString &name);
47 ~CCameraItem();
49 void setSpeed(float value);
50 float getSpeed()
52 return _speed;
54 void setActive(bool active);
55 void setName(const QString &name)
57 _name = name;
59 QString getName() const
61 return _name;
63 void reset();
65 private:
66 void setupListener();
68 NL3D::UCamera _camera;
69 NLMISC::CVector _hotSpot;
71 float _cameraFocal;
72 float _speed;
73 bool _active;
74 QString _name;
77 class CCameraControl: public QObject
79 Q_OBJECT
81 public:
82 CCameraControl(QWidget *parent = 0);
83 ~CCameraControl();
85 QToolBar *getToolBar() const
87 return _camToolBar;
90 public Q_SLOTS:
91 void setEditMode();
92 void setFirstPersonMode();
93 void addCamera();
94 void delCamera();
95 void setSpeed(int value);
96 void changeCamera(int index);
97 void setRenderMode(int value);
98 void setRenderMode();
99 void resetCamera();
101 private:
102 int createCamera(const QString &name);
104 QAction *_fpsAction;
105 QAction *_edit3dAction;
106 QAction *_pointRenderModeAction;
107 QAction *_lineRenderModeAction;
108 QAction *_fillRenderModeAction;
109 QAction *_addCamAction;
110 QAction *_delCamAction;
111 QAction *_resetCamAction;
112 QSpinBox *_speedSpinBox;
113 QComboBox *_listCamComboBox;
114 QMenu *_renderModeMenu;
115 QLabel *_speedLabel;
116 QToolBar *_camToolBar;
118 CCameraItem *_currentCamera;
119 std::vector<CCameraItem *> _cameraList;
121 }; /* class CCameraControl */
123 } /* namespace NLQT */
125 #endif // CAMERA_CONTROL_H