1 | /******************************************************************* |
2 | * |
3 | * Copyright (C) Andreas Wüst <AndreasWuest@gmx.de> |
4 | * Copyright (C) Stephan Kulow <coolo@kde.org> |
5 | * Copyright (C) 2006-2007 Dmitry Suzdalev <dimsuz@gmail.com> |
6 | * |
7 | * This file is part of the KDE project "KAtomic" |
8 | * |
9 | * KAtomic is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2, or (at your option) |
12 | * any later version. |
13 | * |
14 | * KAtomic is distributed in the hope that it will be useful, |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | * GNU General Public License for more details. |
18 | * |
19 | * You should have received a copy of the GNU General Public License |
20 | * along with KAtomic; see the file COPYING. If not, write to |
21 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
22 | * Boston, MA 02110-1301, USA. |
23 | * |
24 | ********************************************************************/ |
25 | #ifndef MOLECULE_H |
26 | #define MOLECULE_H |
27 | |
28 | #include <QList> |
29 | #include <QString> |
30 | #include "atom.h" |
31 | |
32 | class KConfig; |
33 | class KConfigGroup; |
34 | class LevelData; |
35 | |
36 | #define MOLECULE_SIZE 15 |
37 | |
38 | /** |
39 | this class represents one molecule |
40 | */ |
41 | class Molecule |
42 | { |
43 | public: |
44 | const atom& getAtom(int index) const; |
45 | |
46 | uint getAtom(int x, int y) const { return m_molek[x][y]; } |
47 | |
48 | /** |
49 | * Width of molecule measured in atoms |
50 | */ |
51 | int width() const { return m_width; } |
52 | /** |
53 | * Height of molecule measured in atoms |
54 | */ |
55 | int height() const { return m_height; } |
56 | |
57 | /** |
58 | * @return the name of the molecule |
59 | */ |
60 | QString moleculeName() const { return m_name; } |
61 | |
62 | /** |
63 | * @return the molecule weight of the molecule |
64 | */ |
65 | double molecularWeight() const { return m_weight; } |
66 | |
67 | private: |
68 | friend class LevelSet; |
69 | |
70 | Molecule() : m_width(0), m_height(0), m_weight(0) { } |
71 | |
72 | uint m_molek[MOLECULE_SIZE][MOLECULE_SIZE]; // the indexes within atoms |
73 | QList<atom> m_atoms; |
74 | QString m_name; |
75 | |
76 | int m_width; |
77 | int m_height; |
78 | |
79 | ///the molecule weight of the Molecule |
80 | double m_weight; |
81 | |
82 | }; |
83 | |
84 | #endif // MOLECULE_H |
85 | |