Go to the documentation of this file.00001
00004
00005
00006
00007
00008 #ifndef qglv_OBJECTS_TELEPORT_ARROW_HPP_
00009 #define qglv_OBJECTS_TELEPORT_ARROW_HPP_
00010
00011
00012
00013
00014
00015 #include <QGLViewer/qglviewer.h>
00016 #include<QGLViewer/mouseGrabber.h>
00017 #include <QMouseEvent>
00018 #include <QObject>
00019 #include <QPoint>
00020
00021
00022
00023
00024
00025 namespace qglv {
00026
00027
00028
00029
00030
00031 class TeleportArrow : public QObject, qglviewer::MouseGrabber
00032 {
00033 Q_OBJECT
00034 public:
00035 TeleportArrow()
00036 : begin_point(0,0,0)
00037 , end_point(0,0,0)
00038 , moving(false)
00039 , teleport_mode_activated(false)
00040 {}
00041
00042 ~TeleportArrow();
00043
00044 void checkIfGrabsMouse(int x, int y, const qglviewer::Camera* const camera);
00045 virtual void mousePressEvent( QMouseEvent* const event, qglviewer::Camera* const camera);
00046 virtual void mouseReleaseEvent(QMouseEvent* const event, qglviewer::Camera* const camera);
00047 virtual void mouseMoveEvent(QMouseEvent* const event, qglviewer::Camera* const camera);
00048 virtual void mouseDoubleClickEvent(QMouseEvent* const event, qglviewer::Camera* const camera);
00049 virtual void wheelEvent(QWheelEvent* const event, qglviewer::Camera* const camera);
00050
00051 void draw();
00052
00053 public slots:
00054 void activate(bool mode);
00055
00056 signals:
00057 void deactivated();
00058 void teleport(float, float, float, float);
00059
00060 private:
00061 qglviewer::Vec _pointOnZPlane(const QPoint& point, const qglviewer::Camera* camera) const;
00062
00063 qglviewer::Vec begin_point, end_point;
00064 bool moving;
00065 bool teleport_mode_activated;
00066 };
00067
00068 }
00069
00070 #endif