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
00034 #ifndef CRENDERER__H
00035 #define CRENDERER__H
00036
00037
00038
00040 #include "QGLExaminerViewer.h"
00041 #include "QCameraKeyPathEditorImpl.h"
00042
00043
00045 #include <qmainwindow.h>
00046 #include <qslider.h>
00047 #include <qgl.h>
00048
00049
00050
00052 #include <math.h>
00053
00054
00055
00056
00065 class CEditorRenderer : public QObject {
00066 Q_OBJECT
00067
00068
00069
00070 public:
00071 CEditorRenderer(QGLViewer*, QCameraKeyPathEditorImpl *);
00072
00073 ~CEditorRenderer();
00074
00075 QGLViewer* getViewer(void) { return m_pViewer; };
00076
00077 void MakeGlList();
00078
00079
00080
00081 private:
00083 GLuint processHits(GLint hits, GLuint buffer[]);
00084
00085
00086
00087 private slots:
00088
00090 void sltInitializeGL();
00091
00093 void sltResizeGL(int w, int h);
00094
00096 void sltPaintGL();
00097
00099 void sltManageSelection(QMouseEvent *pqEvent);
00100
00102 void sltManageRelease(QMouseEvent *pqEvent);
00103
00105 void sltManageMove(QMouseEvent *pqEvent);
00106
00109 void sltResetSelection();
00110
00111
00112 private:
00113
00115 void renderScene(void);
00116
00118 void renderSolidSphere(const CP3D &cCenter, float radius,
00119 int n1, int n2, float lw=2.5);
00120
00122 void renderWireSphere(const CP3D &cCenter, float radius,
00123 int n1, int n2, float lw=2.5);
00124
00125
00126
00127 QGLViewer *m_pViewer;
00128 QCameraKeyPathEditorImpl *m_pCameraEditor;
00129
00130 GLuint m_glDispList;
00131
00132 bool m_afSelected[12];
00133
00134 bool m_fLeftButtonPressed;
00135 bool m_fMiddleButtonPressed;
00136 bool m_fRightButtonPressed;
00137
00138 CP3D m_cSphereCenter[12];
00139
00140 int m_nMousePosX, m_nMousePosY;
00141 };
00142
00143 #endif // CRENDERER__H