| 1 |
#ifndef BALL_VIEW_KERNEL_MODES_MODEMANAGER_H |
| 2 |
#define BALL_VIEW_KERNEL_MODES_MODEMANAGER_H |
| 3 |
|
| 4 |
#ifndef BALL_VIEW_RENDERING_RENDERERS_RENDERER_H |
| 5 |
#include <BALL/VIEW/RENDERING/RENDERERS/renderer.h> |
| 6 |
#endif |
| 7 |
|
| 8 |
#include <list> |
| 9 |
|
| 10 |
#include <QtCore/QObject> |
| 11 |
|
| 12 |
class QAction; |
| 13 |
class QMenu; |
| 14 |
class QActionGroup; |
| 15 |
class QKeyEvent; |
| 16 |
class QMouseEvent; |
| 17 |
class QWheelEvent; |
| 18 |
class QToolBar; |
| 19 |
|
| 20 |
namespace BALL |
| 21 |
{ |
| 22 |
namespace VIEW |
| 23 |
{ |
| 24 |
class InteractionMode; |
| 25 |
class Scene; |
| 26 |
|
| 27 |
class InteractionModeManager : public QObject |
| 28 |
{ |
| 29 |
Q_OBJECT |
| 30 |
|
| 31 |
public: |
| 32 |
InteractionModeManager(Scene* scene); |
| 33 |
virtual ~InteractionModeManager(); |
| 34 |
|
| 35 |
QString getCurrentModeName() const; |
| 36 |
|
| 37 |
virtual void keyPressEvent(QKeyEvent* evt); |
| 38 |
virtual void keyReleaseEvent(QKeyEvent* evt); |
| 39 |
|
| 40 |
virtual void mouseDoubleClickEvent(QMouseEvent* evt); |
| 41 |
virtual void mouseMoveEvent(QMouseEvent* evt); |
| 42 |
virtual void mousePressEvent(QMouseEvent* evt); |
| 43 |
virtual void mouseReleaseEvent(QMouseEvent* evt); |
| 44 |
|
| 45 |
virtual void wheelEvent(QWheelEvent* evt); |
| 46 |
|
| 47 |
virtual void addToolBarEntries(QToolBar* tb); |
| 48 |
virtual void populateContextMenu(QMenu* menu); |
| 49 |
void setStereoMode(bool stereo_mode); |
| 50 |
|
| 51 |
virtual void setMouseSensitivity(float sensitivity); |
| 52 |
virtual void setMouseWheelSensitivity(float sensitivity); |
| 53 |
|
| 54 |
void switchToLastMode(); |
| 55 |
|
| 56 |
protected Q_SLOTS: |
| 57 |
void setMode_(InteractionMode* new_mode); |
| 58 |
|
| 59 |
protected: |
| 60 |
Renderer::StereoMode stereo_mode_; |
| 61 |
InteractionMode* current_mode_; |
| 62 |
InteractionMode* last_mode_; |
| 63 |
QActionGroup* actions_; |
| 64 |
std::list<InteractionMode*> modes_; |
| 65 |
Scene* scene_; |
| 66 |
bool need_update_; |
| 67 |
|
| 68 |
void init_(); |
| 69 |
bool handleStereoKeyPress_(QKeyEvent* evt); |
| 70 |
}; |
| 71 |
} |
| 72 |
} |
| 73 |
|
| 74 |
#endif |