diff --git a/modules/mol/base/pymod/export_editors.cc b/modules/mol/base/pymod/export_editors.cc index 6a659d286e095a8436dc338b9f9492f70e857f45..cd7b326fdbcc88581feb24e2af2deb838ff435b0 100644 --- a/modules/mol/base/pymod/export_editors.cc +++ b/modules/mol/base/pymod/export_editors.cc @@ -243,6 +243,8 @@ void export_Editors() .def("DeleteResidue", &EditorBase::DeleteResidue) .def("DeleteChain", &EditorBase::DeleteChain) .def("DeleteAtom", &EditorBase::DeleteAtom) + .def("DeleteBond", &EditorBase::DeleteBond) + .def("DeleteBonds", &EditorBase::DeleteBonds) .def("InsertResidueBefore", &EditorBase::InsertResidueBefore) .def("InsertResidueAfter", &EditorBase::InsertResidueAfter) .def("AppendResidue", append_a) diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc index 76e41f216e989e543d577a80e18527e2170febe3..364ea0be0bbbd07f44073d6e65b9723e1039e25f 100644 --- a/modules/mol/base/src/editor_base.cc +++ b/modules/mol/base/src/editor_base.cc @@ -193,6 +193,19 @@ void EditorBase::DeleteAtom(const AtomHandle& atom_handle) atom_handle.GetResidue().Impl()->DeleteAtom(atom_handle.Impl()); } +void EditorBase::DeleteBond(const BondHandle& bond) +{ + bond.GetFirst().Impl()->DeleteConnector(bond.Impl(),true); +} + +void EditorBase::DeleteBonds(const BondHandleList& bond_list) +{ + for(BondHandleList::const_iterator i = bond_list.begin(); + i != bond_list.end(); ++i){ + i->GetFirst().Impl()->DeleteConnector(i->Impl(),true); + } +} + void EditorBase::DeleteResidue(const ResidueHandle& residue_handle) { CheckHandleValidity(residue_handle); diff --git a/modules/mol/base/src/editor_base.hh b/modules/mol/base/src/editor_base.hh index 255390c29dc3f3e7e286ad5ea966748b75ab72b2..a53391767bfb006b7670b3922f9c8ae23872008a 100644 --- a/modules/mol/base/src/editor_base.hh +++ b/modules/mol/base/src/editor_base.hh @@ -248,6 +248,20 @@ public: /// /// All associated torsions and bonds will be removed as well void DeleteAtoms(const AtomHandleList& atoms); + + /// \ brief Delete bond + /// + /// \param bond + /// Is the bond to remove. If no such bond exists, this method will + /// have no effect + void DeleteBond(const BondHandle& bond); + + /// \ brief Delete a set of bond + /// + /// \param bonds + /// bonds to remove. If no such bonds exist, this method will + /// have no effect + void DeleteBonds(const BondHandleList& bonds); /// \brief Add named torsion to entity TorsionHandle AddTorsion(const String& name, const AtomHandle& a1,