Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4867) +++ trunk/doc-rnd/hacking/renames (revision 4868) @@ -270,3 +270,9 @@ event_unbind_cookie -> pcb_event_unbind_cookie event_unbind_allcookie -> pcb_event_unbind_allcookie event -> pcb_event +LineLineIntersect -> pcb_intersect_line_line +LineArcIntersect -> pcb_intersect_line_arc +PinLineIntersect -> pcb_intersect_line_pin +LinePadIntersect -> pcb_intersect_line_pad +ArcPadIntersect -> pcb_intersect_arc_pad +IsPolygonInPolygon -> pcb_is_poly_in_poly Index: trunk/src/find.h =================================================================== --- trunk/src/find.h (revision 4867) +++ trunk/src/find.h (revision 4868) @@ -60,12 +60,12 @@ #define SILK_TYPE \ (PCB_TYPE_LINE | PCB_TYPE_ARC | PCB_TYPE_POLYGON) -pcb_bool LineLineIntersect(pcb_line_t *, pcb_line_t *); -pcb_bool LineArcIntersect(pcb_line_t *, pcb_arc_t *); -pcb_bool PinLineIntersect(pcb_pin_t *, pcb_line_t *); -pcb_bool LinePadIntersect(pcb_line_t *, pcb_pad_t *); -pcb_bool ArcPadIntersect(pcb_arc_t *, pcb_pad_t *); -pcb_bool IsPolygonInPolygon(pcb_polygon_t *, pcb_polygon_t *); +pcb_bool pcb_intersect_line_line(pcb_line_t *, pcb_line_t *); +pcb_bool pcb_intersect_line_arc(pcb_line_t *, pcb_arc_t *); +pcb_bool pcb_intersect_line_pin(pcb_pin_t *, pcb_line_t *); +pcb_bool pcb_intersect_line_pad(pcb_line_t *, pcb_pad_t *); +pcb_bool pcb_intersect_arc_pad(pcb_arc_t *, pcb_pad_t *); +pcb_bool pcb_is_poly_in_poly(pcb_polygon_t *, pcb_polygon_t *); void LookupElementConnections(pcb_element_t *, FILE *); void LookupConnectionsToAllElements(FILE *); void LookupConnection(pcb_coord_t, pcb_coord_t, pcb_bool, pcb_coord_t, int); Index: trunk/src/find_deadcode.c =================================================================== --- trunk/src/find_deadcode.c (revision 4867) +++ trunk/src/find_deadcode.c (revision 4868) @@ -34,7 +34,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, line) && LineLineIntersect(&i->line, line)) + if (!TEST_FLAG(TheFlag, line) && pcb_intersect_line_line(&i->line, line)) longjmp(i->env, 1); return 0; } @@ -46,7 +46,7 @@ if (!arc->Thickness) return 0; - if (!TEST_FLAG(TheFlag, arc) && LineArcIntersect(&i->line, arc)) + if (!TEST_FLAG(TheFlag, arc) && pcb_intersect_line_arc(&i->line, arc)) longjmp(i->env, 1); return 0; } @@ -57,7 +57,7 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) - && LinePadIntersect(&i->line, pad)) + && pcb_intersect_line_pad(&i->line, pad)) longjmp(i->env, 1); return 0; } Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4867) +++ trunk/src/find_geo.c (revision 4868) @@ -37,7 +37,7 @@ * to X,Y * * Intersection of line <--> line: - * - see the description of 'LineLineIntersect()' + * - see the description of 'pcb_intersect_line_line()' */ #include "macro.h" @@ -319,7 +319,7 @@ * Also note that the denominators of eqn 1 & 2 are identical. * */ -pcb_bool LineLineIntersect(pcb_line_t *Line1, pcb_line_t *Line2) +pcb_bool pcb_intersect_line_line(pcb_line_t *Line1, pcb_line_t *Line2) { double s, r; double line1_dx, line1_dy, line2_dx, line2_dy, point1_dx, point1_dy; @@ -329,7 +329,7 @@ return IsLineInQuadrangle(p, Line2); } /* here come only round Line1 because IsLineInQuadrangle() - calls LineLineIntersect() with first argument rounded */ + calls pcb_intersect_line_line() with first argument rounded */ if (TEST_FLAG(PCB_FLAG_SQUARE, Line2)) { pcb_point_t p[4]; form_slanted_rectangle(p, Line2); @@ -416,7 +416,7 @@ * * The end points are hell so they are checked individually */ -pcb_bool LineArcIntersect(pcb_line_t *Line, pcb_arc_t *Arc) +pcb_bool pcb_intersect_line_arc(pcb_line_t *Line, pcb_arc_t *Arc) { double dx, dy, dx1, dy1, l, d, r, r2, Radius; pcb_box_t *box; @@ -546,7 +546,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 IsPolygonInPolygon(pcb_polygon_t *P1, pcb_polygon_t *P2) +pcb_bool pcb_is_poly_in_poly(pcb_polygon_t *P1, pcb_polygon_t *P2) { if (!P1->Clipped || !P2->Clipped) return pcb_false; @@ -599,14 +599,14 @@ * some of the 'pad' routines are the same as for lines because the 'pad' * struct starts with a line struct. See global.h for details */ -pcb_bool LinePadIntersect(pcb_line_t *Line, pcb_pad_t *Pad) +pcb_bool pcb_intersect_line_pad(pcb_line_t *Line, pcb_pad_t *Pad) { - return LineLineIntersect((Line), (pcb_line_t *) Pad); + return pcb_intersect_line_line((Line), (pcb_line_t *) Pad); } -pcb_bool ArcPadIntersect(pcb_arc_t *Arc, pcb_pad_t *Pad) +pcb_bool pcb_intersect_arc_pad(pcb_arc_t *Arc, pcb_pad_t *Pad) { - return LineArcIntersect((pcb_line_t *) (Pad), (Arc)); + return pcb_intersect_line_arc((pcb_line_t *) (Pad), (Arc)); } pcb_bool BoxBoxIntersection(pcb_box_t *b1, pcb_box_t *b2) @@ -620,7 +620,7 @@ static pcb_bool PadPadIntersect(pcb_pad_t *p1, pcb_pad_t *p2) { - return LinePadIntersect((pcb_line_t *) p1, p2); + return pcb_intersect_line_pad((pcb_line_t *) p1, p2); } static inline pcb_bool PV_TOUCH_PV(pcb_pin_t *PV1, pcb_pin_t *PV2) @@ -665,7 +665,7 @@ return BoxBoxIntersection(&b1, &b2); } -pcb_bool PinLineIntersect(pcb_pin_t *PV, pcb_line_t *Line) +pcb_bool pcb_intersect_line_pin(pcb_pin_t *PV, pcb_line_t *Line) { if (TEST_FLAG(PCB_FLAG_SQUARE, PV)) { int shape = GET_SQUARE(PV); Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4867) +++ trunk/src/find_lookup.c (revision 4868) @@ -297,7 +297,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct pv_info *i = (struct pv_info *) cl; - if (!TEST_FLAG(TheFlag, line) && PinLineIntersect(&i->pv, line) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) { + if (!TEST_FLAG(TheFlag, line) && pcb_intersect_line_pin(&i->pv, line) && !TEST_FLAG(PCB_FLAG_HOLE, &i->pv)) { if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); } @@ -613,7 +613,7 @@ pcb_pin_t *pv = (pcb_pin_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pv) && PinLineIntersect(pv, &i->line)) { + if (!TEST_FLAG(TheFlag, pv) && pcb_intersect_line_pin(pv, &i->line)) { if (TEST_FLAG(PCB_FLAG_HOLE, pv)) { SET_FLAG(PCB_FLAG_WARN, pv); conf_core.temp.rat_warn = pcb_true; @@ -820,7 +820,7 @@ pcb_pin_t *pin = (pcb_pin_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, pin) && PinLineIntersect(pin, &i->line)) + if (!TEST_FLAG(TheFlag, pin) && pcb_intersect_line_pin(pin, &i->line)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; } @@ -830,7 +830,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, line) && LineArcIntersect(line, &i->arc)) { + if (!TEST_FLAG(TheFlag, line) && pcb_intersect_line_arc(line, &i->arc)) { if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_ARC, &i->arc, FCT_COPPER)) longjmp(i->env, 1); } @@ -857,7 +857,7 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) - && ArcPadIntersect(&i->arc, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_ARC, &i->arc, FCT_COPPER)) + && pcb_intersect_arc_pad(&i->arc, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_ARC, &i->arc, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; } @@ -922,7 +922,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, line) && LineLineIntersect(&i->line, line)) { + if (!TEST_FLAG(TheFlag, line) && pcb_intersect_line_line(&i->line, line)) { if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_LINE, &i->line, FCT_COPPER)) longjmp(i->env, 1); } @@ -936,7 +936,7 @@ if (!arc->Thickness) return 0; - if (!TEST_FLAG(TheFlag, arc) && LineArcIntersect(&i->line, arc)) { + if (!TEST_FLAG(TheFlag, arc) && pcb_intersect_line_arc(&i->line, arc)) { if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_LINE, &i->line, FCT_COPPER)) longjmp(i->env, 1); } @@ -969,7 +969,7 @@ struct lo_info *i = (struct lo_info *) cl; if (!TEST_FLAG(TheFlag, pad) && i->layer == (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) ? SOLDER_LAYER : COMPONENT_LAYER) - && LinePadIntersect(&i->line, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_LINE, &i->line, FCT_COPPER)) + && pcb_intersect_line_pad(&i->line, pad) && ADD_PAD_TO_LIST(i->layer, pad, PCB_TYPE_LINE, &i->line, FCT_COPPER)) longjmp(i->env, 1); return R_DIR_NOT_FOUND; } @@ -1138,7 +1138,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct lo_info *i = (struct lo_info *) cl; - if (!TEST_FLAG(TheFlag, line) && LinePadIntersect(line, &i->pad)) { + if (!TEST_FLAG(TheFlag, line) && pcb_intersect_line_pad(line, &i->pad)) { if (ADD_LINE_TO_LIST(i->layer, line, PCB_TYPE_PAD, &i->pad, FCT_COPPER)) longjmp(i->env, 1); } @@ -1152,7 +1152,7 @@ if (!arc->Thickness) return 0; - if (!TEST_FLAG(TheFlag, arc) && ArcPadIntersect(arc, &i->pad)) { + if (!TEST_FLAG(TheFlag, arc) && pcb_intersect_arc_pad(arc, &i->pad)) { if (ADD_ARC_TO_LIST(i->layer, arc, PCB_TYPE_PAD, &i->pad, FCT_COPPER)) longjmp(i->env, 1); } @@ -1399,7 +1399,7 @@ /* check all polygons */ polylist_foreach(&(PCB->Data->Layer[layer].Polygon), &it, polygon) { if (!TEST_FLAG(TheFlag, polygon) - && IsPolygonInPolygon(polygon, Polygon) + && pcb_is_poly_in_poly(polygon, Polygon) && ADD_POLYGON_TO_LIST(layer, polygon, PCB_TYPE_POLYGON, Polygon, FCT_COPPER)) return pcb_true; } Index: trunk/src/obj_line_drcenf.c =================================================================== --- trunk/src/obj_line_drcenf.c (revision 4867) +++ trunk/src/obj_line_drcenf.c (revision 4868) @@ -204,7 +204,7 @@ pcb_pin_t *via = (pcb_pin_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(PCB_FLAG_FOUND, via) && PinLineIntersect(via, i->line)) + if (!TEST_FLAG(PCB_FLAG_FOUND, via) && pcb_intersect_line_pin(via, i->line)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -214,7 +214,7 @@ pcb_pad_t *pad = (pcb_pad_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == i->solder && !TEST_FLAG(PCB_FLAG_FOUND, pad) && LinePadIntersect(i->line, pad)) + if (TEST_FLAG(PCB_FLAG_ONSOLDER, pad) == i->solder && !TEST_FLAG(PCB_FLAG_FOUND, pad) && pcb_intersect_line_pad(i->line, pad)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -224,7 +224,7 @@ pcb_line_t *line = (pcb_line_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(PCB_FLAG_FOUND, line) && LineLineIntersect(line, i->line)) + if (!TEST_FLAG(PCB_FLAG_FOUND, line) && pcb_intersect_line_line(line, i->line)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } @@ -234,7 +234,7 @@ pcb_arc_t *arc = (pcb_arc_t *) b; struct drc_info *i = (struct drc_info *) cl; - if (!TEST_FLAG(PCB_FLAG_FOUND, arc) && LineArcIntersect(i->line, arc)) + if (!TEST_FLAG(PCB_FLAG_FOUND, arc) && pcb_intersect_line_arc(i->line, arc)) longjmp(i->env, 1); return R_DIR_FOUND_CONTINUE; } Index: trunk/src/search.c =================================================================== --- trunk/src/search.c (revision 4867) +++ trunk/src/search.c (revision 4868) @@ -639,7 +639,7 @@ line.Point1.Y = line.Point2.Y = Y1; line.Point1.X = X1; line.Point2.X = X2; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* upper-right to lower-right corner */ @@ -646,7 +646,7 @@ line.Point1.X = X2; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* lower-right to lower-left corner */ @@ -653,7 +653,7 @@ line.Point1.Y = Y2; line.Point1.X = X1; line.Point2.X = X2; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* lower-left to upper-left corner */ @@ -660,7 +660,7 @@ line.Point2.X = X1; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); return (pcb_false); @@ -715,25 +715,25 @@ line.Point1.Y = p[0].Y; line.Point2.X = p[1].X; line.Point2.Y = p[1].Y; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* upper-right to lower-right corner */ line.Point1.X = p[2].X; line.Point1.Y = p[2].Y; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* lower-right to lower-left corner */ line.Point2.X = p[3].X; line.Point2.Y = p[3].Y; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); /* lower-left to upper-left corner */ line.Point1.X = p[0].X; line.Point1.Y = p[0].Y; - if (LineLineIntersect(&line, Line)) + if (pcb_intersect_line_line(&line, Line)) return (pcb_true); return (pcb_false); @@ -754,7 +754,7 @@ line.Point1.Y = line.Point2.Y = Y1; line.Point1.X = X1; line.Point2.X = X2; - if (LineArcIntersect(&line, Arc)) + if (pcb_intersect_line_arc(&line, Arc)) return (pcb_true); /* upper-right to lower-right corner */ @@ -761,7 +761,7 @@ line.Point1.X = line.Point2.X = X2; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (LineArcIntersect(&line, Arc)) + if (pcb_intersect_line_arc(&line, Arc)) return (pcb_true); /* lower-right to lower-left corner */ @@ -768,7 +768,7 @@ line.Point1.Y = line.Point2.Y = Y2; line.Point1.X = X1; line.Point2.X = X2; - if (LineArcIntersect(&line, Arc)) + if (pcb_intersect_line_arc(&line, Arc)) return (pcb_true); /* lower-left to upper-left corner */ @@ -775,7 +775,7 @@ line.Point1.X = line.Point2.X = X1; line.Point1.Y = Y1; line.Point2.Y = Y2; - if (LineArcIntersect(&line, Arc)) + if (pcb_intersect_line_arc(&line, Arc)) return (pcb_true); return (pcb_false); Index: trunk/src_plugins/djopt/djopt.c =================================================================== --- trunk/src_plugins/djopt/djopt.c (revision 4867) +++ trunk/src_plugins/djopt/djopt.c (revision 4868) @@ -941,7 +941,7 @@ int th = c->pin ? c->pin->Thickness : c->via->Thickness; 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 && PinLineIntersect(c->pin ? c->pin : c->via, l->line)) { + && dist(l->e->x, l->e->y, c->x, c->y) > th && pcb_intersect_line_pin(c->pin ? c->pin : c->via, l->line)) { return split_line(l, c); } } Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4867) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4868) @@ -159,7 +159,7 @@ for (cur_node = start_point; cur_node != NULL; cur_node = next) { next = cur_node->next; -/* to_insert_isects_cur_node = IsPolygonInPolygon (to_insert->polygon, cur_node->polygon);*/ +/* to_insert_isects_cur_node = pcb_is_poly_in_poly(to_insert->polygon, cur_node->polygon);*/ to_insert_contains_cur_node = PolygonContainsPolygon(to_insert->polyarea, cur_node->polyarea); #if 0