diff --git a/modules/mol/base/pymod/export_editors.cc b/modules/mol/base/pymod/export_editors.cc index 09751b1116becb6fd77d50bb538a146a687cbf37..d7645c0bbdfa04087986e068d707a784f77a900a 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 6657c867c11d0bd80d2c805a1e59bbf02bf7d5d4..cacc8199d4a3f6e44dabb659765a1a3c2f03b65d 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 cd8a4310733c614fa333e58ca51b6ee9a3d8967a..0caf51ea897432656fef802335392dc269c40449 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);