]> git.sur5r.net Git - fstl/blobdiff - src/canvas.h
Fix double-click to open .stl on windows
[fstl] / src / canvas.h
index c094e5b228d1238129f593907fd151c53d1ae682..33313cfcbf894c47aae09119c20398442fbe5369 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <QWidget>
 #include <QtOpenGL/QGLWidget>
+#include <QtOpenGL/QGLFunctions>
 #include <QtOpenGL/QGLShaderProgram>
 #include <QMatrix4x4>
 
@@ -10,7 +11,7 @@ class GLMesh;
 class Mesh;
 class Backdrop;
 
-class Canvas : public QGLWidget
+class Canvas : public QGLWidget, protected QGLFunctions
 {
     Q_OBJECT
 
@@ -18,10 +19,12 @@ public:
     Canvas(const QGLFormat& format, QWidget* parent=0);
 
     void initializeGL();
-    void paintGL();
+    void paintEvent(QPaintEvent* event);
     ~Canvas();
 
 public slots:
+    void set_status(const QString& s);
+    void clear_status();
     void load_mesh(Mesh* m);
 
 
@@ -29,6 +32,7 @@ protected:
     void mousePressEvent(QMouseEvent* event);
     void mouseReleaseEvent(QMouseEvent* event);
     void mouseMoveEvent(QMouseEvent* event);
+    void wheelEvent(QWheelEvent* event);
 
 
 private:
@@ -45,10 +49,12 @@ private:
 
     QVector3D center;
     float scale;
+    float zoom;
     float tilt;
     float yaw;
 
     QPoint mouse_pos;
+    QString status;
 };
 
 #endif // CANVAS_H