2013-11-02 01:48:30 +00:00
|
|
|
#ifndef OPENCS_VIEW_SCENEWIDGET_H
|
|
|
|
#define OPENCS_VIEW_SCENEWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
namespace Ogre
|
|
|
|
{
|
|
|
|
class Camera;
|
|
|
|
class SceneManager;
|
|
|
|
class RenderWindow;
|
2014-03-06 12:02:21 +00:00
|
|
|
class ColourValue;
|
2013-11-02 01:48:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSVRender
|
|
|
|
{
|
2014-02-27 14:23:14 +00:00
|
|
|
class Navigation;
|
|
|
|
|
2013-11-02 01:48:30 +00:00
|
|
|
class SceneWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
public:
|
2013-11-02 01:48:30 +00:00
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
SceneWidget(QWidget *parent);
|
2014-02-25 13:59:46 +00:00
|
|
|
virtual ~SceneWidget();
|
2013-11-02 01:48:30 +00:00
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
QPaintEngine* paintEngine() const;
|
2013-11-02 01:48:30 +00:00
|
|
|
|
2014-03-06 12:02:21 +00:00
|
|
|
void setAmbient (const Ogre::ColourValue& colour);
|
|
|
|
///< \note The actual ambient colour may differ based on lighting settings.
|
|
|
|
|
2014-03-06 09:01:23 +00:00
|
|
|
protected:
|
|
|
|
|
2014-02-27 14:23:14 +00:00
|
|
|
void setNavigation (Navigation *navigation);
|
|
|
|
///< \attention The ownership of \a navigation is not transferred to *this.
|
2014-02-25 13:59:46 +00:00
|
|
|
|
2014-03-10 17:35:49 +00:00
|
|
|
Ogre::SceneManager *getSceneManager();
|
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent* e);
|
|
|
|
void resizeEvent(QResizeEvent* e);
|
|
|
|
bool event(QEvent* e);
|
|
|
|
|
2014-02-25 12:09:37 +00:00
|
|
|
void keyPressEvent (QKeyEvent *event);
|
|
|
|
|
|
|
|
void keyReleaseEvent (QKeyEvent *event);
|
|
|
|
|
|
|
|
void focusOutEvent (QFocusEvent *event);
|
|
|
|
|
2014-02-25 12:39:49 +00:00
|
|
|
void wheelEvent (QWheelEvent *event);
|
|
|
|
|
2014-02-25 13:09:07 +00:00
|
|
|
void leaveEvent (QEvent *event);
|
|
|
|
|
|
|
|
void mouseMoveEvent (QMouseEvent *event);
|
|
|
|
|
|
|
|
void mouseReleaseEvent (QMouseEvent *event);
|
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
void updateOgreWindow();
|
2013-11-02 01:48:30 +00:00
|
|
|
|
2014-02-25 13:14:53 +00:00
|
|
|
int getFastFactor() const;
|
|
|
|
|
2014-02-25 11:30:45 +00:00
|
|
|
Ogre::Camera* mCamera;
|
|
|
|
Ogre::SceneManager* mSceneMgr;
|
|
|
|
Ogre::RenderWindow* mWindow;
|
|
|
|
|
2014-02-27 14:23:14 +00:00
|
|
|
Navigation *mNavigation;
|
2014-02-25 12:09:37 +00:00
|
|
|
bool mUpdate;
|
2014-02-28 10:58:03 +00:00
|
|
|
bool mKeyForward;
|
|
|
|
bool mKeyBackward;
|
|
|
|
bool mKeyLeft;
|
|
|
|
bool mKeyRight;
|
|
|
|
bool mKeyRollLeft;
|
|
|
|
bool mKeyRollRight;
|
2014-02-25 12:17:15 +00:00
|
|
|
bool mFast;
|
2014-02-25 13:09:07 +00:00
|
|
|
bool mDragging;
|
2014-02-25 13:24:35 +00:00
|
|
|
bool mMod1;
|
2014-02-25 13:09:07 +00:00
|
|
|
QPoint mOldPos;
|
2014-02-25 13:14:53 +00:00
|
|
|
int mFastFactor;
|
2014-02-25 12:09:37 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void update();
|
2014-02-25 11:30:45 +00:00
|
|
|
};
|
2013-11-02 01:48:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|