Index: trunk/src/plugins/rt_topo/crbs.c =================================================================== --- trunk/src/plugins/rt_topo/crbs.c (revision 1354) +++ trunk/src/plugins/rt_topo/crbs.c (revision 1355) @@ -123,6 +123,25 @@ #include GRBS_ADDR_HASH(htad_hash); +void crbs_make_point(crbs_t *crbs, double x, double y, double cop, double clr, rtrnd_via_t *via) +{ + grbs_point_t *gpt; + point_t *cpt; + crbs_point_t *p; + + p = crbs_point_new(crbs); + cpt = cdt_insert_point(&crbs->cdt, x, y); + cpt->data = p; + gpt = grbs_point_new(&crbs->grbs, x, y, cop, clr); + gpt->user_data = p; + + printf("GT point_new P%ld %f %f %f %f\n", gpt->uid, x, y, cop, clr); + + p->cpt = cpt; + p->gpt = gpt; + p->obj = via; +} + static void crbs_init(crbs_t *crbs, rtrnd_t *ctx) { rtrnd_via_t *via; @@ -136,25 +155,10 @@ crbs->grbs.user_data = crbs; htad_init(&crbs->addrs, htad_hash, grbs_addr_hash_keyeq); - for(via = rtrnd_rtree_all_first(&it, &ctx->board->vias); via != NULL; via = rtrnd_rtree_all_next(&it)) { - - grbs_point_t *gpt; - point_t *cpt; - crbs_point_t *p; + for(via = rtrnd_rtree_all_first(&it, &ctx->board->vias); via != NULL; via = rtrnd_rtree_all_next(&it)) + crbs_make_point(crbs, via->x, via->y, via->dia/2, via->clearance, via); - p = crbs_point_new(crbs); - cpt = cdt_insert_point(&crbs->cdt, via->x, via->y); - cpt->data = p; - gpt = grbs_point_new(&crbs->grbs, via->x, via->y, via->dia/2, via->clearance); - gpt->user_data = p; - printf("GT point_new P%ld %f %f %f %f\n", gpt->uid, via->x, via->y, via->dia/2, via->clearance); - - p->cpt = cpt; - p->gpt = gpt; - p->obj = via; - } - } static void crbs_clean(crbs_t *crbs) Index: trunk/src/plugins/rt_topo/crbs.h =================================================================== --- trunk/src/plugins/rt_topo/crbs.h (revision 1354) +++ trunk/src/plugins/rt_topo/crbs.h (revision 1355) @@ -51,6 +51,7 @@ htad_t addrs; unsigned disable_concave:1; /* when set to 1, do an all-convex routing */ + unsigned enable_mid_virt:1; /* when set to 1, insert a virtual point in between any two real points in the original cdt; this allows convex-only routing to emulate concave in corridors */ /* routing */ grbs_detached_addr_t *first; /* the address the twonet is starting from */ @@ -65,6 +66,9 @@ /* When a collision happens but the 2net is not known */ extern grbs_2net_t tn_unknown; +/* create a new point (e.g. for a via) in the triangulation and in grbs */ +void crbs_make_point(crbs_t *crbs, double x, double y, double cop, double clr, rtrnd_via_t *via); + #define DIST_HEUR_MULT 1000.0 #endif