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 #ifndef CRENDERER__H
00028 #define CRENDERER__H
00029
00030
00031
00033
00034
00035
00037
00038 #include <qslider.h>
00039 #include <qgl.h>
00040
00041
00042
00044
00045
00046
00047
00048
00055 class CSimpleRenderer : public QObject {
00056 Q_OBJECT
00057
00058
00059
00060 public:
00061 CSimpleRenderer(QGLViewer*);
00062
00063 ~CSimpleRenderer();
00064
00065 QGLViewer* getViewer(void) { return m_pViewer; };
00066
00067 void MakeGlList();
00068
00069 private:
00071 GLuint processHits(GLint hits, GLuint buffer[]);
00072
00073
00074
00075 private slots:
00076
00078 void sltInitializeGL();
00079
00081 void sltResizeGL(int w, int h);
00082
00084 void sltPaintGL();
00085
00087 void sltManageSelection(QMouseEvent *pqEvent);
00088
00090 void sltManageRelease(QMouseEvent *pqEvent);
00091
00093 void sltManageMove(QMouseEvent *pqEvent);
00094
00096 void sltCatchKey(int);
00097
00100 void sltResetSelection();
00101
00102 private:
00103
00105 void renderScene(void);
00106
00108 void renderSolidSphere(const CP3D &cCenter, float radius,
00109 int n1, int n2, float lw=2.5);
00110
00112 void renderWireSphere(const CP3D &cCenter, float radius,
00113 int n1, int n2, float lw=2.5);
00114
00115
00116
00117 QGLViewer *m_pViewer;
00118
00119 GLuint m_glDispList;
00120
00121 bool m_afSelected[12];
00122
00123 bool m_fLeftButtonPressed;
00124 bool m_fMiddleButtonPressed;
00125 bool m_fRightButtonPressed;
00126
00127 CP3D m_cSphereCenter[12];
00128
00129 int m_nMousePosX, m_nMousePosY;
00130 };
00131
00132 #endif // CRENDERER__H