goat3d

view goatview/src/goatview.h @ 98:b43d33f3ba69

[goatview] better LLVM/gcc detection [goatview] close_scene might have solved the occasional crashes on opening a second scene
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 21 May 2014 04:08:11 +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 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 close_scene();
38 void open_anim();
40 public:
41 GoatView();
42 ~GoatView();
44 bool load_scene(const char *fname);
45 bool load_anim(const char *fname);
47 void show_about();
48 };
50 class GoatViewport : public QGLWidget {
51 private:
52 Q_OBJECT
54 QWidget *main_win;
55 bool initialized;
57 public:
58 GoatViewport(QWidget *main_win);
59 ~GoatViewport();
61 QSize sizeHint() const;
63 void initializeGL();
64 void resizeGL(int xsz, int ysz);
65 void paintGL();
67 void toggle_lighting();
69 void mousePressEvent(QMouseEvent *ev);
70 void mouseMoveEvent(QMouseEvent *ev);
71 };
73 #endif // GOATVIEW_H_