5 #include <QPropertyAnimation>
6 #include <QtOpenGL/QGLWidget>
7 #include <QtOpenGL/QGLFunctions>
8 #include <QtOpenGL/QGLShaderProgram>
15 class Canvas : public QGLWidget, protected QGLFunctions
20 Canvas(const QGLFormat& format, QWidget* parent=0);
23 void paintEvent(QPaintEvent* event);
26 void view_orthographic();
27 void view_perspective();
30 void set_status(const QString& s);
32 void load_mesh(Mesh* m, bool is_reload);
36 void mousePressEvent(QMouseEvent* event);
37 void mouseReleaseEvent(QMouseEvent* event);
38 void mouseMoveEvent(QMouseEvent* event);
39 void wheelEvent(QWheelEvent* event);
40 void resizeGL(int width, int height);
41 void set_perspective(float p);
42 void view_anim(float v);
48 QMatrix4x4 transform_matrix() const;
49 QMatrix4x4 view_matrix() const;
51 QGLShaderProgram mesh_shader;
52 QGLShaderProgram quad_shader;
64 Q_PROPERTY(float perspective WRITE set_perspective);
65 QPropertyAnimation anim;