BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
interactionMode.h
Go to the documentation of this file.
1 #ifndef BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
2 #define BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
3 
4 #include <BALL/COMMON/global.h>
5 
6 #include <QtCore/QPoint>
7 #include <QtCore/QSize>
8 #include <QtCore/QObject>
9 
10 class QAction;
11 class QKeyEvent;
12 class QMouseEvent;
13 class QWheelEvent;
14 class QToolBar;
15 class QMenu;
16 
17 namespace BALL
18 {
19  namespace VIEW
20  {
21  class Scene;
22  class MainControl;
23 
25  {
26  Q_OBJECT
27 
28  public:
29  InteractionMode(Scene* scene);
30 
31  virtual ~InteractionMode();
32  virtual void keyPressEvent(QKeyEvent* evt);
33  virtual void keyReleaseEvent(QKeyEvent* evt);
34 
35  virtual void mouseDoubleClickEvent(QMouseEvent* evt);
36  void mouseMoveEvent(QMouseEvent* evt);
37  void mousePressEvent(QMouseEvent* evt);
38  void mouseReleaseEvent(QMouseEvent* evt);
39 
40  virtual void wheelEvent(QWheelEvent* evt);
41 
42  virtual void addToolBarEntries(QToolBar* tb);
43  virtual void populateContextMenu(QMenu*) {};
44 
45  virtual Qt::Key getKey() const = 0;
46  virtual QString getName() const = 0;
47 
48  virtual void deactivate();
49  virtual void activate();
50 
51  void setMouseSensitivity(float sens);
52 
53  QAction* getMainAction();
54 
55  bool isCurrent() const { return is_current_; }
56  void setCurrent(bool current) { is_current_ = current; }
57 
58  signals:
59  void requestModeChange(InteractionMode* mode);
60  protected slots:
61  void modeChangeSlot_();
62 
63  protected:
70  QAction* main_action_;
72 
73  virtual void mouseMoveEventImpl_ (QMouseEvent* evt);
74  virtual void mousePressEventImpl_ (QMouseEvent* evt);
75  virtual void mouseReleaseEventImpl_(QMouseEvent* evt);
76 
77  float getXDiff_() const;
78  float getYDiff_() const;
79  void zoomSystem_();
80  };
81 
82  }
83 }
84 
85 #endif //BALL_VIEW_KERNEL_MODES_INTERACTIONMODE_H
virtual void populateContextMenu(QMenu *)
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
void setCurrent(bool current)
const char * getName()
Definition: rtti.h:97