From: Carsten Niehaus Date: Mon, 12 Jun 2006 15:05:06 +0000 (+0000) Subject: * Ok, make the dialog more sane, adding some slots so that Benoit can continue X-Git-Tag: v3.80.3~103^2~68 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=389633e1c38fea475598a0d19e854cb440dc5400;p=libqmvoc.git * Ok, make the dialog more sane, adding some slots so that Benoit can continue * Benoit: You'll notice some changes in the GL-classes. I added 2 members and 2 slots. In the moleculewidget I removed everything but the constructor. I hope that works fine for you :) CCMAIL:jacob@math.jussieu.fr svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.h; revision=550673 --- diff --git a/kalzium/kalziumglwidget.cpp b/kalzium/kalziumglwidget.cpp index 129f065..9cb8b44 100644 --- a/kalzium/kalziumglwidget.cpp +++ b/kalzium/kalziumglwidget.cpp @@ -22,6 +22,8 @@ KalziumGLWidget::KalziumGLWidget( QWidget * parent ) : QGLWidget( parent ) { sphereDisplayList = 0; + m_molecule = 0; + m_detail = 2; isDragging = false; setMinimumSize( 100,100 ); @@ -165,4 +167,14 @@ void KalziumGLWidget::drawSphere( GLdouble x, GLdouble y, GLdouble z, GLdouble r glPopMatrix(); } +void KalziumGLWidget::slotSetMolecule( OpenBabel::OBMol* molecule ) +{ + m_molecule = molecule; +} + +void KalziumGLWidget::slotSetDetail( int detail ) +{ + m_detail = detail; +} + #include "kalziumglwidget.moc" diff --git a/kalzium/kalziumglwidget.h b/kalzium/kalziumglwidget.h index 86bfadc..d189757 100644 --- a/kalzium/kalziumglwidget.h +++ b/kalzium/kalziumglwidget.h @@ -19,6 +19,8 @@ #define SPHERE_TESSELATE_SLICES 30 #define SPHERE_TESSELATE_STACKS 30 +#include + /** * This class displays the 3D-view of a molecule * @@ -52,6 +54,19 @@ class KalziumGLWidget : public QGLWidget */ virtual ~KalziumGLWidget(); + public slots: + /** + * sets the molecule which will be displayed + * @param molecule the molecule to render + */ + void slotSetMolecule( OpenBabel::OBMol* molecule ); + + /** + * Sets the detail-grade in a range from 0 to 2 + * @param detail the detail-grade of the rendering. 0 is low, 2 is high + */ + void slotSetDetail( int detail ); + protected: /** * This method initilized OpenGL @@ -86,5 +101,15 @@ class KalziumGLWidget : public QGLWidget GLfloat red, GLfloat green, GLfloat blue ); + + /** + * The molecule which is displayed + */ + OpenBabel::OBMol* m_molecule; + + /** + * The detail-grade from 0 to 2 + */ + int m_detail; }; #endif // KALZIUMGLWIDGET_H