File indexing completed on 2024-04-14 03:59:18
0001 /* 0002 This file is part of the KDE project "KAtomic" 0003 0004 SPDX-FileCopyrightText: Andreas Wüst <AndreasWuest@gmx.de> 0005 SPDX-FileCopyrightText: Stephan Kulow <coolo@kde.org> 0006 SPDX-FileCopyrightText: 2006-2007 Dmitry Suzdalev <dimsuz@gmail.com> 0007 0008 SPDX-License-Identifier: GPL-2.0-or-later 0009 */ 0010 0011 #ifndef MOLECULE_H 0012 #define MOLECULE_H 0013 0014 #include "atom.h" 0015 0016 #include <QList> 0017 #include <QString> 0018 0019 0020 #define MOLECULE_SIZE 15 0021 0022 /** 0023 this class represents one molecule 0024 */ 0025 class Molecule 0026 { 0027 public: 0028 const atom& getAtom(int index) const; 0029 0030 uint getAtom(int x, int y) const { return m_molek[x][y]; } 0031 0032 /** 0033 * Width of molecule measured in atoms 0034 */ 0035 int width() const { return m_width; } 0036 /** 0037 * Height of molecule measured in atoms 0038 */ 0039 int height() const { return m_height; } 0040 0041 /** 0042 * @return the name of the molecule 0043 */ 0044 QString moleculeName() const { return m_name; } 0045 0046 /** 0047 * @return the molecule weight of the molecule 0048 */ 0049 double molecularWeight() const { return m_weight; } 0050 0051 private: 0052 friend class LevelSet; 0053 0054 Molecule() : m_width(0), m_height(0), m_weight(0) { } 0055 0056 uint m_molek[MOLECULE_SIZE][MOLECULE_SIZE]; // the indexes within atoms 0057 QList<atom> m_atoms; 0058 QString m_name; 0059 0060 int m_width; 0061 int m_height; 0062 0063 ///the molecule weight of the Molecule 0064 double m_weight; 0065 0066 }; 0067 0068 #endif // MOLECULE_H