void Crag::recCollectEdges(Crag::CragNode n, std::set<Crag::CragEdge>& edges) const { for (Crag::CragEdge e : adjEdges(n)) edges.insert(e); for (Crag::CragArc a : inArcs(n)) recCollectEdges(a.source(), edges); }
std::set<Crag::CragEdge> Crag::leafEdges(CragEdge e) const { std::set<CragEdge> leafEdges; std::set<CragNode> uLeafNodes; std::set<CragNode> vLeafNodes; recLeafNodes(u(e), uLeafNodes); recLeafNodes(v(e), vLeafNodes); for (CragNode n : uLeafNodes) for (CragEdge e : adjEdges(n)) if (isLeafEdge(e)) if (vLeafNodes.count(oppositeNode(n, e))) leafEdges.insert(e); return leafEdges; }
std::set<Crag::CragEdge> Crag::leafEdges(CragNode n) const { std::set<CragNode> nleafNodes = leafNodes(n); std::set<CragEdge> leafEdges; for (CragNode u : nleafNodes) for (CragNode v : nleafNodes) { if (id(u) >= id(v)) continue; for (CragEdge e : adjEdges(u)) if (isLeafEdge(e)) if (nleafNodes.count(oppositeNode(u, e))) leafEdges.insert(e); } return leafEdges; }
void PlanarSPQRTree::adoptEmbedding() { OGDF_ASSERT_IF(dlExtendedChecking, originalGraph().representsCombEmbedding()); // ordered list of adjacency entries (for one original node) in all // skeletons (where this node occurs) NodeArray<SListPure<adjEntry> > adjEdges(tree()); // copy in skeleton of current original node NodeArray<node> currentCopy(tree(),nullptr); NodeArray<adjEntry> lastAdj(tree(),nullptr); SListPure<node> current; // currently processed nodes for (node vOrig : originalGraph().nodes) { for(adjEntry adjOrig : vOrig->adjEdges) { edge eOrig = adjOrig->theEdge(); const Skeleton &S = skeletonOfReal(eOrig); edge eCopy = copyOfReal(eOrig); adjEntry adjCopy = (S.original(eCopy->source()) == vOrig) ? eCopy->adjSource() : eCopy->adjTarget(); setPosInEmbedding(adjEdges,currentCopy,lastAdj,current,S,adjCopy); } for(node vT : current) { skeleton(vT).getGraph().sort(currentCopy[vT],adjEdges[vT]); adjEdges[vT].clear(); currentCopy[vT] = nullptr; } current.clear(); } }