-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathogrewidget.hpp
52 lines (42 loc) · 1.29 KB
/
ogrewidget.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef OGREWIDGET_HPP
#define OGREWIDGET_HPP
#include <QtWidgets/QWidget>
#include <QtGui/QResizeEvent>
#include <OgreRoot.h>
#include <OgreCamera.h>
#include <OgreViewport.h>
#include <OgreSceneManager.h>
#include <OgreRenderWindow.h>
/** Widget Qt opakowujący Ogre.
*/
class OgreWidget:public QWidget
{
Q_OBJECT
public:
/** Konstruktor.
@param parent Wskaźnik do widgetu wyższego w hierarchii.
*/
OgreWidget(QWidget* parent);
/** Destruktor.
*/
~OgreWidget();
Ogre::Root* Root;
Ogre::RenderWindow* Window;
Ogre::SceneManager* SceneManager;
Ogre::SceneNode* Focus;
Ogre::Camera* Camera;
protected:
virtual void resizeEvent(QResizeEvent* event);
virtual void keyPressEvent(QKeyEvent* qKeyEvent);
virtual void mousePressEvent(QMouseEvent* qMouseEvent);
virtual void mouseReleaseEvent(QMouseEvent* qMouseEvent);
virtual void mouseMoveEvent(QMouseEvent* qMouseEvent);
/** Reimplementacja metody QWidget::focusOutEvent. Dzięki temu widget ogre zawsze nasłuchuje klawiaturę, bez kompletnego jej przechwytywania.
@remarks
W razie potrzeby kilku widżetów ogre lepiej dodać możliwość tworzenia niezachłannych obiektów.
*/
virtual void focusOutEvent(QFocusEvent * qFocusEvent);
bool isMousePressed;
QPointF lastMousePosition;
};
#endif