glwidget.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2014 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 #pragma once
20 
21 #ifndef GLWIDGET_HPP
22 #define GLWIDGET_HPP
23 
24 
25 #include <QtOpenGL/QGLWidget>
26 #include <QTime>
27 
28 #include "navigator_tool.hpp"
29 #include "../local/scene.hpp"
30 
31 
32 class glwidget : public QGLWidget
33 {
34 
35  Q_OBJECT
36 
37 public:
38 
39  glwidget(QWidget *parent=0);
40  ~glwidget();
41 
42  void set_wireframe();
43  void set_filled();
44 
46 
47  void draw_text(double x,double y,double z,QString text,QFont font);
48 
49 protected:
50  void initializeGL();
51  void paintGL();
52  void resizeGL(int width, int height);
53  void mousePressEvent(QMouseEvent *event);
54  void mouseReleaseEvent(QMouseEvent *event);
55  void mouseMoveEvent(QMouseEvent *event);
56  void keyPressEvent(QKeyEvent *event);
57  void timerEvent(QTimerEvent *event);
58 
59 
60 
61 private:
62 
64 
65 
66  void print_help_start() const;
69  void draw_camera_stat();
70 
71  void draw_fps();
72  void draw_decorating_info();
73 
74  QTime t_timer;
75 
76 };
77 
78 
79 #endif
void paintGL()
Definition: glwidget.cpp:90
void draw_decorating_info()
Definition: glwidget.cpp:140
void print_help_start() const
Definition: glwidget.cpp:43
(Dirty) Container class for camera, mouse and fps manipulation
Definition: navigator_tool.hpp:45
void mouseReleaseEvent(QMouseEvent *event)
Definition: glwidget.cpp:260
void keyPressEvent(QKeyEvent *event)
Definition: glwidget.cpp:306
void draw_camera_stat()
Definition: glwidget.cpp:405
void mouseMoveEvent(QMouseEvent *event)
Definition: glwidget.cpp:270
cpe::navigator_tool nav
Definition: glwidget.hpp:63
void initializeGL()
Definition: glwidget.cpp:58
void mousePressEvent(QMouseEvent *event)
Definition: glwidget.cpp:247
QTime t_timer
Definition: glwidget.hpp:74
void draw_fps()
Definition: glwidget.cpp:373
void resizeGL(int width, int height)
Definition: glwidget.cpp:242
void set_filled()
Definition: glwidget.cpp:365
void draw_text(double x, double y, double z, QString text, QFont font)
Definition: glwidget.cpp:439
void set_wireframe()
Definition: glwidget.cpp:360
~glwidget()
Definition: glwidget.cpp:39
void draw_orientation(cpe::navigator_tool &nav) const
Definition: glwidget.cpp:205
Definition: glwidget.hpp:32
glwidget(QWidget *parent=0)
Definition: glwidget.cpp:30
Definition: scene.hpp:38
scene current_scene
Definition: glwidget.hpp:45
void timerEvent(QTimerEvent *event)
Definition: glwidget.cpp:354
void draw_pointer(cpe::navigator_tool &nav) const
Definition: glwidget.cpp:175