New lua versions
[ryzomcore.git] / studio / src / plugins / object_viewer / main_window.h
blobdff4d9b4b8e87c83c20611872a4d078c9545de56
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 MAIN_WINDOW_H
21 #define MAIN_WINDOW_H
23 // STL includes
25 // Qt includes
26 #include <QtGui/QMainWindow>
27 #include <QtGui/QLabel>
28 #include <QtGui/QUndoStack>
30 // NeL includes
31 #include <nel/misc/config_file.h>
33 // Project includes
35 namespace NLMISC
37 class CConfigFile;
40 namespace NLQT
43 class CGraphicsViewport;
44 class CAnimationDialog;
45 class CAnimationSetDialog;
46 class CSlotManagerDialog;
47 class CParticleControlDialog;
48 class CParticleWorkspaceDialog;
49 class CSetupFog;
50 class CSkeletonScaleDialog;
51 class CSkeletonTreeModel;
52 class CWaterPoolDialog;
53 class CVegetableDialog;
54 class CGlobalWindDialog;
55 class CDayNightDialog;
56 class CSunColorDialog;
57 class CTuneMRMDialog;
58 class CTuneTimerDialog;
60 class CCameraControl;
62 class CMainWindow : public QMainWindow
64 Q_OBJECT
66 public:
67 CMainWindow(QWidget *parent = 0);
68 ~CMainWindow();
70 int getFrameRate();
71 CSkeletonTreeModel *getSkeletonModel() const
73 return _SkeletonTreeModel;
76 QUndoStack *getUndoStack() const
78 return _undoStack;
81 public Q_SLOTS:
82 void open();
83 void resetScene();
84 void reloadTextures();
86 private Q_SLOTS:
87 void updateStatusBar();
88 void updateRender();
89 void setInterval(int value);
91 protected:
92 virtual void showEvent(QShowEvent *showEvent);
93 virtual void hideEvent(QHideEvent *hideEvent);
95 private:
96 void createActions();
97 void createMenus();
98 void removeMenus();
99 void createToolBars();
100 void createDialogs();
102 bool loadFile(const QString &fileName, const QString &skelName);
104 bool _isGraphicsInitialized, _isGraphicsEnabled;
105 bool _isSoundInitialized, _isSoundEnabled;
107 CGraphicsViewport *_GraphicsViewport;
108 CAnimationDialog *_AnimationDialog;
109 CAnimationSetDialog *_AnimationSetDialog;
110 CSlotManagerDialog *_SlotManagerDialog;
111 CParticleControlDialog *_ParticleControlDialog;
112 CParticleWorkspaceDialog *_ParticleWorkspaceDialog;
113 CVegetableDialog *_VegetableDialog;
114 CWaterPoolDialog *_WaterPoolDialog;
115 CGlobalWindDialog *_GlobalWindDialog;
116 CSetupFog *_SetupFog;
117 CSkeletonScaleDialog *_SkeletonScaleDialog;
118 CDayNightDialog *_DayNightDialog;
119 CSunColorDialog *_SunColorDialog;
120 CTuneMRMDialog *_TuneMRMDialog;
121 CSkeletonTreeModel *_SkeletonTreeModel;
122 CTuneTimerDialog *_TuneTimerDialog;
124 CCameraControl *_cameraControl;
126 QString _lastDir;
128 QTimer *_mainTimer;
129 QTimer *_statusBarTimer;
131 QToolBar *_fileToolBar;
132 QToolBar *_viewToolBar;
133 QToolBar *_toolsBar;
134 QAction *_openAction;
135 QAction *_setBackColorAction;
136 QAction *_frameDelayAction;
137 QAction *_lightGroupAction;
138 QAction *_reloadTexturesAction;
139 QAction *_resetSceneAction;
140 QAction *_saveScreenshotAction;
141 QLabel *_statusInfo;
142 QUndoStack *_undoStack;
144 float _fps;
145 uint _numTri;
146 float _texMem;
147 sint _mouseMode;
149 QMenu *menu;
150 };/* class CMainWindow */
152 } /* namespace NLQT */
154 #endif // MAIN_WINDOW_H