chain.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: chain.h,v 1.39 2005/10/23 12:02:18 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_KERNEL_CHAIN_H
00008 #define BALL_KERNEL_CHAIN_H
00009 
00010 #ifndef BALL_KERNEL_RESIDUE_H
00011 # include <BALL/KERNEL/residue.h>
00012 #endif
00013 
00014 #ifndef BALL_KERNEL_SECONDARYSTRUCTUREITERATOR_H
00015 # include <BALL/KERNEL/secondaryStructureIterator.h>
00016 #endif
00017 
00018 
00019 #define BALL_CHAIN_DEFAULT_NAME   ' '
00020 
00021 namespace BALL
00022 {
00023   class Protein;
00024 
00032   class BALL_EXPORT Chain
00033     : public AtomContainer
00034   {
00035     public:
00036 
00037     BALL_CREATE_DEEP(Chain)
00038 
00039     
00042 
00045     enum Property
00046     {
00047       NUMBER_OF_PROPERTIES = AtomContainer::NUMBER_OF_PROPERTIES
00048     };
00049 
00051 
00054 
00056     Chain();
00057 
00059     Chain(const Chain& chain, bool deep = true);
00060 
00062     Chain(const String& name);
00063 
00065     virtual ~Chain();
00066 
00068 
00071 
00075     void persistentWrite(PersistenceManager& pm, const char* name = 0) const
00076       throw(Exception::GeneralException);
00077 
00081     void persistentRead(PersistenceManager& pm)
00082       throw(Exception::GeneralException);
00083 
00085 
00088 
00094     void set(const Chain& chain, bool deep = true);
00095 
00102     Chain& operator = (const Chain& chain);
00103 
00109     void get(Chain& chain, bool deep = true) const;
00110 
00114     void swap(Chain& chain);
00115 
00117 
00122     bool operator == (const Chain& chain) const;
00123 
00127     bool operator != (const Chain& chain) const;
00128 
00129 
00133 
00138     Protein* getProtein();
00139 
00144     const Protein* getProtein() const;
00145 
00152     SecondaryStructure* getSecondaryStructure(Position position);
00153 
00160     const SecondaryStructure* getSecondaryStructure(Position position) const;
00161 
00167     Residue* getResidue(Position position);
00168 
00174     const Residue* getResidue(Position position) const;
00175 
00181     Residue* getNTerminal();
00182 
00188     const Residue* getNTerminal() const;
00189 
00195     Residue* getCTerminal();
00196 
00202     const Residue* getCTerminal() const;
00203 
00209     PDBAtom* getPDBAtom(Position position);
00210 
00216     const PDBAtom* getPDBAtom(Position position) const;
00217 
00221     Size countSecondaryStructures() const;
00222 
00226     Size countResidues() const;
00227 
00231     Size countPDBAtoms() const;
00232 
00236     void prepend(SecondaryStructure& secondary_structure);
00237 
00241     void append(SecondaryStructure& secondary_structure);
00242 
00246     void insert(SecondaryStructure& secondary_structure);
00247 
00252     void insertBefore(SecondaryStructure& secondary_structure, Composite& before);
00253 
00258     void insertAfter(SecondaryStructure& secondary_structure, Composite& after);
00259 
00263     bool remove(SecondaryStructure& secondary_structure);
00264 
00268     void prepend(Residue& residue);
00269 
00273     void append(Residue& residue);
00274 
00278     void insert(Residue& residue);
00279 
00284     void insertBefore(Residue& residue, Composite& before);
00285 
00290     void insertAfter(Residue& residue, Composite& after);
00291 
00295     bool remove(Residue& residue);
00296 
00300     void spliceBefore(Chain& chain);
00301 
00305     void spliceAfter(Chain &chain);
00306 
00310     void splice(Chain &chain);
00311 
00313 
00316 
00323     virtual void dump(std::ostream& s = std::cout, Size depth = 0) const
00324 ;
00325 
00327 
00328     // --- EXTERNAL ITERATORS
00329 
00330     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure)
00331     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue)
00332     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom)
00333 
00334   protected:
00335 
00336   private:
00337     AtomContainer* getAtomContainer(Position position);
00338 
00339     const AtomContainer* getAtomContainer(Position position) const;
00340 
00341     Atom* getAtom(Position position);
00342 
00343     const Atom* getAtom(Position position) const;
00344 
00345     void prepend(Atom& atom);
00346 
00347     void append(Atom& atom);
00348 
00349     void insert(Atom& atom);
00350 
00351     void insertBefore(Atom& atom, Composite& before);
00352 
00353     void insertAfter(Atom& atom, Composite& after);
00354 
00355     bool remove(Atom& atom);
00356 
00357     void prepend(AtomContainer& atom_container);
00358 
00359     void append(AtomContainer& atom_container);
00360 
00361     void insert(AtomContainer& atom_container);
00362 
00363     void insertBefore(AtomContainer& atom_container, Composite& before);
00364 
00365     void insertAfter(AtomContainer& atom_container, Composite& after);
00366 
00367     void spliceBefore(AtomContainer& atom_container);
00368 
00369     void spliceAfter(AtomContainer& atom_container);
00370 
00371     void splice(AtomContainer& atom_container);
00372 
00373     bool remove(AtomContainer& atom_container);
00374 
00375     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer)
00376   };
00377 } // namespace BALL
00378 
00379 #endif // BALL_KERNEL_CHAIN_H