Skip to content
Snippets Groups Projects
Commit eef9f076 authored by Niklaus Johner's avatar Niklaus Johner
Browse files

Fixed the atom indices in the entity generated in the CoordGroup::Filter function

parent b67a85eb
Branches
Tags
No related merge requests found
......@@ -240,5 +240,12 @@ unsigned long AtomBase::GetIndex() const
return Impl()->GetIndex();
}
void AtomBase::SetIndex(const unsigned long index)
{
this->CheckValidity();
return impl_->SetIndex(index);
}
}} // ns
......@@ -141,6 +141,7 @@ public:
void SetRadius(Real radius);
void SetIndex (const unsigned long index);
const geom::Mat3& GetAnisou() const;
......
......@@ -239,8 +239,12 @@ CoordGroupHandle CoordGroupHandle::Filter(const EntityView& selected, int first,
indices.push_back(i->GetIndex());
}
new_ent=CreateEntityFromView(selected, false);
//we have to correct the atom indices in the new entity
AtomHandleList new_atoms=new_ent.GetAtomList();
for (int i=0,e=atoms.size();i!=e;++i){
new_atoms[i].SetIndex(i);
}
}
CoordGroupHandle filtered_cg=CreateCoordGroup(new_ent.GetAtomList());
std::vector<geom::Vec3> vecs(indices.size());
if (last==-1) last=this->GetFrameCount();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment