BALL  1.4.1
secondaryStructure.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_SECONDARYSTRUCTURE_H
00006 #define BALL_KERNEL_SECONDARYSTRUCTURE_H
00007 
00008 #ifndef BALL_KERNEL_RESIDUE_H
00009 # include <BALL/KERNEL/residue.h>
00010 #endif
00011 
00012 #ifndef BALL_KERNEL_RESIDUEITERATOR_H
00013 # include <BALL/KERNEL/residueIterator.h>
00014 #endif
00015 
00016 #ifndef BALL_KERNEL_ATOMCONTAINER_H
00017 # include <BALL/KERNEL/atomContainer.h>
00018 #endif
00019 
00020 namespace BALL 
00021 {
00029   class BALL_EXPORT SecondaryStructure
00030     : public AtomContainer
00031   {
00032     public:
00033 
00034     BALL_CREATE_DEEP(SecondaryStructure)
00035 
00036     
00039 
00042     enum Type
00043     {
00045       HELIX,
00047       COIL,
00049       STRAND,
00051       TURN,
00053       UNKNOWN,
00055       NUMBER_OF_TYPES
00056     };
00057 
00059 
00060 
00064 
00066     SecondaryStructure();
00067   
00069     SecondaryStructure(const SecondaryStructure& secondary_structure, bool deep = true);
00070   
00072     SecondaryStructure(const String& name);
00073 
00075     virtual ~SecondaryStructure();
00076 
00078     virtual void clear();
00079   
00081     virtual void destroy();
00083 
00091     bool operator == (const SecondaryStructure& secondary_structure) const;
00092 
00096     bool operator != (const SecondaryStructure& secondary_structure) const;
00098 
00102 
00106     void persistentWrite(PersistenceManager& pm, const char* name = 0) const;
00107 
00111     void persistentRead(PersistenceManager& pm);
00113 
00117 
00123     void set(const SecondaryStructure& secondary_structure, bool deep = true);
00124 
00130     SecondaryStructure& operator = (const SecondaryStructure& secondary_structure);
00131 
00137     void get(SecondaryStructure& secondary_structure, bool deep = true) const;
00138 
00142     void swap(SecondaryStructure& secondary_structure);
00144 
00148 
00150     Type getType() const { return type_; }
00151 
00153     void setType(Type type) { type_ = type; }
00154       
00159     Protein* getProtein();
00160 
00165     const Protein* getProtein() const;
00166 
00171     Chain* getChain();
00172 
00177     const Chain* getChain() const;
00178 
00184     Residue* getResidue(Position position);
00185   
00191     const Residue* getResidue(Position position) const;
00192 
00198     Residue* getNTerminal();
00199   
00205     const Residue* getNTerminal() const;
00206 
00212     Residue* getCTerminal();
00213   
00219     const Residue* getCTerminal() const;
00220 
00226     PDBAtom* getPDBAtom(Position position);
00227   
00233     const PDBAtom* getPDBAtom(Position position) const;
00234   
00238     Size countResidues() const;
00239 
00243     Size countPDBAtoms() const;
00244 
00248     void prepend(Residue& residue);
00249 
00253     void append(Residue& residue);
00254 
00258     void insert(Residue& residue);
00259 
00264     void insertBefore(Residue& residue, Composite& before);
00265 
00270     void insertAfter(Residue& residue, Composite& after);
00271 
00275     bool remove(Residue& residue);
00276 
00281     void spliceBefore(SecondaryStructure& secondary_structure);
00282 
00287     void spliceAfter(SecondaryStructure& secondary_structure);
00288 
00292     void splice(SecondaryStructure& secondary_structure);
00294 
00298   
00303     virtual bool isValid() const;
00304 
00311     virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00312 
00314       
00315     // --- EXTERNAL ITERATORS
00316 
00317     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(Residue)
00318     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(PDBAtom)
00319 
00320     protected:
00321     
00323     Type type_;
00324 
00325     private:
00326 
00327     Fragment* getFragment(Position position);
00328   
00329     const Fragment* getFragment(Position position) const;
00330   
00331     Atom* getAtom(Position position);
00332   
00333     const Atom* getAtom(Position position) const;
00334 
00335     void prepend(Atom& atom);
00336 
00337     void append(Atom& atom);
00338 
00339     void insert(Atom& atom);
00340 
00341     void insertBefore(Atom& atom, Composite& before);
00342 
00343     void insertAfter(Atom& atom, Composite& after);
00344 
00345     bool remove(Atom& atom);
00346 
00347     void prepend(AtomContainer& atom_container);
00348 
00349     void append(AtomContainer& atom_container);
00350 
00351     void insert(AtomContainer& atom_container);
00352       
00353     void insertBefore(AtomContainer& atom_container, Composite& before);
00354 
00355     void insertAfter(AtomContainer& atom_container, Composite& after);
00356 
00357     void spliceBefore(AtomContainer& atom_container);
00358 
00359     void spliceAfter(AtomContainer& atom_container);
00360 
00361     void splice(AtomContainer& atom_container);
00362 
00363     bool remove(AtomContainer& atom_container);
00364 
00365     BALL_KERNEL_DEFINE_ITERATOR_CREATORS(AtomContainer)
00366 
00367   };
00368 
00369 } // namespace BALL
00370 
00371 #endif // BALL_KERNEL_SECONDARYSTRUCTURE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines