Revision: 78286 http://sourceforge.net/p/brlcad/code/78286 Author: starseeker Date: 2021-02-19 21:31:26 +0000 (Fri, 19 Feb 2021) Log Message: ----------- Set up mouse move event handler for OpenGL widget. Not doing anything with the info yet, jus making sure we can capture it.
Modified Paths: -------------- brlcad/trunk/src/isst/isstgl.cpp brlcad/trunk/src/isst/isstgl.h Modified: brlcad/trunk/src/isst/isstgl.cpp =================================================================== --- brlcad/trunk/src/isst/isstgl.cpp 2021-02-19 21:23:19 UTC (rev 78285) +++ brlcad/trunk/src/isst/isstgl.cpp 2021-02-19 21:31:26 UTC (rev 78286) @@ -174,6 +174,19 @@ } +void isstGL::mouseMoveEvent(QMouseEvent *e) { + + bu_log("(%d,%d)\n", e->x(), e->y()); + if (x_prev > -INT_MAX && y_prev > -INT_MAX) { + bu_log("Delta: (%d,%d)\n", e->x() - x_prev, e->y() - y_prev); + } + + x_prev = e->x(); + y_prev = e->y(); + + QOpenGLWidget::mouseMoveEvent(e); +} + void isstGL::save_image() { QImage image = this->grabFramebuffer(); image.save("file.png"); Modified: brlcad/trunk/src/isst/isstgl.h =================================================================== --- brlcad/trunk/src/isst/isstgl.h 2021-02-19 21:23:19 UTC (rev 78285) +++ brlcad/trunk/src/isst/isstgl.h 2021-02-19 21:31:26 UTC (rev 78286) @@ -62,6 +62,7 @@ void paintGL() override; void keyPressEvent(QKeyEvent *k) override; + void mouseMoveEvent(QMouseEvent *e) override; private: struct camera_tile_s tile; @@ -72,6 +73,9 @@ int resolution_factor = 0; int rescaled = 0; int do_render = 1; + + int x_prev = -INT_MAX; + int y_prev = -INT_MAX; }; #endif /* ISSTGL_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits