QtViewer: some refactorings.
parent
6d58926046
commit
67febc41c6
|
@ -590,22 +590,7 @@ void CGLView::resizeGL(int pWidth, int pHeight)
|
||||||
gluPerspective(mCamera_FOVY, mCamera_Viewport_AspectRatio, 1.0, 100000.0);///TODO: znear/zfar depend on scene size.
|
gluPerspective(mCamera_FOVY, mCamera_Viewport_AspectRatio, 1.0, 100000.0);///TODO: znear/zfar depend on scene size.
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGLView::paintGL()
|
void CGLView::drawCoordSystem() {
|
||||||
{
|
|
||||||
QTime time_paintbegin;
|
|
||||||
|
|
||||||
time_paintbegin = QTime::currentTime();
|
|
||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
// Apply current camera transformations.
|
|
||||||
glMultMatrixf((GLfloat*)&mHelper_Camera.Rotation_AroundCamera);
|
|
||||||
glTranslatef(-mHelper_Camera.Translation_ToScene.x, -mHelper_Camera.Translation_ToScene.y, -mHelper_Camera.Translation_ToScene.z);
|
|
||||||
glMultMatrixf((GLfloat*)&mHelper_Camera.Rotation_Scene);
|
|
||||||
// Coordinate system
|
|
||||||
if(mLightingEnabled) glDisable(GL_LIGHTING);///TODO: display list
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_1D, 0);
|
glBindTexture(GL_TEXTURE_1D, 0);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
glBindTexture(GL_TEXTURE_3D, 0);
|
glBindTexture(GL_TEXTURE_3D, 0);
|
||||||
|
@ -621,6 +606,27 @@ void CGLView::paintGL()
|
||||||
qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0);
|
qglColor(QColor(Qt::blue)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, 100000.0);
|
||||||
qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0);
|
qglColor(QColor(Qt::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0);
|
||||||
glEnd();
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGLView::paintGL()
|
||||||
|
{
|
||||||
|
QTime time_paintbegin;
|
||||||
|
|
||||||
|
time_paintbegin = QTime::currentTime();
|
||||||
|
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glLoadIdentity();
|
||||||
|
// Apply current camera transformations.
|
||||||
|
glMultMatrixf((GLfloat*)&mHelper_Camera.Rotation_AroundCamera);
|
||||||
|
glTranslatef(-mHelper_Camera.Translation_ToScene.x, -mHelper_Camera.Translation_ToScene.y, -mHelper_Camera.Translation_ToScene.z);
|
||||||
|
glMultMatrixf((GLfloat*)&mHelper_Camera.Rotation_Scene);
|
||||||
|
// Coordinate system
|
||||||
|
if ( mLightingEnabled ) {
|
||||||
|
glDisable( GL_LIGHTING );///TODO: display list
|
||||||
|
}
|
||||||
|
drawCoordSystem();
|
||||||
|
|
||||||
glDisable(GL_COLOR_MATERIAL);
|
glDisable(GL_COLOR_MATERIAL);
|
||||||
if(mLightingEnabled) glEnable(GL_LIGHTING);
|
if(mLightingEnabled) glEnable(GL_LIGHTING);
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ private:
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void drawCoordSystem();
|
||||||
/// \fn void initializeGL() override
|
/// \fn void initializeGL() override
|
||||||
/// Overrided function for initialise OpenGL.
|
/// Overrided function for initialise OpenGL.
|
||||||
void initializeGL() override;
|
void initializeGL() override;
|
||||||
|
|
Loading…
Reference in New Issue