00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_CHAIN_IMPL_HH
00020 #define OST_CHAIN_IMPL_HH
00021
00022 #include <boost/enable_shared_from_this.hpp>
00023
00024 #include <ost/mol/module_config.hh>
00025 #include <ost/geom/geom.hh>
00026
00027 #include <ost/mol/residue_prop.hh>
00028 #include <ost/mol/impl/chain_impl_fw.hh>
00029 #include <ost/mol/impl/residue_impl_fw.hh>
00030 #include <ost/mol/impl/entity_impl_fw.hh>
00031 #include <ost/mol/entity_visitor_fw.hh>
00032 #include <ost/mol/impl/atom_impl_fw.hh>
00033
00034 #include <ost/generic_property.hh>
00035
00036 #include <ost/mol/sec_structure.hh>
00037
00038 namespace ost { namespace mol {namespace impl {
00039
00041 class ChainImpl: public GenericPropContainerImpl,
00042 public boost::enable_shared_from_this<ChainImpl>
00043 {
00044 public:
00045 ChainImpl(const EntityImplPtr& e, const String& name);
00046
00047 void SetName(const String& new_name);
00048 String GetName() const;
00049
00052 ResidueImplPtr AppendResidue(const ResidueImplPtr& res);
00053
00054 ResidueImplPtr InsertResidueBefore(int index, const ResNum& n,
00055 const ResidueKey& k);
00056 ResidueImplPtr InsertResidueAfter(int index, const ResNum& n,
00057 const ResidueKey& k);
00062 ResidueImplPtr AppendResidue(const ResidueKey& k);
00063
00065 ResidueImplPtr AppendResidue(const ResidueKey& k, const ResNum& n);
00066
00067
00068 ResidueImplPtr GetPrev(const ResidueImplPtr& r) const;
00069
00071 ResidueImplPtr GetNext(const ResidueImplPtr& r) const;
00072
00073 const ResidueImplList& GetResidueList() const;
00075 bool InSequence() const;
00076
00077 ResidueImplList& GetResidueList() {
00078 return residue_list_;
00079 }
00080
00081 Real GetMass() const;
00082 geom::Vec3 GetCenterOfMass() const;
00083 geom::Vec3 GetCenterOfAtoms() const;
00084 geom::Vec3 GetGeometricCenter() const;
00085 geom::Vec3 GetGeometricStart() const;
00086 geom::Vec3 GetGeometricEnd() const;
00087
00090 ResidueImplPtr FindResidue(const ResNum& number) const;
00091
00092 AtomImplPtr FindAtom(const ResNum& number,
00093 const String& atom_name) const;
00094
00096 int GetResidueCount() const;
00097
00099 int GetAtomCount() const;
00100
00102 int GetBondCount() const;
00103
00104 void Apply(EntityVisitor& v);
00105
00106 EntityImplPtr GetEntity() const;
00107
00108 void DeleteResidue(const ResNum& number);
00109
00110 void DeleteResidue(const ResidueImplPtr& residue);
00111
00112 void DeleteAllResidues();
00113
00114 int GetIndex(const ResNum& number) const;
00115
00116 void AssignSecondaryStructure(SecStructure ss,
00117 const ResNum& start,
00118 const ResNum& end);
00119 private:
00120 void UpdateShifts();
00121 typedef struct {
00122 int start;
00123 int shift;
00124 } Shift;
00125 std::list<Shift> shifts_;
00126 EntityImplW ent_;
00127 String name_;
00128 ResidueImplList residue_list_;
00131 bool in_sequence_;
00132 };
00133
00134 }}}
00135
00136 #endif
00137