blob: 78df57a3a6c8ed0083a29f89570732a3c4e4d85d (
plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
#ifndef MMSCENE_H
#define MMSCENE_H
#include "glcube.h"
#include "glitem.h"
#include "glsphere.h"
#include "gldisc.h"
class MMScene : public GLItem
{
Q_OBJECT
public:
MMScene(QQuickItem *parent = 0);
~MMScene();
public slots:
void mousePressed(int x, int y);
protected:
/**
* @brief paintUnderQmlScene
* Virtual function for painting under a QML scene. This function is called by paintBefore after
* calling createGeometries and initializing and binding the renderer.
* Overwrite in subclasses for painting geometries in m_points with the renderer.
*/
virtual void paintUnderQmlScene();
/**
* @brief paintUnderQmlScene
* Virtual function for painting on top of a QML scene. This function is called by paintAfter after
* calling createGeometries and initializing and binding the renderer.
* Overwrite in subclasses for painting geometries in m_points with the renderer.
*/
virtual void paintOnTopOfQmlScene();
/**
* @brief setupGeometry puts the geometric data into the arrays (m_Vertices etc.) and sets geometryIsValid flag.
*/
void setupGeometry();
/**
* @brief drawTriangles
* Draws two triangles.
*/
void drawTriangles();
/**
* @brief createCubef Creates a cube and apends it for drawing.
* @param lbb The left bottom back cube vector.
* @param rtf The right top front cube vector.
*/
virtual void createCube(const QVector3D &lbb, const QVector3D &rtf);
/**
* @brief createSphere Creates a sphere and apends it for drawing,
*/
void createSphere();
/**
* @brief createDisc Creates a disc and apends it for drawing.
*/
void createDisc();
/**
* @brief createF Creates an 'F' with cubes.
* @param height The height of the 'F'.
*/
virtual void createF(double height);
/**
* @brief drawF Draws an 'F' with matrix transformations.
* @param height The height of the 'F'.
*/
virtual void drawF(double height);
private:
GLCube *m_cube;
GLSphere *m_sphere;
GLDisc *m_disc;
/**
* @brief m_MouseNear
* The near point of a mouse click or movement.
* Needed in synchronizeThreads().
*/
QVector3D m_MouseNear;
/**
* @brief m_MouseNear
* The far point of a mouse click or movement.
* Needed in synchronizeThreads().
*/
QVector3D m_mouseFar;
/**
* @brief m_lastIntersection
* The last intersection of the mouse line with the chessboard.
*/
QVector3D m_lastIntersection;
};
#endif // MMSCENE_H
|