Skip to content
Snippets Groups Projects
Commit 386ec0f7 authored by valerio's avatar valerio
Browse files

GetAngle interface for EntityViews and taking AtomViews

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2071 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 14844cbd
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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)
......
......@@ -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
{
......
......@@ -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;
......
......@@ -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)
{
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment