From: BenoƮt Jacob Date: Sat, 21 Oct 2006 12:27:04 +0000 (+0000) Subject: complete the port of kalzium to eigen X-Git-Tag: v3.80.3~103^2~7 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=08a1cc6c42b8cf95dfce8b071fa4d8a49919dfb3;p=libqmvoc.git complete the port of kalzium to eigen (i had forgotten to port m_rotationMatrix to use Eigen::Matrix4d) svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.h; revision=597713 --- diff --git a/kalzium/kalziumglwidget.cpp b/kalzium/kalziumglwidget.cpp index 2073b88..f3b1da2 100644 --- a/kalzium/kalziumglwidget.cpp +++ b/kalzium/kalziumglwidget.cpp @@ -65,11 +65,7 @@ void KalziumGLWidget::initializeGL() glDepthFunc( GL_LEQUAL ); glEnable( GL_CULL_FACE ); - glMatrixMode( GL_MODELVIEW ); - glPushMatrix(); - glLoadIdentity(); - glGetDoublev( GL_MODELVIEW_MATRIX, m_RotationMatrix ); - glPopMatrix(); + m_rotationMatrix.loadIdentity(); glEnable( GL_NORMALIZE ); glEnable( GL_LIGHTING ); @@ -168,7 +164,7 @@ void KalziumGLWidget::renderScene( GLenum renderMode, // set up the camera glLoadIdentity(); glTranslated ( 0.0, 0.0, -3.0 * getMolRadius() ); - glMultMatrixd ( m_RotationMatrix ); + glMultMatrixd ( m_rotationMatrix.array() ); // set up fog if( m_useFog && renderMode == GL_RENDER ) @@ -365,8 +361,8 @@ void KalziumGLWidget::mouseMoveEvent( QMouseEvent * event ) glLoadIdentity(); glRotated( deltaDragging.x(), 0.0, 1.0, 0.0 ); glRotated( deltaDragging.y(), 1.0, 0.0, 0.0 ); - glMultMatrixd( m_RotationMatrix ); - glGetDoublev( GL_MODELVIEW_MATRIX, m_RotationMatrix ); + glMultMatrixd( m_rotationMatrix.array() ); + glGetDoublev( GL_MODELVIEW_MATRIX, m_rotationMatrix.array() ); glPopMatrix(); updateGL(); } @@ -392,8 +388,8 @@ void KalziumGLWidget::rotate( ) //no idea what value is for what... :) glRotated( 10.0, 0.0, 1.0, 0.0 ); glRotated( 10.0, 1.0, 0.0, 0.0 ); - glMultMatrixd( m_RotationMatrix ); - glGetDoublev( GL_MODELVIEW_MATRIX, m_RotationMatrix ); + glMultMatrixd( m_rotationMatrix ); + glGetDoublev( GL_MODELVIEW_MATRIX, m_rotationMatrix ); glPopMatrix(); updateGL(); */ diff --git a/kalzium/kalziumglwidget.h b/kalzium/kalziumglwidget.h index cc19aee..cdc5255 100644 --- a/kalzium/kalziumglwidget.h +++ b/kalzium/kalziumglwidget.h @@ -63,7 +63,7 @@ class KalziumGLWidget : public QGLWidget /** * Stores the rotation that is applied to the model. */ - GLdouble m_RotationMatrix[16]; + Eigen::Matrix4d m_rotationMatrix; /** * The molecule which is displayed