QtViewer: some refactorings.

pull/1062/head
Kim Kulling 2016-11-08 14:53:52 +01:00
parent 6d58926046
commit 67febc41c6
2 changed files with 23 additions and 17 deletions

View File

@ -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.
}
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
void CGLView::drawCoordSystem() {
glBindTexture(GL_TEXTURE_1D, 0);
glBindTexture(GL_TEXTURE_2D, 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::yellow)), glVertex3f(0.0, 0.0, 0.0), glVertex3f(0.0, 0.0, -100000.0);
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);
if(mLightingEnabled) glEnable(GL_LIGHTING);

View File

@ -253,7 +253,7 @@ private:
/********************************************************************/
protected:
void drawCoordSystem();
/// \fn void initializeGL() override
/// Overrided function for initialise OpenGL.
void initializeGL() override;