From ce6805624240e5a6e34ebb71718703b1d1c1a066 Mon Sep 17 00:00:00 2001 From: Ansgar Philippsen <ansgar.philippsen@gmail.com> Date: Thu, 5 May 2011 11:22:51 -0400 Subject: [PATCH] fix for BZDNG-253: atom index is now properly maintained upon entity copy --- modules/mol/base/src/impl/atom_impl.cc | 1 - modules/mol/base/src/impl/entity_impl.cc | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mol/base/src/impl/atom_impl.cc b/modules/mol/base/src/impl/atom_impl.cc index 29e2c565f..3339ead62 100644 --- a/modules/mol/base/src/impl/atom_impl.cc +++ b/modules/mol/base/src/impl/atom_impl.cc @@ -54,7 +54,6 @@ AtomImpl::AtomImpl(const EntityImplPtr& e, connector_list_(), fragment_(), state_(0), - index_(index) { EntityHandle ent = this->GetEntity(); diff --git a/modules/mol/base/src/impl/entity_impl.cc b/modules/mol/base/src/impl/entity_impl.cc index 4e311ddc0..58d2bce06 100644 --- a/modules/mol/base/src/impl/entity_impl.cc +++ b/modules/mol/base/src/impl/entity_impl.cc @@ -147,6 +147,7 @@ void EntityImpl::ReplicateHierarchy(EntityImplPtr dest) e3=src_res->GetAtomList().end(); k!=e3; ++k) { AtomImplPtr src_atom=*k; AtomImplPtr dst_atom=dst_res->InsertAtom(src_atom); + dst_atom->SetIndex(src_atom->GetIndex()); } } } @@ -229,6 +230,7 @@ void EntityImpl::DoCopy(EntityImplPtr dest) // first copy the chain - residue - atom hierarchy before replicating the // bond network and the torsions dest->SetName(this->GetName()); + dest->next_index_=0; this->ReplicateHierarchy(dest); this->DoCopyBondsAndTorsions(dest); } -- GitLab