Index: trunk/src_plugins/rbs_routing/rbs_routing.c =================================================================== --- trunk/src_plugins/rbs_routing/rbs_routing.c (revision 38766) +++ trunk/src_plugins/rbs_routing/rbs_routing.c (revision 38767) @@ -37,8 +37,10 @@ #include "menu_internal.c" #include "map.h" +#include "stretch.h" #include "map.c" +#include "stretch.c" static const char pcb_acts_RbsConnect[] = "RbsConnect()"; static const char pcb_acth_RbsConnect[] = "Make a new rubber band stretch connection between two points"; @@ -53,10 +55,10 @@ static fgw_error_t pcb_act_RbsStretch(fgw_arg_t *res, int argc, fgw_arg_t *argv) { pcb_board_t *pcb = PCB_ACT_BOARD; - static rbsr_map_t rbs = {0}; + static rbsr_stretch_t rbss = {0}; int type; void *ptr1, *ptr2, *ptr3; - rnd_coord_t x, y; + rnd_coord_t x, y, tx, ty; if (rnd_hid_get_coords("Click on a copper line or arc", &x, &y, 0) != 0) return -1; @@ -73,10 +75,10 @@ rnd_trace("map on %ld\n", (long)lid); - rbsr_map_pcb(&rbs, pcb, lid); - rbsr_map_debug_draw(&rbs, "rbs.svg"); - rbsr_map_debug_dump(&rbs, "rbs.dump"); - + tx = x - RND_MM_TO_COORD(5); + ty = y; + rbsr_stretch_line_begin(&rbss, pcb, lid, l); + rbsr_stretch_line_end(&rbss); } else { rnd_message(RND_MSG_ERROR, "Failed to find a line or arc at that location\n"); Index: trunk/src_plugins/rbs_routing/stretch.c =================================================================== --- trunk/src_plugins/rbs_routing/stretch.c (nonexistent) +++ trunk/src_plugins/rbs_routing/stretch.c (revision 38767) @@ -0,0 +1,23 @@ + +int rbsr_stretch_line_begin(rbsr_stretch_t *rbss, pcb_board_t *pcb, rnd_layer_id_t lid, pcb_line_t *line) +{ + grbs_line_t *gl; + + rbsr_map_pcb(&rbss->map, pcb, lid); + rbsr_map_debug_draw(&rbss->map, "rbss1.svg"); + rbsr_map_debug_dump(&rbss->map, "rbss1.dump"); + + gl = htpp_get(&rbss->map.robj2grbs, line); + if (gl == NULL) { + rnd_message(RND_MSG_ERROR, "rbsr_stretch_line_begin(): can't stretch this line (not in the grbs map)\n"); + return -1; + } + + return 0; +} + +void rbsr_stretch_line_end(rbsr_stretch_t *rbss) +{ + +} + Index: trunk/src_plugins/rbs_routing/stretch.h =================================================================== --- trunk/src_plugins/rbs_routing/stretch.h (nonexistent) +++ trunk/src_plugins/rbs_routing/stretch.h (revision 38767) @@ -0,0 +1,11 @@ +typedef struct rbsr_stretch_s { + rbsr_map_t map; + grbs_addr_t *from, *to; + + grbs_point_t *via; +} rbsr_stretch_t; + + +/* Start stretching a routing line; returns 0 on success */ +int rbsr_stretch_line_begin(rbsr_stretch_t *rbss, pcb_board_t *pcb, rnd_layer_id_t lid, pcb_line_t *line); +void rbsr_stretch_line_end(rbsr_stretch_t *rbss);