|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
49 template<
class BaseEmbedder,
class T>
58 edgeLengthSG, nodeInBlockSG);
65 if (*BaseEmbedder::pAdjExternal ==
nullptr) {
66 node on = BaseEmbedder::pBCTree->original(nSG_to_nG[m_adjExternal->
theNode()]);
70 == BaseEmbedder::pBCTree->original(eSG_to_eG[m_adjExternal->
theEdge()])) {
71 *BaseEmbedder::pAdjExternal = ae->
twin();
77 bool DGcomputed =
false;
82 Graph* p_DG =
nullptr;
89 node nH = nSG_to_nG[nSG];
90 node nG = BaseEmbedder::pBCTree->original(nH);
94 if (BaseEmbedder::pBCTree->bcproper(nG) == cT) {
101 node cT2 = BaseEmbedder::pBCTree->bcproper(nG);
102 bool doRecurse =
true;
105 node parent_bT_of_cT2 =
nullptr;
110 if (e_cT2_to_bT2->
source() == cT2) {
111 parent_bT_of_cT2 = e_cT2_to_bT2->
target();
118 if (BaseEmbedder::treeNodeTreated[parent_bT_of_cT2]) {
125 bool aeExtExists =
false;
127 if (aeFace->
theNode() == nSG) {
145 p_adjacencyList->
init(SG);
148 (*p_adjacencyList)[nBG].pushBack(ae_nBG);
155 if (!adjEntryTreated[nBG].search(adj).valid()) {
161 adjEntryTreated[adj2->
theNode()].pushBack(adj2);
163 (*p_adjacencyList)[adj2->
twinNode()];
164 adj2 = *ladj.cyclicPred(ladj.search(adj2->
twin()));
165 }
while (adj2 != adj);
167 p_faces->pushBack(newFace);
172 for (
int i = 0; i < p_faces->size(); i++) {
187 bool do_break =
false;
190 if (adj4 == adj2->twin()) {
205 && !adjFaces[(*p_fPG_to_nDG)[f1_id]]
206 .search((*p_fPG_to_nDG)[f2_id])
208 && !adjFaces[(*p_fPG_to_nDG)[f2_id]]
209 .search((*p_fPG_to_nDG)[f1_id])
211 adjFaces[(*p_fPG_to_nDG)[f1_id]].pushBack(
212 (*p_fPG_to_nDG)[f2_id]);
213 p_DG->
newEdge((*p_fPG_to_nDG)[f1_id], (*p_fPG_to_nDG)[f2_id]);
228 for (
edge e : DG_edges) {
229 node s = e->source();
230 node t = e->target();
235 node efDG = (*p_fPG_to_nDG)[extFaceID];
237 p_distances->
init(*p_DG);
239 shortestPath.
call(*p_DG, efDG, el, *p_distances,
pi);
244 int optFaceDist = -1;
246 for (
int fID = 0; fID < p_faces->
size(); ++fID) {
249 bool contains_nSG =
false;
252 if (adj->theNode() == nSG) {
260 int thisDist = (*p_distances)[(*p_fPG_to_nDG)[fID]];
262 if (optFaceDist == -1 || optFaceDist > thisDist) {
264 optFaceDist = thisDist;
274 if (!BaseEmbedder::treeNodeTreated[bT2]) {
275 this->embedBlock(bT2, cT2, *pAfter);
282 bool after_ae =
true;
283 for (
adjEntry aeNode = ae; after_ae || aeNode != ae;
285 edge eG = BaseEmbedder::pBCTree->original(eSG_to_eG[aeNode->theEdge()]);
287 if (pAfter->
valid()) {
288 *pAfter = BaseEmbedder::newOrder[nG].insertAfter(eG->
adjSource(), *pAfter);
290 *pAfter = BaseEmbedder::newOrder[nG].pushBack(eG->
adjSource());
293 if (pAfter->
valid()) {
294 *pAfter = BaseEmbedder::newOrder[nG].insertAfter(eG->
adjTarget(), *pAfter);
296 *pAfter = BaseEmbedder::newOrder[nG].pushBack(eG->
adjTarget());
300 after_ae &= aeNode->
succ() !=
nullptr;
303 if (*pAfter !=
after) {
311 delete p_adjacencyList;
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
The namespace for all OGDF objects.
Declaration and implementation of ArrayBuffer class.
Includes declaration of graph class.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
node theNode() const
Returns the node whose adjacency list contains this element.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
bool valid() const
Returns true iff the iterator points to an element.
void allEdges(CONTAINER &edgeContainer) const
Returns a container with all edges of the graph.
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
Class for adjacency list elements.
adjEntry firstAdj() const
Returns the first adjacency element in the face.
ListIteratorBase< E, isConst, isReverse > succ() const
Returns successor iterator.
edge theEdge() const
Returns the edge associated with this adjacency entry.
Declaration of class BCTree.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
Decralation of GraphElement and GraphList classes.
adjEntry succ() const
Returns the successor in the adjacency list.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
static void embed(Graph &G, adjEntry &adjExternal, const NodeArray< T > &nodeLength, const EdgeArray< T > &edgeLength, const node &n=nullptr)
Embeds G by computing and extending a maximum face in G containing n.
void push(E e)
Puts a new element in the buffer.
Declaration of class ShortestPathWithBFM which computes shortest paths via Bellman-Ford-Moore.
node source() const
Returns the source node of the edge.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
void internalEmbedBlock(Graph &SG, NodeArray< T > &nodeLengthSG, EdgeArray< T > &edgeLengthSG, NodeArray< node > &nSG_to_nG, EdgeArray< edge > &eSG_to_eG, node nodeInBlockSG, node cT, ListIterator< adjEntry > &after)
Computes single-source shortest-paths with Bellman-Ford-Moore's algorithm.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Data type for general directed graphs (adjacency list representation).
constexpr double pi
The constant .
Computes an embedding of a biconnected graph with maximum external face.
Common functionality for layer-based embedding algorithms.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Basic declarations, included by all source files.
Declaration of CombinatorialEmbedding and face.
node newNode(int index=-1)
Creates a new node and returns it.
Combinatorial embeddings of planar graphs with modification functionality.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
node opposite(node v) const
Returns the adjacent node different from v.
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
void init(const Graph *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
int size() const
Returns the number of elements in the list.
Encapsulates a pointer to a list element.
virtual bool call(const Graph &G, const node s, const EdgeArray< int > &length, NodeArray< int > &d, NodeArray< edge > &pi) override
node target() const
Returns the target node of the edge.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
Class for the representation of nodes.
iterator pushBack(const E &x)
Adds element x at the end of the list.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Faces in a combinatorial embedding.