From 4dd6d98e1f31841930ba8b84f3fcc92f7ead04e0 Mon Sep 17 00:00:00 2001 From: valerio <valerio@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Tue, 22 Jun 2010 11:57:32 +0000 Subject: [PATCH] Removed Apply methods from export and docs git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2438 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/mol/base/doc/entity.rst | 44 +++---------------- modules/mol/base/pymod/export_atom.cc | 1 - modules/mol/base/pymod/export_atom_view.cc | 4 -- modules/mol/base/pymod/export_bond.cc | 5 --- modules/mol/base/pymod/export_chain.cc | 1 - modules/mol/base/pymod/export_chain_view.cc | 5 --- modules/mol/base/pymod/export_entity_view.cc | 5 --- modules/mol/base/pymod/export_residue.cc | 1 - modules/mol/base/pymod/export_residue_view.cc | 5 --- 9 files changed, 6 insertions(+), 65 deletions(-) diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst index 3098c265c..8aa95e6a8 100644 --- a/modules/mol/base/doc/entity.rst +++ b/modules/mol/base/doc/entity.rst @@ -247,12 +247,6 @@ The Handle Classes See :attr:`mass` - .. method:: Apply(visitor) - - Apply EntityVisitor to the entity. In Python, you usually don't need this - function bother using. EntityVisitors are mainly used in C++ to implement - algorithms that are able to operate on :class:`EntityViews <EntityView>` - and :class:`entity handles<EntityHandle>` at the same time. .. method:: FindWithin(pos, radius) @@ -605,15 +599,6 @@ The Handle Classes :type: list of :class:`bond handles<BondHandle>` - .. method:: Apply(visitor) - - Apply an entity visitor to the atom. In Python, you usually don't have to - use this method. It is mainly used in C++ to write algorithms that work on - both :class:`EntityHandle` and :class:`EntityView` at the same time. - - :param visitor: The entity visitor - :type visitor: :class:`EntityVisitor` - .. method:: FindBondToAtom(other_atom) Finds and returns the bond formed between this atom and `other_atom`. If no @@ -804,14 +789,14 @@ The View Classes .. method:: CreateFullView() - Returns a copy of this entity. Provided for duck-typing purposes. + Returns a copy of this entity. Provided for `duck-typing <http://en.wikipedia.org/wiki/Duck_typing>` purposes. :rtype: EntityView .. method:: AddChain(chain_handle[, view_add_flags]) Add chain to view. By default, only the chain is added to the view, but not - its residues and atoms. This behaviour can be changed by passing in an + its residues and atoms. This behavior can be changed by passing in an appropriate set of `view_add_flags` :param chain_handle: @@ -876,7 +861,6 @@ The View Classes :type residue: ResidueView - .. method:: RemoveAtom(atom) Remove atom from view @@ -959,6 +943,7 @@ The View Classes .. method:: GetMass() Get total mass of view. + :rtype: float .. method:: GetCenterOfMass() @@ -970,8 +955,8 @@ The View Classes .. method:: GetGeometricCenter() - Get the geometric center, that is the centerof the axis-aligned - bounding box. + Get the geometric center (the center of the axis-aligned + bounding box). :rtype: :class:`~ost.geom.Vec3` @@ -979,7 +964,6 @@ The View Classes :rtype: :class:`~ost.geom.Vec3` - .. attribute:: chain_count Number of chains. Read-only. See :meth:`GetChainCount`. @@ -1022,14 +1006,6 @@ The View Classes :rtype: int - .. method:: Apply(visitor) - - Apply entity visitor to view. In Python, you usually don't have to use this - method. See :meth:`EntityHandle.Apply` - - :param visitor: - :type visitor: class:`EntityVisitor` - .. method:: GetResidueCount() See :attr:`residue_count` @@ -1052,7 +1028,6 @@ The View Classes :rtype: class:`ResidueViewList` - .. method:: GetGeometricEnd() :rtype: :class:`~ost.geom.Vec3` @@ -1070,7 +1045,6 @@ The View Classes .. class:: ChainView - .. attribute:: name The chain name. The name uniquely identifies the chain in the entity. In @@ -1161,7 +1135,6 @@ The View Classes :type: bool - .. method:: AddAtom(atom_handle[, view_add_flags]) Add atom to the view. If the residue of the atom is not already part of the @@ -1178,7 +1151,7 @@ The View Classes Add residue to the view. If the atom does not belong to chain, the result is undefined. By default, only the residue, but no atoms are added to the view. - To change the behaviour, pass in a suitable combination of `view_add_flags`. + To change the behavior, pass in a suitable combination of `view_add_flags`. :param residue_handle: :type residue_handle: :class:`ResidueHandle` @@ -1208,7 +1181,6 @@ The View Classes :rtype: :class:`ResidueView` :returns: The residue view, or an invalid residue view if no residue with the given residue number is in the view. - .. method:: GetCenterOfAtoms() @@ -1222,11 +1194,9 @@ The View Classes See :attr:`entity` - .. method:: GetGeometricCenter() See :attr:`geometric_center` - .. method:: GetHandle() @@ -1258,7 +1228,6 @@ The View Classes .. method:: InSequence() See :attr:`in_sequence` - .. method:: IsValid() @@ -1297,7 +1266,6 @@ The View Classes :param visitor: The visitor :type visitor: :class:`EntityVisitor` - .. class:: ResidueView .. attribute:: name diff --git a/modules/mol/base/pymod/export_atom.cc b/modules/mol/base/pymod/export_atom.cc index 90449eda7..13fc2ee55 100644 --- a/modules/mol/base/pymod/export_atom.cc +++ b/modules/mol/base/pymod/export_atom.cc @@ -76,7 +76,6 @@ void export_Atom() class_<AtomHandle, bases<AtomBase> >("AtomHandle", init<>()) .def("GetResidue",&AtomHandle::GetResidue) .add_property("residue",&AtomHandle::GetResidue) - .def("Apply", &AtomHandle::Apply, args("visitor")) .def("GetBondList", &AtomHandle::GetBondList) .def("GetBondCount", &AtomHandle::GetBondCount) .add_property("valid", &AtomHandle::IsValid) diff --git a/modules/mol/base/pymod/export_atom_view.cc b/modules/mol/base/pymod/export_atom_view.cc index 3b4683264..d8bc4a0ee 100644 --- a/modules/mol/base/pymod/export_atom_view.cc +++ b/modules/mol/base/pymod/export_atom_view.cc @@ -28,14 +28,10 @@ using namespace ost::mol; void export_AtomView() { - void (AtomView::* apply1)(EntityVisitor&) = &AtomView::Apply; - void (AtomView::* apply2)(EntityViewVisitor&) = &AtomView::Apply; class_<AtomView, bases<AtomBase> >("AtomView", init<>()) .def("GetResidue",&AtomView::GetResidue) .add_property("residue",&AtomView::GetResidue) - .def("Apply", apply1, args("visitor")) - .def("Apply", apply2, args("visitor")) .def(self==self) .def(self!=self) .add_property("handle", &AtomView::GetHandle) diff --git a/modules/mol/base/pymod/export_bond.cc b/modules/mol/base/pymod/export_bond.cc index ddfde4721..e409f0a86 100644 --- a/modules/mol/base/pymod/export_bond.cc +++ b/modules/mol/base/pymod/export_bond.cc @@ -30,9 +30,6 @@ using namespace ost::mol; void export_Bond() { - void (BondHandle::* apply1)(EntityVisitor&) = &BondHandle::Apply; - void (BondHandle::* apply2)(EntityViewVisitor&) = &BondHandle::Apply; - class_<BondHandle> bond_handle("BondHandle", init<>()); bond_handle .def("GetPos", &BondHandle::GetPos) @@ -55,8 +52,6 @@ void export_Bond() .def("GetBondOrder",&BondHandle::GetBondOrder) .def("SetBondOrder",&BondHandle::SetBondOrder) .def("IsValid", &BondHandle::IsValid) - .def("Apply",apply1) - .def("Apply",apply2) .def(self == self) .def(self != self) .def(self_ns::str(self)) diff --git a/modules/mol/base/pymod/export_chain.cc b/modules/mol/base/pymod/export_chain.cc index 35c6b7acc..a0c603fd7 100644 --- a/modules/mol/base/pymod/export_chain.cc +++ b/modules/mol/base/pymod/export_chain.cc @@ -65,7 +65,6 @@ void export_Chain() //.def("AppendResidue", append_one_arg, args("residue_key")) //.def("AppendResidue", append_two_arg, args("residue_key", // "residue_number")) - .def("Apply", &ChainHandle::Apply, args("visitor")) .def("GetNext", &ChainHandle::GetNext) .def("GetPrev", &ChainHandle::GetPrev) //.def("InsertResidueBefore", &ChainHandle::InsertResidueBefore, diff --git a/modules/mol/base/pymod/export_chain_view.cc b/modules/mol/base/pymod/export_chain_view.cc index c0c1e7324..ee6753b52 100644 --- a/modules/mol/base/pymod/export_chain_view.cc +++ b/modules/mol/base/pymod/export_chain_view.cc @@ -61,9 +61,6 @@ void export_ChainView() .def(ost::VectorAdditions<ChainViewList>()) ; - void (ChainView::* apply1)(EntityVisitor&) = &ChainView::Apply; - void (ChainView::* apply2)(EntityViewVisitor&) = &ChainView::Apply; - class_<ChainView, bases<ChainBase> >("ChainView", init<>()) .def("GetResidueList", &ChainView::GetResidueList, return_value_policy<copy_const_reference>()) @@ -81,8 +78,6 @@ void export_ChainView() X_add_residue_overloads(args("residue_handle", "view_add_flags"))) .def("AddResidue", vm, X_add_residue_overloads(args("residue_view", "view_add_flags"))) - .def("Apply", apply1, args("visitor")) - .def("Apply", apply2, args("visitor")) .def("RemoveResidue", &ChainView::RemoveResidue) .def("RemoveResidues", &ChainView::RemoveResidues) .def("InSequence", &ChainView::InSequence) diff --git a/modules/mol/base/pymod/export_entity_view.cc b/modules/mol/base/pymod/export_entity_view.cc index 0d1da4f85..aaa75efb7 100644 --- a/modules/mol/base/pymod/export_entity_view.cc +++ b/modules/mol/base/pymod/export_entity_view.cc @@ -80,15 +80,10 @@ void export_EntityView() .export_values() ; - 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", init<>()) - .def("Apply",apply1) - .def("Apply",apply2) .def("Copy", &EntityView::Copy) .def("FindChain", find_chain_str) .def("FindResidue", &EntityView::FindResidue) diff --git a/modules/mol/base/pymod/export_residue.cc b/modules/mol/base/pymod/export_residue.cc index 5334fb2ba..532f4b0a2 100644 --- a/modules/mol/base/pymod/export_residue.cc +++ b/modules/mol/base/pymod/export_residue.cc @@ -156,7 +156,6 @@ void export_Residue() .add_property("atoms", &ResidueHandle::GetAtomList) .def("FindAtom", &ResidueHandle::FindAtom, args("atom_name")) .def("FindTorsion", &ResidueHandle::FindTorsion) - .def("Apply", &ResidueHandle::Apply, args("visitor")) .def("GetAtomCount", &ResidueHandle::GetAtomCount) .def("GetBondCount", &ResidueHandle::GetBondCount) .add_property("atom_count", &ResidueHandle::GetAtomCount) diff --git a/modules/mol/base/pymod/export_residue_view.cc b/modules/mol/base/pymod/export_residue_view.cc index 13695ba9c..63bd1c746 100644 --- a/modules/mol/base/pymod/export_residue_view.cc +++ b/modules/mol/base/pymod/export_residue_view.cc @@ -51,9 +51,6 @@ void export_ResidueView() .def(ost::VectorAdditions<ResidueViewList>()) ; - void (ResidueView::* apply1)(EntityVisitor&) = &ResidueView::Apply; - void (ResidueView::* apply2)(EntityViewVisitor&) = &ResidueView::Apply; - class_<ResidueView, bases<ResidueBase> >("ResidueView", init<>()) .def("GetChain",&ResidueView::GetChain) .def("GetAtomList", &ResidueView::GetAtomList, @@ -67,8 +64,6 @@ void export_ResidueView() .def("AddAtom", add_atom_view, X_add_atom_overloads(args("atom_view", "flags"))) .def("FindAtom", handle_find_atom, args("atom_handle")) .def("IsAtomIncluded", &ResidueView::IsAtomIncluded, args("atom_handle")) - .def("Apply", apply1, args("visitor")) - .def("Apply", apply2, args("visitor")) .def("GetIndex", &ResidueView::GetIndex) .add_property("chain", &ResidueView::GetChain) .add_property("entity", &ResidueView::GetEntity) -- GitLab