00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 00005 #ifndef BALL_KERNEL_SYSTEM_H 00006 #define BALL_KERNEL_SYSTEM_H 00007 00008 #ifndef BALL_KERNEL_ATOM_H 00009 # include <BALL/KERNEL/atomIterator.h> 00010 #endif 00011 00012 #ifndef BALL_KERNEL_MOLECULEITERATOR_H 00013 # include <BALL/KERNEL/moleculeIterator.h> 00014 #endif 00015 00016 #ifndef BALL_KERNEL_PROTEINITERATOR_H 00017 # include <BALL/KERNEL/proteinIterator.h> 00018 #endif 00019 00020 #ifndef BALL_KERNEL_NUCLEICACIDITERATOR_H 00021 # include <BALL/KERNEL/nucleicAcidIterator.h> 00022 #endif 00023 00024 #ifndef BALL_KERNEL_NUCLEOTIDEIDITERATOR_H 00025 # include <BALL/KERNEL/nucleotideIterator.h> 00026 #endif 00027 00028 #define BALL_SYSTEM_DEFAULT_NAME "" 00029 00030 namespace BALL 00031 { 00038 class BALL_EXPORT System 00039 : public AtomContainer 00040 { 00041 public: 00042 00043 BALL_CREATE_DEEP(System) 00044 00045 00048 00050 System(); 00051 00053 System(const System& system, bool deep = true); 00054 00056 System(const String& name); 00057 00059 virtual ~System(); 00060 00062 00065 00069 void persistentWrite(PersistenceManager& pm, const char* name = 0) const; 00070 00074 void persistentRead(PersistenceManager& pm); 00075 00077 00080 00086 void set(const System& system, bool deep = true); 00087 00092 System& operator = (const System& system); 00093 00098 void get(System& system, bool deep = true) const; 00099 00101 00106 bool operator == (const System& system) const; 00107 00111 bool operator != (const System& system) const; 00112 00116 00125 Molecule* getMolecule(Position position); 00126 00135 const Molecule* getMolecule(Position position) const; 00136 00145 Protein* getProtein(Position position); 00146 00155 const Protein* getProtein(Position position) const; 00156 00160 Size countMolecules() const; 00161 00165 Size countFragments() const; 00166 00170 Size countAtoms() const; 00171 00175 Size countProteins() const; 00176 00180 Size countChains() const; 00181 00185 Size countSecondaryStructures() const; 00186 00190 Size countResidues() const; 00191 00195 Size countNucleicAcids() const; 00196 00200 Size countNucleotides() const; 00201 00205 void prepend(Molecule& molecule); 00206 00210 void append(Molecule& molecule); 00211 00215 void insert(Molecule& molecule); 00216 00221 void insertBefore(Molecule& molecule, Composite& before); 00222 00227 void insertAfter(Molecule& molecule, Composite& after); 00228 00232 bool remove(Molecule& molecule); 00233 00238 void spliceBefore(System& system); 00239 00244 void spliceAfter(System& system); 00245 00249 void splice(System& system); 00250 00252 00253 // --- EXTERNAL ITERATORS --- 00254 00255 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Atom) 00256 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer) 00257 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Fragment) 00258 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Molecule) 00259 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Protein) 00260 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue) 00261 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Chain) 00262 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure) 00263 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Nucleotide) 00264 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(NucleicAcid) 00265 00266 }; 00267 } // namespace BALL 00268 00269 #endif // BALL_KERNEL_SYSTEM_H