]> Git trees. - libqmvoc.git/commitdiff
Benoit, please copy test.cml to /home/kde4/ and then test the latticeviewer. Somehow...
authorCarsten Niehaus <cniehaus@gmx.de>
Sat, 24 Jun 2006 14:16:55 +0000 (14:16 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Sat, 24 Jun 2006 14:16:55 +0000 (14:16 +0000)
http://upload.wikimedia.org/wikipedia/commons/d/db/NaCl-estructura_cristalina.svg

Somehow setting the style like I did in latticedialog.cpp (commented out)
doesn't work (gives me a blank widget...). Perhaps you have an idea.

CCMAIL:kalzium@kde.org

svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.h; revision=554591

kalzium/kalziumglwidget.cpp
kalzium/kalziumglwidget.h

index f5c63cdfbe2eb1bae3feecdb6880b67d2f733cc8..74c3a188b26388091ba5b362d2614209334f239e 100644 (file)
@@ -652,6 +652,18 @@ GLColor& KalziumGLWidget::getAtomColor( OpenBabel::OBAtom* atom )
                c.m_green = 1.0;
                c.m_blue = 0.0;
        }
+       else if ( atom->GetAtomicNum() == 11 )
+       {//Natrium
+               c.m_red = 0.2;
+               c.m_green = 1.0;
+               c.m_blue = 0.0;
+       }
+       else if ( atom->GetAtomicNum() == 17 )
+       {//Chlorine
+               c.m_red = 0.1;
+               c.m_green = 0.1;
+               c.m_blue = 0.9;
+       }
        else
        {
                c.m_red = 0.5;
index fec571186ca45474ed50b8683a596143403e6d4d..8dd194b9c593c9e0d0300e7cbeae4c4392db5505 100644 (file)
@@ -123,18 +123,6 @@ class KalziumGLWidget : public QGLWidget
                        BOND_CYLINDER_BICOLOR
                } m_bondStyle;
 
-               /**
-                * Some style presets
-                */
-               enum StylePreset
-               {
-                       PRESET_LINES,
-                       PRESET_STICKS,
-                       PRESET_SPHERES_AND_GRAY_BONDS,
-                       PRESET_SPHERES_AND_BICOLOR_BONDS,
-                       PRESET_BIG_SPHERES
-               };
-
        private: // some standard 3D math stuff here
 
                /**
@@ -179,6 +167,24 @@ class KalziumGLWidget : public QGLWidget
                inline OpenBabel::OBMol* molecule () const
                        { return m_molecule; }
 
+               /**
+                * Some style presets
+                */
+               enum StylePreset
+               {
+                       PRESET_LINES,
+                       PRESET_STICKS,
+                       PRESET_SPHERES_AND_GRAY_BONDS,
+                       PRESET_SPHERES_AND_BICOLOR_BONDS,
+                       PRESET_BIG_SPHERES
+               };
+               
+               /**
+                * Chooses the style of rendering among some presets
+                * @param stylePreset the wanted style preset
+                */
+               void ChooseStylePreset( StylePreset stylePreset );
+
        public slots:
                /**
                 * sets the molecule which will be displayed
@@ -192,10 +198,6 @@ class KalziumGLWidget : public QGLWidget
                 */
                void slotSetDetail( int detail );
 
-               /**
-                * Chooses the style of rendering among some presets
-                * @param stylePreset the wanted style preset
-                */
                /**
                 * Chooses the style of rendering among some presets
                 * @param stylePreset the wanted style preset
@@ -282,12 +284,6 @@ class KalziumGLWidget : public QGLWidget
                inline GLFLOAT bondRadius();
                inline GLFLOAT atomRadius();
 
-               /**
-                * Chooses the style of rendering among some presets
-                * @param stylePreset the wanted style preset
-                */
-               void ChooseStylePreset( StylePreset stylePreset );
-
                /**
                 * returns the color which an atom should be painted
                 */