00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_KERNEL_MOLECULE_H
00008 #define BALL_KERNEL_MOLECULE_H
00009
00010 #ifndef BALL_KERNEL_ATOMCONTAINER_H
00011 # include <BALL/KERNEL/atomContainer.h>
00012 #endif
00013
00014 #ifndef BALL_KERNEL_FRAGMENT_H
00015 # include <BALL/KERNEL/fragment.h>
00016 #endif
00017
00018 #ifndef BALL_KERNEL_FRAGMENTITERATOR_H
00019 # include <BALL/KERNEL/fragmentIterator.h>
00020 #endif
00021
00022 namespace BALL
00023 {
00024 class System;
00025
00031 class BALL_EXPORT Molecule
00032 : public AtomContainer
00033 {
00034 public:
00035
00036 BALL_CREATE_DEEP(Molecule)
00037
00038
00041
00044 enum Property
00045 {
00046 IS_SOLVENT = AtomContainer::NUMBER_OF_PROPERTIES,
00047 NUMBER_OF_PROPERTIES
00048 };
00049
00051
00054
00057 Molecule();
00058
00061 Molecule(const Molecule& molecule, bool deep = true);
00062
00065 Molecule(const String& name);
00066
00069 virtual ~Molecule();
00070
00072
00075
00079 void persistentWrite(PersistenceManager& pm, const char* name = 0) const
00080 throw(Exception::GeneralException);
00081
00085 void persistentRead(PersistenceManager& pm)
00086 throw(Exception::GeneralException);
00087
00089
00092
00097 void set(const Molecule& molecule, bool deep = true);
00098
00102 Molecule& operator = (const Molecule& molecule);
00103
00108 void get(Molecule& molecule, bool deep = true) const;
00109
00113 void swap(Molecule& molecule);
00114
00116
00119
00123 System* getSystem();
00124
00128 const System* getSystem() const;
00129
00133 void prepend(Atom& atom);
00134
00138 void append(Atom& atom);
00139
00143 void insert(Atom& atom);
00144
00149 void insertBefore(Atom& atom, Composite& before);
00150
00155 void insertAfter(Atom& atom, Composite& after);
00156
00160 bool remove(Atom& atom);
00161
00165 void prepend(AtomContainer& atom_container);
00166
00170 void append(AtomContainer& atom_container);
00171
00175 void insert(AtomContainer& atom_container);
00176
00181 void insertBefore(AtomContainer& atom_container, Composite& before);
00182
00187 void insertAfter(AtomContainer& atom_container, Composite& after);
00188
00192 void spliceBefore(AtomContainer& atom_container);
00193
00197 void spliceAfter(AtomContainer& atom_container);
00198
00204 void splice(AtomContainer& atom_container);
00205
00209 bool remove(AtomContainer& atom_container);
00210
00212
00215
00222 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00223
00225
00230 bool operator == (const Molecule& molecule) const;
00231
00235 bool operator != (const Molecule& molecule) const;
00236
00237
00238 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Fragment)
00239
00240
00241 protected:
00242
00243 Molecule* getMolecule();
00244
00245 const Molecule* getMolecule() const;
00246
00247 AtomContainer* getSuperAtomContainer();
00248
00249 const AtomContainer* getSuperAtomContainer() const;
00250
00251 void prepend(Molecule& molecule);
00252
00253 void append(Molecule& molecule);
00254
00255 void insert(Molecule& molecule);
00256
00257 void insertBefore(Molecule& molecule, Composite& composite);
00258
00259 void insertAfter(Molecule& molecule, Composite& composite);
00260
00261 bool remove(Molecule& molecule);
00262
00263 bool isSubAtomContainerOf(const AtomContainer& atom_container) const;
00264 };
00265 }
00266
00267 #endif // BALL_KERNEL_MOLECULE_H