Hello Vincent,
every node
(=NodeElement*
) has its own list of adjacency entries in the form of myNode->adjEntries
. The order of these adjacency entries in the list determines their clockwise ordering around the node and hence the embedding.
In your case, it seems like it would suffice to use Graph::split
, see https://ogdf.uos.de/doc/classogdf_1_1_graph.html#ac3be54a0554615b50cf6661029abb592 .
The node n would not be replaced, but the resulting graph would be isomorphic to your example:
edge edge_wBar_w = G.split(edge_n_w);
edge edge_yBar_y = G.split(edge_n_y);
node yBar = edge_yBar_y->source();
...
However, if you need to construct a (sub-)graph with the correct embedding from scratch, e.g. because you have to delete n for some reason, you can use one of the Graph::newEdge
-methods that take a previously created adjEntry as a parameter (https://ogdf.uos.de/doc/classogdf_1_1_graph.html#a828ce5716995ae452cc8e2842b45e313 and below):
node vBar = G.newNode();
edge e = G.newEdge(vBar, v);
edge f = G.newEdge(e->adjSource(), x);
...
Best regards,
Dagobert