goat3d

view goatview/src/goatview.h @ 90:8b156bc5205b

[maxgoat] fixed the transform export bug [goatview] added widgets for the animation controls [goatview] added a grid ground plane with automatic sizing and transitions from size to size
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 17 May 2014 06:26:24 +0300
parents 7941e89798e5
children da100bf13f7f
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 QComboBox *cbox_anims;
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);
45 void show_about();
46 };
48 class GoatViewport : public QGLWidget {
49 private:
50 Q_OBJECT
52 QWidget *main_win;
53 bool initialized;
55 public:
56 GoatViewport(QWidget *main_win);
57 ~GoatViewport();
59 QSize sizeHint() const;
61 void initializeGL();
62 void resizeGL(int xsz, int ysz);
63 void paintGL();
65 void toggle_lighting();
67 void mousePressEvent(QMouseEvent *ev);
68 void mouseMoveEvent(QMouseEvent *ev);
69 };
71 #endif // GOATVIEW_H_