1 | /*
|
---|
2 | * MoleculeListClass.hpp
|
---|
3 | *
|
---|
4 | * Created on: Oct 20, 2011
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef MOLECULELISTCLASS_HPP_
|
---|
9 | #define MOLECULELISTCLASS_HPP_
|
---|
10 |
|
---|
11 | #ifdef HAVE_CONFIG_H
|
---|
12 | #include <config.h>
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | #include <iosfwd>
|
---|
16 | #include <list>
|
---|
17 | #include <string>
|
---|
18 |
|
---|
19 | #include "CodePatterns/Observer.hpp"
|
---|
20 | #include "CodePatterns/ObservedIterator.hpp"
|
---|
21 | #include "CodePatterns/Cacheable.hpp"
|
---|
22 |
|
---|
23 | class molecule;
|
---|
24 | class periodentafel;
|
---|
25 | class World;
|
---|
26 |
|
---|
27 | typedef std::list<molecule *> MoleculeList;
|
---|
28 | typedef std::pair<MoleculeList::iterator, bool> MoleculeListTest;
|
---|
29 |
|
---|
30 |
|
---|
31 | /** A list of \a molecule classes.
|
---|
32 | */
|
---|
33 | class MoleculeListClass : public Observable
|
---|
34 | {
|
---|
35 | public:
|
---|
36 | MoleculeList ListOfMolecules; //!< List of the contained molecules
|
---|
37 | int MaxIndex;
|
---|
38 |
|
---|
39 | MoleculeListClass(World *world);
|
---|
40 | ~MoleculeListClass();
|
---|
41 |
|
---|
42 | bool AddHydrogenCorrection(std::string &path);
|
---|
43 | bool StoreForcesFile(std::string &path, int *SortIndex);
|
---|
44 | void insert(molecule *mol);
|
---|
45 | void erase(molecule *mol);
|
---|
46 | molecule * ReturnIndex(int index);
|
---|
47 | bool OutputConfigForListOfFragments(std::string &prefix, int *SortIndex);
|
---|
48 | int NumberOfActiveMolecules();
|
---|
49 | void Enumerate(std::ostream *out);
|
---|
50 | void Output(std::ostream *out);
|
---|
51 | int CountAllAtoms() const;
|
---|
52 |
|
---|
53 | // Methods moved here from the menus
|
---|
54 | // TODO: more refactoring needed on these methods
|
---|
55 | void createNewMolecule(periodentafel *periode);
|
---|
56 | void loadFromXYZ(periodentafel *periode);
|
---|
57 | void setMoleculeFilename();
|
---|
58 | void parseXYZIntoMolecule();
|
---|
59 | void eraseMolecule();
|
---|
60 |
|
---|
61 | private:
|
---|
62 | World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor
|
---|
63 | };
|
---|
64 |
|
---|
65 | #endif /* MOLECULELISTCLASS_HPP_ */
|
---|