From 1c7d2b7022f1df491f6452a8abe85b195d7a9797 Mon Sep 17 00:00:00 2001 From: Carsten Niehaus Date: Tue, 21 Feb 2006 17:24:31 +0000 Subject: [PATCH] Have to store the total number of nuclons for SAX2-reasons... svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=512050 --- libscience/isotope.cpp | 13 +++++++------ libscience/isotope.h | 3 +-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libscience/isotope.cpp b/libscience/isotope.cpp index 452eed1..0d38c38 100644 --- a/libscience/isotope.cpp +++ b/libscience/isotope.cpp @@ -101,20 +101,21 @@ QString Isotope::parentElementSymbol() const void Isotope::setNucleons( int number ) { - int protons = m_identifier->value().toInt(); - int neutrons = number - protons; - m_nucleons.protons = protons; - m_nucleons.neutrons = neutrons; + m_numberOfNucleons = number; } int Isotope::nucleons() const { - return m_nucleons.neutrons + m_nucleons.protons; + return m_numberOfNucleons; } Isotope::Nucleons Isotope::nucleonsAfterDecay( Decay kind ) { - Nucleons n = m_nucleons; + Isotope::Nucleons n; + int protons = m_identifier->value().toInt(); + int neutrons = m_numberOfNucleons - protons; + n.protons = protons; + n.neutrons = neutrons; switch ( kind ) { diff --git a/libscience/isotope.h b/libscience/isotope.h index dae6b7a..db6789e 100644 --- a/libscience/isotope.h +++ b/libscience/isotope.h @@ -148,8 +148,7 @@ class Isotope ChemicalDataObject* m_betaminus; ChemicalDataObject* m_alpha; - Isotope::Nucleons m_nucleons; - + int m_numberOfNucleons; }; #endif // ISOTOPE_H -- 2.47.3