BALL  1.4.1
chain.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_KERNEL_CHAIN_H
00006 #define BALL_KERNEL_CHAIN_H
00007 
00008 #ifndef BALL_KERNEL_RESIDUE_H
00009 # include <BALL/KERNEL/residue.h>
00010 #endif
00011 
00012 #ifndef BALL_KERNEL_SECONDARYSTRUCTUREITERATOR_H
00013 # include <BALL/KERNEL/secondaryStructureIterator.h>
00014 #endif
00015 
00016 
00017 #define BALL_CHAIN_DEFAULT_NAME   ' '
00018 
00019 namespace BALL
00020 {
00021   class Protein;
00022 
00030   class BALL_EXPORT Chain
00031     : public AtomContainer
00032   {
00033     public:
00034 
00035     BALL_CREATE_DEEP(Chain)
00036 
00037     
00040 
00043     enum Property
00044     {
00045       NUMBER_OF_PROPERTIES = AtomContainer::NUMBER_OF_PROPERTIES
00046     };
00047 
00049 
00052 
00054     Chain();
00055 
00057     Chain(const Chain& chain, bool deep = true);
00058 
00060     Chain(const String& name);
00061 
00063     virtual ~Chain();
00064 
00066 
00069 
00073     void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
00074 
00078     void persistentRead(PersistenceManager& pm);
00079 
00081 
00084 
00090     void set(const Chain& chain, bool deep = true);
00091 
00098     Chain& operator = (const Chain& chain);
00099 
00105     void get(Chain& chain, bool deep = true) const;
00106 
00110     void swap(Chain& chain);
00111 
00113 
00118     bool operator == (const Chain& chain) const;
00119 
00123     bool operator != (const Chain& chain) const;
00124 
00125 
00129 
00134     Protein* getProtein();
00135 
00140     const Protein* getProtein() const;
00141 
00148     SecondaryStructure* getSecondaryStructure(Position position);
00149 
00156     const SecondaryStructure* getSecondaryStructure(Position position) const;
00157 
00163     Residue* getResidue(Position position);
00164 
00170     const Residue* getResidue(Position position) const;
00171 
00177     Residue* getNTerminal();
00178 
00184     const Residue* getNTerminal() const;
00185 
00191     Residue* getCTerminal();
00192 
00198     const Residue* getCTerminal() const;
00199 
00205     PDBAtom* getPDBAtom(Position position);
00206 
00212     const PDBAtom* getPDBAtom(Position position) const;
00213 
00217     Size countSecondaryStructures() const;
00218 
00222     Size countResidues() const;
00223 
00227     Size countPDBAtoms() const;
00228 
00232     void prepend(SecondaryStructure& secondary_structure);
00233 
00237     void append(SecondaryStructure& secondary_structure);
00238 
00242     void insert(SecondaryStructure& secondary_structure);
00243 
00248     void insertBefore(SecondaryStructure& secondary_structure, Composite& before);
00249 
00254     void insertAfter(SecondaryStructure& secondary_structure, Composite& after);
00255 
00259     bool remove(SecondaryStructure& secondary_structure);
00260 
00264     void prepend(Residue& residue);
00265 
00269     void append(Residue& residue);
00270 
00274     void insert(Residue& residue);
00275 
00280     void insertBefore(Residue& residue, Composite& before);
00281 
00286     void insertAfter(Residue& residue, Composite& after);
00287 
00291     bool remove(Residue& residue);
00292 
00296     void spliceBefore(Chain& chain);
00297 
00301     void spliceAfter(Chain &chain);
00302 
00306     void splice(Chain &chain);
00307 
00309 
00312 
00319     virtual void dump(std::ostream& s = std::cout, Size depth = 0) const
00320 ;
00321 
00323 
00324     // --- EXTERNAL ITERATORS
00325 
00326     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(SecondaryStructure)
00327     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue)
00328     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom)
00329 
00330   protected:
00331 
00332   private:
00333     AtomContainer* getAtomContainer(Position position);
00334 
00335     const AtomContainer* getAtomContainer(Position position) const;
00336 
00337     Atom* getAtom(Position position);
00338 
00339     const Atom* getAtom(Position position) const;
00340 
00341     void prepend(Atom& atom);
00342 
00343     void append(Atom& atom);
00344 
00345     void insert(Atom& atom);
00346 
00347     void insertBefore(Atom& atom, Composite& before);
00348 
00349     void insertAfter(Atom& atom, Composite& after);
00350 
00351     bool remove(Atom& atom);
00352 
00353     void prepend(AtomContainer& atom_container);
00354 
00355     void append(AtomContainer& atom_container);
00356 
00357     void insert(AtomContainer& atom_container);
00358 
00359     void insertBefore(AtomContainer& atom_container, Composite& before);
00360 
00361     void insertAfter(AtomContainer& atom_container, Composite& after);
00362 
00363     void spliceBefore(AtomContainer& atom_container);
00364 
00365     void spliceAfter(AtomContainer& atom_container);
00366 
00367     void splice(AtomContainer& atom_container);
00368 
00369     bool remove(AtomContainer& atom_container);
00370 
00371     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer)
00372   };
00373 } // namespace BALL
00374 
00375 #endif // BALL_KERNEL_CHAIN_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines