goat3d

view goatview/src/goatview.h @ 99:d7ab4f13f5af

Merge
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 May 2014 05:01:34 +0300
parents 32dccb16678f b43d33f3ba69
children
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 QGroupBox *grp_anim_time, *grp_anim_ctl;
26 QSlider *slider_time;
27 QLabel *label_time_start, *label_time_end;
28 QSpinBox *spin_time;
29 QCheckBox *chk_loop;
30 QAction *act_play, *act_rewind;
32 void closeEvent(QCloseEvent *ev);
33 bool make_menu();
34 bool make_dock();
35 bool make_center();
37 private slots:
38 void open_scene();
39 void close_scene();
40 void open_anim();
42 public:
43 GoatView();
44 ~GoatView();
46 bool load_scene(const char *fname);
47 bool load_anim(const char *fname);
49 void show_about();
50 };
52 class GoatViewport : public QGLWidget {
53 private:
54 Q_OBJECT
56 QWidget *main_win;
57 bool initialized;
59 public:
60 GoatViewport(QWidget *main_win);
61 ~GoatViewport();
63 QSize sizeHint() const;
65 void initializeGL();
66 void resizeGL(int xsz, int ysz);
67 void paintGL();
69 void toggle_lighting();
71 void mousePressEvent(QMouseEvent *ev);
72 void mouseMoveEvent(QMouseEvent *ev);
73 };
75 #endif // GOATVIEW_H_