Commit ee7fa32d authored by CGoGN GIT Supervisor's avatar CGoGN GIT Supervisor

Merge branch 'master' of /home/kraemer/CGoGN

* 'master' of /home/kraemer/CGoGN:
  ajout cb_wheelEvent
parents eb4c4e01 ceb16a9c
......@@ -291,6 +291,11 @@ public:
*/
virtual void cb_mouseMove(int button, int x, int y) {}
/**
* the mouse has been move (with button still pressed)
*/
virtual void cb_wheelEvent(int delta, int x, int y) {}
/**
* key press CB (context is ok)
*/
......@@ -365,7 +370,6 @@ public:
*/
std::string selectFileSave(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)");
public slots:
virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; }
virtual void cb_Open() { std::cerr << "callback not implemented" << std::endl; }
......
......@@ -292,7 +292,7 @@ void GLWidget::mouseMoveEvent(QMouseEvent* event)
m_cbs->cb_mouseMove(event->button(), event->x(), getHeight() - event->y());
}
void GLWidget::wheelEvent ( QWheelEvent * event )
void GLWidget::wheelEvent(QWheelEvent* event)
{
float wl = -0.05f * FAR_PLANE / foc;
......@@ -303,9 +303,12 @@ void GLWidget::wheelEvent ( QWheelEvent * event )
newModel = 1;
updateGL();
if (m_cbs)
m_cbs->cb_wheelEvent(event->delta(), event->x(), getHeight() - event->y());
}
void GLWidget:: keyPressEvent(QKeyEvent* event)
void GLWidget::keyPressEvent(QKeyEvent* event)
{
if (event->key() == Qt::Key_Escape)
close();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment