From: Carsten Niehaus Date: Mon, 12 Jun 2006 17:02:10 +0000 (+0000) Subject: This way we can test with real testfiles. Only problem: The path is still hardcoded X-Git-Tag: v3.80.3~103^2~67 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=dfa7e1dd22e80c403d9a639bdbdf472cd4f74a29;p=libqmvoc.git This way we can test with real testfiles. Only problem: The path is still hardcoded svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.cpp; revision=550760 --- diff --git a/kalzium/kalziumglwidget.cpp b/kalzium/kalziumglwidget.cpp index 9cb8b44..4dee5d7 100644 --- a/kalzium/kalziumglwidget.cpp +++ b/kalzium/kalziumglwidget.cpp @@ -15,9 +15,16 @@ #include + #include #include +#include "openbabel2wrapper.h" +#include +#include + +using namespace OpenBabel; + KalziumGLWidget::KalziumGLWidget( QWidget * parent ) : QGLWidget( parent ) { @@ -77,13 +84,21 @@ void KalziumGLWidget::initializeGL() void KalziumGLWidget::paintGL() { + if ( !m_molecule ) + return; + glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); glLoadIdentity(); glTranslated( 0.0, 0.0, -12.0); glMultMatrixd( RotationMatrix ); - drawSphere(1.0, -1.0, -2.0, 1.5, 1.0, 0.0, 0.0); - drawSphere(-2.0, 1.0, 1.0, 2.5, 0.0, 1.0, 0.0); - drawSphere(2.0, 0.5, 0.0, 1.0, 0.0, 0.0, 1.0); + + FOR_ATOMS_OF_MOL( a, m_molecule ) + { + GLdouble x = ( GLdouble )a->GetX(); + GLdouble y = ( GLdouble )a->GetY(); + GLdouble z = ( GLdouble )a->GetZ(); + drawSphere(x,y,z,1.0, 1.0, 0.0, 0.0); + } } void KalziumGLWidget::resizeGL( int width, int height )