Skip to content
Snippets Groups Projects
Commit 548fe6d9 authored by B13nch3n's avatar B13nch3n
Browse files

Removed the need for an Editor from connecting branched entities out of mmCIFInfo

parent 9230d0a0
Branches
Tags
No related merge requests found
......@@ -225,16 +225,19 @@ const std::vector<MMCifInfoEntityBranch> MMCifInfo::GetEntityBranchLinks() const
return all_links;
}
void MMCifInfo::ConnectBranchLinks(mol::XCSEditor editor)
void MMCifInfo::ConnectBranchLinks()
{
MMCifInfoEntityBranchMap::iterator blm_it;
for (blm_it = entity_branches_.begin();
blm_it != entity_branches_.end(); ++blm_it) {
for (std::vector<MMCifInfoEntityBranch>::iterator blv_it =
blm_it->second.begin();
blv_it != blm_it->second.end();
++blv_it) {
blv_it->ConnectBranchLink(editor);
// We assume that one chain only comes from one entity, so we go with one
// editor per chain
std::vector<MMCifInfoEntityBranch>::iterator blv_it = blm_it->second.begin();
if (blv_it != blm_it->second.end()) {
mol::XCSEditor editor = blv_it->GetAtom1().GetEntity().EditXCS();
for (; blv_it != blm_it->second.end(); ++blv_it) {
blv_it->ConnectBranchLink(editor);
}
}
}
}
......
......@@ -1179,7 +1179,7 @@ public:
/// \brief Connect all atoms listed as links for branched entities.
///
void ConnectBranchLinks(mol::XCSEditor editor);
void ConnectBranchLinks();
//protected:
......
......@@ -294,7 +294,7 @@ class TestMMCifInfo(unittest.TestCase):
self.assertEqual(blinks[1].atom1.qualified_name, "B.NAG2.C1")
self.assertEqual(blinks[1].GetAtom2().qualified_name, "B.NAG1.O4")
info.ConnectBranchLinks(editor)
info.ConnectBranchLinks()
self.assertEqual(atom4.GetBondPartners()[0].qualified_name, "B.NAG2.C1")
if __name__== '__main__':
......
......@@ -359,7 +359,7 @@ BOOST_AUTO_TEST_CASE(mmcif_info)
BOOST_CHECK(blinks[1].GetAtom2().GetQualifiedName() == "B.BMA1.O3");
// check that branch links get bonds
info.ConnectBranchLinks(editor);
info.ConnectBranchLinks();
BOOST_CHECK(atom11.GetBondPartners()[0] == atom12);
BOOST_CHECK(atom22.GetBondPartners()[0] == atom21);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment