Loading...
Searching...
No Matches
interactionMode.h
Go to the documentation of this file.
#ifndef BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
#define BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
#include <BALL/COMMON/global.h>
#include <QtCore/QPoint>
#include <QtCore/QSize>
#include <QtCore/QObject>
class QAction;
class QKeyEvent;
class QMouseEvent;
class QWheelEvent;
class QToolBar;
class QMenu;
namespace BALL
{
namespace VIEW
{
class Scene;
class MainControl;
class BALL_VIEW_EXPORT InteractionMode : public QObject
{
Q_OBJECT
public:
InteractionMode(Scene* scene);
virtual ~InteractionMode();
virtual void keyPressEvent(QKeyEvent* evt);
virtual void keyReleaseEvent(QKeyEvent* evt);
virtual void mouseDoubleClickEvent(QMouseEvent* evt);
void mouseMoveEvent(QMouseEvent* evt);
void mousePressEvent(QMouseEvent* evt);
void mouseReleaseEvent(QMouseEvent* evt);
virtual void wheelEvent(QWheelEvent* evt);
virtual void addToolBarEntries(QToolBar* tb);
virtual void populateContextMenu(QMenu*) {};
virtual Qt::Key getKey() const = 0;
virtual QString getName() const = 0;
virtual void deactivate();
virtual void activate();
void setMouseSensitivity(float sens);
void setMouseWheelSensitivity(float sens);
QAction* getMainAction();
bool isCurrent() const { return is_current_; }
void setCurrent(bool current) { is_current_ = current; }
Q_SIGNALS:
void requestModeChange(InteractionMode* mode);
protected Q_SLOTS:
void modeChangeSlot_();
protected:
Scene* scene_;
QPoint mouse_pos_old_;
QPoint mouse_pos_new_;
QSize desktop_size_;
float mouse_sensitivity_;
float mouse_wheel_sensitivity_;
QAction* main_action_;
bool is_current_;
virtual void mouseMoveEventImpl_ (QMouseEvent* evt);
virtual void mousePressEventImpl_ (QMouseEvent* evt);
virtual void mouseReleaseEventImpl_(QMouseEvent* evt);
float getXDiff_() const;
float getYDiff_() const;
void zoomSystem_();
};
}
}
#endif //BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
global.h
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition COMMON/global.h:52
BALL::VIEW::InteractionMode::modeChangeSlot_
void modeChangeSlot_()
BALL::VIEW::InteractionMode::desktop_size_
QSize desktop_size_
Definition interactionMode.h:68
BALL::VIEW::InteractionMode::mouseReleaseEventImpl_
virtual void mouseReleaseEventImpl_(QMouseEvent *evt)
BALL::VIEW::InteractionMode::mouse_pos_new_
QPoint mouse_pos_new_
Definition interactionMode.h:67
BALL::VIEW::InteractionMode::mouse_wheel_sensitivity_
float mouse_wheel_sensitivity_
Definition interactionMode.h:70
BALL::VIEW::InteractionMode::deactivate
virtual void deactivate()
BALL::VIEW::InteractionMode::getMainAction
QAction * getMainAction()
BALL::VIEW::InteractionMode::mouseMoveEventImpl_
virtual void mouseMoveEventImpl_(QMouseEvent *evt)
BALL::VIEW::InteractionMode::wheelEvent
virtual void wheelEvent(QWheelEvent *evt)
BALL::VIEW::InteractionMode::getKey
virtual Qt::Key getKey() const =0
BALL::VIEW::InteractionMode::zoomSystem_
void zoomSystem_()
BALL::VIEW::InteractionMode::mousePressEvent
void mousePressEvent(QMouseEvent *evt)
BALL::VIEW::InteractionMode::mousePressEventImpl_
virtual void mousePressEventImpl_(QMouseEvent *evt)
BALL::VIEW::InteractionMode::setCurrent
void setCurrent(bool current)
Definition interactionMode.h:57
BALL::VIEW::InteractionMode::isCurrent
bool isCurrent() const
Definition interactionMode.h:56
BALL::VIEW::InteractionMode::requestModeChange
void requestModeChange(InteractionMode *mode)
BALL::VIEW::InteractionMode::setMouseWheelSensitivity
void setMouseWheelSensitivity(float sens)
BALL::VIEW::InteractionMode::is_current_
bool is_current_
Definition interactionMode.h:72
BALL::VIEW::InteractionMode::main_action_
QAction * main_action_
Definition interactionMode.h:71
BALL::VIEW::InteractionMode::setMouseSensitivity
void setMouseSensitivity(float sens)
BALL::VIEW::InteractionMode::getName
virtual QString getName() const =0
BALL::VIEW::InteractionMode::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *evt)
BALL::VIEW::InteractionMode::scene_
Scene * scene_
Definition interactionMode.h:65
BALL::VIEW::InteractionMode::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *evt)
BALL::VIEW::InteractionMode::mouse_pos_old_
QPoint mouse_pos_old_
Definition interactionMode.h:66
BALL::VIEW::InteractionMode::keyReleaseEvent
virtual void keyReleaseEvent(QKeyEvent *evt)
BALL::VIEW::InteractionMode::populateContextMenu
virtual void populateContextMenu(QMenu *)
Definition interactionMode.h:43
BALL::VIEW::InteractionMode::keyPressEvent
virtual void keyPressEvent(QKeyEvent *evt)
BALL::VIEW::InteractionMode::addToolBarEntries
virtual void addToolBarEntries(QToolBar *tb)
BALL::VIEW::InteractionMode::getXDiff_
float getXDiff_() const
BALL::VIEW::InteractionMode::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *evt)
BALL::VIEW::InteractionMode::activate
virtual void activate()
BALL::VIEW::InteractionMode::InteractionMode
InteractionMode(Scene *scene)
BALL::VIEW::InteractionMode::~InteractionMode
virtual ~InteractionMode()
BALL::VIEW::InteractionMode::getYDiff_
float getYDiff_() const
BALL::VIEW::InteractionMode::mouse_sensitivity_
float mouse_sensitivity_
Definition interactionMode.h:69
BALL::VIEW::MainControl
Definition mainControl.h:118
BALL::VIEW::Scene
Definition scene.h:141
QMouseEvent
QObject
BALL::VIEW
Definition constraints.h:35
BALL
Definition constants.h:13