diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc index 410e1b03b20b14553ff5352cbacef18f05d673cd..022109e062fa53e4be69a7c919e98c0350de6e5e 100644 --- a/modules/mol/base/src/editor_base.cc +++ b/modules/mol/base/src/editor_base.cc @@ -22,7 +22,7 @@ #include "impl/entity_impl.hh" #include "impl/chain_impl.hh" #include "impl/residue_impl.hh" - +#include "impl/atom_impl.hh" #include "mol.hh" /* @@ -125,6 +125,12 @@ void EditorBase::DeleteResidue(const ResidueHandle& residue_handle) residue_handle.GetChain().Impl()->DeleteResidue(residue_handle.Impl()); } +void EditorBase::RenameAtom(AtomHandle atom, const String& new_name) +{ + CheckHandleValidity(atom); + atom.Impl()->SetName(new_name); +} + BondHandle EditorBase::Connect(const AtomHandle& first, const AtomHandle& second) { CheckHandleValidity(first); diff --git a/modules/mol/base/src/editor_base.hh b/modules/mol/base/src/editor_base.hh index 110c6b668f0a314b81e266017a026c999068f766..4a1ab915ab074fc03bd18c7056c11ac9a377e215 100644 --- a/modules/mol/base/src/editor_base.hh +++ b/modules/mol/base/src/editor_base.hh @@ -187,6 +187,9 @@ public: /// \brief Get edit mode of editor EditMode GetMode() const; + + /// \brief change the name of the atom to the new name + void RenameAtom(AtomHandle atom, const String& new_name); protected: EditorBase(const EntityHandle& ent, EditMode mode); void UpdateTrace();