Index: trunk/src/plugins/rt_topo/crbs.c =================================================================== --- trunk/src/plugins/rt_topo/crbs.c (revision 1342) +++ trunk/src/plugins/rt_topo/crbs.c (revision 1343) @@ -35,6 +35,7 @@ #include "route_res.h" #include +#include #include "crbs.h" @@ -64,7 +65,7 @@ ang = e->ang[1]; else abort(); - +printf(" (ACHK ang=%f arc=%f->%f) ", ang, arc->new_sa, arc->new_da); if (grbs_angle_in_arc(arc->new_sa, arc->new_da, ang, 1)) return &tn_unknown; } @@ -73,7 +74,42 @@ return NULL; } +static grbs_2net_t *crbs_coll_check_line_(grbs_t *grbs, grbs_2net_t *tn, grbs_point_t *gpt, const g2d_cline_t *cl) +{ + crbs_point_t *pt = gpt->user_data; + EDGELIST_FOREACH(edge, (pt->cpt->adj_edges)) { + crbs_edge_t *e = edge->data; + if (e->nets > 0) { + g2d_cline_t ecl; + + ecl.p1.x = edge->endp[0]->pos.x; ecl.p1.y = edge->endp[0]->pos.y; + ecl.p2.x = edge->endp[1]->pos.x; ecl.p2.y = edge->endp[1]->pos.y; + +printf(" (LCHK) "); + if (g2d_isc_cline_cline(cl, &ecl)) + return &tn_unknown; + } + } + EDGELIST_FOREACH_END(); + return NULL; +} + +static grbs_2net_t *crbs_coll_check_line_cb(grbs_t *grbs, grbs_2net_t *tn, grbs_point_t *pt1, double x1, double y1, grbs_point_t *pt2, double x2, double y2) +{ + grbs_2net_t *res; + g2d_cline_t cl; + + cl.p1.x = x1; cl.p1.y = y1; + cl.p2.x = x2; cl.p2.y = y2; + + res = crbs_coll_check_line_(grbs, tn, pt1, &cl); + if (res == NULL) + res = crbs_coll_check_line_(grbs, tn, pt2, &cl); + + return res; +} + crbs_point_t *crbs_point_new(crbs_t *crbs) { crbs_point_t *p = calloc(sizeof(crbs_point_t), 1); @@ -93,6 +129,7 @@ crbs->ctx = ctx; crbs->grbs.coll_report_cb = crbs_coll_report_cb; crbs->grbs.coll_check_arc = crbs_coll_check_arc_cb; + crbs->grbs.coll_check_line = crbs_coll_check_line_cb; crbs->grbs.user_data = crbs; htad_init(&crbs->addrs, htad_hash, grbs_addr_hash_keyeq);