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

Added stride to CoordGroup::Filter

parent a16376e0
Branches
Tags
No related merge requests found
......@@ -75,7 +75,7 @@ void export_CoordGroup()
.add_property("start_time",&CoordGroupHandle::GetStartTime,&CoordGroupHandle::SetStartTime)
.def("__getitem__",cg_getitem)
.def("__setitem__",cg_setitem)
.def("Filter", &CoordGroupHandle::Filter, (arg("selected"),arg("first")=0,arg("last")=-1))
.def("Filter", &CoordGroupHandle::Filter, (arg("selected"),arg("first")=0,arg("last")=-1,arg("stride")=1))
;
def("CreateCoordGroup",CreateCoordGroup);
......
......@@ -220,7 +220,7 @@ void CoordGroupHandle::Capture(uint frame)
}
}
CoordGroupHandle CoordGroupHandle::Filter(const EntityView& selected, int first, int last) const
CoordGroupHandle CoordGroupHandle::Filter(const EntityView& selected, int first, int last, int stride) const
{
this->CheckValidity();
std::vector<unsigned long> indices;
......@@ -248,7 +248,8 @@ CoordGroupHandle CoordGroupHandle::Filter(const EntityView& selected, int first,
CoordGroupHandle filtered_cg=CreateCoordGroup(new_ent.GetAtomList());
std::vector<geom::Vec3> vecs(indices.size());
if (last==-1) last=this->GetFrameCount();
for (int i=first; i<last; ++i) {
if (stride<=0) stride=1;
for (int i=first; i<last; i=i+stride) {
LOG_INFO("Filtering frame " << i << "/" << last);
CoordFramePtr frame=this->GetFrame(i);
for (std::vector<unsigned long>::const_iterator
......
......@@ -109,7 +109,7 @@ public:
/// \brief return a filtered coord group, containing only the atoms in the
/// view
CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1) const;
CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1,int stride=1) const;
/// \brief apply in-place transform to each coordinate in each frame
void ApplyTransform(const geom::Transform& tf);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment