• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kalzium/libscience

  • sources
  • kde-4.12
  • kdeedu
  • kalzium
  • libscience
isotope.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Carsten Niehaus <cniehaus@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18  ***************************************************************************/
19 #include "isotope.h"
20 #include "chemicaldataobject.h"
21 
22 #include <kdebug.h>
23 
24 Isotope::Isotope()
25 {
26 }
27 
28 Isotope::~Isotope()
29 {
30 }
31 
32 void Isotope::addData( ChemicalDataObject o )
33 {
34  if ( o.type() == ChemicalDataObject::exactMass )
35  m_mass = o;
36  else if ( o.type() == ChemicalDataObject::atomicNumber )
37  m_identifier = o;
38  else if ( o.type() == ChemicalDataObject::symbol )
39  m_parentElementSymbol = o;
40  else if ( o.type() == ChemicalDataObject::spin )
41  m_spin = o;
42  else if ( o.type() == ChemicalDataObject::magneticMoment )
43  m_magmoment = o;
44  else if ( o.type() == ChemicalDataObject::relativeAbundance )
45  m_abundance = o;
46  else if ( o.type() == ChemicalDataObject::halfLife )
47  m_halflife = o;
48  else if ( o.type() == ChemicalDataObject::ecDecay )
49  m_ecdecay = o;
50  else if ( o.type() == ChemicalDataObject::ecDecayLikeliness )
51  m_eclikeliness = o;
52  else if ( o.type() == ChemicalDataObject::betaplusDecay )
53  m_betaplusdecay = o;
54  else if ( o.type() == ChemicalDataObject::betaplusDecayLikeliness )
55  m_betapluslikeliness = o;
56  else if ( o.type() == ChemicalDataObject::betaminusDecay )
57  m_betaminusdecay = o;
58  else if ( o.type() == ChemicalDataObject::betaminusDecayLikeliness )
59  m_betaminuslikeliness = o;
60  else if ( o.type() == ChemicalDataObject::alphaDecay )
61  m_alphadecay = o;
62  else if ( o.type() == ChemicalDataObject::alphaDecayLikeliness )
63  m_alphalikeliness = o;
64 
65 }
66 
67 double Isotope::mass() const
68 {
69  return m_mass.value().toDouble();
70 }
71 
72 QString Isotope::errorMargin() const
73 {
74  return m_mass.errorValue().toString();
75 }
76 
77 int Isotope::parentElementNumber() const
78 {
79  return m_identifier.value().toInt();
80 }
81 
82 QString Isotope::spin() const
83 {
84  return m_spin.value().toString();
85 }
86 
87 QString Isotope::magmoment() const
88 {
89  return m_magmoment.value().toString();
90 }
91 
92 QString Isotope::abundance() const
93 {
94  return m_abundance.value().toString();
95  return QString();
96 }
97 
98 double Isotope::halflife() const
99 {
100  return m_halflife.value().toDouble();
101 }
102 
103 QString Isotope::halflifeUnit() const
104 {
105  return m_halflife.unitAsString();
106 }
107 
108 double Isotope::ecdecay() const
109 {
110  return m_ecdecay.value().toDouble();
111 }
112 double Isotope::eclikeliness() const
113 {
114  return m_eclikeliness.value().toDouble();
115 }
116 double Isotope::betaplusdecay() const
117 {
118  return m_betaplusdecay.value().toDouble();
119 }
120 
121 double Isotope::betapluslikeliness() const
122 {
123  return m_betapluslikeliness.value().toDouble();
124 }
125 
126 double Isotope::betaminusdecay() const
127 {
128  return m_betaminusdecay.value().toDouble();
129 }
130 
131 double Isotope::betaminuslikeliness() const
132 {
133  return m_betaminuslikeliness.value().toDouble();
134 }
135 
136 double Isotope::alphadecay() const
137 {
138  return m_alphadecay.value().toDouble();
139 }
140 
141 double Isotope::alphalikeliness() const
142 {
143  return m_alphalikeliness.value().toDouble();
144 }
145 
146 QString Isotope::parentElementSymbol() const
147 {
148  return m_parentElementSymbol.value().toString();
149 }
150 
151 void Isotope::setNucleons( int number )
152 {
153  m_numberOfNucleons = number;
154 }
155 
156 int Isotope::nucleons() const
157 {
158  return m_numberOfNucleons;
159 }
160 
161 Isotope::Nucleons Isotope::nucleonsAfterDecay( Decay kind )
162 {
163  Isotope::Nucleons n;
164  int protons = m_identifier.value().toInt();
165  int neutrons = m_numberOfNucleons - protons;
166  n.protons = protons;
167  n.neutrons = neutrons;
168 
169  switch ( kind )
170  {
171  case ALPHA:
172  n.protons-=2;
173  break;
174  case BETAMINUS:
175  n.protons+=1;
176  n.neutrons-=1;
177  break;
178  case BETAPLUS:
179  n.protons-=1;
180  break;
181  case EC:
182  n.protons-=1;
183  n.neutrons+=1;
184  break;
185  }
186 
187  return n;
188 }
ChemicalDataObject::spin
The spin.
Definition: chemicaldataobject.h:73
Isotope::BETAMINUS
beta minus decay
Definition: isotope.h:167
Isotope::setNucleons
void setNucleons(int number)
Set the number of nucleons of the isotope to .
Definition: isotope.cpp:151
Isotope::Nucleons::protons
int protons
the number of protons of the isotope
Definition: isotope.h:59
ChemicalDataObject::type
BlueObelisk type() const
Definition: chemicaldataobject.cpp:128
Isotope::Isotope
Isotope()
Constructs a new empty isotope.
Definition: isotope.cpp:24
ChemicalDataObject::unitAsString
QString unitAsString() const
Definition: chemicaldataobject.cpp:173
Isotope::Nucleons
This struct stores the information how the nucleons in the isotopes are split into neutrons and proto...
Definition: isotope.h:49
Isotope::betaminuslikeliness
double betaminuslikeliness() const
Definition: isotope.cpp:131
Isotope::errorMargin
QString errorMargin() const
Definition: isotope.cpp:72
isotope.h
Isotope::ALPHA
alpha decay
Definition: isotope.h:165
Isotope::EC
ec decay
Definition: isotope.h:168
Isotope::mass
double mass() const
Definition: isotope.cpp:67
ChemicalDataObject::alphaDecayLikeliness
The percentage of alphadecay.
Definition: chemicaldataobject.h:76
ChemicalDataObject::symbol
the symbol of the element
Definition: chemicaldataobject.h:50
ChemicalDataObject::errorValue
QVariant errorValue() const
Definition: chemicaldataobject.cpp:138
Isotope::abundance
QString abundance() const
Definition: isotope.cpp:92
ChemicalDataObject::ecDecay
The decayenergy of ecminusdecay in MeV.
Definition: chemicaldataobject.h:83
Isotope::Nucleons::neutrons
int neutrons
the number of neutrons of the isotope
Definition: isotope.h:54
Isotope::Decay
Decay
This enum stores the different kinds of decay.
Definition: isotope.h:163
Isotope::alphalikeliness
double alphalikeliness() const
Definition: isotope.cpp:141
ChemicalDataObject::relativeAbundance
The abundance, relative to 100.
Definition: chemicaldataobject.h:72
ChemicalDataObject
A ChemicalDataObject is an object which contains information about a chemical element.
Definition: chemicaldataobject.h:38
Isotope::halflifeUnit
QString halflifeUnit() const
Definition: isotope.cpp:103
chemicaldataobject.h
ChemicalDataObject::magneticMoment
The magnetic dipole moment.
Definition: chemicaldataobject.h:74
Isotope::eclikeliness
double eclikeliness() const
Definition: isotope.cpp:112
Isotope::betapluslikeliness
double betapluslikeliness() const
Definition: isotope.cpp:121
Isotope::betaplusdecay
double betaplusdecay() const
Definition: isotope.cpp:116
Isotope::~Isotope
~Isotope()
Destructor.
Definition: isotope.cpp:28
ChemicalDataObject::betaminusDecay
The decayenergy of betaminusdecay in MeV.
Definition: chemicaldataobject.h:81
Isotope::parentElementSymbol
QString parentElementSymbol() const
If the isotope belongs to Iron, this method will return "Fe".
Definition: isotope.cpp:146
Isotope::addData
void addData(ChemicalDataObject o)
add the ChemicalDataObject o
Definition: isotope.cpp:32
Isotope::parentElementNumber
int parentElementNumber() const
If the isotope belongs to Iron, this method will return "26".
Definition: isotope.cpp:77
Isotope::spin
QString spin() const
Definition: isotope.cpp:82
ChemicalDataObject::betaplusDecayLikeliness
The percentage of betaplusdecay.
Definition: chemicaldataobject.h:78
ChemicalDataObject::halfLife
The halflife.
Definition: chemicaldataobject.h:75
Isotope::nucleonsAfterDecay
Isotope::Nucleons nucleonsAfterDecay(Decay kind)
Definition: isotope.cpp:161
ChemicalDataObject::alphaDecay
The decayenergy of alphadecay in MeV.
Definition: chemicaldataobject.h:77
ChemicalDataObject::atomicNumber
The atomic number of the element.
Definition: chemicaldataobject.h:49
ChemicalDataObject::ecDecayLikeliness
The percentage of ecdecay.
Definition: chemicaldataobject.h:82
ChemicalDataObject::exactMass
exact masses of the most common isotopes for each element
Definition: chemicaldataobject.h:53
Isotope::halflife
double halflife() const
Definition: isotope.cpp:98
Isotope::alphadecay
double alphadecay() const
Definition: isotope.cpp:136
Isotope::magmoment
QString magmoment() const
Definition: isotope.cpp:87
ChemicalDataObject::value
QVariant value() const
Every ChemicalDataObject contains one data.
Definition: chemicaldataobject.cpp:133
Isotope::betaminusdecay
double betaminusdecay() const
Definition: isotope.cpp:126
ChemicalDataObject::betaminusDecayLikeliness
The percentage of betaminusdecay.
Definition: chemicaldataobject.h:80
Isotope::ecdecay
double ecdecay() const
Definition: isotope.cpp:108
Isotope::nucleons
int nucleons() const
Definition: isotope.cpp:156
ChemicalDataObject::betaplusDecay
The decayenergy of betaplusdecay in MeV.
Definition: chemicaldataobject.h:79
Isotope::BETAPLUS
beta plus decay
Definition: isotope.h:166
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:31 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalzium/libscience

Skip menu "kalzium/libscience"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal