21 #ifndef SNARK_GRAPHICS_GL_VIEW_H_
22 #define SNARK_GRAPHICS_GL_VIEW_H_
24 #include <boost/optional.hpp>
25 #include <boost/thread.hpp>
27 #include <Qt3D/qglview.h>
28 #include <QMouseEvent>
29 #include "./coordinates.h"
31 namespace snark {
namespace graphics {
namespace qt3d {
34 class view :
public QGLView
38 view(
const QColor4ub& background_color,
double fov,
bool z_up,
bool orthographic =
false );
42 void hide_coordinates() { m_show_coordinates =
false; update(); }
46 void updateView(
const QVector3D& min,
const QVector3D& max );
53 QVector3D
unproject(
float x,
float y,
float depth );
54 boost::optional< QVector3D >
getPoint(
const QPoint& point2d );
57 const QColor4ub m_background_color;
58 QVector3D m_sceneCenter;
60 boost::optional< Eigen::Vector3d > m_offset;
63 boost::optional< QPoint > m_startPan;
64 boost::optional< QPoint > m_startRotate;
67 boost::optional< coordinates > m_coordinates;
68 bool m_show_coordinates;