From: Carsten Niehaus Date: Mon, 12 Jun 2006 17:36:41 +0000 (+0000) Subject: Add colours for the diffrent atom types :) X-Git-Tag: v3.80.3~103^2~66 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=2a8c1c321aa6ab3ca082848da1d363b631ed4f36;p=libqmvoc.git Add colours for the diffrent atom types :) svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglwidget.cpp; revision=550767 --- diff --git a/kalzium/kalziumglwidget.cpp b/kalzium/kalziumglwidget.cpp index 4dee5d7..f7c6f6e 100644 --- a/kalzium/kalziumglwidget.cpp +++ b/kalzium/kalziumglwidget.cpp @@ -97,7 +97,35 @@ void KalziumGLWidget::paintGL() 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); + + double r = 0.5; + double g = 0.5; + double b = 0.5; + + if ( a->IsOxygen() ) + {//red + r = 1.0; + g = 0.0; + b = 0.0; + } + else if ( a->IsSulfur() ) + {//yellow + r = 1.0; + g = 1.0; + b = 0.0; + }//almost black + else if ( a->IsCarbon() ) + { + r = 0.95; + g = 0.95; + b = 0.95; + } + + double radius = 1.0; + drawSphere( + x, y, z, + radius, + r, g, b); } }