Index: trunk/src/find.c =================================================================== --- trunk/src/find.c (revision 30841) +++ trunk/src/find.c (revision 30842) @@ -34,6 +34,8 @@ TODO("find: this is the only non-reentrant part - pass it on!") pcb_coord_t Bloat = 0; +const pcb_find_t pcb_find0_, *pcb_find0 = &pcb_find0_; + #include "find_geo.c" #include "find_any_isect.c" @@ -161,7 +163,7 @@ do { \ pcb_any_obj_t *__obj__ = (pcb_any_obj_t *)obj; \ if (!(PCB_DFLAG_TEST(&(__obj__->Flags), ctx->mark))) { \ - if (!INOCONN(curr, obj) && (pcb_intersect_obj_obj(curr, __obj__))) {\ + if (!INOCONN(curr, obj) && (pcb_intersect_obj_obj(ctx, curr, __obj__))) {\ if (pcb_find_addobj(ctx, __obj__, curr, ctype, 1) != 0) { retstmt; } \ if ((__obj__->term != NULL) && (!ctx->ignore_intconn) && (__obj__->intconn > 0)) \ find_int_conn(ctx, __obj__); \ @@ -173,7 +175,7 @@ do { \ pcb_any_obj_t *__obj__ = (pcb_any_obj_t *)obj; \ if (!(PCB_DFLAG_TEST(&(__obj__->Flags), ctx->mark))) { \ - if (!INOCONN(curr, obj) && (pcb_intersect_obj_obj(curr, __obj__))) {\ + if (!INOCONN(curr, obj) && (pcb_intersect_obj_obj(ctx, curr, __obj__))) {\ if (pcb_find_addobj(ctx, __obj__, curr, ctype, ctx->consider_rats) != 0) { retstmt; } \ if ((__obj__->term != NULL) && (!ctx->ignore_intconn) && (__obj__->intconn > 0)) \ find_int_conn(ctx, __obj__); \ Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 30841) +++ trunk/src/find.h (revision 30842) @@ -77,6 +77,7 @@ unsigned aborted:1; }; +extern const pcb_find_t *pcb_find0; /* nop-configuration for calling isc functions */ unsigned long pcb_find_from_xy(pcb_find_t *ctx, pcb_data_t *data, pcb_coord_t x, pcb_coord_t y); @@ -89,16 +90,16 @@ void pcb_find_free(pcb_find_t *ctx); /* High level intersection function: returns if a and b intersect (overlap) */ -pcb_bool pcb_intersect_obj_obj(pcb_any_obj_t *a, pcb_any_obj_t *b); +pcb_bool pcb_intersect_obj_obj(const pcb_find_t *ctx, pcb_any_obj_t *a, pcb_any_obj_t *b); /* Low level intersection functions: */ -pcb_bool pcb_isc_line_line(pcb_line_t *Line1, pcb_line_t *Line2); -pcb_bool pcb_isc_line_arc(pcb_line_t *Line, pcb_arc_t *Arc); -pcb_bool pcb_isc_arc_poly(pcb_arc_t *Arc, pcb_poly_t *Polygon); -pcb_bool pcb_isc_arc_polyarea(pcb_arc_t *Arc, pcb_polyarea_t *pa); -pcb_bool pcb_isc_line_poly(pcb_line_t *Line, pcb_poly_t *Polygon); -pcb_bool pcb_isc_poly_poly(pcb_poly_t *P1, pcb_poly_t *P2); -pcb_bool_t pcb_isc_pstk_line(pcb_pstk_t *ps, pcb_line_t *line); +pcb_bool pcb_isc_line_line(const pcb_find_t *ctx, pcb_line_t *Line1, pcb_line_t *Line2); +pcb_bool pcb_isc_line_arc(const pcb_find_t *ctx, pcb_line_t *Line, pcb_arc_t *Arc); +pcb_bool pcb_isc_arc_poly(const pcb_find_t *ctx, pcb_arc_t *Arc, pcb_poly_t *Polygon); +pcb_bool pcb_isc_arc_polyarea(const pcb_find_t *ctx, pcb_arc_t *Arc, pcb_polyarea_t *pa); +pcb_bool pcb_isc_line_poly(const pcb_find_t *ctx, pcb_line_t *Line, pcb_poly_t *Polygon); +pcb_bool pcb_isc_poly_poly(const pcb_find_t *ctx, pcb_poly_t *P1, pcb_poly_t *P2); +pcb_bool_t pcb_isc_pstk_line(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_line_t *line); /* Return whether obj is marked as already visited by the current search context */ #define PCB_FIND_IS_MARKED(ctx, obj) PCB_DFLAG_TEST(&((obj)->Flags), (ctx)->mark) Index: trunk/src/find_any_isect.c =================================================================== --- trunk/src/find_any_isect.c (revision 30841) +++ trunk/src/find_any_isect.c (revision 30842) @@ -29,13 +29,13 @@ TODO(": implement text intersections") -pcb_bool pcb_isc_text_line(pcb_text_t *a, pcb_line_t *b) { return pcb_false; } -pcb_bool pcb_isc_text_text(pcb_text_t *a, pcb_text_t *b) { return pcb_false; } -pcb_bool pcb_isc_text_poly(pcb_text_t *a, pcb_poly_t *b) { return pcb_false; } -pcb_bool pcb_isc_text_arc(pcb_text_t *a, pcb_arc_t *b) { return pcb_false; } -pcb_bool pcb_isc_text_pstk(pcb_text_t *a, pcb_pstk_t *b) { return pcb_false; } +pcb_bool pcb_isc_text_line(const pcb_find_t *ctx, pcb_text_t *a, pcb_line_t *b) { return pcb_false; } +pcb_bool pcb_isc_text_text(const pcb_find_t *ctx, pcb_text_t *a, pcb_text_t *b) { return pcb_false; } +pcb_bool pcb_isc_text_poly(const pcb_find_t *ctx, pcb_text_t *a, pcb_poly_t *b) { return pcb_false; } +pcb_bool pcb_isc_text_arc(const pcb_find_t *ctx, pcb_text_t *a, pcb_arc_t *b) { return pcb_false; } +pcb_bool pcb_isc_text_pstk(const pcb_find_t *ctx, pcb_text_t *a, pcb_pstk_t *b) { return pcb_false; } -pcb_bool pcb_intersect_obj_obj(pcb_any_obj_t *a, pcb_any_obj_t *b) +pcb_bool pcb_intersect_obj_obj(const pcb_find_t *ctx, pcb_any_obj_t *a, pcb_any_obj_t *b) { /* produce the clopped version for polygons to compare */ if ((a->type == PCB_OBJ_POLY) && (((pcb_poly_t *)a)->Clipped == NULL)) @@ -51,13 +51,13 @@ case PCB_OBJ_LINE: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_line_line((pcb_line_t *)a, (pcb_line_t *)b); - case PCB_OBJ_TEXT: return pcb_isc_text_line((pcb_text_t *)b, (pcb_line_t *)a); - case PCB_OBJ_POLY: return pcb_isc_line_poly((pcb_line_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_line_arc((pcb_line_t *)a, (pcb_arc_t *)b); -/* case PCB_OBJ_GFX: return pcb_isc_line_gfx((pcb_line_t *)a, (pcb_gfx_t *)b);*/ - case PCB_OBJ_PSTK: return pcb_isc_pstk_line((pcb_pstk_t *)b, (pcb_line_t *)a); - case PCB_OBJ_RAT: return pcb_isc_rat_line((pcb_rat_t *)b, (pcb_line_t *)a); + case PCB_OBJ_LINE: return pcb_isc_line_line(ctx, (pcb_line_t *)a, (pcb_line_t *)b); + case PCB_OBJ_TEXT: return pcb_isc_text_line(ctx, (pcb_text_t *)b, (pcb_line_t *)a); + case PCB_OBJ_POLY: return pcb_isc_line_poly(ctx, (pcb_line_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_line_arc(ctx, (pcb_line_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_line_gfx(ctx, (pcb_line_t *)a, (pcb_gfx_t *)b);*/ + case PCB_OBJ_PSTK: return pcb_isc_pstk_line(ctx, (pcb_pstk_t *)b, (pcb_line_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_line(ctx, (pcb_rat_t *)b, (pcb_line_t *)a); default:; } break; @@ -64,12 +64,12 @@ case PCB_OBJ_TEXT: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_text_line((pcb_text_t *)a, (pcb_line_t *)b); - case PCB_OBJ_TEXT: return pcb_isc_text_text((pcb_text_t *)a, (pcb_text_t *)b); - case PCB_OBJ_POLY: return pcb_isc_text_poly((pcb_text_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_text_arc((pcb_text_t *)a, (pcb_arc_t *)b); -/* case PCB_OBJ_GFX: return pcb_isc_text_gfx((pcb_text_t *)a, (pcb_gfx_t *)b);*/ - case PCB_OBJ_PSTK: return pcb_isc_text_pstk((pcb_text_t *)a, (pcb_pstk_t *)b); + case PCB_OBJ_LINE: return pcb_isc_text_line(ctx, (pcb_text_t *)a, (pcb_line_t *)b); + case PCB_OBJ_TEXT: return pcb_isc_text_text(ctx, (pcb_text_t *)a, (pcb_text_t *)b); + case PCB_OBJ_POLY: return pcb_isc_text_poly(ctx, (pcb_text_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_text_arc(ctx, (pcb_text_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_text_gfx(ctx, (pcb_text_t *)a, (pcb_gfx_t *)b);*/ + case PCB_OBJ_PSTK: return pcb_isc_text_pstk(ctx, (pcb_text_t *)a, (pcb_pstk_t *)b); case PCB_OBJ_RAT: return pcb_false; /* text is invisible to find for now */ default:; } @@ -78,13 +78,13 @@ case PCB_OBJ_POLY: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_line_poly((pcb_line_t *)b, (pcb_poly_t *)a); - case PCB_OBJ_TEXT: return pcb_isc_text_poly((pcb_text_t *)b, (pcb_poly_t *)a); - case PCB_OBJ_POLY: return pcb_isc_poly_poly((pcb_poly_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_arc_poly((pcb_arc_t *)b, (pcb_poly_t *)a); -/* case PCB_OBJ_GFX: return pcb_isc_gfx_poly((pcb_gfx_t *)b, (pcb_poly_t *)a);*/ - case PCB_OBJ_PSTK: return pcb_isc_pstk_poly((pcb_pstk_t *)b, (pcb_poly_t *)a); - case PCB_OBJ_RAT: return pcb_isc_rat_poly((pcb_rat_t *)b, (pcb_poly_t *)a); + case PCB_OBJ_LINE: return pcb_isc_line_poly(ctx, (pcb_line_t *)b, (pcb_poly_t *)a); + case PCB_OBJ_TEXT: return pcb_isc_text_poly(ctx, (pcb_text_t *)b, (pcb_poly_t *)a); + case PCB_OBJ_POLY: return pcb_isc_poly_poly(ctx, (pcb_poly_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_arc_poly(ctx, (pcb_arc_t *)b, (pcb_poly_t *)a); +/* case PCB_OBJ_GFX: return pcb_isc_gfx_poly(ctx, (pcb_gfx_t *)b, (pcb_poly_t *)a);*/ + case PCB_OBJ_PSTK: return pcb_isc_pstk_poly(ctx, (pcb_pstk_t *)b, (pcb_poly_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_poly(ctx, (pcb_rat_t *)b, (pcb_poly_t *)a); default:; } break; @@ -91,13 +91,13 @@ case PCB_OBJ_ARC: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_line_arc((pcb_line_t *)b, (pcb_arc_t *)a); - case PCB_OBJ_TEXT: return pcb_isc_text_arc((pcb_text_t *)b, (pcb_arc_t *)a); - case PCB_OBJ_POLY: return pcb_isc_arc_poly((pcb_arc_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_arc_arc((pcb_arc_t *)a, (pcb_arc_t *)b); -/* case PCB_OBJ_GFX: return pcb_isc_gfx_arc((pcb_gfx_t *)a, (pcb_arc_t *)b);*/ - case PCB_OBJ_PSTK: return pcb_isc_pstk_arc((pcb_pstk_t *)b, (pcb_arc_t *)a); - case PCB_OBJ_RAT: return pcb_isc_rat_arc((pcb_rat_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_LINE: return pcb_isc_line_arc(ctx, (pcb_line_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_TEXT: return pcb_isc_text_arc(ctx, (pcb_text_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_POLY: return pcb_isc_arc_poly(ctx, (pcb_arc_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_arc_arc(ctx, (pcb_arc_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_gfx_arc(ctx, (pcb_gfx_t *)a, (pcb_arc_t *)b);*/ + case PCB_OBJ_PSTK: return pcb_isc_pstk_arc(ctx, (pcb_pstk_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_arc(ctx, (pcb_rat_t *)b, (pcb_arc_t *)a); default:; } break; @@ -104,13 +104,13 @@ /* case PCB_OBJ_GFX: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_line_gfx((pcb_line_t *)b, (pcb_gfx_t *)a); - case PCB_OBJ_TEXT: return pcb_isc_text_gfx((pcb_text_t *)b, (pcb_gfx_t *)a); - case PCB_OBJ_POLY: return pcb_isc_gfx_poly((pcb_gfx_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_arc_arc((pcb_arc_t *)a, (pcb_arc_t *)b); - case PCB_OBJ_GFX: return pcb_isc_gfx_gfx((pcb_gfx_t *)a, (pcb_gfx_t *)b); - case PCB_OBJ_PSTK: return pcb_isc_pstk_arc((pcb_pstk_t *)b, (pcb_arc_t *)a); - case PCB_OBJ_RAT: return pcb_isc_rat_arc((pcb_rat_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_LINE: return pcb_isc_line_gfx(ctx, (pcb_line_t *)b, (pcb_gfx_t *)a); + case PCB_OBJ_TEXT: return pcb_isc_text_gfx(ctx, (pcb_text_t *)b, (pcb_gfx_t *)a); + case PCB_OBJ_POLY: return pcb_isc_gfx_poly(ctx, (pcb_gfx_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_arc_arc(ctx, (pcb_arc_t *)a, (pcb_arc_t *)b); + case PCB_OBJ_GFX: return pcb_isc_gfx_gfx(ctx, (pcb_gfx_t *)a, (pcb_gfx_t *)b); + case PCB_OBJ_PSTK: return pcb_isc_pstk_arc(ctx, (pcb_pstk_t *)b, (pcb_arc_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_arc(ctx, (pcb_rat_t *)b, (pcb_arc_t *)a); default:; } break;*/ @@ -117,13 +117,13 @@ case PCB_OBJ_PSTK: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_pstk_line((pcb_pstk_t *)a, (pcb_line_t *)b); - case PCB_OBJ_TEXT: return pcb_isc_text_pstk((pcb_text_t *)b, (pcb_pstk_t *)a); - case PCB_OBJ_POLY: return pcb_isc_pstk_poly((pcb_pstk_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_pstk_arc((pcb_pstk_t *)a, (pcb_arc_t *)b); -/* case PCB_OBJ_GFX: return pcb_isc_pstk_gfx((pcb_pstk_t *)a, (pcb_gfx_t *)b);*/ - case PCB_OBJ_PSTK: return pcb_isc_pstk_pstk((pcb_pstk_t *)a, (pcb_pstk_t *)b); - case PCB_OBJ_RAT: return pcb_isc_pstk_rat((pcb_pstk_t *)a, (pcb_rat_t *)b); + case PCB_OBJ_LINE: return pcb_isc_pstk_line(ctx, (pcb_pstk_t *)a, (pcb_line_t *)b); + case PCB_OBJ_TEXT: return pcb_isc_text_pstk(ctx, (pcb_text_t *)b, (pcb_pstk_t *)a); + case PCB_OBJ_POLY: return pcb_isc_pstk_poly(ctx, (pcb_pstk_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_pstk_arc(ctx, (pcb_pstk_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_pstk_gfx(ctx, (pcb_pstk_t *)a, (pcb_gfx_t *)b);*/ + case PCB_OBJ_PSTK: return pcb_isc_pstk_pstk(ctx, (pcb_pstk_t *)a, (pcb_pstk_t *)b); + case PCB_OBJ_RAT: return pcb_isc_pstk_rat(ctx, (pcb_pstk_t *)a, (pcb_rat_t *)b); default:; } break; @@ -130,13 +130,13 @@ case PCB_OBJ_RAT: switch(b->type) { case PCB_OBJ_VOID: return pcb_false; - case PCB_OBJ_LINE: return pcb_isc_rat_line((pcb_rat_t *)a, (pcb_line_t *)b); + case PCB_OBJ_LINE: return pcb_isc_rat_line(ctx, (pcb_rat_t *)a, (pcb_line_t *)b); case PCB_OBJ_TEXT: return pcb_false; /* text is invisible to find for now */ - case PCB_OBJ_POLY: return pcb_isc_rat_poly((pcb_rat_t *)a, (pcb_poly_t *)b); - case PCB_OBJ_ARC: return pcb_isc_rat_arc((pcb_rat_t *)a, (pcb_arc_t *)b); -/* case PCB_OBJ_GFX: return pcb_isc_rat_gfx((pcb_rat_t *)a, (pcb_gfx_t *)b);*/ - case PCB_OBJ_PSTK: return pcb_isc_pstk_rat((pcb_pstk_t *)b, (pcb_rat_t *)a); - case PCB_OBJ_RAT: return pcb_isc_rat_rat((pcb_rat_t *)a, (pcb_rat_t *)b); + case PCB_OBJ_POLY: return pcb_isc_rat_poly(ctx, (pcb_rat_t *)a, (pcb_poly_t *)b); + case PCB_OBJ_ARC: return pcb_isc_rat_arc(ctx, (pcb_rat_t *)a, (pcb_arc_t *)b); +/* case PCB_OBJ_GFX: return pcb_isc_rat_gfx(ctx, (pcb_rat_t *)a, (pcb_gfx_t *)b);*/ + case PCB_OBJ_PSTK: return pcb_isc_pstk_rat(ctx, (pcb_pstk_t *)b, (pcb_rat_t *)a); + case PCB_OBJ_RAT: return pcb_isc_rat_rat(ctx, (pcb_rat_t *)a, (pcb_rat_t *)b); default:; } break; Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 30841) +++ trunk/src/find_geo.c (revision 30842) @@ -57,7 +57,7 @@ /* This is required for fullpoly: whether an object bbox intersects a poly bbox can't be determined by a single contour check because there might be multiple contours. Returns 1 if obj bbox intersects any island's bbox */ -PCB_INLINE int box_isc_poly_any_island_bbox(const pcb_box_t *box, const pcb_poly_t *poly, int first_only) +PCB_INLINE int box_isc_poly_any_island_bbox(const pcb_find_t *ctx, const pcb_box_t *box, const pcb_poly_t *poly, int first_only) { pcb_poly_it_t it; pcb_polyarea_t *pa; @@ -155,7 +155,7 @@ * * */ -static pcb_bool pcb_isc_arc_arc(pcb_arc_t *Arc1, pcb_arc_t *Arc2) +static pcb_bool pcb_isc_arc_arc(const pcb_find_t *ctx, pcb_arc_t *Arc1, pcb_arc_t *Arc2) { double x, y, dx, dy, r1, r2, a, d, l, t, t1, t2, dl; pcb_coord_t pdx, pdy; @@ -266,7 +266,7 @@ /* --------------------------------------------------------------------------- * Tests if point is same as line end point or center point */ -static pcb_bool pcb_isc_ratp_line(pcb_point_t *Point, pcb_line_t *Line) +static pcb_bool pcb_isc_ratp_line(const pcb_find_t *ctx, pcb_point_t *Point, pcb_line_t *Line) { pcb_coord_t cx, cy; @@ -284,13 +284,13 @@ } /* Tests any end of a rat line is on the line */ -static pcb_bool pcb_isc_rat_line(pcb_rat_t *rat, pcb_line_t *line) +static pcb_bool pcb_isc_rat_line(const pcb_find_t *ctx, pcb_rat_t *rat, pcb_line_t *line) { pcb_layergrp_id_t gid = pcb_layer_get_group_(line->parent.layer); - if ((rat->group1 == gid) && pcb_isc_ratp_line(&rat->Point1, line)) + if ((rat->group1 == gid) && pcb_isc_ratp_line(ctx, &rat->Point1, line)) return pcb_true; - if ((rat->group2 == gid) && pcb_isc_ratp_line(&rat->Point2, line)) + if ((rat->group2 == gid) && pcb_isc_ratp_line(ctx, &rat->Point2, line)) return pcb_true; return pcb_false; @@ -299,7 +299,7 @@ /* --------------------------------------------------------------------------- * Tests if point is same as arc end point or center point */ -static pcb_bool pcb_isc_ratp_arc(pcb_point_t *Point, pcb_arc_t *arc) +static pcb_bool pcb_isc_ratp_arc(const pcb_find_t *ctx, pcb_point_t *Point, pcb_arc_t *arc) { pcb_coord_t cx, cy; @@ -321,13 +321,13 @@ } /* Tests any end of a rat line is on the arc */ -static pcb_bool pcb_isc_rat_arc(pcb_rat_t *rat, pcb_arc_t *arc) +static pcb_bool pcb_isc_rat_arc(const pcb_find_t *ctx, pcb_rat_t *rat, pcb_arc_t *arc) { pcb_layergrp_id_t gid = pcb_layer_get_group_(arc->parent.layer); - if ((rat->group1 == gid) && pcb_isc_ratp_arc(&rat->Point1, arc)) + if ((rat->group1 == gid) && pcb_isc_ratp_arc(ctx, &rat->Point1, arc)) return pcb_true; - if ((rat->group2 == gid) && pcb_isc_ratp_arc(&rat->Point2, arc)) + if ((rat->group2 == gid) && pcb_isc_ratp_arc(ctx, &rat->Point2, arc)) return pcb_true; return pcb_false; @@ -336,7 +336,7 @@ /* --------------------------------------------------------------------------- * Tests if rat line point is connected to a polygon */ -static pcb_bool pcb_isc_ratp_poly(pcb_point_t *Point, pcb_poly_t *polygon, int donut) +static pcb_bool pcb_isc_ratp_poly(const pcb_find_t *ctx, pcb_point_t *Point, pcb_poly_t *polygon, int donut) { pcb_coord_t cx, cy; pcb_poly_it_t it; @@ -388,14 +388,14 @@ } /* Tests any end of a rat line is on the poly */ -static pcb_bool pcb_isc_rat_poly(pcb_rat_t *rat, pcb_poly_t *poly) +static pcb_bool pcb_isc_rat_poly(const pcb_find_t *ctx, pcb_rat_t *rat, pcb_poly_t *poly) { pcb_layergrp_id_t gid = pcb_layer_get_group_(poly->parent.layer); int donut = PCB_FLAG_TEST(PCB_FLAG_VIA, rat); - if ((rat->group1 == gid) && pcb_isc_ratp_poly(&rat->Point1, poly, donut)) + if ((rat->group1 == gid) && pcb_isc_ratp_poly(ctx, &rat->Point1, poly, donut)) return pcb_true; - if ((rat->group2 == gid) && pcb_isc_ratp_poly(&rat->Point2, poly, donut)) + if ((rat->group2 == gid) && pcb_isc_ratp_poly(ctx, &rat->Point2, poly, donut)) return pcb_true; return pcb_false; @@ -402,7 +402,7 @@ } /* Tests any end of a rat line is on the other rat */ -static pcb_bool pcb_isc_rat_rat(pcb_rat_t *r1, pcb_rat_t *r2) +static pcb_bool pcb_isc_rat_rat(const pcb_find_t *ctx, pcb_rat_t *r1, pcb_rat_t *r2) { if ((r1->group1 == r2->group1) && (r1->Point1.X == r2->Point1.X) && (r1->Point1.Y == r2->Point1.Y)) return pcb_true; @@ -495,7 +495,7 @@ * Also note that the denominators of eqn 1 & 2 are identical. * */ -pcb_bool pcb_isc_line_line(pcb_line_t *Line1, pcb_line_t *Line2) +pcb_bool pcb_isc_line_line(const pcb_find_t *ctx, pcb_line_t *Line1, pcb_line_t *Line2) { double s, r; double line1_dx, line1_dy, line2_dx, line2_dy, point1_dx, point1_dy; @@ -592,7 +592,7 @@ * * The end points are hell so they are checked individually */ -pcb_bool pcb_isc_line_arc(pcb_line_t *Line, pcb_arc_t *Arc) +pcb_bool pcb_isc_line_arc(const pcb_find_t *ctx, pcb_line_t *Line, pcb_arc_t *Arc) { double dx, dy, dx1, dy1, l, d, r, r2, Radius; pcb_coord_t ex, ey; @@ -650,7 +650,7 @@ * - check the two end points of the arc. If none of them matches * - check all segments of the polygon against the arc. */ -pcb_bool pcb_isc_arc_poly(pcb_arc_t *Arc, pcb_poly_t *Polygon) +pcb_bool pcb_isc_arc_poly(const pcb_find_t *ctx, pcb_arc_t *Arc, pcb_poly_t *Polygon) { pcb_box_t *Box = (pcb_box_t *) Arc; @@ -659,7 +659,7 @@ return pcb_false; if (!Polygon->Clipped) return pcb_false; - if (box_isc_poly_any_island_bbox(Box, Polygon, !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, Polygon))) { + if (box_isc_poly_any_island_bbox(ctx, Box, Polygon, !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, Polygon))) { pcb_polyarea_t *ap; if (!(ap = pcb_poly_from_pcb_arc(Arc, Arc->Thickness + Bloat))) @@ -669,7 +669,7 @@ return pcb_false; } -pcb_bool pcb_isc_arc_polyarea(pcb_arc_t *Arc, pcb_polyarea_t *pa) +pcb_bool pcb_isc_arc_polyarea(const pcb_find_t *ctx, pcb_arc_t *Arc, pcb_polyarea_t *pa) { pcb_box_t *Box = (pcb_box_t *) Arc; pcb_bool res = pcb_false; @@ -696,7 +696,7 @@ * - check the two end points of the line. If none of them matches * - check all segments of the polygon against the line. */ -pcb_bool pcb_isc_line_poly(pcb_line_t *Line, pcb_poly_t *Polygon) +pcb_bool pcb_isc_line_poly(const pcb_find_t *ctx, pcb_line_t *Line, pcb_poly_t *Polygon) { pcb_box_t *Box = (pcb_box_t *) Line; pcb_polyarea_t *lp; @@ -716,7 +716,7 @@ y2 = MAX(Line->Point1.Y, Line->Point2.Y) + wid; return pcb_poly_is_rect_in_p(x1, y1, x2, y2, Polygon); } - if (box_isc_poly_any_island_bbox(Box, Polygon, !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, Polygon))) { + if (box_isc_poly_any_island_bbox(ctx, Box, Polygon, !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, Polygon))) { if (!(lp = pcb_poly_from_pcb_line(Line, Line->Thickness + Bloat))) return pcb_false; /* error */ return box_isc_poly_any_island_free(lp, Polygon, !PCB_FLAG_TEST(PCB_FLAG_FULLPOLY, Polygon)); @@ -730,7 +730,7 @@ * First check all points out of P1 against P2 and vice versa. * If both fail check all lines of P1 against the ones of P2 */ -pcb_bool pcb_isc_poly_poly(pcb_poly_t *P1, pcb_poly_t *P2) +pcb_bool pcb_isc_poly_poly(const pcb_find_t *ctx, pcb_poly_t *P1, pcb_poly_t *P2) { int pcp_cnt = 0; pcb_coord_t pcp_gap; @@ -813,7 +813,7 @@ line.Point2.X = v->point[0]; line.Point2.Y = v->point[1]; pcb_line_bbox(&line); - if (pcb_isc_line_poly(&line, P2)) + if (pcb_isc_line_poly(ctx, &line, P2)) return pcb_true; line.Point1.X = line.Point2.X; line.Point1.Y = line.Point2.Y; @@ -833,7 +833,7 @@ /* returns whether a round-cap pcb line touches a polygon; assumes bounding boxes do touch */ -PCB_INLINE pcb_bool_t pcb_isc_line_polyline(pcb_pline_t *pl, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick) +PCB_INLINE pcb_bool_t pcb_isc_line_polyline(const pcb_find_t *ctx, pcb_pline_t *pl, pcb_coord_t x1, pcb_coord_t y1, pcb_coord_t x2, pcb_coord_t y2, pcb_coord_t thick) { pcb_coord_t ox, oy, vx, vy; double dx, dy, h, l; @@ -888,7 +888,7 @@ pcb_line.Flags = shape_line.square ? pcb_flag_make(PCB_FLAG_SQUARE) : pcb_no_flags(); \ } while(0) -static pcb_bool_t pcb_isc_pstk_line_shp(pcb_pstk_t *ps, pcb_line_t *line, pcb_pstk_shape_t *shape) +static pcb_bool_t pcb_isc_pstk_line_shp(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_line_t *line, pcb_pstk_shape_t *shape) { if (shape == NULL) goto noshape; @@ -896,12 +896,12 @@ case PCB_PSSH_POLY: if (shape->data.poly.pa == NULL) pcb_pstk_shape_update_pa(&shape->data.poly); - return pcb_isc_line_polyline(shape->data.poly.pa->contours, line->Point1.X - ps->x, line->Point1.Y - ps->y, line->Point2.X - ps->x, line->Point2.Y - ps->y, line->Thickness); + return pcb_isc_line_polyline(ctx, shape->data.poly.pa->contours, line->Point1.X - ps->x, line->Point1.Y - ps->y, line->Point2.X - ps->x, line->Point2.Y - ps->y, line->Thickness); case PCB_PSSH_LINE: { pcb_line_t tmp; shape_line_to_pcb_line(ps, shape->data.line, tmp); - return pcb_isc_line_line(line, &tmp); + return pcb_isc_line_line(ctx, line, &tmp); } case PCB_PSSH_CIRC: { @@ -926,25 +926,25 @@ slshape = pcb_pstk_shape_mech_or_hole_at(PCB, ps, line->parent.layer, &sltmp); if (slshape == NULL) return pcb_false; - return pcb_isc_pstk_line_shp(ps, line, slshape); + return pcb_isc_pstk_line_shp(ctx, ps, line, slshape); } } return pcb_false; } -pcb_bool_t pcb_isc_pstk_line(pcb_pstk_t *ps, pcb_line_t *line) +pcb_bool_t pcb_isc_pstk_line(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_line_t *line) { pcb_pstk_shape_t *shape; pcb_pstk_proto_t *proto; shape = pcb_pstk_shape_at(PCB, ps, line->parent.layer); - if (pcb_isc_pstk_line_shp(ps, line, shape)) + if (pcb_isc_pstk_line_shp(ctx, ps, line, shape)) return pcb_true; proto = pcb_pstk_get_proto(ps); if (proto->hplated) { shape = pcb_pstk_shape_mech_at(PCB, ps, line->parent.layer); - if (pcb_isc_pstk_line_shp(ps, line, shape)) + if (pcb_isc_pstk_line_shp(ctx, ps, line, shape)) return pcb_true; } @@ -952,7 +952,7 @@ } -PCB_INLINE pcb_bool_t pcb_isc_pstk_arc_shp(pcb_pstk_t *ps, pcb_arc_t *arc, pcb_pstk_shape_t *shape) +PCB_INLINE pcb_bool_t pcb_isc_pstk_arc_shp(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_arc_t *arc, pcb_pstk_shape_t *shape) { if (shape == NULL) goto noshape; @@ -973,7 +973,7 @@ if (shape->data.poly.pa == NULL) pcb_pstk_shape_update_pa(&shape->data.poly); - return pcb_isc_arc_polyarea(&tmp, shape->data.poly.pa); + return pcb_isc_arc_polyarea(ctx, &tmp, shape->data.poly.pa); } case PCB_PSSH_LINE: @@ -980,7 +980,7 @@ { pcb_line_t tmp; shape_line_to_pcb_line(ps, shape->data.line, tmp); - return pcb_isc_line_arc(&tmp, arc); + return pcb_isc_line_arc(ctx, &tmp, arc); } case PCB_PSSH_CIRC: return pcb_is_point_on_arc(shape->data.circ.x + ps->x, shape->data.circ.y + ps->y, shape->data.circ.dia/2, arc); @@ -996,25 +996,25 @@ slshape = pcb_pstk_shape_mech_or_hole_at(PCB, ps, arc->parent.layer, &sltmp); if (slshape == NULL) return pcb_false; - return pcb_isc_pstk_arc_shp(ps, arc, slshape); + return pcb_isc_pstk_arc_shp(ctx, ps, arc, slshape); } } return pcb_false; } -PCB_INLINE pcb_bool_t pcb_isc_pstk_arc(pcb_pstk_t *ps, pcb_arc_t *arc) +PCB_INLINE pcb_bool_t pcb_isc_pstk_arc(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_arc_t *arc) { pcb_pstk_shape_t *shape; pcb_pstk_proto_t *proto; shape = pcb_pstk_shape_at(PCB, ps, arc->parent.layer); - if (pcb_isc_pstk_arc_shp(ps, arc, shape)) + if (pcb_isc_pstk_arc_shp(ctx, ps, arc, shape)) return pcb_true; proto = pcb_pstk_get_proto(ps); if (proto->hplated) { shape = pcb_pstk_shape_mech_at(PCB, ps, arc->parent.layer); - if (pcb_isc_pstk_arc_shp(ps, arc, shape)) + if (pcb_isc_pstk_arc_shp(ctx, ps, arc, shape)) return pcb_true; } @@ -1047,7 +1047,7 @@ return shp; } -PCB_INLINE pcb_bool_t pcb_isc_pstk_poly_shp(pcb_pstk_t *ps, pcb_poly_t *poly, pcb_pstk_shape_t *shape) +PCB_INLINE pcb_bool_t pcb_isc_pstk_poly_shp(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_poly_t *poly, pcb_pstk_shape_t *shape) { if (shape == NULL) goto noshape; @@ -1066,7 +1066,7 @@ pcb_line_t tmp; shape_line_to_pcb_line(ps, shape->data.line, tmp); pcb_line_bbox(&tmp); - return pcb_isc_line_poly(&tmp, poly); + return pcb_isc_line_poly(ctx, &tmp, poly); } case PCB_PSSH_CIRC: { @@ -1078,7 +1078,7 @@ tmp.Thickness = shape->data.circ.dia; tmp.Flags = pcb_no_flags(); pcb_line_bbox(&tmp); - return pcb_isc_line_poly(&tmp, poly); + return pcb_isc_line_poly(ctx, &tmp, poly); } case PCB_PSSH_HSHADOW: /* if the poly reaches the plated hole or slot, there's connection */ @@ -1092,7 +1092,7 @@ slshape = pcb_pstk_shape_mech_or_hole_at(PCB, ps, poly->parent.layer, &sltmp); if (slshape == NULL) return pcb_false; - return pcb_isc_pstk_poly_shp(ps, poly, slshape); + return pcb_isc_pstk_poly_shp(ctx, ps, poly, slshape); } } @@ -1099,19 +1099,19 @@ return pcb_false; } -PCB_INLINE pcb_bool_t pcb_isc_pstk_poly(pcb_pstk_t *ps, pcb_poly_t *poly) +PCB_INLINE pcb_bool_t pcb_isc_pstk_poly(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_poly_t *poly) { pcb_pstk_shape_t *shape; pcb_pstk_proto_t *proto; shape = pcb_pstk_shape_at(PCB, ps, poly->parent.layer); - if (pcb_isc_pstk_poly_shp(ps, poly, shape)) + if (pcb_isc_pstk_poly_shp(ctx, ps, poly, shape)) return pcb_true; proto = pcb_pstk_get_proto(ps); if (proto->hplated) { shape = pcb_pstk_shape_mech_at(PCB, ps, poly->parent.layer); - if (pcb_isc_pstk_poly_shp(ps, poly, shape)) + if (pcb_isc_pstk_poly_shp(ctx, ps, poly, shape)) return pcb_true; } @@ -1119,14 +1119,14 @@ } -PCB_INLINE pcb_bool_t pstk_shape_isc_circ_poly(pcb_pstk_t *p, pcb_pstk_shape_t *sp, pcb_pstk_t *c, pcb_pstk_shape_t *sc) +PCB_INLINE pcb_bool_t pstk_shape_isc_circ_poly(const pcb_find_t *ctx, pcb_pstk_t *p, pcb_pstk_shape_t *sp, pcb_pstk_t *c, pcb_pstk_shape_t *sc) { pcb_coord_t px = sc->data.circ.x + c->x - p->x; pcb_coord_t py = sc->data.circ.y + c->y - p->y; - return pcb_isc_line_polyline(sp->data.poly.pa->contours, px, py, px, py, sc->data.circ.dia); + return pcb_isc_line_polyline(ctx, sp->data.poly.pa->contours, px, py, px, py, sc->data.circ.dia); } -PCB_INLINE pcb_bool_t pstk_shape_isc_circ_line(pcb_pstk_t *l, pcb_pstk_shape_t *sl, pcb_pstk_t *c, pcb_pstk_shape_t *sc) +PCB_INLINE pcb_bool_t pstk_shape_isc_circ_line(const pcb_find_t *ctx, pcb_pstk_t *l, pcb_pstk_shape_t *sl, pcb_pstk_t *c, pcb_pstk_shape_t *sc) { pcb_any_line_t tmp; tmp.Point1.X = sl->data.line.x1 + l->x; @@ -1138,7 +1138,7 @@ return pcb_is_point_in_line(sc->data.circ.x + c->x, sc->data.circ.y + c->y, sc->data.circ.dia/2, &tmp); } -PCB_INLINE pcb_bool_t pcb_pstk_shape_intersect(pcb_pstk_t *ps1, pcb_pstk_shape_t *shape1, pcb_pstk_t *ps2, pcb_pstk_shape_t *shape2) +PCB_INLINE pcb_bool_t pcb_pstk_shape_intersect(const pcb_find_t *ctx, pcb_pstk_t *ps1, pcb_pstk_shape_t *shape1, pcb_pstk_t *ps2, pcb_pstk_shape_t *shape2) { if ((shape1->shape == PCB_PSSH_POLY) && (shape1->data.poly.pa == NULL)) pcb_pstk_shape_update_pa(&shape1->data.poly); @@ -1159,9 +1159,9 @@ return res; } case PCB_PSSH_LINE: - return pcb_isc_line_polyline(shape1->data.poly.pa->contours, shape2->data.line.x1 + ps2->x - ps1->x, shape2->data.line.y1 + ps2->y - ps1->y, shape2->data.line.x2 + ps2->x - ps1->x, shape2->data.line.y2 + ps2->y - ps1->y, shape2->data.line.thickness); + return pcb_isc_line_polyline(ctx, shape1->data.poly.pa->contours, shape2->data.line.x1 + ps2->x - ps1->x, shape2->data.line.y1 + ps2->y - ps1->y, shape2->data.line.x2 + ps2->x - ps1->x, shape2->data.line.y2 + ps2->y - ps1->y, shape2->data.line.thickness); case PCB_PSSH_CIRC: - return pstk_shape_isc_circ_poly(ps1, shape1, ps2, shape2); + return pstk_shape_isc_circ_poly(ctx, ps1, shape1, ps2, shape2); case PCB_PSSH_HSHADOW: return 0; /* non-object won't intersect */ } @@ -1170,16 +1170,16 @@ case PCB_PSSH_LINE: switch(shape2->shape) { case PCB_PSSH_POLY: - return pcb_isc_line_polyline(shape2->data.poly.pa->contours, shape1->data.line.x1 + ps1->x - ps2->x, shape1->data.line.y1 + ps1->y - ps2->y, shape1->data.line.x2 + ps1->x - ps2->x, shape1->data.line.y2 + ps1->y - ps2->y, shape1->data.line.thickness); + return pcb_isc_line_polyline(ctx, shape2->data.poly.pa->contours, shape1->data.line.x1 + ps1->x - ps2->x, shape1->data.line.y1 + ps1->y - ps2->y, shape1->data.line.x2 + ps1->x - ps2->x, shape1->data.line.y2 + ps1->y - ps2->y, shape1->data.line.thickness); case PCB_PSSH_LINE: { pcb_line_t tmp1, tmp2; shape_line_to_pcb_line(ps1, shape1->data.line, tmp1); shape_line_to_pcb_line(ps2, shape2->data.line, tmp2); - return pcb_isc_line_line(&tmp1, &tmp2); + return pcb_isc_line_line(ctx, &tmp1, &tmp2); } case PCB_PSSH_CIRC: - return pstk_shape_isc_circ_line(ps1, shape1, ps2, shape2); + return pstk_shape_isc_circ_line(ctx, ps1, shape1, ps2, shape2); case PCB_PSSH_HSHADOW: return 0; /* non-object won't intersect */ } @@ -1188,9 +1188,9 @@ case PCB_PSSH_CIRC: switch(shape2->shape) { case PCB_PSSH_POLY: - return pstk_shape_isc_circ_poly(ps2, shape2, ps1, shape1); + return pstk_shape_isc_circ_poly(ctx, ps2, shape2, ps1, shape1); case PCB_PSSH_LINE: - return pstk_shape_isc_circ_line(ps2, shape2, ps1, shape1); + return pstk_shape_isc_circ_line(ctx, ps2, shape2, ps1, shape1); case PCB_PSSH_CIRC: { double cdist2 = pcb_distance2(ps1->x + shape1->data.circ.x, ps1->y + shape1->data.circ.y, ps2->x + shape2->data.circ.x, ps2->y + shape2->data.circ.y); @@ -1208,7 +1208,7 @@ return pcb_false; } -PCB_INLINE pcb_bool_t pcb_isc_pstk_pstk(pcb_pstk_t *ps1, pcb_pstk_t *ps2) +PCB_INLINE pcb_bool_t pcb_isc_pstk_pstk(const pcb_find_t *ctx, pcb_pstk_t *ps1, pcb_pstk_t *ps2) { pcb_layer_t *ly; pcb_pstk_proto_t *proto1, *proto2; @@ -1228,7 +1228,7 @@ shape1 = pcb_pstk_shape_at(PCB, ps1, ly); shape2 = pcb_pstk_shape_at(PCB, ps2, ly); - if ((shape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ps1, shape1, ps2, shape2)) return pcb_true; + if ((shape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ctx, ps1, shape1, ps2, shape2)) return pcb_true; if (proto1->hplated) slshape1 = pcb_pstk_shape_mech_or_hole_at(PCB, ps1, ly, &sltmp1); @@ -1235,15 +1235,15 @@ if (proto2->hplated) slshape2 = pcb_pstk_shape_mech_or_hole_at(PCB, ps2, ly, &sltmp2); - if ((slshape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ps1, slshape1, ps2, shape2)) return pcb_true; - if ((slshape2 != NULL) && (shape1 != NULL) && pcb_pstk_shape_intersect(ps2, slshape2, ps1, shape1)) return pcb_true; - if ((slshape1 != NULL) && (slshape2 != NULL) && pcb_pstk_shape_intersect(ps1, slshape1, ps2, slshape2)) return pcb_true; + if ((slshape1 != NULL) && (shape2 != NULL) && pcb_pstk_shape_intersect(ctx, ps1, slshape1, ps2, shape2)) return pcb_true; + if ((slshape2 != NULL) && (shape1 != NULL) && pcb_pstk_shape_intersect(ctx, ps2, slshape2, ps1, shape1)) return pcb_true; + if ((slshape1 != NULL) && (slshape2 != NULL) && pcb_pstk_shape_intersect(ctx, ps1, slshape1, ps2, slshape2)) return pcb_true; } return pcb_false; } -PCB_INLINE pcb_bool_t pcb_isc_pstk_rat(pcb_pstk_t *ps, pcb_rat_t *rat) +PCB_INLINE pcb_bool_t pcb_isc_pstk_rat(const pcb_find_t *ctx, pcb_pstk_t *ps, pcb_rat_t *rat) { pcb_board_t *pcb = PCB; Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 30841) +++ trunk/src/obj_line_drcenf.c (revision 30842) @@ -200,7 +200,7 @@ pcb_pstk_t *ps = (pcb_pstk_t *)b; struct drc_info *i = (struct drc_info *)cl; - if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, ps) && pcb_isc_pstk_line(ps, i->line)) + if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, ps) && pcb_isc_pstk_line(pcb_find0, ps, i->line)) longjmp(i->env, 1); return PCB_R_DIR_FOUND_CONTINUE; } @@ -210,7 +210,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && pcb_isc_line_line(line, i->line)) + if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, line) && pcb_isc_line_line(pcb_find0, line, i->line)) longjmp(i->env, 1); return PCB_R_DIR_FOUND_CONTINUE; } @@ -220,7 +220,7 @@ pcb_arc_t *arc = (pcb_arc_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && pcb_isc_line_arc(i->line, arc)) + if (!PCB_FLAG_TEST(PCB_FLAG_FOUND, arc) && pcb_isc_line_arc(pcb_find0, i->line, arc)) longjmp(i->env, 1); return PCB_R_DIR_FOUND_CONTINUE; } Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 30841) +++ trunk/src/search.c (revision 30842) @@ -748,7 +748,7 @@ line.Point1.Y = line.Point2.Y = Y1; line.Point1.X = X1; line.Point2.X = X2; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* upper-right to lower-right corner */ @@ -755,7 +755,7 @@ line.Point1.X = X2; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* lower-right to lower-left corner */ @@ -762,7 +762,7 @@ line.Point1.Y = Y2; line.Point1.X = X1; line.Point2.X = X2; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* lower-left to upper-left corner */ @@ -769,7 +769,7 @@ line.Point2.X = X1; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; return pcb_false; @@ -826,25 +826,25 @@ line.Point1.Y = p[0].Y; line.Point2.X = p[1].X; line.Point2.Y = p[1].Y; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* upper-right to lower-right corner */ line.Point1.X = p[2].X; line.Point1.Y = p[2].Y; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* lower-right to lower-left corner */ line.Point2.X = p[3].X; line.Point2.Y = p[3].Y; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; /* lower-left to upper-left corner */ line.Point1.X = p[0].X; line.Point1.Y = p[0].Y; - if (pcb_isc_line_line(&line, Line)) + if (pcb_isc_line_line(pcb_find0, &line, Line)) return pcb_true; return pcb_false; @@ -877,7 +877,7 @@ line.Point1.Y = line.Point2.Y = Y1; line.Point1.X = X1; line.Point2.X = X2; - if (pcb_isc_line_arc(&line, Arc)) + if (pcb_isc_line_arc(pcb_find0, &line, Arc)) return pcb_true; /* upper-right to lower-right corner */ @@ -884,7 +884,7 @@ line.Point1.X = line.Point2.X = X2; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (pcb_isc_line_arc(&line, Arc)) + if (pcb_isc_line_arc(pcb_find0, &line, Arc)) return pcb_true; /* lower-right to lower-left corner */ @@ -891,7 +891,7 @@ line.Point1.Y = line.Point2.Y = Y2; line.Point1.X = X1; line.Point2.X = X2; - if (pcb_isc_line_arc(&line, Arc)) + if (pcb_isc_line_arc(pcb_find0, &line, Arc)) return pcb_true; /* lower-left to upper-left corner */ @@ -898,7 +898,7 @@ line.Point1.X = line.Point2.X = X1; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (pcb_isc_line_arc(&line, Arc)) + if (pcb_isc_line_arc(pcb_find0, &line, Arc)) return pcb_true; return pcb_false; Index: trunk/src_plugins/act_read/act_geo.c =================================================================== --- trunk/src_plugins/act_read/act_geo.c (revision 30841) +++ trunk/src_plugins/act_read/act_geo.c (revision 30842) @@ -98,7 +98,7 @@ if ((obj1 == NULL) || ((obj1->type & PCB_OBJ_CLASS_REAL) == 0) || (obj2 == NULL) || ((obj2->type & PCB_OBJ_CLASS_REAL) == 0)) return FGW_ERR_ARG_CONV; - PCB_ACT_IRES(pcb_intersect_obj_obj(obj1, obj2)); + PCB_ACT_IRES(pcb_intersect_obj_obj(pcb_find0, obj1, obj2)); return 0; } Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 30841) +++ trunk/src_plugins/djopt/djopt.c (revision 30842) @@ -896,7 +896,7 @@ int th = djmax(p->BoundingBox.X2 - p->BoundingBox.X1, p->BoundingBox.Y2 - p->BoundingBox.Y1); th /= 2; if (dist(l->s->x, l->s->y, c->x, c->y) > th - && dist(l->e->x, l->e->y, c->x, c->y) > th && pcb_isc_pstk_line(p, l->line)) { + && dist(l->e->x, l->e->y, c->x, c->y) > th && pcb_isc_pstk_line(pcb_find0, p, l->line)) { return split_line(l, c); } } Index: trunk/src_plugins/lib_compat_help/pstk_help.c =================================================================== --- trunk/src_plugins/lib_compat_help/pstk_help.c (revision 30841) +++ trunk/src_plugins/lib_compat_help/pstk_help.c (revision 30842) @@ -250,7 +250,7 @@ if (!((lyt & (PCB_LYT_MASK | PCB_LYT_PASTE)))) continue; /* care for mask and paste objects */ - if (!pcb_intersect_obj_obj(o, c)) + if (!pcb_intersect_obj_obj(pcb_find0, o, c)) continue; /* only if intersects with the original copper pad */ for(l = 0; l < NUM_LYTS; l++) { Index: trunk/src_plugins/puller/puller.c =================================================================== --- trunk/src_plugins/puller/puller.c (revision 30841) +++ trunk/src_plugins/puller/puller.c (revision 30842) @@ -747,7 +747,7 @@ /* See if the line passes through this pin - if so, split it into two lines so they can be pulled independently. */ - if (pcb_isc_pstk_line(pin, line)) { + if (pcb_isc_pstk_line(pcb_find0, pin, line)) { #if TRACE1 pcb_printf("splitting line %#mD-%#mD because it passes through pin %#mD r%d\n", line->Point1.X, line->Point1.Y, line->Point2.X, line->Point2.Y, pin->x, pin->y, pin->Thickness / 2); Index: trunk/src_plugins/query/fnc_geo.c =================================================================== --- trunk/src_plugins/query/fnc_geo.c (revision 30841) +++ trunk/src_plugins/query/fnc_geo.c (revision 30842) @@ -60,5 +60,5 @@ if ((argc != 2) || (argv[0].type != PCBQ_VT_OBJ) || (argv[1].type != PCBQ_VT_OBJ)) return -1; - PCB_QRY_RET_INT(res, pcb_intersect_obj_obj(argv[0].data.obj, argv[1].data.obj)); + PCB_QRY_RET_INT(res, pcb_intersect_obj_obj(pcb_find0, argv[0].data.obj, argv[1].data.obj)); }