-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewer.h
58 lines (42 loc) · 1.24 KB
/
viewer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Main GL viewer class, based on the QGLViewer library.
*
* QGLViewer is a Qt-based viewer, which provides an OpenGL rendering
* context and GUI event management.
* The documentation of the QGLViewer library can be found at the following
* url: http://www.libqglviewer.com
*/
#ifndef _VIEWER_
#define _VIEWER_
#include <QGLViewer/qglviewer.h>
#include <list>
using namespace std;
class Renderable;
class Viewer : public QGLViewer
{
public :
Viewer();
virtual ~Viewer();
void addRenderable(Renderable *r);
/* Scene methods */
protected :
/// List of the scene objects, to render, animate, ...
list<Renderable *> renderableList;
/// Create the scene and initializes rendering parameters
virtual void init();
/// Draw every objects of the scene
virtual void draw();
/// Animate every objects of the scene
virtual void animate();
/* Viewing parameters */
protected :
bool toogleWireframe;
bool toogleLight;
/// Handle keyboard events specifically
virtual void keyPressEvent(QKeyEvent *e);
/// Handle keyboard events specifically
virtual void mouseMoveEvent(QMouseEvent *e);
/// Draw every objects of the scene
virtual QString helpString() const;
};
#endif