diff --git a/modules/mol/base/pymod/export_coord_group.cc b/modules/mol/base/pymod/export_coord_group.cc index c6f30e8f5cf1b772d989b34b90e7b2f8072f1513..fa3a06132292cc2e65d727197e2888832c54da0b 100644 --- a/modules/mol/base/pymod/export_coord_group.cc +++ b/modules/mol/base/pymod/export_coord_group.cc @@ -47,7 +47,9 @@ void export_CoordGroup() .def("GetEntity",&CoordGroupHandle::GetEntity) .def("GetAtomCount",&CoordGroupHandle::GetAtomCount) .def("AddFrames", &CoordGroupHandle::AddFrames) + .def("AddFrame", &CoordGroupHandle::AddFrame) .def("GetFrameCount",&CoordGroupHandle::GetFrameCount) + .def("GetFramePositions",&CoordGroupHandle::GetFramePositions) .def("SetFramePositions",&CoordGroupHandle::SetFramePositions) .def("SetAtomPos",&CoordGroupHandle::SetAtomPos) .def("GetAtomPos",&CoordGroupHandle::GetAtomPos) diff --git a/modules/mol/base/src/coord_group.cc b/modules/mol/base/src/coord_group.cc index 47622e9017071fddc6fb001565f5bb12c4b5e715..127c82463bf20c1df65f2f0234d3474bdc3c78ed 100644 --- a/modules/mol/base/src/coord_group.cc +++ b/modules/mol/base/src/coord_group.cc @@ -73,6 +73,14 @@ void CoordGroupHandle::SetFramePositions(uint frame, //source_->SetFramePositions(frame, clist); } + +geom::Vec3List CoordGroupHandle::GetFramePositions(uint frame) + { + this->CheckValidity(); + return *(this->GetFrame(frame)); + } + + void CoordGroupHandle::CopyFrame(uint frame) { this->CheckValidity(); diff --git a/modules/mol/base/src/coord_group.hh b/modules/mol/base/src/coord_group.hh index 57701931bff1e4740e15aa5eb76d15301ee7e508..22a829dd662f50d8bee3cb6490806ca120039f01 100644 --- a/modules/mol/base/src/coord_group.hh +++ b/modules/mol/base/src/coord_group.hh @@ -52,6 +52,9 @@ public: /// initial atomlist void SetFramePositions(uint frame, const std::vector<geom::Vec3>& clist); + /// \brief get the positions of all the atoms in the given frame + geom::Vec3List GetFramePositions(uint frame); + /// \brief copy atom positions of given frame to stored atoms in entity void CopyFrame(uint frame);