From eac6d6ecc4c36dc840cbb2e5391eb7a8980354b4 Mon Sep 17 00:00:00 2001 From: tobias <tobias@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Thu, 22 Apr 2010 12:22:50 +0000 Subject: [PATCH] small extension to ICSEditor::RotateTorsionAngle git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2106 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/mol/base/pymod/export_editors.cc | 8 +++++++- modules/mol/base/src/ics_editor.cc | 17 +++++++++++++++++ modules/mol/base/src/ics_editor.hh | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/modules/mol/base/pymod/export_editors.cc b/modules/mol/base/pymod/export_editors.cc index 09751b111..d7645c0bb 100644 --- a/modules/mol/base/pymod/export_editors.cc +++ b/modules/mol/base/pymod/export_editors.cc @@ -48,6 +48,11 @@ void (ICSEditor::*set_torsion_a)(TorsionHandle, Real)=&ICSEditor::SetTorsionAngl void (ICSEditor::*set_torsion_b)(const AtomHandle&, const AtomHandle&, const AtomHandle&, const AtomHandle&, Real)=&ICSEditor::SetTorsionAngle; + +void (ICSEditor::*rotate_torsion_a)(TorsionHandle, Real)=&ICSEditor::RotateTorsionAngle; +void (ICSEditor::*rotate_torsion_b)(const AtomHandle&, const AtomHandle&, + const AtomHandle&, const AtomHandle&, + Real)=&ICSEditor::RotateTorsionAngle; BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(X_insert_atom_overloads, EditorBase::InsertAtom, 3, 4) @@ -94,7 +99,8 @@ void export_Editors() .def("SetBondLength", &ICSEditor::SetBondLength) .def("SetTorsionAngle", set_torsion_a) .def("SetTorsionAngle", set_torsion_b) - .def("RotateTorsionAngle", &ICSEditor::RotateTorsionAngle) + .def("RotateTorsionAngle", rotate_torsion_a) + .def("RotateTorsionAngle", rotate_torsion_b) .def("UpdateXCS", &ICSEditor::UpdateXCS) .def("__exit__", &ICSEditor::UpdateXCS) ; diff --git a/modules/mol/base/src/ics_editor.cc b/modules/mol/base/src/ics_editor.cc index 6657c867c..cacc8199d 100644 --- a/modules/mol/base/src/ics_editor.cc +++ b/modules/mol/base/src/ics_editor.cc @@ -113,6 +113,23 @@ void ICSEditor::RotateTorsionAngle(TorsionHandle torsion, Real angle) } +void ICSEditor::RotateTorsionAngle(const AtomHandle& atom_a, + const AtomHandle& atom_b, + const AtomHandle& atom_c, + const AtomHandle& atom_d, Real angle) +{ + CheckHandleValidity(atom_a); + CheckHandleValidity(atom_b); + CheckHandleValidity(atom_c); + CheckHandleValidity(atom_d); + impl::Dihedral d(atom_a.Impl(), atom_b.Impl(), atom_c.Impl(), atom_d.Impl()); + Real cur_angle=d.GetAngleICS(); + d.SetAngleICS(cur_angle+angle); + ent_.Impl()->MarkXCSDirty(); + this->Update(); +} + + void ICSEditor::SetTorsionAngle(const AtomHandle& atom_a, const AtomHandle& atom_b, const AtomHandle& atom_c, diff --git a/modules/mol/base/src/ics_editor.hh b/modules/mol/base/src/ics_editor.hh index cd8a43107..0caf51ea8 100644 --- a/modules/mol/base/src/ics_editor.hh +++ b/modules/mol/base/src/ics_editor.hh @@ -78,6 +78,12 @@ public: /// \brief rotate torsion angle void RotateTorsionAngle(TorsionHandle torsion, Real delta); + void RotateTorsionAngle(const AtomHandle& atom_a, + const AtomHandle& atom_b, + const AtomHandle& atom_c, + const AtomHandle& atom_d, + Real angle); + void SetTorsionAngle(const AtomHandle& atom_a, const AtomHandle& atom_b, const AtomHandle& atom_c, const AtomHandle& atom_d, Real angle); -- GitLab