Go to the documentation of this file.00001
00004
00005
00006
00007
00008 #ifndef qglv_OBJECTS_FAT_MAN_HPP_
00009 #define qglv_OBJECTS_FAT_MAN_HPP_
00010
00011
00012
00013
00014
00015
00016 #include <Eigen/Core>
00017 #include <memory>
00018 #include <QGLViewer/qglviewer.h>
00019 #include <QGLViewer/mouseGrabber.h>
00020 #include <QMouseEvent>
00021 #include <QObject>
00022 #include <QWheelEvent>
00023 #include <QPoint>
00024 #include <sophus/se3.hpp>
00025
00026
00027
00028
00029
00030 namespace qglv {
00031
00032
00033
00034
00045 class FatMan : public QObject, qglviewer::MouseGrabber {
00046 Q_OBJECT
00047 public:
00048 FatMan(const Sophus::SE3f& pose = Sophus::SE3f());
00049 virtual ~FatMan();
00050
00051 void checkIfGrabsMouse(int x, int y, const qglviewer::Camera* const camera);
00052 virtual void mousePressEvent( QMouseEvent* const event, qglviewer::Camera* const camera);
00053 virtual void mouseMoveEvent(QMouseEvent* const event, qglviewer::Camera* const camera);
00054 virtual void mouseReleaseEvent(QMouseEvent* const event, qglviewer::Camera* const camera);
00055 virtual void wheelEvent(QWheelEvent* const event, qglviewer::Camera* const camera);
00056
00057 Eigen::Vector3f position() const { return pose.translation(); }
00058
00059 void draw();
00060
00061 signals:
00062 void moved(const float&, const float&);
00063
00064 private:
00065 bool updated;
00066 bool moving;
00067 int gl_id_start;
00068 Sophus::SE3f pose;
00070 void _glGenLists();
00071
00072 Eigen::Vector3f _pointOnZPlane(const QPoint& point, const qglviewer::Camera* camera) const;
00073 };
00074
00075
00076
00077
00078
00079 typedef std::shared_ptr<FatMan> FatManPtr;
00080
00081
00082
00083
00084
00085 }
00086
00087 #endif