goat3d

view goatview/src/goatview.h @ 97:32dccb16678f

[goatview] GUI layout fixes
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 May 2014 05:00:21 +0300
parents da100bf13f7f
children d7ab4f13f5af
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 open_anim();
41 public:
42 GoatView();
43 ~GoatView();
45 bool load_scene(const char *fname);
46 bool load_anim(const char *fname);
48 void show_about();
49 };
51 class GoatViewport : public QGLWidget {
52 private:
53 Q_OBJECT
55 QWidget *main_win;
56 bool initialized;
58 public:
59 GoatViewport(QWidget *main_win);
60 ~GoatViewport();
62 QSize sizeHint() const;
64 void initializeGL();
65 void resizeGL(int xsz, int ysz);
66 void paintGL();
68 void toggle_lighting();
70 void mousePressEvent(QMouseEvent *ev);
71 void mouseMoveEvent(QMouseEvent *ev);
72 };
74 #endif // GOATVIEW_H_