]> Git trees. - libqmvoc.git/commitdiff
* Ok, make the dialog more sane, adding some slots so that Benoit can continue
authorCarsten Niehaus <cniehaus@gmx.de>
Mon, 12 Jun 2006 15:05:06 +0000 (15:05 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Mon, 12 Jun 2006 15:05:06 +0000 (15:05 +0000)
* 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

kalzium/kalziumglwidget.cpp
kalzium/kalziumglwidget.h

index 129f06570c81aaf97999866f3891bf0aa4fdc975..9cb8b44cb9a03c0369dbb160118d9d382f66bc30 100644 (file)
@@ -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"
index 86bfadcc2cec7d62cdb86ac64440965901eef524..d189757a76172f9369795564d816dc4c61eb6228 100644 (file)
@@ -19,6 +19,8 @@
 #define SPHERE_TESSELATE_SLICES        30
 #define SPHERE_TESSELATE_STACKS        30
 
+#include <openbabel/mol.h>
+
 /**
  * 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