diff --git a/modules/mol/base/pymod/export_entity.cc b/modules/mol/base/pymod/export_entity.cc index 67d273b09a1db687a7b651f1ce89ff85c2e2479f..a3624877abe4bc0c9636d3e312278170c5506bba 100644 --- a/modules/mol/base/pymod/export_entity.cc +++ b/modules/mol/base/pymod/export_entity.cc @@ -46,6 +46,10 @@ StringMethod select_string=&EntityHandle::Select; //Connect1 conn1=&EntityHandle::Connect; //Connect2 conn2=&EntityHandle::Connect; + +Real (EntityHandle::*get_angle1)(const AtomHandle&, const AtomHandle&, const AtomHandle&) const = &EntityHandle::GetAngle; +Real (EntityHandle::*get_angle2)(const AtomView&, const AtomView&, const AtomView&) const = &EntityHandle::GetAngle; + BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_xcs_editor_overloads, EntityHandle::RequestXCSEditor, 0, 1) BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_ics_editor_overloads, @@ -92,7 +96,8 @@ void export_Entity() .add_property("residue_count", &EntityHandle::GetResidueCount) .add_property("atom_count", &EntityHandle::GetAtomCount) .def("FindWithin", &EntityHandle::FindWithin) - .def("GetAngle", &EntityHandle::GetAngle) + .def("GetAngle", get_angle1) + .def("GetAngle", get_angle2) .def("FindTorsion", &EntityHandle::FindTorsion) .def("Apply", &EntityHandle::Apply) .def("Copy", &EntityHandle::Copy) diff --git a/modules/mol/base/pymod/export_entity_view.cc b/modules/mol/base/pymod/export_entity_view.cc index 765c33f57cba357de42db3a744937a9cf77fe58b..66bd21c44c541d691ff3230c87ff58ece24d4de8 100644 --- a/modules/mol/base/pymod/export_entity_view.cc +++ b/modules/mol/base/pymod/export_entity_view.cc @@ -83,6 +83,9 @@ void export_EntityView() void (EntityView::* apply1)(EntityVisitor&) = &EntityView::Apply; void (EntityView::* apply2)(EntityViewVisitor&) = &EntityView::Apply; + Real (EntityView::*get_angle1)(const AtomHandle&, const AtomHandle&, const AtomHandle&) const = &EntityView::GetAngle; + Real (EntityView::*get_angle2)(const AtomView&, const AtomView&, const AtomView&) const = &EntityView::GetAngle; + class_<EntityView, bases<EntityBase> >("EntityView", no_init) .def("Apply",apply1) .def("Apply",apply2) @@ -102,6 +105,8 @@ void export_EntityView() .def("GetResidueCount", &EntityView::GetResidueCount) .def("GetChainCount", &EntityView::GetChainCount) .def("GetBondCount", &EntityView::GetBondCount) + .def("GetAngle", get_angle1) + .def("GetAngle", get_angle2) .def("FindChain", find_chain_hnd) .def("RemoveChain", &EntityView::RemoveChain) .def("FindWithin", &EntityView::FindWithin) diff --git a/modules/mol/base/src/entity_handle.cc b/modules/mol/base/src/entity_handle.cc index bbbcd5ceb3fe57980f5e5437a6119b5f83390e60..b0ac01f09e135c5110bf970af372b13ebbf14590 100644 --- a/modules/mol/base/src/entity_handle.cc +++ b/modules/mol/base/src/entity_handle.cc @@ -215,6 +215,12 @@ Real EntityHandle::GetAngle(const AtomHandle& a1, const AtomHandle& a2, return Impl()->GetAngle(a1.Impl(), a2.Impl(), a3.Impl()); } +Real EntityHandle::GetAngle(const AtomView& a1, const AtomView& a2, + const AtomView& a3) const +{ + return GetAngle(a1.GetHandle(), a2.GetHandle(), a3.GetHandle()); +} + const geom::Mat4& EntityHandle::GetTransformationMatrix() const { diff --git a/modules/mol/base/src/entity_handle.hh b/modules/mol/base/src/entity_handle.hh index da951984115ff1973dc2d7ff847e2d3fc0b4f049..9bb291d8ea21cd21907ee65ec4d20b09ed1d99e7 100644 --- a/modules/mol/base/src/entity_handle.hh +++ b/modules/mol/base/src/entity_handle.hh @@ -253,6 +253,10 @@ public: Real GetAngle(const AtomHandle& a1, const AtomHandle& a2, const AtomHandle& a3) const; + /// \brief Get angle in radians between bonds a1-a2 and a2-a3 + Real GetAngle(const AtomView& a1, const AtomView& a2, + const AtomView& a3) const; + const geom::Mat4& GetTransformationMatrix() const; diff --git a/modules/mol/base/src/entity_view.cc b/modules/mol/base/src/entity_view.cc index 00e9585ce2b5717c3ca339386a48b2ad08ffdfa8..6616e3b985921427e5319d7c1b10176980339e0a 100644 --- a/modules/mol/base/src/entity_view.cc +++ b/modules/mol/base/src/entity_view.cc @@ -697,6 +697,19 @@ std::pair<Real,Real> EntityView::GetMinMax(const String& prop, return std::make_pair(min_v,max_v); } +Real EntityView::GetAngle(const AtomHandle& a1, const AtomHandle& a2, + const AtomHandle& a3) const +{ + return this->GetHandle().GetAngle(a1,a2,a3); +} + +Real EntityView::GetAngle(const AtomView& a1, const AtomView& a2, + const AtomView& a3) const +{ + return this->GetHandle().GetAngle(a1.GetHandle(),a2.GetHandle(),a3.GetHandle()); +} + + #ifdef _MSC_VER AtomView EntityView::AddXAtom(const AtomHandle& ah, ViewAddFlags flags) { diff --git a/modules/mol/base/src/entity_view.hh b/modules/mol/base/src/entity_view.hh index e191e6595fcad242cdc9dbcbbbc6d667b72a1b61..e55894da5fa97e37911942c0151abd01f8ce2eab 100644 --- a/modules/mol/base/src/entity_view.hh +++ b/modules/mol/base/src/entity_view.hh @@ -284,6 +284,14 @@ public: std::pair<Real,Real> GetMinMax(const String& prop, Prop::Level hint=Prop::UNSPECIFIED) const; + /// \brief Get angle in radians between bonds a1-a2 and a2-a3 + Real GetAngle(const AtomHandle& a1, const AtomHandle& a2, + const AtomHandle& a3) const; + + /// \brief Get angle in radians between bonds a1-a2 and a2-a3 + Real GetAngle(const AtomView& a1, const AtomView& a2, + const AtomView& a3) const; + /// \brief returns a string containing a human-readable summary of the /// entity view String Dump() const;