From c9284a6b367137df90cc462e44a40c58bc41f934 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 20 Mar 2005 16:55:06 +0000 Subject: [PATCH] elimtrivial concats the pnames; new spec. for mov feat processing --- layout/redactgraph.c | 57 +++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/layout/redactgraph.c b/layout/redactgraph.c index 004f3e2..4ec2e6f 100644 --- a/layout/redactgraph.c +++ b/layout/redactgraph.c @@ -250,37 +250,44 @@ static void node_surely_orphaned(Node *node) { * * SECOND STAGE: * - * We split nodes: every node which has (only) edges which are part - * of the same segment is split into one node for each position and - * direction (directions are end0-to-side0+end1-to-side1 and - * end0-to-side1+end1-to-side0), to which the corresponding edges - * are connected. Any resulting node which has only one edge is - * removed together with the edge. + * We remove stub moveable edges: whenever, at a node which has only + * edges which are part of the same segment, we find an edge on one + * side in which is not matched exactly (moveable feature settings + * and direction) by an edge on the other side, we delete that extra + * edge: * - * For example, when we start with: + * is split into one node + * for each position and direction (directions are + * end0-to-side0+end1-to-side1 and end0-to-side1+end1-to-side0), to + * which the corresponding edges are connected. Any resulting node + * which has only one edge is removed together with the edge. * - * ,---A1/P0J0---. - * ...*----A1/P0J1----*---A1/P0J1---*... - * `---A1/P1J0---' `--A1/P1J1--' - * `--A1/P1J1--' + * For example (neglecting direction for the purposes of the + * example), when we start with: * - * the middle node is split like this (neglecting directions for - * clarity): + * ,---A1/P0J0---. + * ...*----A1/P0J1----*---A1/P0J1---*... + * `---A1/P1J0---' `--A1/P1J1--' + * `--A1/P1J1--' * - * ,---A1/P0J0----* - * ...*----A1/P0J1----*---A1/P0J1---*... - * `---A1/P1J0----* / - * `--A1/P1J1----*---A1/P1J1-' + * the edges A1/P0J0 and A1/P1J1 are not matched on the RHS of the node, + * so they are removed: * - * and then the stub edges and nodes are removed, leaving this: + * ...*----A1/P0J1----*---A1/P0J1---*... + * `---A1/P1J0---' `--A1/P1J1--' * - * ...*----A1/P0J1----*---A1/P0J1---*... - * \ / - * `--A1/P1J1----*---A1/P1J1-' * - * The actual implementation of the second stage simply considers - * whether to create each node as it goes along, rather than - * inventing nodes merely to delete them. + * THIRD STAGE: + * + * We split nodes: every node which has only edges which are part of + * the same segment is split into one node for each kind of edge + * which goes through it. The 2nd stage ensures that this is always + * straightforward. + * + * Our example above turns into: + * + * ...*----A1/P0J1----*---A1/P0J1---*... + * `---A1/P1J0----*---A1/P1J1--' */ static void movfeatmultedges(void) { @@ -402,6 +409,8 @@ static void elimtrivial(void) { continue; } trace(" yes:\n"); + rightedge->edge->pname= + masprintf("%s+%s", leftedge->edge->pname, rightedge->edge->pname); rightedge->edge->distance += leftedge->edge->distance; edgeend_replumb(rightedge, edgeend_otherend(leftedge)->node); edge_delete(leftedge->edge); -- 2.30.2