]> Git trees. - libqmvoc.git/commitdiff
complete the port of kalzium to eigen
authorBenoît Jacob <jacob.benoit.1@gmail.com>
Sat, 21 Oct 2006 12:27:04 +0000 (12:27 +0000)
committerBenoît Jacob <jacob.benoit.1@gmail.com>
Sat, 21 Oct 2006 12:27:04 +0000 (12:27 +0000)
(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
kalzium/kalziumglwidget.h

index 2073b88afbcf4bf060abc3c378162a91bb5d9a50..f3b1da25ae3009eda5793106ee05e4cd80da73a8 100644 (file)
@@ -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();
 */
index cc19aee8f0a5184049cd015aa6101b172454365c..cdc525584190cf62dd9c959834a6171ee4ac12b8 100644 (file)
@@ -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