fat_man.hpp
Go to the documentation of this file.
00001 
00004 /*****************************************************************************
00005 ** Ifdefs
00006 *****************************************************************************/
00007 
00008 #ifndef qglv_OBJECTS_FAT_MAN_HPP_
00009 #define qglv_OBJECTS_FAT_MAN_HPP_
00010 
00011 /*****************************************************************************
00012 ** Includes
00013 *****************************************************************************/
00014 
00015 //#include <dslam_math_helpers/sophus.hpp>
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 ** Namespaces
00028 *****************************************************************************/
00029 
00030 namespace qglv {
00031 
00032 /*****************************************************************************
00033 ** The Fat Man
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   // TODO : move this off to a common method somewhere
00072   Eigen::Vector3f _pointOnZPlane(const QPoint& point, const qglviewer::Camera* camera) const;
00073 };
00074 
00075 /*****************************************************************************
00076  ** Typedefs
00077  *****************************************************************************/
00078 
00079 typedef std::shared_ptr<FatMan> FatManPtr;
00080 
00081 /*****************************************************************************
00082 ** Trailers
00083 *****************************************************************************/
00084 
00085 } // namespace qglv
00086 
00087 #endif /* qglv_OBJECTS_FAT_MAN_HPP_ */


qglv_extras
Author(s): Daniel Stonier
autogenerated on Sat Jun 18 2016 08:19:30