#ifndef MMSCENE_H #define MMSCENE_H #include "glchessboard.h" #include "glcube.h" #include "gldisc.h" #include "glitem.h" #include "glsphere.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 appends it for drawing, */ void createSphere(); /** * @brief createDisc Creates a disc and appends it for drawing. */ void createDisc(); /** * @brief createChessboard Creates a chessboard and appends it for drawing. */ void createChessboard(); /** * @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; GLChessboard *m_chessboard; /** * @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