glwidget.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2013 Damien Rohmer
4 **
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef GLWIDGET_HPP_
20 #define GLWIDGET_HPP_
21 
22 
23 
24 
25 #include <QtOpenGL/QGLWidget>
26 #include <QTime>
27 #include <navigator_tool.hpp>
28 #include <scene.hpp>
29 
30 
31 class glwidget : public QGLWidget
32 {
33 
34  Q_OBJECT
35 
36 public:
37 
38  glwidget(QWidget *parent=0);
39  ~glwidget();
40 
41 
42  void set_wireframe();
43  void set_filled();
44 
45 
47 
48  void draw_text(double x,double y,double z,QString text,QFont font);
49 
50 protected:
51  void initializeGL();
52  void paintGL();
53  void resizeGL(int width, int height);
54  void mousePressEvent(QMouseEvent *event);
55  void mouseReleaseEvent(QMouseEvent *event);
56  void mouseMoveEvent(QMouseEvent *event);
57  void keyPressEvent(QKeyEvent *event);
58  void timerEvent(QTimerEvent *event);
59 
60 
61 
62 private:
63 
65 
66 
67  void print_help_start() const;
70  void draw_camera_stat();
71 
72  void draw_fps();
73  void draw_decorating_info();
74 
75  QTime t_timer;
76 
77 };
78 
79 
80 #endif