00001
00002
00003
00004
00005 #ifndef BALL_KERNEL_MOLECULE_H
00006 #define BALL_KERNEL_MOLECULE_H
00007
00008 #ifndef BALL_KERNEL_ATOMCONTAINER_H
00009 # include <BALL/KERNEL/atomContainer.h>
00010 #endif
00011
00012 #ifndef BALL_KERNEL_FRAGMENT_H
00013 # include <BALL/KERNEL/fragment.h>
00014 #endif
00015
00016 #ifndef BALL_KERNEL_FRAGMENTITERATOR_H
00017 # include <BALL/KERNEL/fragmentIterator.h>
00018 #endif
00019
00020 namespace BALL
00021 {
00022 class System;
00023
00029 class BALL_EXPORT Molecule
00030 : public AtomContainer
00031 {
00032 public:
00033
00034 BALL_CREATE_DEEP(Molecule)
00035
00036
00039
00042 enum Property
00043 {
00044 IS_SOLVENT = AtomContainer::NUMBER_OF_PROPERTIES,
00045 NUMBER_OF_PROPERTIES
00046 };
00047
00049
00052
00055 Molecule();
00056
00059 Molecule(const Molecule& molecule, bool deep = true);
00060
00063 Molecule(const String& name);
00064
00067 virtual ~Molecule();
00068
00070
00073
00077 void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
00078
00082 void persistentRead(PersistenceManager& pm);
00083
00085
00088
00093 void set(const Molecule& molecule, bool deep = true);
00094
00098 Molecule& operator = (const Molecule& molecule);
00099
00104 void get(Molecule& molecule, bool deep = true) const;
00105
00109 void swap(Molecule& molecule);
00110
00112
00115
00119 System* getSystem();
00120
00124 const System* getSystem() const;
00125
00129 void prepend(Atom& atom);
00130
00134 void append(Atom& atom);
00135
00139 void insert(Atom& atom);
00140
00145 void insertBefore(Atom& atom, Composite& before);
00146
00151 void insertAfter(Atom& atom, Composite& after);
00152
00156 bool remove(Atom& atom);
00157
00161 void prepend(AtomContainer& atom_container);
00162
00166 void append(AtomContainer& atom_container);
00167
00171 void insert(AtomContainer& atom_container);
00172
00177 void insertBefore(AtomContainer& atom_container, Composite& before);
00178
00183 void insertAfter(AtomContainer& atom_container, Composite& after);
00184
00188 void spliceBefore(AtomContainer& atom_container);
00189
00193 void spliceAfter(AtomContainer& atom_container);
00194
00200 void splice(AtomContainer& atom_container);
00201
00205 bool remove(AtomContainer& atom_container);
00206
00208
00211
00218 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00219
00221
00226 bool operator == (const Molecule& molecule) const;
00227
00231 bool operator != (const Molecule& molecule) const;
00232
00233
00234 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Fragment)
00235
00236
00237 protected:
00238
00239 Molecule* getMolecule();
00240
00241 const Molecule* getMolecule() const;
00242
00243 AtomContainer* getSuperAtomContainer();
00244
00245 const AtomContainer* getSuperAtomContainer() const;
00246
00247 void prepend(Molecule& molecule);
00248
00249 void append(Molecule& molecule);
00250
00251 void insert(Molecule& molecule);
00252
00253 void insertBefore(Molecule& molecule, Composite& composite);
00254
00255 void insertAfter(Molecule& molecule, Composite& composite);
00256
00257 bool remove(Molecule& molecule);
00258
00259 bool isSubAtomContainerOf(const AtomContainer& atom_container) const;
00260 };
00261 }
00262
00263 #endif // BALL_KERNEL_MOLECULE_H