goat3d

view goatview/src/goatview.h @ 95:da100bf13f7f

[goat3d] implemented animation loading [goatview] working on the animation controls
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 19 May 2014 06:42:40 +0300
parents 8b156bc5205b
children 32dccb16678f b43d33f3ba69
line source
1 #ifndef GOATVIEW_H_
2 #define GOATVIEW_H_
4 #include <QtCore/QtCore>
5 #include <QtWidgets/QtWidgets>
6 #include <QtOpenGL/QGLWidget>
7 #include "goat3d.h"
8 #include "scenemodel.h"
10 void post_redisplay();
12 extern goat3d *scene;
14 class GoatViewport;
16 class GoatView : public QMainWindow {
17 private:
18 Q_OBJECT
20 GoatViewport *glview;
21 QTreeView *treeview;
22 SceneModel *scene_model;
24 // animation controls
25 QSlider *slider_time;
26 QSpinBox *spin_time;
27 QCheckBox *chk_loop;
28 QAction *act_play, *act_rewind;
30 void closeEvent(QCloseEvent *ev);
31 bool make_menu();
32 bool make_dock();
33 bool make_center();
35 private slots:
36 void open_scene();
37 void open_anim();
39 public:
40 GoatView();
41 ~GoatView();
43 bool load_scene(const char *fname);
44 bool load_anim(const char *fname);
46 void show_about();
47 };
49 class GoatViewport : public QGLWidget {
50 private:
51 Q_OBJECT
53 QWidget *main_win;
54 bool initialized;
56 public:
57 GoatViewport(QWidget *main_win);
58 ~GoatViewport();
60 QSize sizeHint() const;
62 void initializeGL();
63 void resizeGL(int xsz, int ysz);
64 void paintGL();
66 void toggle_lighting();
68 void mousePressEvent(QMouseEvent *ev);
69 void mouseMoveEvent(QMouseEvent *ev);
70 };
72 #endif // GOATVIEW_H_