diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc index 31642fee31bff6b7e4f621bd0376f75647891015..9e8729d9374391321f511f8e17e1bef79b81d327 100644 --- a/modules/mol/base/src/editor_base.cc +++ b/modules/mol/base/src/editor_base.cc @@ -208,9 +208,13 @@ void EditorBase::RenumberAllResidues(int start, bool keep_spacing) ent_.Impl()->RenumberAllResidues(start, keep_spacing); } -void EditorBase::RenumberChain(const String& name, int start, bool keep_spacing) +void EditorBase::RenumberChain(const ChainHandle& chain, int start, bool keep_spacing) { - ent_.Impl()->RenumberChain(name, start, keep_spacing); + CheckHandleValidity(chain); + if(chain.GetEntity()!=ent_){ + throw Error("Chain does not belong to the editors entity!"); + } + chain.Impl()->RenumberAllResidues(start, keep_spacing); } void EditorBase::RenameAtom(AtomHandle atom, const String& new_name) diff --git a/modules/mol/base/src/editor_base.hh b/modules/mol/base/src/editor_base.hh index ad87fe149adf3af3e8d9168632be6e7d1192fdae..05d82ddb0682e12737b629947f010947cb009842 100644 --- a/modules/mol/base/src/editor_base.hh +++ b/modules/mol/base/src/editor_base.hh @@ -293,7 +293,7 @@ public: /// \param keep_spacing /// If set to false, residues will continously be renumbered ongoing from start. /// Otherwise the spacings between the residues are kept. - void RenumberChain(const String& name, int start, bool keep_spacing); + void RenumberChain(const ChainHandle& chain, int start, bool keep_spacing); /// \brief Get edit mode of editor EditMode GetMode() const {return mode_;} diff --git a/modules/mol/base/src/impl/entity_impl.cc b/modules/mol/base/src/impl/entity_impl.cc index f8fa19e32b363590ccb7b10d536e1c72f3a3eba2..1fd465f235f4d05f7d29d727b4b423dc6a69d277 100644 --- a/modules/mol/base/src/impl/entity_impl.cc +++ b/modules/mol/base/src/impl/entity_impl.cc @@ -1202,16 +1202,4 @@ void EntityImpl::RenumberAllResidues(int start, bool keep_spacing) } -void EntityImpl::RenumberChain(const String& name, int start, bool keep_spacing) -{ - ChainImplPtr ch=this->FindChain(name); - - if(!ch) { - throw Error("Could not find chain with name "+name); - } - - ch->RenumberAllResidues(start, keep_spacing); - -} - }}} // ns diff --git a/modules/mol/base/src/impl/entity_impl.hh b/modules/mol/base/src/impl/entity_impl.hh index 74d8ded333567b09e2b9da6c5843c57a646c6884..c95bef408db5c911b40b71b6ae460baa5890b827 100644 --- a/modules/mol/base/src/impl/entity_impl.hh +++ b/modules/mol/base/src/impl/entity_impl.hh @@ -251,8 +251,6 @@ public: void RenumberAllResidues(int start, bool keep_spacing); - void RenumberChain(const String& name, int start, bool keep_spacing); - private: void DoCopy(EntityImplPtr dest);