diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc index b6cc4ab455036672b612e2d37f4ccfa93414b9c5..76e41f216e989e543d577a80e18527e2170febe3 100644 --- a/modules/mol/base/src/editor_base.cc +++ b/modules/mol/base/src/editor_base.cc @@ -42,8 +42,7 @@ ChainHandle EditorBase::InsertChain(const String& chain_name) ChainHandle EditorBase::InsertChain(const String& chain_name, ChainHandle chain, bool deep) { - impl::ChainImplPtr inserted_chain=ent_.Impl()->InsertChain(chain.Impl(), deep); - inserted_chain->SetName(chain_name); + impl::ChainImplPtr inserted_chain=ent_.Impl()->InsertChain(chain_name, chain.Impl(), deep); return inserted_chain; } diff --git a/modules/mol/base/src/impl/entity_impl.cc b/modules/mol/base/src/impl/entity_impl.cc index 865ef7172ebf5452e9acdc737ea170f068ad01f3..937a63213164791056f34434b5c69267f8dc1047 100644 --- a/modules/mol/base/src/impl/entity_impl.cc +++ b/modules/mol/base/src/impl/entity_impl.cc @@ -126,9 +126,9 @@ EntityImplPtr EntityImpl::Copy() return ent_p; } -ChainImplPtr EntityImpl::InsertChain(const ChainImplPtr& chain, bool deep) +ChainImplPtr EntityImpl::InsertChain(const String& chain_name, const ChainImplPtr& chain, bool deep) { - ChainImplPtr dst_chain=this->InsertChain(chain->GetName()); + ChainImplPtr dst_chain=this->InsertChain(chain_name); dst_chain->Assign(*chain.get()); if(deep) { @@ -147,7 +147,7 @@ void EntityImpl::ReplicateHierarchy(EntityImplPtr dest) for (ChainImplList::const_iterator i=chain_list_.begin(), e1=chain_list_.end(); i!=e1; ++i) { ChainImplPtr src_chain=*i; - dest->InsertChain(src_chain,true); + dest->InsertChain(src_chain->GetName(),src_chain,true); } } diff --git a/modules/mol/base/src/impl/entity_impl.hh b/modules/mol/base/src/impl/entity_impl.hh index 6862e5e27f2d827c17aee720725b9b0ebda97100..5033bd55e806f4cb21331649a663ac36ef28fe7f 100644 --- a/modules/mol/base/src/impl/entity_impl.hh +++ b/modules/mol/base/src/impl/entity_impl.hh @@ -111,7 +111,7 @@ public: /// The chain will have no residues and atoms // force deep to be set explicitely, because it is better than implicit // (and since we are on the impl level interface consistency isn't that critical) - ChainImplPtr InsertChain(const ChainImplPtr& chain, bool deep); + ChainImplPtr InsertChain(const String& chain_name, const ChainImplPtr& chain, bool deep); ConnectorImplP Connect(const AtomImplPtr& first, const AtomImplPtr& second, Real len, Real theta, Real phi, unsigned char bond_order);