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
00035 #ifndef CRENDERER__H
00036 #define CRENDERER__H
00037
00038
00039
00041
00042
00043
00045
00046 #include <qslider.h>
00047 #include <qgl.h>
00048
00049
00050
00052
00053
00054
00055
00056
00057 class CPlayerRenderer : public QObject {
00058 Q_OBJECT
00059
00060
00061
00062 public:
00063 CPlayerRenderer(QGLViewer*);
00064
00065 ~CPlayerRenderer();
00066
00067 QGLViewer* getViewer(void) { return m_pViewer; };
00068
00069 void MakeGlList();
00070
00071 private:
00073 GLuint processHits(GLint hits, GLuint buffer[]);
00074
00075
00076
00077 private slots:
00078
00080 void sltInitializeGL();
00081
00083 void sltResizeGL(int w, int h);
00084
00086 void sltPaintGL();
00087
00089 void sltManageSelection(QMouseEvent *pqEvent);
00090
00092 void sltManageRelease(QMouseEvent *pqEvent);
00093
00095 void sltManageMove(QMouseEvent *pqEvent);
00096
00098 void sltCatchKey(int);
00099
00102 void sltResetSelection();
00103
00104 private:
00105
00107 void renderScene(void);
00108
00110 void renderSolidSphere(const CP3D &cCenter, float radius,
00111 int n1, int n2, float lw=2.5);
00112
00114 void renderWireSphere(const CP3D &cCenter, float radius,
00115 int n1, int n2, float lw=2.5);
00116
00117
00118
00119 QGLViewer *m_pViewer;
00120
00121 GLuint m_glDispList;
00122
00123 bool m_afSelected[12];
00124
00125 bool m_fLeftButtonPressed;
00126 bool m_fMiddleButtonPressed;
00127 bool m_fRightButtonPressed;
00128
00129 CP3D m_cSphereCenter[12];
00130
00131 int m_nMousePosX, m_nMousePosY;
00132 };
00133
00134 #endif // CRENDERER__H