00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_EDITOR_BASE_HS
00020 #define OST_EDITOR_BASE_HS
00021
00022
00023
00024
00025 #include <ost/mol/module_config.hh>
00026
00027 #include <ost/geom/geom.hh>
00028
00029 #include "entity_handle.hh"
00030 #include "residue_prop.hh"
00031 #include "editor_type_fw.hh"
00032
00033 namespace ost { namespace mol {
00034
00046 class DLLEXPORT_OST_MOL EditorBase {
00047 public:
00058 ChainHandle InsertChain(const String& chain_name);
00059
00077 ChainHandle InsertChain(const String& chain_name, ChainHandle chain, bool deep=false);
00078
00094 ResidueHandle AppendResidue(ChainHandle chain, const ResidueKey& k);
00095
00096 ResidueHandle AppendResidue(ChainHandle chain, const ResidueKey& k,
00097 const ResNum& num);
00098
00113
00114 ResidueHandle AppendResidue(ChainHandle chain, ResidueHandle residue, bool deep=false);
00115
00131 ResidueHandle InsertResidueBefore(ChainHandle chain, int index,
00132 const ResNum& num,
00133 const ResidueKey& k);
00134
00140 ResidueHandle InsertResidueAfter(ChainHandle chain, int index,
00141 const ResNum& num,
00142 const ResidueKey& k);
00143
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 AtomHandle InsertAtom(ResidueHandle residue, const String& name,
00161 const geom::Vec3& pos, const String& ele="",
00162 Real occupancy=1.0, Real b_factor=0.0,
00163 bool is_hetatm=false);
00164
00174
00175 AtomHandle InsertAtom(ResidueHandle residue, AtomHandle atom);
00176
00179 AtomHandle InsertAltAtom(ResidueHandle residue, const String& name,
00180 const String& alt_group, const geom::Vec3& pos,
00181 const String& ele="", Real occ=1.0,
00182 Real b_factor=0.0);
00183
00187
00188 AtomHandle InsertAltAtom(ResidueHandle residue, AtomHandle atom,
00189 const String& alt_group);
00190
00191
00204 void AddAltAtomPos(const String& group, const AtomHandle& atom,
00205 const geom::Vec3& position, Real occ=1.0,
00206 Real b_factor=0.0);
00207
00208
00213 BondHandle Connect(const AtomHandle& first, const AtomHandle& second);
00214 BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
00215 unsigned char bond_order);
00216 BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
00217 Real len, Real theta, Real phi);
00218 BondHandle Connect(const AtomHandle& first, const AtomHandle& second,
00219 Real len, Real theta, Real phi,
00220 unsigned char bond_order);
00221
00222 void RenameResidue(ResidueHandle res, const String& new_name);
00223
00224 void SetResidueNumber(ResidueHandle res, const ResNum& num);
00225
00226 void RenameChain(ChainHandle chain, const String& new_name);
00227
00232 void SetChainType(ChainHandle chain, const ChainType type);
00233
00238 void SetChainDescription(ChainHandle chain, const String desc);
00239
00243 void DeleteAllAtoms(ResidueHandle res);
00244
00252 void DeleteAtom(const AtomHandle& atom);
00256 void DeleteAtoms(const AtomHandleList& atoms);
00257
00263 void DeleteBond(const BondHandle& bond);
00264
00270 void DeleteBonds(const BondHandleList& bonds);
00271
00273 TorsionHandle AddTorsion(const String& name, const AtomHandle& a1,
00274 const AtomHandle& a2, const AtomHandle& a3,
00275 const AtomHandle& a4);
00279 void DeleteChain(const ChainHandle& chain);
00280
00286 void DeleteResidue(const ResidueHandle& residue_handle);
00287
00289 void ReorderResidues(const ChainHandle& chain);
00290
00292 void ReorderAllResidues();
00293
00303 void RenumberAllResidues(int start, bool keep_spacing);
00304
00305
00306 void RenumberChain(ChainHandle chain, const ResNumList& new_numbers);
00307
00321 void RenumberChain(const ChainHandle& chain, int start, bool keep_spacing);
00322
00324 EditMode GetMode() const {return mode_;}
00325
00327 EntityHandle GetEntity() const {return ent_;}
00328
00330 void RenameAtom(AtomHandle atom, const String& new_name);
00331 protected:
00332 EditorBase(const EntityHandle& ent, EditMode mode);
00333 void UpdateTrace();
00334 EntityHandle ent_;
00335 EditMode mode_;
00336 };
00337
00338 }}
00339
00340 #endif