Merge --squash crazy-branch to master
[agianapa.git] / qt / socg / myglwidget.h
blob7095e6313b9e9141d7664b197daa65541d6ee340
1 #ifndef MYGLWIDGET_H
2 #define MYGLWIDGET_H
4 #include <iostream>
5 #include <QGLWidget>
6 #include <QMutex>
7 #include <QTimer>
9 #include "axis.h"
10 #include "camera.h"
11 #include "coordsAndAngles.h"
12 #include "sphere.h"
14 typedef enum axis_t { AXIS_X, AXIS_Y, AXIS_Z };
16 class WorkerThread;
18 class MyGLWidget : public QGLWidget
20 Q_OBJECT
22 public:
23 // Non-default arguments must come first
24 MyGLWidget(Axis *pAxisX = 0, Axis *pAxisY = 0, Axis *pAxisZ = 0,
25 Camera *pCamera = 0, Sphere *pSphere = 0,
26 unsigned int timerInterval = 100, WorkerThread *pthread = 0,
27 QWidget *parent = 0);
28 ~MyGLWidget();
30 // Setters
31 void setAxis(axis_t axis, const Axis *pAxis);
32 void setCamera(const Camera *pCamera);
33 void setSphere(const Sphere *pShere);
34 void setCoordsAndAngles(const CoordsAndAngles *pCoordsAndAngles);
35 protected:
36 void initializeGL();
37 void paintGL();
38 void resizeGL(int width, int height);
40 private:
41 // Functions
42 void drawAxis(void);
43 void drawSphere(void);
45 // Sphere coordinations and orientation
46 const CoordsAndAngles *m_pCoordsAndAngles;
48 const Axis *m_pAxisX;
49 const Axis *m_pAxisY;
50 const Axis *m_pAxisZ;
52 const Camera *m_pCamera;
53 const Sphere *m_pSphere;
56 #endif // MYGLWIDGET_H