From 08a1cc6c42b8cf95dfce8b071fa4d8a49919dfb3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Jacob?= Date: Sat, 21 Oct 2006 12:27:04 +0000 Subject: [PATCH] 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 --- kalzium/kalziumglwidget.cpp | 16 ++++++---------- kalzium/kalziumglwidget.h | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) 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 -- 2.47.3