goat3d
annotate 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 |
rev | line source |
---|---|
nuclear@73 | 1 #ifndef GOATVIEW_H_ |
nuclear@73 | 2 #define GOATVIEW_H_ |
nuclear@73 | 3 |
nuclear@75 | 4 #include <QtCore/QtCore> |
nuclear@73 | 5 #include <QtWidgets/QtWidgets> |
nuclear@73 | 6 #include <QtOpenGL/QGLWidget> |
nuclear@74 | 7 #include "goat3d.h" |
nuclear@85 | 8 #include "scenemodel.h" |
nuclear@74 | 9 |
nuclear@88 | 10 void post_redisplay(); |
nuclear@88 | 11 |
nuclear@74 | 12 extern goat3d *scene; |
nuclear@73 | 13 |
nuclear@82 | 14 class GoatViewport; |
nuclear@76 | 15 |
nuclear@73 | 16 class GoatView : public QMainWindow { |
nuclear@83 | 17 private: |
nuclear@73 | 18 Q_OBJECT |
nuclear@83 | 19 |
nuclear@82 | 20 GoatViewport *glview; |
nuclear@85 | 21 QTreeView *treeview; |
nuclear@85 | 22 SceneModel *scene_model; |
nuclear@82 | 23 |
nuclear@90 | 24 // animation controls |
nuclear@97 | 25 QGroupBox *grp_anim_time, *grp_anim_ctl; |
nuclear@90 | 26 QSlider *slider_time; |
nuclear@97 | 27 QLabel *label_time_start, *label_time_end; |
nuclear@95 | 28 QSpinBox *spin_time; |
nuclear@90 | 29 QCheckBox *chk_loop; |
nuclear@90 | 30 QAction *act_play, *act_rewind; |
nuclear@90 | 31 |
nuclear@75 | 32 void closeEvent(QCloseEvent *ev); |
nuclear@73 | 33 bool make_menu(); |
nuclear@73 | 34 bool make_dock(); |
nuclear@73 | 35 bool make_center(); |
nuclear@73 | 36 |
nuclear@73 | 37 private slots: |
nuclear@73 | 38 void open_scene(); |
nuclear@73 | 39 void open_anim(); |
nuclear@73 | 40 |
nuclear@73 | 41 public: |
nuclear@73 | 42 GoatView(); |
nuclear@73 | 43 ~GoatView(); |
nuclear@82 | 44 |
nuclear@82 | 45 bool load_scene(const char *fname); |
nuclear@95 | 46 bool load_anim(const char *fname); |
nuclear@83 | 47 |
nuclear@83 | 48 void show_about(); |
nuclear@73 | 49 }; |
nuclear@73 | 50 |
nuclear@73 | 51 class GoatViewport : public QGLWidget { |
nuclear@82 | 52 private: |
nuclear@73 | 53 Q_OBJECT |
nuclear@82 | 54 |
nuclear@82 | 55 QWidget *main_win; |
nuclear@82 | 56 bool initialized; |
nuclear@82 | 57 |
nuclear@73 | 58 public: |
nuclear@82 | 59 GoatViewport(QWidget *main_win); |
nuclear@73 | 60 ~GoatViewport(); |
nuclear@73 | 61 |
nuclear@73 | 62 QSize sizeHint() const; |
nuclear@73 | 63 |
nuclear@73 | 64 void initializeGL(); |
nuclear@73 | 65 void resizeGL(int xsz, int ysz); |
nuclear@73 | 66 void paintGL(); |
nuclear@78 | 67 |
nuclear@83 | 68 void toggle_lighting(); |
nuclear@83 | 69 |
nuclear@78 | 70 void mousePressEvent(QMouseEvent *ev); |
nuclear@78 | 71 void mouseMoveEvent(QMouseEvent *ev); |
nuclear@73 | 72 }; |
nuclear@73 | 73 |
nuclear@73 | 74 #endif // GOATVIEW_H_ |