00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00042 #ifndef CRENDERER__H
00043 #define CRENDERER__H
00044
00045
00046
00048 #include <QGLViewer.h>
00049
00050
00052 #include <qmainwindow.h>
00053 #include <qslider.h>
00054 #include <qgl.h>
00055
00056
00057
00059 #include <math.h>
00060
00061
00062
00063
00064 class CPlayerRenderer : public QObject {
00065 Q_OBJECT
00066
00067
00068
00069 public:
00070 CPlayerRenderer(QGLViewer*);
00071
00072 ~CPlayerRenderer();
00073
00074 QGLViewer* getViewer(void) { return m_pViewer; };
00075
00076 void MakeGlList();
00077
00078 private:
00080 GLuint processHits(GLint hits, GLuint buffer[]);
00081
00082
00083
00084 private slots:
00085
00087 void sltInitializeGL();
00088
00090 void sltResizeGL(int w, int h);
00091
00093 void sltPaintGL();
00094
00096 void sltManageSelection(QMouseEvent *pqEvent);
00097
00099 void sltManageRelease(QMouseEvent *pqEvent);
00100
00102 void sltManageMove(QMouseEvent *pqEvent);
00103
00105 void sltCatchKey(int);
00106
00109 void sltResetSelection();
00110
00111 private:
00112
00114 void renderScene(void);
00115
00117 void renderSolidSphere(const CP3D &cCenter, float radius,
00118 int n1, int n2, float lw=2.5);
00119
00121 void renderWireSphere(const CP3D &cCenter, float radius,
00122 int n1, int n2, float lw=2.5);
00123
00124
00125
00126 QGLViewer *m_pViewer;
00127
00128 GLuint m_glDispList;
00129
00130 bool m_afSelected[12];
00131
00132 bool m_fLeftButtonPressed;
00133 bool m_fMiddleButtonPressed;
00134 bool m_fRightButtonPressed;
00135
00136 CP3D m_cSphereCenter[12];
00137
00138 int m_nMousePosX, m_nMousePosY;
00139 };
00140
00141 #endif // CRENDERER__H