Skip to content
Snippets Groups Projects
Commit 99b3fb88 authored by Gabriel Studer's avatar Gabriel Studer
Browse files

add delete bond functionality to editors

parent d3bfb360
Branches
Tags
No related merge requests found
......@@ -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)
......
......@@ -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);
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment