00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: system.h,v 1.38 2005/10/23 12:02:20 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_KERNEL_SYSTEM_H 00008 #define BALL_KERNEL_SYSTEM_H 00009 00010 #ifndef BALL_KERNEL_ATOM_H 00011 # include <BALL/KERNEL/atomIterator.h> 00012 #endif 00013 00014 #ifndef BALL_KERNEL_MOLECULEITERATOR_H 00015 # include <BALL/KERNEL/moleculeIterator.h> 00016 #endif 00017 00018 #ifndef BALL_KERNEL_PROTEINITERATOR_H 00019 # include <BALL/KERNEL/proteinIterator.h> 00020 #endif 00021 00022 #ifndef BALL_KERNEL_NUCLEICACIDITERATOR_H 00023 # include <BALL/KERNEL/nucleicAcidIterator.h> 00024 #endif 00025 00026 #ifndef BALL_KERNEL_NUCLEOTIDEIDITERATOR_H 00027 # include <BALL/KERNEL/nucleotideIterator.h> 00028 #endif 00029 00030 #define BALL_SYSTEM_DEFAULT_NAME "" 00031 00032 namespace BALL 00033 { 00040 class BALL_EXPORT System 00041 : public AtomContainer 00042 { 00043 public: 00044 00045 BALL_CREATE_DEEP(System) 00046 00047 00050 00052 System(); 00053 00055 System(const System& system, bool deep = true); 00056 00058 System(const String& name); 00059 00061 virtual ~System(); 00062 00064 00067 00071 void persistentWrite(PersistenceManager& pm, const char* name = 0) const 00072 throw(Exception::GeneralException); 00073 00077 void persistentRead(PersistenceManager& pm) 00078 throw(Exception::GeneralException); 00079 00081 00084 00090 void set(const System& system, bool deep = true); 00091 00096 System& operator = (const System& system); 00097 00102 void get(System& system, bool deep = true) const; 00103 00105 00110 bool operator == (const System& system) const; 00111 00115 bool operator != (const System& system) const; 00116 00120 00129 Molecule* getMolecule(Position position); 00130 00139 const Molecule* getMolecule(Position position) const; 00140 00149 Protein* getProtein(Position position); 00150 00159 const Protein* getProtein(Position position) const; 00160 00164 Size countMolecules() const; 00165 00169 Size countFragments() const; 00170 00174 Size countAtoms() const; 00175 00179 Size countProteins() const; 00180 00184 Size countChains() const; 00185 00189 Size countSecondaryStructures() const; 00190 00194 Size countResidues() const; 00195 00199 Size countNucleicAcids() const; 00200 00204 Size countNucleotides() const; 00205 00209 void prepend(Molecule& molecule); 00210 00214 void append(Molecule& molecule); 00215 00219 void insert(Molecule& molecule); 00220 00225 void insertBefore(Molecule& molecule, Composite& before); 00226 00231 void insertAfter(Molecule& molecule, Composite& after); 00232 00236 bool remove(Molecule& molecule); 00237 00242 void spliceBefore(System& system); 00243 00248 void spliceAfter(System& system); 00249 00253 void splice(System& system); 00254 00256 00257 // --- EXTERNAL ITERATORS --- 00258 00259 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Atom) 00260 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer) 00261 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Fragment) 00262 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Molecule) 00263 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Protein) 00264 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue) 00265 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Chain) 00266 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure) 00267 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Nucleotide) 00268 BALL_KERNEL_DEFINE_ITERATOR_CREATORS(NucleicAcid) 00269 00270 }; 00271 } // namespace BALL 00272 00273 #endif // BALL_KERNEL_SYSTEM_H