]> Git trees. - libqmvoc.git/commitdiff
* remove the files which are now in libphysics.
authorCarsten Niehaus <cniehaus@gmx.de>
Thu, 13 Oct 2005 13:09:49 +0000 (13:09 +0000)
committerCarsten Niehaus <cniehaus@gmx.de>
Thu, 13 Oct 2005 13:09:49 +0000 (13:09 +0000)
svn path=/trunk/KDE/kdeedu/kalzium/src/spectrum.cpp; revision=470255

kalzium/src/element.cpp [deleted file]
kalzium/src/element.h [deleted file]
kalzium/src/isotope.cpp [deleted file]
kalzium/src/isotope.h [deleted file]
kalzium/src/spectrum.cpp [deleted file]
kalzium/src/spectrum.h [deleted file]
kalzium/src/tempunit.cpp [deleted file]
kalzium/src/tempunit.h [deleted file]

diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp
deleted file mode 100644 (file)
index 4087aa8..0000000
+++ /dev/null
@@ -1,540 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2003, 2004, 2005 by Carsten Niehaus                     *
- *   cniehaus@kde.org                                                      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
- ***************************************************************************/
-
-#include "element.h"
-#include "prefs.h"
-#include "spectrum.h"
-#include "isotope.h"
-#include "kalziumdataobject.h"
-#include "kalziumutils.h"
-#include "tempunit.h"
-
-#include <qdom.h>
-#include <qfile.h>
-#include <qpainter.h>
-#include <qregexp.h>
-#include <qfontmetrics.h>
-
-#include <kdebug.h>
-#include <klocale.h>
-#include <kurl.h>
-#include <kstandarddirs.h>
-
-Element::Element()
-{
-       m_radioactive = false;
-       m_artificial = false;
-       m_abundance = 0;
-}
-
-Isotope* Element::isotopeByNucleons( int numberOfNucleons )
-{
-       QList<Isotope*>::ConstIterator it = m_isotopeList.begin();
-       const QList<Isotope*>::ConstIterator itEnd = m_isotopeList.end();
-
-       for ( ; it != itEnd; ++it )
-       {
-               if ( ( ( *it )->neutrons() + ( *it )->protones() ) == numberOfNucleons )
-                       return *it;
-       }
-       return 0;
-}
-
-QString Element::parsedOrbits( bool canBeEmpty )
-{
-       if ( m_orbits.isEmpty() )
-               if ( !canBeEmpty )
-                       return i18n( "structure means orbital configuration in this case", "Unknown structure" );
-               else
-                       return "";
-       
-       QString orbits = m_orbits;
-       QRegExp rxs("([a-z])([0-9]+)");
-       QRegExp rxb("([a-z]{2}) ",false);
-       orbits.replace(rxs,"\\1<sup>\\2</sup>"); //superscript around electron number
-       orbits.replace(rxb,"<b>\\1</b> "); //bold around element symbols
-       return orbits;
-}
-
-Element::~Element()
-{
-}
-
-double Element::meanmass()
-{
-       return m_mass/m_number;
-}
-
-const QString Element::adjustRadius( RADIUSTYPE rtype )
-{
-       double val = 0.0;
-       QString v;
-
-       switch ( rtype )
-       {
-               case ATOMIC:
-                       val = m_RadiusAR;
-                       break;
-               case IONIC:
-                       val = m_RadiusIon;
-                       break;
-               case COVALENT:
-                       val = m_RadiusCR;
-                       break;
-               case VDW:
-                       val = m_RadiusVDW;
-                       break;
-       }
-
-       if ( val <= 0 )
-               v = i18n( "Value unknown" );
-       else
-               v = i18n( "%1 is a length, eg: 12.3 pm", "%1 pm" ).arg( QString::number( val ) );
-       return v;
-}
-
-const QString Element::adjustUnits( const int type, double value )
-{
-       QString v;
-       if ( type == IE  ) //an ionization energy
-       {
-               if ( Prefs::energies() == 0 )
-               {
-                       value*=96.6;
-                       v = QString::number( value );
-                       v.append( " kJ/mol" );
-               }
-               else // use electronvolt
-               {
-                       v = QString::number( value );
-                       v.append( " eV" );
-               }
-       }
-       return v;
-}
-
-const QString Element::adjustUnits( const int type )
-{
-       QString v = QString::null;
-
-       double val = 0.0; //the value to convert
-       
-       if ( type == BOILINGPOINT || type == MELTINGPOINT ) // convert a temperature
-       {
-               if ( type == BOILINGPOINT )
-                       val = boiling();
-               else
-                       val = melting();
-
-               if ( val <= 0 )
-                       v = i18n( "Value unknown" );
-               else
-               {
-                       double newvalue = TempUnit::convert( val, (int)TempUnit::Kelvin, Prefs::temperature() );
-                       switch (Prefs::temperature()) {
-                               case 0: //Kelvin
-                                       v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( newvalue );
-                                       break;
-                               case 1://Kelvin to Celsius
-                                       v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( newvalue ).arg( QChar(0xB0) );
-                                       break;
-                               case 2: // Kelvin to Fahrenheit
-                                       v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( newvalue ).arg( QChar(0xB0) );
-                                       break;
-                               case 3: // Kelvin to Rankine
-                                       v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( newvalue ).arg( QChar(0xB0) );
-                                       break;
-                               case 4: // Kelvin to Reamur
-                                       v = i18n( "%1 is the temperature in Reamur", "%1 %2R" ).arg( newvalue ).arg( QChar(0xB0) );
-                                       break;
-                       }
-               }
-       }
-       else if ( type == EN ) //Electronegativity
-       {
-               val = electroneg();
-               if ( val <= 0 )
-               v = i18n( "Value not defined" );
-               else
-                       v = QString::number( val );
-       }
-       else if ( type == EA ) //Electron affinity
-       {
-               val = electroaf();
-               if ( val == 0.0 )
-                       v = i18n( "Value not defined" );
-               else
-               {
-                       if ( Prefs::energies() == 0 )
-                       {
-                               v = i18n( "%1 kJ/mol" ).arg( QString::number( val ) );
-                       }
-                       else // use electronvolt
-                       {
-                               val/=96.6;
-                               v = i18n( "%1 eV" ).arg( QString::number( val ) );
-                       }
-               }
-       }
-       else if ( type == MASS ) // its a mass
-       {
-               val = mass();
-               if ( val <= 0 )
-                       v = i18n( "Value unknown" );
-               else
-                       v = i18n( "%1 u" ).arg( QString::number( val ) );
-       }
-       else if ( type == DENSITY ) // its a density
-       {
-               val = density();
-
-               if ( val <= 0 )
-                       v = i18n( "Value unknown" );
-               else
-               {
-                       if ( boiling() < 295.0 )//gasoline
-                       {
-                               v = i18n( "%1 g/L" ).arg( QString::number( val ) );
-                       }
-                       else//liquid or solid
-                       {
-                               v = i18n( "%1 g/cm<sup>3</sup>" ).arg( QString::number( val ) );
-                       }
-               }
-       }
-       else if ( type == DATE ) //its a date
-       {
-               val = date();
-               if ( val < 1600 )
-               {
-                       v = i18n( "This element was known to ancient cultures" );
-               }
-               else
-               {
-                       v = i18n( "This element was discovered in the year %1" ).arg( QString::number( val ) );
-               }
-       }
-
-       return v;
-}
-
-void Element::drawStateOfMatter( QPainter* p, double temp )
-{
-       //the height of a "line" inside an element
-       int h_small = 15; //the size for the small units like elementnumber
-
-       //The X-coordiante
-       int X = xPos();
-       
-       //The Y-coordinate
-       int Y = yPos();
-       
-       QColor color = currentColor( temp );
-       
-       p->setPen( color );
-       p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, color );
-       
-       QString text;
-       QFont symbol_font = p->font();
-
-       symbol_font.setPointSize( 10 );
-       QFont f = p->font();
-       f.setPointSize( 9 );
-               
-       p->setFont( f );
-
-       //top left
-       p->setPen( Qt::black );
-       text = QString::number( KalziumUtils::strippedValue( mass( ) ) );
-       p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text );
-
-       text = QString::number( number() );
-       p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, text );
-
-       p->setFont( symbol_font );
-       p->drawText( X,Y, ELEMENTSIZE,ELEMENTSIZE,Qt::AlignCenter, symbol() );
-       
-       //border
-       p->setPen( Qt::black );
-       p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
-}
-
-QColor Element::currentColor( const double temp )
-{
-       QColor color;
-       
-       //take the colours for the given temperature
-       const double iButton_melting = melting();
-       const double iButton_boiling = boiling();
-
-       //If either the mp or bp is not known return
-       //This is to avoid undefined behaviour
-//     if ( iButton_boiling <= 0.0 || iButton_melting <= 0.0 )
-//             return Qt::lightGray;
-
-       if ( temp < iButton_melting )
-       { //the element is solid
-               color= Prefs::color_solid();
-       }
-       else if ( temp > iButton_melting &&
-                       temp < iButton_boiling ) 
-       { //the element is liquid
-               color= Prefs::color_liquid();
-       }
-       else if ( temp > iButton_boiling && iButton_boiling > 0.0 )
-       { //the element is vaporous
-               color= Prefs::color_vapor();
-       }
-       else
-               color = Qt::lightGray;
-
-       return color;
-}
-
-       
-void Element::drawGradient( QPainter* p, const QString& value, const QColor& c)
-{
-       //Set the elementColor to c to make the overviewwidget show
-       //the correct color
-       setElementColor( c );
-       
-       //the height of a "line" inside an element
-       int h_small = 10; //the size for the small units like elementnumber
-
-       //The X-coordiante
-       int X = xPos();
-       
-       //The Y-coordinate
-       int Y = yPos();
-
-       p->setPen( c );
-       p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, c );
-       
-       p->setPen( Qt::black );
-       QFont symbol_font = p->font();
-       QFont f = p->font();
-
-       f.setPointSize( KalziumUtils::maxSize(value, QRect( X,Y+ELEMENTSIZE-h_small, ELEMENTSIZE, h_small ),f, p ) );
-       p->setFont( f );
-
-       p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, value );
-
-       const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 );
-       int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p );
-       symbol_font.setPointSize( goodsize );
-       p->setFont( symbol_font );
-       p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,Qt::AlignCenter, symbol() );
-       
-       //border
-       p->setPen( Qt::black );
-       p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
-}
-
-void Element::drawGrayedOut( QPainter *p )
-{ 
-       //The X-coordiante
-       int X = xPos();
-       
-       //The Y-coordinate
-       int Y = yPos();
-       
-       p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, Qt::lightGray );
-       
-       p->setPen( Qt::darkGray );
-       
-       QFont symbol_font = p->font();
-       const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 );
-       int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p );
-       symbol_font.setPointSize( goodsize );
-       p->setFont( symbol_font );
-       p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,Qt::AlignCenter, symbol() );
-
-       p->setPen( Qt::black );
-       p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
-}
-
-void Element::drawSelf( QPainter* p, bool simple, bool isCrystal )
-{
-       //the height of a "line" inside an element
-       int h_small = 12; //the size for the small units like elementnumber
-
-       //The X-coordiante
-       int X = xPos();
-       
-       //The Y-coordinate
-       int Y = yPos();
-
-       p->setPen( elementColor() );
-       p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, elementColor() );
-       p->setPen( Qt::black );
-       
-       QString text;
-       QFont symbol_font = p->font();
-       
-       const int max = ELEMENTSIZE-10;
-       
-       const QRect rect = QRect( X,Y,ELEMENTSIZE-2,max );
-
-       int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p );
-       symbol_font.setPointSize( goodsize );
-       p->setFont( symbol_font );
-       
-       if ( !simple )
-               p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignCenter, symbol() );
-       else
-               p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignHCenter, symbol() );
-       
-       QFont f = p->font();
-
-       QRect smallRect( X,Y ,ELEMENTSIZE-4,h_small );
-       f.setPointSize( KalziumUtils::maxSize( QString::number( number() ), smallRect, f, p ) );
-       
-       p->setFont( f );
-
-       if ( !simple )
-       {//the user only wants a simple periodic table, don't weight the cell
-               QString text;
-               if ( isCrystal )
-               {
-                       QString structure = crystalstructure();
-                       /**
-                        * hcp: hexagonal close packed
-                        * fcc: face centered cubic
-                        * krz/bcc body centered cubic// kubisch raumzentriert
-                        * kdp: kubisch dicht gepackt
-                        * hdp: hexagonal dicht gepackt
-                        * ccp: cubic close packed // kubisch dichteste Kugelpackung
-                        */
-                       if ( structure == "own")
-                               text = i18n( "this means, the element has its 'own' structur", "own" );
-                       else if ( structure == "bcc" )
-                               text = i18n( "Crystalsystem body centered cubic", "bcc" );
-                       else if ( structure == "hdp" )
-                               text = i18n( "Crystalsystem hexagonal dense packed", "hdp" );
-                       else if ( structure == "ccp" )
-                               text = i18n( "Crystalsystem cubic close packed", "ccp" );
-               }
-               else
-                       text = QString::number( KalziumUtils::strippedValue( mass( ) ) );
-               p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,Qt::AlignCenter, text );
-       }
-       
-       text = QString::number( number() );
-       p->drawText( X+2,Y+ELEMENTSIZE-h_small , ELEMENTSIZE-4, h_small,Qt::AlignCenter, text );
-       
-       p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1);
-}
-
-/*!
-    This looks pretty evil and it is. The problem is that a PeriodicTableView is pretty
-    irregular and you cannot "calculate" the position. 
- */
-void Element::setupXY()
-{
- static const int posXRegular[111] = {1,18,
-                                                                       1,2,13,14,15,16,17,18,
-                                                                       1,2,13,14,15,16,17,18,
-                                                                       1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
-                                                                       1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,  //Element 54 (Xe)
-                                                                       1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,     //Element 71 (Lu)
-                                                                             4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
-                                                                       1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,     //Element 71 (Lr)
-                                                                             4,5,6,7,8,9,10,11};
- static const int posYRegular[111] = {1,1,
-                                                                       2,2, 2, 2, 2, 2, 2, 2,
-                                                                       3,3, 3, 3, 3, 3, 3, 3,
-                                                                       4,4,4,4,4,4,4,4,4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
-                                                                       5,5,5,5,5,5,5,5,5, 5, 5, 5, 5, 5, 5, 5, 5, 5,  //Element 54 (Xe)
-                                                               6,6,6,8,8,8,8,8,8, 8, 8, 8, 8, 8, 8, 8, 8,     //Element 71 (Lr)
-                                                                             6,6,6,6,6,6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
-                                                                       7,7,7,9,9,9,9,9,9, 9, 9, 9, 9, 9, 9, 9, 9,
-                                                                             7,7,7,7,7,7,7,7};
-
- x = posXRegular[m_number-1];
- y = posYRegular[m_number-1];
-}
-
-void Element::setRadius( RADIUSTYPE type, double value, const QString& name )
-{
-       switch ( type )
-       {
-               case ATOMIC:
-                       m_RadiusAR = value;
-                       break;
-               case IONIC:
-                       m_RadiusIon = value;
-                       m_ionvalue = name;
-                       break;
-               case COVALENT:
-                       m_RadiusCR = value;
-                       break;
-               case VDW:
-                       m_RadiusVDW = value;
-                       break;
-       }
-}
-
-double Element::radius( RADIUSTYPE type )
-{
-       switch ( type )
-       {
-               case ATOMIC:
-                       return m_RadiusAR;
-                       break;
-               case IONIC:
-                       return m_RadiusIon;
-                       break;
-               case COVALENT:
-                       return m_RadiusCR;
-                       break;
-               case VDW:
-                       return m_RadiusVDW;
-                       break;
-       }
-       return 0.0;
-}
-
-int Element::xPos() const
-{
-       return ( x-1 )*ELEMENTSIZE;
-}
-
-int Element::yPos() const
-{
-       // mind the small gap over rare earth!
-       int tmp_y = ( y-1 )*ELEMENTSIZE + ELEMENTSIZE;
-
-       // 57=Lanthanum, 72=Hafnium, 89=Actinium & 104=Rutherfordium (i.e., if
-       // n_number is in rare earth's block)
-       if ( (m_number > 57 && m_number < 72) || (m_number > 89 && m_number < 104) )
-               tmp_y += ELEMENTSIZE/3;
-
-       return tmp_y;
-}
-
-QPoint Element::pos() const
-{
-       return QPoint( xPos(), yPos() );
-}
-
-QPoint Element::coords() const
-{
-       return QPoint( x, y );
-}
diff --git a/kalzium/src/element.h b/kalzium/src/element.h
deleted file mode 100644 (file)
index e7ee189..0000000
+++ /dev/null
@@ -1,515 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2003, 2004, 2005 by Carsten Niehaus                     *
- *   cniehaus@kde.org                                                      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
- ***************************************************************************/
-#ifndef ELEMENT_H
-#define ELEMENT_H
-
-#define ELEMENTSIZE 40
-
-#include <qcolor.h>
-#include <qlist.h>
-
-class Element;
-class QDomDocument;
-class QPainter;
-class QPoint;
-class QFont;
-class QRect;
-class Spectrum;
-class Isotope;
-
-struct coordinate;
-
-typedef QList<Element*> EList;
-typedef QList<coordinate> CList;
-typedef QList<double> doubleList;
-
-struct coordinate{
-       int x;
-       int y;
-};
-
-/**
- * In this class all information about an element are stored. This means that
- * both the chemical date and the data about the position are stored
- * in this class.
- * @short This class is the represention of a chemical element
- * @author Carsten Niehaus
-*/
-class Element{
-       public:
-               Element();
-
-               virtual ~Element();
-
-               /**
-                * @returns a pointer to the istope with @p numberOfNucleons
-                * nucleons
-                */
-               Isotope* isotopeByNucleons( int numberOfNucleons );
-               
-               enum RADIUSTYPE
-               {
-                       ATOMIC = 0,
-                       IONIC,
-                       VDW, //van der Waals radius
-                       COVALENT
-               };
-
-               /**
-                * @return the number of the element
-                */
-               int number() const {
-                       return m_number;
-               }
-
-               /**
-                * @return if the Element is radioactive
-                */
-               bool radioactive() const{
-                       return m_radioactive;
-               }
-               
-               /**
-                * @return if the Element is artificial
-                */
-               bool artificial() const{
-                       return m_artificial;
-               }
-
-               /**
-                * @return the information where the name of the Element comes from
-                */
-               QString nameOrigin() const{
-                       return m_origin;
-               }
-
-               QString orbits() const{
-                       return m_orbits;
-               }
-               
-               void setMass( double value ) { m_mass = value; }
-               void setEN( double value ) { m_EN = value; }
-               void setEA( double value ) { m_EA = value; }
-               void setMeltingpoint( double value ) { m_MP = value; }
-               void setBoilingpoint( double value ) { m_BP = value; }
-
-               /**
-                * sets the density of the Element
-                * @param value the density of the Element
-                */
-               void setDensity( double value ) { m_Density = value; }
-
-               /**
-                * set the radius of the radiustype @p type to the value @p value.
-                * The ionicradius also has a name @p name. This will store the charge of
-                * the ion (for example, +2 or -3 )
-                */
-               void setRadius( RADIUSTYPE type, double value, const QString& name = 0 );
-               
-               void setDate( int date ) { m_date = date; }
-               void setPeriod( int period ){ m_period = period; }
-               void setBiologicalMeaning( int value ) { m_biological = value; }
-               void setNumber( int num ){ m_number = num; }
-
-               /**
-                * set the abundance in crustal rocks [pm]
-                * @param abundance the abundace in crustal rocks
-                */
-               void setAbundance( int abundance ){ m_abundance = abundance; }
-
-               void setScientist( const QString& value ) { m_scientist = value; }
-               void setCrysatalstructure( const QString& value ) { m_crystalstructure = value; }
-               void setName( const QString& value ) { m_name = value; }
-               void setOrigin( const QString& value ) { m_origin = value; }
-               void setBlock( const QString& value ) { m_block = value; }
-               void setGroup( const QString& value ) { m_group = value; }
-               void setFamily( const QString& value ) { m_family = value; }
-               void setOrbits( const QString& value ) { m_orbits = value; }
-               void setSymbol( const QString& value ) { m_symbol = value; }
-               void setOxydation( const QString& value ) { m_oxstage = value; }
-               void setAcidicbehaviour( const QString& value ) { m_acidbeh = value; }
-               void setIsotopes( const QString& value ) { m_isotopes = value; }
-               
-               void setArtificial(){ m_artificial = true; }
-               void setRadioactive(){ m_radioactive = true; }
-               
-               void setIonisationList( doubleList l ){ m_ionenergies = l; }
-
-               QList<Isotope*> isotopes() const{
-                       return m_isotopeList;
-        }
-
-               QList<double> spectrumList() const{
-                       return m_spectrumList;
-               }
-
-               void setIsotopeList( QList<Isotope*> list ){
-                       m_isotopeList = list;
-               }
-
-               /**
-                * sets the Spectrum of the Element
-                * @param spec the Spectrum of the Element
-                */
-               void setSpectrum( Spectrum *spec ){
-                       m_spectrum = spec;
-               }
-
-               /**
-                * @return if the element has information about spectra
-                */
-               bool hasSpectrum() const{
-                       return m_hasSpectrum;
-               }
-
-               /**
-                * define if the element has a known Spectrum
-                * @param value if true, the Element has a Spectrum
-                */
-               void setHasSepctrum(bool value){
-                       m_hasSpectrum = value;
-               }
-
-               /**
-                * @return the Spectrum of the element
-                */
-               Spectrum* spectrum() const{
-                       return m_spectrum;
-               }
-
-               doubleList ionisationList() const{
-                       return m_ionenergies;
-               }
-               
-               /**
-                * @return the date of discovery of the element
-                */
-               int date() const {
-                       return m_date; 
-               }
-
-               /**
-                * return the correct color of the element at the
-                * temperature @p temp
-                */
-               QColor currentColor( const double temp );
-    
-               /**
-                * mutator for the element's color
-                */
-               void setElementColor( const QColor &c ) { m_Color = c; }
-               
-               /**
-                * @return the importance of the element for biological
-                * systems.
-                * @li 0: blah
-                * @li 1: blub
-                * @li 2: blub
-                * @li 3: blub
-                * @li 4: blub
-                * @li 5: blub
-                * @li 6: blub
-                */
-               int biological() const {
-                       return m_biological;
-               }
-
-               /**
-                * @return the abundance in crustal rocks in parts per million
-                */
-               int abundance() const {
-                       return 12;
-               }
-               
-               /**
-                * @return the symbol of the element
-                */
-               QString symbol() const {
-                       return m_symbol;
-               }
-
-               /**
-                * @return the scientist who discovered the element
-                */
-               QString scientist() const{
-                       return m_scientist;
-               }
-
-               /**
-                * @return the crystal structure of the element
-                */
-               QString crystalstructure() const{
-                       return m_crystalstructure;
-               }
-               
-               /**
-                * @return the name of the element
-                */
-               QString elname() const {
-                       return m_name;
-               }
-
-               //FIXME I need to add a way to have more than one ionic radius
-               QString ioncharge() const{
-                       return m_ionvalue;
-               }
-               
-               /**
-                * @return the chemical block (s, p, d, f) of the element
-                */
-               QString block() const {
-                       return m_block;
-               }
-               
-               /**
-                * @return the group of the element
-                */
-               QString group() const {
-                       return m_group;
-               }
-               
-               int period() const {
-                       return m_period;
-               }
-
-               QString family() const {
-                       return m_family;
-               }
-               
-               /**
-                * @return the acidic behavior of the element
-                */
-               QString acidicbeh() const {
-                       return m_acidbeh;
-               }
-
-               /**
-                * @return the oxydationstages of the element
-                */
-               QString oxstage() const {
-                       return m_oxstage;
-               }
-               
-               /**
-                * @return the orbits of the element. The QString is already
-                * parsed so that the numbers are superscripts and the first
-                * block is bold.
-                * @param canBeEmpty specifies if the string returned can be
-                * empty instead of a "Unknown structure" one.
-                */
-               QString parsedOrbits( bool canBeEmpty = false );
-               
-               /**
-                * @return the boiling point of the element in Kelvin
-                */
-               double boiling() const {
-                       return m_BP;
-               }
-               
-               /**
-                * @return the melting point of the element in Kelvin
-                */
-               double melting() const {
-                       return m_MP;
-               }
-               
-               /**
-                * @return the electronegativity of the element in the
-                * Pauling-scale
-                */
-               double electroneg() const {
-                       return m_EN;
-               }
-
-               /**
-               * @return the electroaffinity of the element
-               */
-               double electroaf() const {
-                       return m_EA;
-               }
-
-               /**
-                * @return the atomic mass of the element in units
-                */
-               double mass() const {
-                       return m_mass;
-               }
-               
-               /**
-                * @return the density of the element in gramms per mol
-                */
-               double density() const {
-                       return m_Density;
-               }
-               
-               /**
-                * @return the radius of the element in picometers
-                */
-               double radius( RADIUSTYPE type );
-               
-               /**
-                * @return the mean mass of the element
-                */
-               double meanmass();
-
-               int x, y; //for the RegularPeriodicTableView
-
-               /**
-                * adjusts the units for the data. The user can
-                * for example define if Fahrenheit, Kelvin or 
-                * Degrees Celsius should be used for the temperature. 
-                * This method takes care of that and adjust the 
-                * values.
-                * @param type the TYPE of the data
-                * @return the adjusted datastring
-                */
-               const QString adjustUnits( const int type );
-
-               const QString adjustRadius( RADIUSTYPE rtype );
-
-               /**
-                * adjusts the units for the data. The user can
-                * for example define if Fahrenheit, Kelvin or 
-                * Degrees Celsius should be used for the temperature. 
-                * This method takes care of that and adjust the 
-                * values. Depending on @p type a unit will be
-                * added to the adjusted value.
-                * @param type the TYPE of the data
-                * @param value the value of the data. 
-                * @return the adjusted datastring
-                */
-               const QString adjustUnits( const int type, double value );
-
-               /**
-                * types of datas
-                */
-               enum TYPE
-               {
-                       NOGRADIENT = 0,
-                       ATOMICRADIUS,
-                       COVALENTRADIUS,
-                       VDWRADIUS,
-                       MASS,
-                       DENSITY,
-                       BOILINGPOINT,
-                       MELTINGPOINT,
-                       EN,
-                       EA,
-                       DATE,
-                       IE,
-                       IONICRADIUS
-               };
-
-               QPoint pos() const;
-               QPoint coords() const;
-
-               /**
-                * accessor for the element's color
-                */
-               QColor elementColor() const {
-                       return m_Color; 
-               }
-
-               void setupXY();
-
-       private:
-               /**
-                * the integer num represents the number of the element
-                */
-               int m_ElementNumber;
-
-               Spectrum *m_spectrum;
-
-               bool m_hasSpectrum;
-
-               QList<Isotope*> m_isotopeList;
-
-               QList<double> m_spectrumList;
-       
-               QColor m_Color;
-
-               int xPos() const;
-               int yPos() const;
-
-               double  m_mass,
-                       m_MP,
-                       m_BP,
-                       m_EN,
-                       m_EA,
-                       m_Density,
-                       m_RadiusAR,
-                       m_RadiusCR,
-                       m_RadiusVDW,
-                       m_RadiusIon;
-               
-
-               int     m_number,
-                       m_date,
-                       m_biological,
-                       m_period,
-                       m_abundance;
-
-               QString m_symbol,
-                       m_name,
-                       m_origin,
-                       m_oxstage,
-                       m_block,
-                       m_group,
-                       m_family,
-                       m_acidbeh,
-                       m_orbits,
-                       m_isotopes,
-                       m_scientist,
-                       m_crystalstructure,
-                       m_ionvalue;
-
-               bool m_artificial,
-                        m_radioactive;
-
-               doubleList m_ionenergies;
-               
-       public:
-               /**
-                * draw the rectangle with the information
-                * @param p painter to do the drawing on
-                * @param value the value to display as text
-                * @param c the color used to paint the element
-                */
-               virtual void drawGradient( QPainter* p, const QString& value, const QColor& c);
-               
-               /**
-                * Draw the Element grayed out. Used in the timeline
-                * @param p the painter used for the painting
-                */
-               virtual void drawGrayedOut( QPainter* p );
-               
-               /**
-                * draw the rectangle with the information
-                * @param p painter to do the drawing on
-                * @param simple if True more information will be shown
-                * @param isCrystal whether the elements should draw its crystal structure
-                */
-               virtual void drawSelf( QPainter* p, bool simple = false, bool isCrystal = false );
-
-               virtual void drawStateOfMatter( QPainter* p, double temperature );
-};
-
-
-#endif
diff --git a/kalzium/src/isotope.cpp b/kalzium/src/isotope.cpp
deleted file mode 100644 (file)
index 420c32c..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005 by Carsten Niehaus                                 *
- *   cniehaus@kde.org                                                      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
- ***************************************************************************/
-#include "isotope.h"
-
-#include <kdebug.h>
-#include <klocale.h>
-
-Isotope::Isotope( int neutrons, int protones,  double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay, double alphapercentage, double betapluspercentage, double betaminuspercentage, double ecpercentage, QString spin, QString magmoment)
-{
-       m_neutrons = neutrons;
-       m_protones = protones;
-       m_percentage = percentage;
-       m_halflife = halflife;
-       m_format = format;
-       m_weight = weight;
-       m_alphadecay = alphadecay;
-       m_betaplusdecay = betaplusdecay;
-       m_betaminusdecay = betaminusdecay;
-       m_ecdecay = ecdecay;
-       
-       m_spin = spin;
-       m_magmoment = magmoment;
-
-       m_alphapercentage = alphapercentage;
-       m_betapluspercentage = betapluspercentage;
-       m_betaminuspercentage = betaminuspercentage;
-       m_ecpercentage = ecpercentage;
-}
-
-QString Isotope::halflifeAsString()
-{
-       QString halflife;
-
-       if ( !seconds() )//years
-       {
-               if ( m_halflife > 1000000 )
-                       halflife = i18n("%1 million years").arg( m_halflife/1000000.0 );
-               if ( m_halflife > 1000000000 )
-                       halflife = i18n("%1 billion years").arg( m_halflife/1000000000.0 );
-               else
-                       halflife = i18n("%1 years").arg( m_halflife );
-       }
-       else
-       {
-               if ( m_halflife < 120 )
-                       halflife = i18n("%1 seconds").arg( m_halflife );
-               else if ( m_halflife > 1000 )
-                       halflife = i18n("%1 minutes").arg( m_halflife/60.0 );
-               else if ( m_halflife > 3600 )
-                       halflife = i18n("%1 hours").arg( m_halflife/( 60*60 ) );
-               if ( m_halflife > 86400 )   //one day
-                       halflife = i18n("%1 days").arg( m_halflife/( 60*60*24 ) );
-               if ( m_halflife > ( 31536000 * 2 ) ) //two year
-                       halflife = i18n("%1 years").arg( m_halflife/( 3600.0*365 ));
-       }
-
-       return halflife;
-}
diff --git a/kalzium/src/isotope.h b/kalzium/src/isotope.h
deleted file mode 100644 (file)
index feed345..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-#ifndef ISOTOPE_H
-#define ISOTOPE_H
-/***************************************************************************
- *   Copyright (C) 2005 by Carsten Niehaus                                 *
- *   cniehaus@kde.org                                                      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
- ***************************************************************************/
-
-#include <qstring.h>
-
-/**
- * @author Carsten Niehaus
- * @author Jörg Buchwald
- *
- * This class represents an Isotope with all its properties
- */
-class Isotope
-{
-       public:
-               Isotope( int neutrons, 
-                               int protones, 
-                               double percentage, 
-                               double weight, 
-                               double halflife, 
-                               QString format, 
-                               double alphadecay, 
-                               double betaplusdecay, 
-                               double betaminusdecay, 
-                               double ecdecay, 
-                               double alphapercentage, 
-                               double betapluspercentage, 
-                               double betaminuspercentage, 
-                               double ecpercentage, 
-                               QString spin, 
-                               QString magmoment);
-
-               bool seconds() const{
-                       if ( m_format == "seconds" )
-                               return true;
-                       else
-                               return false;
-               }
-
-               /**
-                * @return the halflife period of the isotope it if has one. The format
-                * is defined by seconds()
-                */
-               double halflife() const{
-                       return m_halflife;
-               }
-               
-               double percentage() const{
-                       return m_percentage;
-               }
-
-               /**
-                * @return the number of neutrons the isotope has
-                */
-               int neutrons() const{
-                       return m_neutrons;
-               }
-
-               /**
-                * @return the number of protones the isotope has
-                */
-               int protones() const{
-                       return m_protones;
-               }
-
-               /**
-                * @return the number of nucleons of ths isotope
-                */
-               int nucleons() const{
-                       return m_protones+m_neutrons;
-               }
-
-               /**
-                * the weight of the isotope
-                */
-               double weight() const{
-                       return m_weight;
-               }
-               
-               /**
-                * @return the energy of isotope's alpha decay 
-                */
-               double alphadecay() const{
-                       return m_alphadecay;
-               }
-               
-               /**
-                * @return the energy of isotope's beta plus decay
-                */
-               double betaplusdecay() const{
-                       return m_betaplusdecay;
-               }
-               
-               /**
-                * @return the energy of isotope's beta-minus decay
-                */
-               double betaminusdecay() const{
-                       return m_betaminusdecay;
-               }
-               
-               /**
-                * @return the energy of isotope's EC- decay
-                */
-               double ecdecay() const{
-                       return m_ecdecay;
-               }
-       
-               QString spin() const{
-                       return m_spin;
-               }
-               
-               QString magmoment() const{
-                       return m_magmoment;
-               }
-
-               /**
-                * @return the halflife as a QString. The format will be
-                * appended, for example "seconds" or "years" depending 
-                * on the timeframe
-                */
-               QString halflifeAsString();
-
-               /**
-                * @return the percentage of the betaminus decay
-                */
-               double betaminuspercentage() const{
-                       return m_betaminuspercentage;
-               }
-               
-               /**
-                * @return the percentage of the betaplus decay
-                */
-               double betapluspercentage() const{
-                       return m_betapluspercentage;
-               }
-               
-               /**
-                * @return the percentage of the alpha decay
-                */
-               double alphapercentage() const{
-                       return m_alphapercentage;
-               }
-               
-               /**
-                * @return the percentage of the EC decay
-                */
-               double ecpercentage() const{
-                       return m_ecpercentage;
-               }
-
-       private:
-               /**
-                * it is either "years" or "seconds". Usually we use seconds. But some
-                * isotopes have half-lifes of billion of years. This simply
-                * doesn't fit into a unsigned int or double
-                */
-               QString m_format;
-
-               /**
-                * the weight of the isotope
-                */
-               double m_weight;
-
-               /**
-                * the half-life of an isotope, usually in seconds
-                * @see m_format
-                */
-               double m_halflife;
-               
-               /**
-                * If 95.2% of the isotopes are of this type, this
-                * variable will have the value 95.2
-                */
-               double m_percentage;
-
-               /**
-                * the number of neutrons
-                */
-               int m_neutrons;
-
-               /**
-                * the number of protones
-                */
-               int m_protones;
-       
-               ///Specify if the decay is the energy
-               double  m_alphadecay;
-               ///Specify if the decay is the energy
-               double  m_betaplusdecay;
-               ///Specify if the decay is the energy
-               double  m_betaminusdecay;
-               ///Specify if the decay is the energy
-               double  m_ecdecay;
-               
-               
-               /**
-               *spin and parity
-               */
-               QString m_spin;
-               
-               /**
-               * magnetic moment
-               */
-               QString m_magmoment;
-
-               /**
-                * the percentage with which the istope decays as alpha-rays
-                */
-               double m_alphapercentage;
-               
-               /**
-                * the percentage with which the istope decays as beta-plus 
-                */
-               double m_betapluspercentage;
-               
-               /**
-                * the percentage with which the istope decays as beta-minus
-                */
-               double m_betaminuspercentage;
-               /**
-                * the percentage with which the istope decays as EC
-                */
-               double m_ecpercentage;
-};
-
-#endif // ISOTOPE_H
diff --git a/kalzium/src/spectrum.cpp b/kalzium/src/spectrum.cpp
deleted file mode 100644 (file)
index 99a7199..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005 by Carsten Niehaus                                 *
- *   cniehaus@kde.org                                                      *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.             *
- ***************************************************************************/
-#include "spectrum.h"
-
-#include "element.h"
-
-#include <klocale.h>
-
-#include <math.h>
-
-double Spectrum::minBand()
-{
-       double value = ( *m_bandlist.begin() )->wavelength;
-       QList<band*>::const_iterator it = m_bandlist.begin();
-       const QList<band*>::const_iterator itEnd = m_bandlist.end();
-       for (;it!=itEnd;++it)
-       {
-               if ( value > ( *it )->wavelength )
-                       value = ( *it )->wavelength;
-       }
-       return value;
-}
-
-double Spectrum::maxBand()
-{
-       double value = ( *m_bandlist.begin() )->wavelength;
-       QList<band*>::const_iterator it = m_bandlist.begin();
-       const QList<band*>::const_iterator itEnd = m_bandlist.end();
-       for (;it!=itEnd;++it)
-       {
-               if ( value < ( *it )->wavelength )
-                       value = ( *it )->wavelength;
-       }
-       return value;
-}
-
-
-Spectrum* Spectrum::adjustToWavelength( double min, double max )
-{
-       Spectrum *spec = new Spectrum();
-
-       QList<band*>::const_iterator it = m_bandlist.begin();
-       const QList<band*>::const_iterator itEnd = m_bandlist.end();
-
-       for ( ; it != itEnd; ++it )
-       {
-               if ( ( *it )->wavelength < min || ( *it )->wavelength > max )
-                       continue;
-
-               spec->addBand( *it );
-       }
-
-       spec->adjustMinMax();
-
-       return spec;
-}
-
-void Spectrum::adjustIntensities()
-{
-       int maxInt = 0;
-       QList<band*>::Iterator it = m_bandlist.begin();
-       const QList<band*>::Iterator itEnd = m_bandlist.end();
-
-       //find the highest intensity
-       for ( ; it != itEnd; ++it )
-       {
-               if ( ( *it )->intensity > maxInt )
-                       maxInt = ( *it )->intensity;
-       }
-
-       //check if an adjustment is needed or not
-       if ( maxInt == 1000 ) return;
-
-       double max = ( double ) maxInt;
-
-       //now adjust the intensities.
-       it = m_bandlist.begin();
-       for ( ; it != itEnd; ++it )
-       {
-               double curInt = ( ( double )( *it )->intensity );
-               
-               double newInt = max*1000/curInt;
-               ( *it )->intensity = ( int ) round( newInt );
-       }
-}
-
-QList<double> Spectrum::wavelengths( double min, double max )
-{
-       QList<double> list;
-       
-       QList<band*>::const_iterator it = m_bandlist.begin();
-       const QList<band*>::const_iterator itEnd = m_bandlist.end();
-
-       for ( ; it != itEnd; ++it )
-       {
-               if ( ( *it )->wavelength < min || ( *it )->wavelength > max )
-                       continue;
-
-               list.append( ( *it )->wavelength );
-       }
-
-       return list;
-}
-
-QString Spectrum::bandsAsHtml()
-{
-       QString html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>Chemical data</title>i<body>";
-
-       html += "<table>";
-       
-       QList<band*>::const_iterator it = m_bandlist.begin();
-       const QList<band*>::const_iterator itEnd = m_bandlist.end();
-       for (;it!=itEnd;++it)
-       {
-               html += QString( "<tr>" )
-                    + "<td>" + i18n( "Wavelength: %1 nm" ).arg( ( *it )->wavelength ) + "</td>"
-                    + "<td>" + i18n( "Intensity: %1" ).arg( ( *it )->intensity ) + "</td>"
-                    + "<td>" + i18n( "Probability: %1 10<sup>8</sup>s<sup>-1</sup>" ).arg( ( *it )->aki ) + "</td>"
-                    + "<td>" + i18n( "Energy 1: %1" ).arg( ( *it )->energy1 ) + "</td>"
-                    + "<td>" + i18n( "Energy 2: %1" ).arg( ( *it )->energy2 ) + "</td>"
-                    + "<td>" + i18n( "Electron Configuration 1: %1" ).arg( ( *it )->electronconfig1 ) + "</td>"
-                    + "<td>" + i18n( "Electron Configuration 2: %1" ).arg( ( *it )->electronconfig2 ) + "</td>"
-                    + "<td>" + i18n( "Term 1: %1" ).arg( ( *it )->term1 ) + "</td>"
-                    + "<td>" + i18n( "Term 2: %1" ).arg( ( *it )->term2 ) + "</td>"
-                    + "<td>" + i18n( "J 1: %1" ).arg( ( *it )->J1 ) + "</td>"
-                    + "<td>" + i18n( "J 2: %1" ).arg( ( *it )->J2 ) + "</td>"
-                    + "</tr>\n";
-       }
-
-       html += "</table>";
-
-       html += "</body></html>";
-       return html;
-}
-
diff --git a/kalzium/src/spectrum.h b/kalzium/src/spectrum.h
deleted file mode 100644 (file)
index 8ef4774..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-#ifndef SPECTRUM_H
-#define SPECTRUM_H
-/***************************************************************************
- *   Copyright (C) 2005 by Carsten Niehaus                                 *
- *   cniehaus@kde.org                                                      *
- *   
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.             *
- ***************************************************************************/
-
-#include <qlist.h>
-#include <qstring.h>
-
-class Element;
-
-/**
- * @author Carsten Niehaus
- *
- * This class represents an spectrum with all its properties
- */
-class Spectrum
-{
-       public:
-               /**
-                * This spectrum doesn't belong to any element
-                */
-               Spectrum(){};
-               
-               /**
-                * public destructor
-                */
-               ~Spectrum(){};
-
-               /**
-                * a band is one line in the spectrum of an element
-                */
-               class band
-               {
-                       public:
-                               band(){
-                                       wavelength = -1.0;
-                                       aki = -1.0;
-                                       energy1 = -1.0;
-                                       energy2 = -1.0;
-                                       intensity = -1;
-                               }
-
-                       ///in nm
-                       double wavelength;
-
-                       ///Transition Probabilities
-                       ///10^8s-1  (1000000000 per second)
-                       double aki;
-
-                       ///number of energylevels per centimeter
-                       double energy1;
-
-                       ///number of energylevels per centimeter
-                       double energy2;
-
-                       ///relative. The highest is per definition 1000
-                       int intensity;
-
-                       QString electronconfig1;
-                       QString electronconfig2;
-                       QString term1;
-                       QString term2;
-                       QString J1;
-                       QString J2;
-               };
-
-               /**
-                * adds the band @p b to the internal
-                * lists of bands
-                */
-               void addBand( Spectrum::band* b ){
-                       if ( b )
-                               m_bandlist.append( b );
-               }
-
-               /**
-                * @param min the lowest allowed wavalength in nanometer
-                * @param max the highest allowed wavalength in nanometer
-                * 
-                * @returns a spectrum with the wavelength in the range
-                * of @p min to @p max. The intensities are readjusted
-                * so that the biggest intensity is again 1000 and the 
-                * others are adopted.
-                */
-               Spectrum* adjustToWavelength( double min, double max );
-
-               /**
-                * sets the highest intensity to 1000 and adjusts the
-                * others
-                */
-               void adjustIntensities();
-
-               /**
-                * @param min the lowest allowed wavalength in nanometer
-                * @param max the highest allowed wavalength in nanometer
-                * 
-                * @return the wavelength in a QList<double>
-                */
-               QList<double> wavelengths( double min, double max );
-
-               /**
-                * @return the smallest wavelength
-                */
-               double min() const{
-                       return m_min;
-               }
-               
-               /**
-                * @return the highest wavelength
-                */
-               double max() const{
-                       return m_max;
-               }
-
-               /**
-                * @return the list of bands of the spectrum
-                */
-               QList<Spectrum::band*> bandlist(){
-                       return m_bandlist;
-               }
-               
-               QList<Spectrum::band*> bandList(){
-                       return bandlist();
-               }
-       
-               /**
-                * cache the values of the biggest and
-                * smallest wavelenght
-                */
-               void adjustMinMax(){
-                       m_min = minBand();
-                       m_max = maxBand();
-               }
-
-               /**
-                * @return the data of a spectrum as HTML code
-                */
-               QString bandsAsHtml();
-
-               /**
-                * @return the parent element of this spectrum
-                */
-               Element* parentElement()
-               { return m_parentElement; }
-
-       private:
-               /**
-                * @return the smallest wavelength
-                */
-               double minBand();
-               
-               /**
-                * @return the biggest wavelength
-                */
-               double maxBand();
-
-               /**
-                * the internal dataset
-                */
-               QList<band*> m_bandlist;
-
-               /**
-                * the cached values of the highest and lowest wavelength
-                */
-               double m_max, m_min;
-
-               Element* m_parentElement;
-};
-#endif // SPECTRUM_H
diff --git a/kalzium/src/tempunit.cpp b/kalzium/src/tempunit.cpp
deleted file mode 100644 (file)
index 55d3630..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-/***************************************************************************
- *   Copyright (C) 2005 by Pino Toscano                                    *
- *   toscano.pino@tiscali.it                                               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
- ***************************************************************************/
-
-#include "tempunit.h"
-
-double TempUnit::convert( double value, TempUnit::Unit from, TempUnit::Unit to )
-{
-       /**
-        * These are the four formula needed to convert from
-        * Kelvin the the other units:
-
-        Kelvin  Celsius  °C = K - 273,15
-        Kelvin  Fahrenheit  °F = K × 1,8 - 459,67
-        Kelvin  Rankine  °Ra = K × 1,8
-        Kelvin  Reaumur  °R = ( K - 273,15 ) × 0,8
-        */
-
-       if ( from != Kelvin )
-               value = convertToKelvin( value, from );
-
-       //now 'value' is in Kelvin
-       switch( to )
-       {
-               case Celsius:
-                       return value - 273.16;
-               case Fahrenheit:
-                       return value * 1.8 - 459.67;
-               case Rankine:
-                       return value * 1.8;
-               case Reaumur:
-                       return ( value - 273.15 )* 0.8;
-               case Kelvin:
-                       return value;
-       }
-       return value;
-}
-
-double TempUnit::convertToKelvin( const double value, TempUnit::Unit from )
-{
-       switch( from )
-       {
-               case Kelvin:
-                       return value;
-               case Celsius:
-                       return value + 273.16;
-               case Fahrenheit:
-                       return ( value + 459.67 )/1.8;
-               case Rankine:
-                       return value / 1.8;
-               case Reaumur:
-                       return ( value * 1.25 ) + 273.15;
-       }
-       return value;
-}
-
-double TempUnit::convert( const double value, int from, int to )
-{
-       return convert( value, (TempUnit::Unit)from, (TempUnit::Unit)to );
-}
-
-QStringList TempUnit::unitListSymbols()
-{
-       QStringList list;
-       list << "K";
-       list << QString::fromUtf8("°C");
-       list << QString::fromUtf8("°F");
-       list << QString::fromUtf8("°Ra");
-       list << QString::fromUtf8("°R");
-       return list;
-}
-
-QString TempUnit::unitListSymbol( int i )
-{
-       QStringList l = unitListSymbols();
-       if ( ( i < 0 ) || ( i >= (int)l.count() ) )
-               return l[0];
-       return l[i];
-}
-
-QPair<double, double> TempUnit::rangeForUnit( TempUnit::Unit u )
-{
-       switch( u )
-       {
-               case Kelvin:
-               {
-                       return QPair<double, double>( 0.0, 5000.0 );
-                       break;
-               }
-               case Celsius:
-               {
-                       return QPair<double, double>( -273.16, 4726.84 );
-                       break;
-               }
-               case Fahrenheit:
-               {
-                       return QPair<double, double>( -459.67, 8540.33 );
-                       break;
-               }
-               case Rankine:
-               {
-                       return QPair<double, double>( 0.0, 9000.0 );
-                       break;
-               }
-               case Reaumur:
-               {
-                       return QPair<double, double>( -218.52, 3781.48 );
-                       break;
-               }
-       }
-       return QPair<double, double>( 0.0, 5000.0 );
-}
-
-QPair<double, double> TempUnit::rangeForUnit( int u )
-{
-       return rangeForUnit( (TempUnit::Unit)u );
-}
-
diff --git a/kalzium/src/tempunit.h b/kalzium/src/tempunit.h
deleted file mode 100644 (file)
index db4c366..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef TEMPUNIT_H
-#define TEMPUNIT_H
-/***************************************************************************
- *   Copyright (C) 2005 by Pino Toscano                                    *
- *   toscano.pino@tiscali.it                                               *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program; if not, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
- ***************************************************************************/
-
-#include <qpair.h>
-#include <qstringlist.h>
-
-/**
- * This class obtains all the info needed to work with the units of measure
- * of temperature.
- *
- * It has static methods you can call to get the various infos. The most
- * important methods is convert(), that performs conversions.
- *
- * @author Pino Toscano
- */
-class TempUnit
-{
-       public:
-
-               enum Unit { Kelvin = 0, 
-                       Celsius, 
-                       Fahrenheit,
-                       Rankine,
-                       Reaumur 
-               };
-
-               /**
-                * Convert the temperature unit @p value given in the unit
-                * @p from to the unit @p to.
-                *
-                * @return the value converted
-                */
-               static double convert( double value,
-                                      TempUnit::Unit from,
-                                      TempUnit::Unit to );
-
-
-               /**
-                * @param value the temperature to convert
-                * @param from the unit from which to convert
-                *
-                * @return the temperature to Kelvin
-                */
-               static double convertToKelvin( const double value,
-                               TempUnit::Unit from );
-               
-               /**
-                * @overload
-                */
-               static double convert( const double value,
-                                      int from,
-                                      int to );
-
-               /**
-                * @return a list with the symbols of the temperature units
-                * we support
-                */
-               static QStringList unitListSymbols();
-
-               /**
-                * @return the symbol of the @p i -th unit 
-                */
-               static QString unitListSymbol( int i );
-
-               static QPair<double, double> rangeForUnit( TempUnit::Unit u );
-
-               /**
-                * @overload
-                */
-               static QPair<double, double> rangeForUnit( int u );
-
-};
-#endif // TEMPUNIT_H