Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4801) +++ trunk/src/action_helper.c (revision 4802) @@ -1016,7 +1016,7 @@ { pcb_point_t *points = Crosshair.AttachedPolygon.Points; pcb_cardinal_t n = Crosshair.AttachedPolygon.PointN; - POLYAREA *original, *new_hole, *result; + pcb_polyarea_t *original, *new_hole, *result; pcb_flag_t Flags; /* do update of position; use the 'PCB_MODE_LINE' mechanism */ @@ -1030,7 +1030,7 @@ /* check if this is the last point of a polygon */ if (n >= 3 && points[0].X == Crosshair.AttachedLine.Point2.X && points[0].Y == Crosshair.AttachedLine.Point2.Y) { - /* Create POLYAREAs from the original polygon + /* Create pcb_polyarea_ts from the original polygon * and the new hole polygon */ original = PolygonToPoly((pcb_polygon_t *) Crosshair.AttachedObject.Ptr2); new_hole = PolygonToPoly(&Crosshair.AttachedPolygon); Index: trunk/src/find_geo.c =================================================================== --- trunk/src/find_geo.c (revision 4801) +++ trunk/src/find_geo.c (revision 4802) @@ -483,7 +483,7 @@ if (Box->X1 <= Polygon->Clipped->contours->xmax + Bloat && Box->X2 >= Polygon->Clipped->contours->xmin - Bloat && Box->Y1 <= Polygon->Clipped->contours->ymax + Bloat && Box->Y2 >= Polygon->Clipped->contours->ymin - Bloat) { - POLYAREA *ap; + pcb_polyarea_t *ap; if (!(ap = ArcPoly(Arc, Arc->Thickness + Bloat))) return pcb_false; /* error */ @@ -503,7 +503,7 @@ pcb_bool IsLineInPolygon(pcb_line_t *Line, pcb_polygon_t *Polygon) { pcb_box_t *Box = (pcb_box_t *) Line; - POLYAREA *lp; + pcb_polyarea_t *lp; /* lines with clearance never touch polygons */ if (TEST_FLAG(PCB_FLAG_CLEARPOLY, Polygon) && TEST_FLAG(PCB_FLAG_CLEARLINE, Line)) @@ -566,10 +566,10 @@ /* now the difficult case of bloated */ if (Bloat > 0) { - PLINE *c; + pcb_pline_t *c; for (c = P1->Clipped->contours; c; c = c->next) { pcb_line_t line; - VNODE *v = &c->head; + pcb_vnode_t *v = &c->head; if (c->xmin - Bloat <= P2->Clipped->contours->xmax && c->xmax + Bloat >= P2->Clipped->contours->xmin && c->ymin - Bloat <= P2->Clipped->contours->ymax && c->ymax + Bloat >= P2->Clipped->contours->ymin) { @@ -633,7 +633,7 @@ shape2 = GET_SQUARE(PV2); if ((shape1 > 1) || (shape2 > 1)) { - POLYAREA *pl1, *pl2; + pcb_polyarea_t *pl1, *pl2; int ret; pl1 = PinPoly(PV1, PIN_SIZE(PV1) + Bloat, 0); @@ -679,7 +679,7 @@ { /* shaped pin case */ - POLYAREA *pl, *lp; + pcb_polyarea_t *pl, *lp; int ret; pl = PinPoly(PV, PIN_SIZE(PV), 0); Index: trunk/src/find_lookup.c =================================================================== --- trunk/src/find_lookup.c (revision 4801) +++ trunk/src/find_lookup.c (revision 4802) @@ -363,7 +363,7 @@ longjmp(i->env, 1); } else if (TEST_FLAG(PCB_FLAG_OCTAGON, &i->pv)) { - POLYAREA *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, GET_SQUARE(&i->pv)); + pcb_polyarea_t *oct = OctagonPoly(i->pv.X, i->pv.Y, i->pv.Thickness / 2, GET_SQUARE(&i->pv)); if (isects(oct, polygon, pcb_true) && ADD_POLYGON_TO_LIST(i->layer, polygon, PCB_TYPE_PIN, &i->pv, FCT_COPPER)) longjmp(i->env, 1); @@ -678,7 +678,7 @@ longjmp(i->env, 1); } else if (TEST_FLAG(PCB_FLAG_OCTAGON, pv)) { - POLYAREA *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, GET_SQUARE(pv)); + pcb_polyarea_t *oct = OctagonPoly(pv->X, pv->Y, PIN_SIZE(pv) / 2, GET_SQUARE(pv)); if (isects(oct, &i->polygon, pcb_true) && ADD_PV_TO_LIST(pv, PCB_TYPE_POLYGON, &i->polygon, FCT_COPPER)) longjmp(i->env, 1); } Index: trunk/src/hid_draw_helpers.c =================================================================== --- trunk/src/hid_draw_helpers.c (revision 4801) +++ trunk/src/hid_draw_helpers.c (revision 4802) @@ -7,10 +7,10 @@ #include "obj_pad.h" #include "obj_poly.h" -static void fill_contour(pcb_hid_gc_t gc, PLINE * pl) +static void fill_contour(pcb_hid_gc_t gc, pcb_pline_t * pl) { Coord *x, *y, n, i = 0; - VNODE *v; + pcb_vnode_t *v; n = pl->Count; x = (Coord *) malloc(n * sizeof(*x)); @@ -27,9 +27,9 @@ free(y); } -static void thindraw_contour(pcb_hid_gc_t gc, PLINE * pl) +static void thindraw_contour(pcb_hid_gc_t gc, pcb_pline_t * pl) { - VNODE *v; + pcb_vnode_t *v; Coord last_x, last_y; Coord this_x, this_y; @@ -63,22 +63,22 @@ while ((v = v->next) != pl->head.next); } -static void fill_contour_cb(PLINE * pl, void *user_data) +static void fill_contour_cb(pcb_pline_t * pl, void *user_data) { pcb_hid_gc_t gc = (pcb_hid_gc_t) user_data; - PLINE *local_pl = pl; + pcb_pline_t *local_pl = pl; fill_contour(gc, pl); poly_FreeContours(&local_pl); } -static void fill_clipped_contour(pcb_hid_gc_t gc, PLINE * pl, const pcb_box_t * clip_box) +static void fill_clipped_contour(pcb_hid_gc_t gc, pcb_pline_t * pl, const pcb_box_t * clip_box) { - PLINE *pl_copy; - POLYAREA *clip_poly; - POLYAREA *piece_poly; - POLYAREA *clipped_pieces; - POLYAREA *draw_piece; + pcb_pline_t *pl_copy; + pcb_polyarea_t *clip_poly; + pcb_polyarea_t *piece_poly; + pcb_polyarea_t *clipped_pieces; + pcb_polyarea_t *draw_piece; int x; clip_poly = RectPoly(clip_box->X1, clip_box->X2, clip_box->Y1, clip_box->Y2); @@ -147,7 +147,7 @@ NoHolesPolygonDicer(poly, clip_box, fill_contour_cb, gc); } if (poly->NoHolesValid && poly->NoHoles) { - PLINE *pl; + pcb_pline_t *pl; for (pl = poly->NoHoles; pl != NULL; pl = pl->next) { if (clip_box == NULL) @@ -167,7 +167,7 @@ } } -static int thindraw_hole_cb(PLINE * pl, void *user_data) +static int thindraw_hole_cb(pcb_pline_t * pl, void *user_data) { pcb_hid_gc_t gc = (pcb_hid_gc_t) user_data; thindraw_contour(gc, pl); Index: trunk/src/obj_pinvia.c =================================================================== --- trunk/src/obj_pinvia.c (revision 4801) +++ trunk/src/obj_pinvia.c (revision 4802) @@ -209,7 +209,7 @@ Coord width; if ((GET_SQUARE(Pin) > 1) && (TEST_FLAG(PCB_FLAG_SQUARE, Pin))) { - POLYAREA *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance); + pcb_polyarea_t *p = PinPoly(Pin, PIN_SIZE(Pin), Pin->Clearance); poly_bbox(p, &Pin->BoundingBox); poly_Free(&p); } Index: trunk/src/obj_pinvia_therm.c =================================================================== --- trunk/src/obj_pinvia_therm.c (revision 4801) +++ trunk/src/obj_pinvia_therm.c (revision 4802) @@ -44,12 +44,12 @@ Coord x, y; Coord s, c; char style; - POLYAREA *p; + pcb_polyarea_t *p; }; -static POLYAREA *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) +static pcb_polyarea_t *diag_line(Coord X, Coord Y, Coord l, Coord w, pcb_bool rt) { - PLINE *c; + pcb_pline_t *c; pcb_vector_t v; Coord x1, x2, y1, y2; @@ -82,10 +82,10 @@ return ContourToPoly(c); } -static POLYAREA *square_therm(pcb_pin_t *pin, pcb_cardinal_t style) +static pcb_polyarea_t *square_therm(pcb_pin_t *pin, pcb_cardinal_t style) { - POLYAREA *p, *p2; - PLINE *c; + pcb_polyarea_t *p, *p2; + pcb_pline_t *c; pcb_vector_t v; Coord d, in, out; @@ -309,9 +309,9 @@ } } -static POLYAREA *oct_therm(pcb_pin_t *pin, pcb_cardinal_t style) +static pcb_polyarea_t *oct_therm(pcb_pin_t *pin, pcb_cardinal_t style) { - POLYAREA *p, *p2, *m; + pcb_polyarea_t *p, *p2, *m; Coord t = 0.5 * pcb->ThermScale * pin->Clearance; Coord w = pin->Thickness + pin->Clearance; @@ -337,7 +337,7 @@ case 5: { Coord t = pin->Thickness / 2; - POLYAREA *q; + pcb_polyarea_t *q; /* cheat by using the square therm's rounded parts */ p = square_therm(pin, style); q = RectPoly(pin->X - t, pin->X + t, pin->Y - t, pin->Y + t); @@ -348,15 +348,15 @@ } } -/* ThermPoly returns a POLYAREA having all of the clearance that when +/* ThermPoly returns a pcb_polyarea_t having all of the clearance that when * subtracted from the plane create the desired thermal fingers. * Usually this is 4 disjoint regions. * */ -POLYAREA *ThermPoly(pcb_board_t *p, pcb_pin_t *pin, pcb_cardinal_t laynum) +pcb_polyarea_t *ThermPoly(pcb_board_t *p, pcb_pin_t *pin, pcb_cardinal_t laynum) { pcb_arc_t a; - POLYAREA *pa, *arc; + pcb_polyarea_t *pa, *arc; pcb_cardinal_t style = GET_THERM(laynum, pin); if (style == 3) @@ -371,7 +371,7 @@ case 1: case 2: { - POLYAREA *m; + pcb_polyarea_t *m; Coord t = (pin->Thickness + pin->Clearance) / 2; Coord w = 0.5 * pcb->ThermScale * pin->Clearance; pa = CirclePoly(pin->X, pin->Y, t); Index: trunk/src/obj_pinvia_therm.h =================================================================== --- trunk/src/obj_pinvia_therm.h (revision 4801) +++ trunk/src/obj_pinvia_therm.h (revision 4802) @@ -39,6 +39,6 @@ #include #include "config.h" -POLYAREA *ThermPoly(pcb_board_t *, pcb_pin_t *, pcb_cardinal_t); +pcb_polyarea_t *ThermPoly(pcb_board_t *, pcb_pin_t *, pcb_cardinal_t); #endif Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 4801) +++ trunk/src/obj_poly.h (revision 4802) @@ -36,8 +36,8 @@ PCB_ANYOBJECTFIELDS; pcb_cardinal_t PointN; /* number of points in polygon */ pcb_cardinal_t PointMax; /* max number from malloc() */ - POLYAREA *Clipped; /* the clipped region of this polygon */ - PLINE *NoHoles; /* the polygon broken into hole-less regions */ + pcb_polyarea_t *Clipped; /* the clipped region of this polygon */ + pcb_pline_t *NoHoles; /* the polygon broken into hole-less regions */ int NoHolesValid; /* Is the NoHoles polygon up to date? */ pcb_point_t *Points; /* data */ pcb_cardinal_t *HoleIndex; /* Index of hole data within the Points array */ Index: trunk/src/polyarea.h =================================================================== --- trunk/src/polyarea.h (revision 4801) +++ trunk/src/polyarea.h (revision 4802) @@ -55,30 +55,30 @@ }; -typedef struct CVCList CVCList; -typedef struct VNODE VNODE; -struct CVCList { +typedef struct pcb_cvc_list_s pcb_cvc_list_t; +typedef struct pcb_vnode_s pcb_vnode_t; +struct pcb_cvc_list_s { double angle; - VNODE *parent; - CVCList *prev, *next, *head; + pcb_vnode_t *parent; + pcb_cvc_list_t *prev, *next, *head; char poly, side; }; -struct VNODE { - VNODE *next, *prev, *shared; +struct pcb_vnode_s { + pcb_vnode_t *next, *prev, *shared; struct { unsigned int status:3; unsigned int mark:1; } Flags; - CVCList *cvc_prev; - CVCList *cvc_next; + pcb_cvc_list_t *cvc_prev; + pcb_cvc_list_t *cvc_next; pcb_vector_t point; }; -typedef struct PLINE PLINE; -struct PLINE { +typedef struct pcb_pline_s pcb_pline_t; +struct pcb_pline_s { Coord xmin, ymin, xmax, ymax; - PLINE *next; - VNODE head; + pcb_pline_t *next; + pcb_vnode_t head; unsigned int Count; double area; pcb_rtree_t *tree; @@ -91,45 +91,45 @@ } Flags; }; -PLINE *poly_NewContour(pcb_vector_t v); +pcb_pline_t *poly_NewContour(pcb_vector_t v); -void poly_IniContour(PLINE * c); -void poly_ClrContour(PLINE * c); /* clears list of vertices */ -void poly_DelContour(PLINE ** c); +void poly_IniContour(pcb_pline_t * c); +void poly_ClrContour(pcb_pline_t * c); /* clears list of vertices */ +void poly_DelContour(pcb_pline_t ** c); -pcb_bool poly_CopyContour(PLINE ** dst, PLINE * src); +pcb_bool poly_CopyContour(pcb_pline_t ** dst, pcb_pline_t * src); -void poly_PreContour(PLINE * c, pcb_bool optimize); /* prepare contour */ -void poly_InvContour(PLINE * c); /* invert contour */ +void poly_PreContour(pcb_pline_t * c, pcb_bool optimize); /* prepare contour */ +void poly_InvContour(pcb_pline_t * c); /* invert contour */ -VNODE *poly_CreateNode(pcb_vector_t v); +pcb_vnode_t *poly_CreateNode(pcb_vector_t v); -void poly_InclVertex(VNODE * after, VNODE * node); -void poly_ExclVertex(VNODE * node); +void poly_InclVertex(pcb_vnode_t * after, pcb_vnode_t * node); +void poly_ExclVertex(pcb_vnode_t * node); /**********************************************************************/ -typedef struct POLYAREA POLYAREA; -struct POLYAREA { - POLYAREA *f, *b; - PLINE *contours; +typedef struct pcb_polyarea_s pcb_polyarea_t; +struct pcb_polyarea_s { + pcb_polyarea_t *f, *b; + pcb_pline_t *contours; pcb_rtree_t *contour_tree; }; -pcb_bool poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst); -void poly_M_Incl(POLYAREA ** list, POLYAREA * a); +pcb_bool poly_M_Copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst); +void poly_M_Incl(pcb_polyarea_t ** list, pcb_polyarea_t * a); -pcb_bool poly_Copy0(POLYAREA ** dst, const POLYAREA * src); -pcb_bool poly_Copy1(POLYAREA * dst, const POLYAREA * src); +pcb_bool poly_Copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src); +pcb_bool poly_Copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src); -pcb_bool poly_InclContour(POLYAREA * p, PLINE * c); -pcb_bool poly_ExclContour(POLYAREA * p, PLINE * c); +pcb_bool poly_InclContour(pcb_polyarea_t * p, pcb_pline_t * c); +pcb_bool poly_ExclContour(pcb_polyarea_t * p, pcb_pline_t * c); -pcb_bool poly_ChkContour(PLINE * a); +pcb_bool poly_ChkContour(pcb_pline_t * a); -pcb_bool poly_CheckInside(POLYAREA * c, pcb_vector_t v0); -pcb_bool Touching(POLYAREA * p1, POLYAREA * p2); +pcb_bool poly_CheckInside(pcb_polyarea_t * c, pcb_vector_t v0); +pcb_bool Touching(pcb_polyarea_t * p1, pcb_polyarea_t * p2); /**********************************************************************/ @@ -138,16 +138,16 @@ /* checks whether point lies within contour independently of its orientation */ -int poly_InsideContour(PLINE * c, pcb_vector_t v); -int poly_ContourInContour(PLINE * poly, PLINE * inner); -POLYAREA *poly_Create(void); +int poly_InsideContour(pcb_pline_t * c, pcb_vector_t v); +int poly_ContourInContour(pcb_pline_t * poly, pcb_pline_t * inner); +pcb_polyarea_t *poly_Create(void); -void poly_Free(POLYAREA ** p); -void poly_Init(POLYAREA * p); -void poly_FreeContours(PLINE ** pl); -pcb_bool poly_Valid(POLYAREA * p); +void poly_Free(pcb_polyarea_t ** p); +void poly_Init(pcb_polyarea_t * p); +void poly_FreeContours(pcb_pline_t ** pl); +pcb_bool poly_Valid(pcb_polyarea_t * p); -enum PolygonBooleanOperation { +enum pcb_poly_bool_op_e { PBO_UNITE, PBO_ISECT, PBO_SUB, @@ -160,12 +160,12 @@ int vect_inters2(pcb_vector_t A, pcb_vector_t B, pcb_vector_t C, pcb_vector_t D, pcb_vector_t S1, pcb_vector_t S2); -int poly_Boolean(const POLYAREA * a, const POLYAREA * b, POLYAREA ** res, int action); -int poly_Boolean_free(POLYAREA * a, POLYAREA * b, POLYAREA ** res, int action); -int poly_AndSubtract_free(POLYAREA * a, POLYAREA * b, POLYAREA ** aandb, POLYAREA ** aminusb); -int SavePOLYAREA(POLYAREA * PA, char *fname); +int poly_Boolean(const pcb_polyarea_t * a, const pcb_polyarea_t * b, pcb_polyarea_t ** res, int action); +int poly_Boolean_free(pcb_polyarea_t * a, pcb_polyarea_t * b, pcb_polyarea_t ** res, int action); +int poly_AndSubtract_free(pcb_polyarea_t * a, pcb_polyarea_t * b, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb); +int Savepcb_polyarea_t(pcb_polyarea_t * PA, char *fname); -/* calculate the bounding box of a POLYAREA and save result in b */ -void poly_bbox(POLYAREA * p, pcb_box_t * b); +/* calculate the bounding box of a pcb_polyarea_t and save result in b */ +void poly_bbox(pcb_polyarea_t * p, pcb_box_t * b); #endif /* PCB_POLYAREA_H */ Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 4801) +++ trunk/src/polygon.c (revision 4802) @@ -33,32 +33,32 @@ A PCB pcb_polygon_t contains an array of points outlining the polygon. This is what is manipulated by the UI and stored in the saved PCB. -A pcb_polygon_t also contains a POLYAREA called 'Clipped' which is +A pcb_polygon_t also contains a pcb_polyarea_t called 'Clipped' which is computed dynamically by InitClip every time a board is loaded. The -point array is converted to a POLYAREA by original_poly and then holes +point array is converted to a pcb_polyarea_t by original_poly and then holes are cut in it by clearPoly. After that it is maintained dynamically as parts are added, moved or removed (this is why sometimes bugs can be fixed by just re-loading the board). -A POLYAREA consists of a linked list of PLINE structures. The head of -that list is POLYAREA.contours. The first contour is an outline of a -filled region. All of the subsequent PLINEs are holes cut out of that -first contour. POLYAREAs are in a doubly-linked list and each member +A pcb_polyarea_t consists of a linked list of pcb_pline_t structures. The head of +that list is pcb_polyarea_t.contours. The first contour is an outline of a +filled region. All of the subsequent pcb_pline_ts are holes cut out of that +first contour. pcb_polyarea_ts are in a doubly-linked list and each member of the list is an independent (non-overlapping) area with its own -outline and holes. The function biggest() finds the largest POLYAREA +outline and holes. The function biggest() finds the largest pcb_polyarea_t so that pcb_polygon_t.Clipped points to that shape. The rest of the polygon still exists, it's just ignored when turning the polygon into copper. -The first POLYAREA in pcb_polygon_t.Clipped is what is used for the vast +The first pcb_polyarea_t in pcb_polygon_t.Clipped is what is used for the vast majority of Polygon related tests. The basic logic for an -intersection is "is the target shape inside POLYAREA.contours and NOT -fully enclosed in any of POLYAREA.contours.next... (the holes)". +intersection is "is the target shape inside pcb_polyarea_t.contours and NOT +fully enclosed in any of pcb_polyarea_t.contours.next... (the holes)". The polygon dicer (NoHolesPolygonDicer and r_NoHolesPolygonDicer) -emits a series of "simple" PLINE shapes. That is, the PLINE isn't +emits a series of "simple" pcb_pline_t shapes. That is, the pcb_pline_t isn't linked to any other "holes" oulines). That's the meaning of the first -test in r_NoHolesPolygonDicer. It is testing to see if the PLINE +test in r_NoHolesPolygonDicer. It is testing to see if the pcb_pline_t contour (the first, making it a solid outline) has a valid next pointer (which would point to one or more holes). The dicer works by recursively chopping the polygon in half through the first hole it @@ -171,7 +171,7 @@ return point; } -static void add_noholes_polyarea(PLINE * pline, void *user_data) +static void add_noholes_polyarea(pcb_pline_t * pline, void *user_data) { pcb_polygon_t *poly = (pcb_polygon_t *) user_data; @@ -190,10 +190,10 @@ poly->NoHolesValid = 1; } -static POLYAREA *biggest(POLYAREA * p) +static pcb_polyarea_t *biggest(pcb_polyarea_t * p) { - POLYAREA *n, *top = NULL; - PLINE *pl; + pcb_polyarea_t *n, *top = NULL; + pcb_pline_t *pl; pcb_rtree_t *tree; double big = -1; if (!p) @@ -235,9 +235,9 @@ return p; } -POLYAREA *ContourToPoly(PLINE * contour) +pcb_polyarea_t *ContourToPoly(pcb_pline_t * contour) { - POLYAREA *p; + pcb_polyarea_t *p; poly_PreContour(contour, pcb_true); assert(contour->Flags.orient == PLF_DIR); if (!(p = poly_Create())) @@ -247,10 +247,10 @@ return p; } -static POLYAREA *original_poly(pcb_polygon_t * p) +static pcb_polyarea_t *original_poly(pcb_polygon_t * p) { - PLINE *contour = NULL; - POLYAREA *np = NULL; + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; pcb_cardinal_t n; pcb_vector_t v; int hole = 0; @@ -292,14 +292,14 @@ return biggest(np); } -POLYAREA *PolygonToPoly(pcb_polygon_t * p) +pcb_polyarea_t *PolygonToPoly(pcb_polygon_t * p) { return original_poly(p); } -POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2) +pcb_polyarea_t *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2) { - PLINE *contour = NULL; + pcb_pline_t *contour = NULL; pcb_vector_t v; /* Return NULL for zero or negatively sized rectangles */ @@ -346,9 +346,9 @@ } -POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style) +pcb_polyarea_t *OctagonPoly(Coord x, Coord y, Coord radius, int style) { - PLINE *contour = NULL; + pcb_pline_t *contour = NULL; pcb_vector_t v; double xm[8], ym[8]; @@ -398,7 +398,7 @@ * 2 for a half circle * or 4 for a quarter circle */ -void frac_circle(PLINE * c, Coord X, Coord Y, pcb_vector_t v, int range) +void frac_circle(pcb_pline_t * c, Coord X, Coord Y, pcb_vector_t v, int range) { double e1, e2, t1; int i; @@ -422,9 +422,9 @@ } /* create a circle approximation from lines */ -POLYAREA *CirclePoly(Coord x, Coord y, Coord radius) +pcb_polyarea_t *CirclePoly(Coord x, Coord y, Coord radius) { - PLINE *contour; + pcb_pline_t *contour; pcb_vector_t v; if (radius <= 0) @@ -442,9 +442,9 @@ } /* make a rounded-corner rectangle with radius t beyond x1,x2,y1,y2 rectangle */ -POLYAREA *RoundRect(Coord x1, Coord x2, Coord y1, Coord y2, Coord t) +pcb_polyarea_t *RoundRect(Coord x1, Coord x2, Coord y1, Coord y2, Coord t) { - PLINE *contour = NULL; + pcb_pline_t *contour = NULL; pcb_vector_t v; assert(x2 > x1); @@ -470,10 +470,10 @@ } #define ARC_ANGLE 5 -static POLYAREA *ArcPolyNoIntersect(pcb_arc_t * a, Coord thick) +static pcb_polyarea_t *ArcPolyNoIntersect(pcb_arc_t * a, Coord thick) { - PLINE *contour = NULL; - POLYAREA *np = NULL; + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; pcb_vector_t v; pcb_box_t *ends; int i, segs; @@ -539,11 +539,11 @@ } #define MIN_CLEARANCE_BEFORE_BISECT 10. -POLYAREA *ArcPoly(pcb_arc_t * a, Coord thick) +pcb_polyarea_t *ArcPoly(pcb_arc_t * a, Coord thick) { double delta; pcb_arc_t seg1, seg2; - POLYAREA *tmp1, *tmp2, *res; + pcb_polyarea_t *tmp1, *tmp2, *res; delta = (a->Delta < 0) ? -a->Delta : a->Delta; @@ -567,10 +567,10 @@ return ArcPolyNoIntersect(a, thick); } -POLYAREA *LinePoly(pcb_line_t * L, Coord thick) +pcb_polyarea_t *LinePoly(pcb_line_t * L, Coord thick) { - PLINE *contour = NULL; - POLYAREA *np = NULL; + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; pcb_vector_t v; double d, dx, dy; long half; @@ -624,10 +624,10 @@ } /* make a rounded-corner rectangle */ -POLYAREA *SquarePadPoly(pcb_pad_t * pad, Coord clear) +pcb_polyarea_t *SquarePadPoly(pcb_pad_t * pad, Coord clear) { - PLINE *contour = NULL; - POLYAREA *np = NULL; + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; pcb_vector_t v; double d; double tx, ty; @@ -695,9 +695,9 @@ } /* clear np1 from the polygon */ -static int Subtract(POLYAREA * np1, pcb_polygon_t * p, pcb_bool fnp) +static int Subtract(pcb_polyarea_t * np1, pcb_polygon_t * p, pcb_bool fnp) { - POLYAREA *merged = NULL, *np = np1; + pcb_polyarea_t *merged = NULL, *np = np1; int x; assert(np); assert(p); @@ -733,7 +733,7 @@ } /* create a polygon of the pin clearance */ -POLYAREA *PinPoly(pcb_pin_t * pin, Coord thick, Coord clear) +pcb_polyarea_t *PinPoly(pcb_pin_t * pin, Coord thick, Coord clear) { int size; @@ -757,15 +757,15 @@ return CirclePoly(pin->X, pin->Y, size); } -POLYAREA *BoxPolyBloated(pcb_box_t * box, Coord bloat) +pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, Coord bloat) { return RectPoly(box->X1 - bloat, box->X2 + bloat, box->Y1 - bloat, box->Y2 + bloat); } /* return the clearance polygon for a pin */ -static POLYAREA *pin_clearance_poly(pcb_cardinal_t layernum, pcb_board_t *pcb, pcb_pin_t * pin) +static pcb_polyarea_t *pin_clearance_poly(pcb_cardinal_t layernum, pcb_board_t *pcb, pcb_pin_t * pin) { - POLYAREA *np; + pcb_polyarea_t *np; if (TEST_THERM(layernum, pin)) np = ThermPoly(pcb, pin, layernum); else @@ -776,7 +776,7 @@ /* remove the pin clearance from the polygon */ static int SubtractPin(pcb_data_t * d, pcb_pin_t * pin, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; pcb_cardinal_t i; if (pin->Clearance == 0) @@ -798,7 +798,7 @@ static int SubtractLine(pcb_line_t * line, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line)) return 0; @@ -809,7 +809,7 @@ static int SubtractArc(pcb_arc_t * arc, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc)) return 0; @@ -820,7 +820,7 @@ static int SubtractText(pcb_text_t * text, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; const pcb_box_t *b = &text->BoundingBox; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text)) @@ -832,7 +832,7 @@ static int SubtractPad(pcb_pad_t * pad, pcb_polygon_t * p) { - POLYAREA *np = NULL; + pcb_polyarea_t *np = NULL; if (pad->Clearance == 0) return 0; @@ -853,7 +853,7 @@ pcb_layer_t *layer; pcb_polygon_t *polygon; pcb_bool solder; - POLYAREA *accumulate; + pcb_polyarea_t *accumulate; int batch_size; jmp_buf env; }; @@ -872,8 +872,8 @@ pcb_pin_t *pin = (pcb_pin_t *) b; struct cpInfo *info = (struct cpInfo *) cl; pcb_polygon_t *polygon; - POLYAREA *np; - POLYAREA *merged; + pcb_polyarea_t *np; + pcb_polyarea_t *merged; pcb_cardinal_t i; /* don't subtract the object that was put back! */ @@ -948,8 +948,8 @@ pcb_line_t *line = (pcb_line_t *) b; struct cpInfo *info = (struct cpInfo *) cl; pcb_polygon_t *polygon; - POLYAREA *np; - POLYAREA *merged; + pcb_polyarea_t *np; + pcb_polyarea_t *merged; /* don't subtract the object that was put back! */ if (b == info->other) @@ -1049,10 +1049,10 @@ return r; } -static int Unsubtract(POLYAREA * np1, pcb_polygon_t * p) +static int Unsubtract(pcb_polyarea_t * np1, pcb_polygon_t * p) { - POLYAREA *merged = NULL, *np = np1; - POLYAREA *orig_poly, *clipped_np; + pcb_polyarea_t *merged = NULL, *np = np1; + pcb_polyarea_t *orig_poly, *clipped_np; int x; assert(np); assert(p && p->Clipped); @@ -1086,7 +1086,7 @@ static int UnsubtractPin(pcb_pin_t * pin, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; /* overlap a bit to prevent gaps from rounding errors */ np = BoxPolyBloated(&pin->BoundingBox, UNSUBTRACT_BLOAT * 400000); @@ -1102,7 +1102,7 @@ static int UnsubtractArc(pcb_arc_t * arc, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, arc)) return 0; @@ -1120,7 +1120,7 @@ static int UnsubtractLine(pcb_line_t * line, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, line)) return 0; @@ -1138,7 +1138,7 @@ static int UnsubtractText(pcb_text_t * text, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; if (!TEST_FLAG(PCB_FLAG_CLEARLINE, text)) return 0; @@ -1156,7 +1156,7 @@ static int UnsubtractPad(pcb_pad_t * pad, pcb_layer_t * l, pcb_polygon_t * p) { - POLYAREA *np; + pcb_polyarea_t *np; /* overlap a bit to prevent notches from rounding errors */ np = BoxPolyBloated(&pad->BoundingBox, UNSUBTRACT_BLOAT); @@ -1366,10 +1366,10 @@ * the search. */ int -PolygonHoles(pcb_polygon_t * polygon, const pcb_box_t * range, int (*callback) (PLINE * contour, void *user_data), void *user_data) +PolygonHoles(pcb_polygon_t * polygon, const pcb_box_t * range, int (*callback) (pcb_pline_t * contour, void *user_data), void *user_data) { - POLYAREA *pa = polygon->Clipped; - PLINE *pl; + pcb_polyarea_t *pa = polygon->Clipped; + pcb_pline_t *pl; /* If this hole is so big the polygon doesn't exist, then it's not * really a hole. */ @@ -1556,9 +1556,9 @@ PlowsPolygon(Data, type, ptr1, ptr2, subtract_plow); } -pcb_bool isects(POLYAREA * a, pcb_polygon_t *p, pcb_bool fr) +pcb_bool isects(pcb_polyarea_t * a, pcb_polygon_t *p, pcb_bool fr) { - POLYAREA *x; + pcb_polyarea_t *x; pcb_bool ans; ans = Touching(a, p->Clipped); /* argument may be register, so we must copy it */ @@ -1571,7 +1571,7 @@ pcb_bool IsPointInPolygon(Coord X, Coord Y, Coord r, pcb_polygon_t *p) { - POLYAREA *c; + pcb_polyarea_t *c; pcb_vector_t v; v[0] = X; v[1] = Y; @@ -1605,52 +1605,52 @@ pcb_bool IsRectangleInPolygon(Coord X1, Coord Y1, Coord X2, Coord Y2, pcb_polygon_t *p) { - POLYAREA *s; + pcb_polyarea_t *s; if (!(s = RectPoly(min(X1, X2), max(X1, X2), min(Y1, Y2), max(Y1, Y2)))) return pcb_false; return isects(s, p, pcb_true); } -/* NB: This function will free the passed POLYAREA. - * It must only be passed a single POLYAREA (pa->f == pa->b == pa) +/* NB: This function will free the passed pcb_polyarea_t. + * It must only be passed a single pcb_polyarea_t (pa->f == pa->b == pa) */ -static void r_NoHolesPolygonDicer(POLYAREA * pa, void (*emit) (PLINE *, void *), void *user_data) +static void r_NoHolesPolygonDicer(pcb_polyarea_t * pa, void (*emit) (pcb_pline_t *, void *), void *user_data) { - PLINE *p = pa->contours; + pcb_pline_t *p = pa->contours; if (!pa->contours->next) { /* no holes */ pa->contours = NULL; /* The callback now owns the contour */ - /* Don't bother removing it from the POLYAREA's rtree - since we're going to free the POLYAREA below anyway */ + /* Don't bother removing it from the pcb_polyarea_t's rtree + since we're going to free the pcb_polyarea_t below anyway */ emit(p, user_data); poly_Free(&pa); return; } else { - POLYAREA *poly2, *left, *right; + pcb_polyarea_t *poly2, *left, *right; /* make a rectangle of the left region slicing through the middle of the first hole */ poly2 = RectPoly(p->xmin, (p->next->xmin + p->next->xmax) / 2, p->ymin, p->ymax); poly_AndSubtract_free(pa, poly2, &left, &right); if (left) { - POLYAREA *cur, *next; + pcb_polyarea_t *cur, *next; cur = left; do { next = cur->f; cur->f = cur->b = cur; /* Detach this polygon piece */ r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The POLYAREA was freed by its use in the recursive dicer */ + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ } while ((cur = next) != left); } if (right) { - POLYAREA *cur, *next; + pcb_polyarea_t *cur, *next; cur = right; do { next = cur->f; cur->f = cur->b = cur; /* Detach this polygon piece */ r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The POLYAREA was freed by its use in the recursive dicer */ + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ } while ((cur = next) != right); } @@ -1657,9 +1657,9 @@ } } -void NoHolesPolygonDicer(pcb_polygon_t *p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data) +void NoHolesPolygonDicer(pcb_polygon_t *p, const pcb_box_t * clip, void (*emit) (pcb_pline_t *, void *), void *user_data) { - POLYAREA *main_contour, *cur, *next; + pcb_polyarea_t *main_contour, *cur, *next; main_contour = poly_Create(); /* copy the main poly only */ @@ -1666,7 +1666,7 @@ poly_Copy1(main_contour, p->Clipped); /* clip to the bounding box */ if (clip) { - POLYAREA *cbox = RectPoly(clip->X1, clip->X2, clip->Y1, clip->Y2); + pcb_polyarea_t *cbox = RectPoly(clip->X1, clip->X2, clip->Y1, clip->Y2); poly_Boolean_free(main_contour, cbox, &main_contour, PBO_ISECT); } if (main_contour == NULL) @@ -1679,7 +1679,7 @@ next = cur->f; cur->f = cur->b = cur; /* Detach this polygon piece */ r_NoHolesPolygonDicer(cur, emit, user_data); - /* NB: The POLYAREA was freed by its use in the recursive dicer */ + /* NB: The pcb_polyarea_t was freed by its use in the recursive dicer */ } while ((cur = next) != main_contour); } @@ -1687,7 +1687,7 @@ /* make a polygon split into multiple parts into multiple polygons */ pcb_bool MorphPolygon(pcb_layer_t *layer, pcb_polygon_t *poly) { - POLYAREA *p, *start; + pcb_polyarea_t *p, *start; pcb_bool many = pcb_false; pcb_flag_t flags; @@ -1713,7 +1713,7 @@ RemovePolygon(layer, poly); inhibit = pcb_true; do { - VNODE *v; + pcb_vnode_t *v; pcb_polygon_t *newone; if (p->contours->area > PCB->IsleArea) { @@ -1737,7 +1737,7 @@ DrawPolygon(layer, newone); } else { - POLYAREA *t = p; + pcb_polyarea_t *t = p; p = p->f; poly_DelContour(&t->contours); @@ -1750,9 +1750,9 @@ return many; } -void debug_pline(PLINE * pl) +void debug_pline(pcb_pline_t * pl) { - VNODE *v; + pcb_vnode_t *v; pcb_fprintf(stderr, "\txmin %#mS xmax %#mS ymin %#mS ymax %#mS\n", pl->xmin, pl->xmax, pl->ymin, pl->ymax); v = &pl->head; while (v) { @@ -1763,11 +1763,11 @@ } } -void debug_polyarea(POLYAREA * p) +void debug_polyarea(pcb_polyarea_t * p) { - PLINE *pl; + pcb_pline_t *pl; - fprintf(stderr, "POLYAREA %p\n", (void *)p); + fprintf(stderr, "pcb_polyarea_t %p\n", (void *)p); for (pl = p->contours; pl; pl = pl->next) debug_pline(pl); } @@ -1775,7 +1775,7 @@ void debug_polygon(pcb_polygon_t * p) { pcb_cardinal_t i; - POLYAREA *pa; + pcb_polyarea_t *pa; fprintf(stderr, "POLYGON %p %d pts\n", (void *)p, p->PointN); for (i = 0; i < p->PointN; i++) pcb_fprintf(stderr, "\t%d: %#mD\n", i, p->Points[i].X, p->Points[i].Y); @@ -1795,15 +1795,15 @@ } } -/* Convert a POLYAREA (and all linked POLYAREA) to +/* Convert a pcb_polyarea_t (and all linked pcb_polyarea_t) to * raw PCB polygons on the given layer. */ -void PolyToPolygonsOnLayer(pcb_data_t * Destination, pcb_layer_t * Layer, POLYAREA * Input, pcb_flag_t Flags) +void PolyToPolygonsOnLayer(pcb_data_t * Destination, pcb_layer_t * Layer, pcb_polyarea_t * Input, pcb_flag_t Flags) { pcb_polygon_t *Polygon; - POLYAREA *pa; - PLINE *pline; - VNODE *node; + pcb_polyarea_t *pa; + pcb_pline_t *pline; + pcb_vnode_t *node; pcb_bool outer; if (Input == NULL) Index: trunk/src/polygon.h =================================================================== --- trunk/src/polygon.h (revision 4801) +++ trunk/src/polygon.h (revision 4802) @@ -61,20 +61,20 @@ void GoToPreviousPoint(void); void ClosePolygon(void); void CopyAttachedPolygonToLayer(void); -int PolygonHoles(pcb_polygon_t * ptr, const pcb_box_t * range, int (*callback) (PLINE *, void *user_data), void *user_data); +int PolygonHoles(pcb_polygon_t * ptr, const pcb_box_t * range, int (*callback) (pcb_pline_t *, void *user_data), void *user_data); int PlowsPolygon(pcb_data_t *, int, void *, void *, r_dir_t (*callback) (pcb_data_t *, pcb_layer_t *, pcb_polygon_t *, int, void *, void *)); void ComputeNoHoles(pcb_polygon_t * poly); -POLYAREA *ContourToPoly(PLINE *); -POLYAREA *PolygonToPoly(pcb_polygon_t *); -POLYAREA *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2); -POLYAREA *CirclePoly(Coord x, Coord y, Coord radius); -POLYAREA *OctagonPoly(Coord x, Coord y, Coord radius, int style); -POLYAREA *LinePoly(pcb_line_t * l, Coord thick); -POLYAREA *ArcPoly(pcb_arc_t * l, Coord thick); -POLYAREA *PinPoly(pcb_pin_t * l, Coord thick, Coord clear); -POLYAREA *BoxPolyBloated(pcb_box_t * box, Coord radius); -void frac_circle(PLINE *, Coord, Coord, pcb_vector_t, int); +pcb_polyarea_t *ContourToPoly(pcb_pline_t *); +pcb_polyarea_t *PolygonToPoly(pcb_polygon_t *); +pcb_polyarea_t *RectPoly(Coord x1, Coord x2, Coord y1, Coord y2); +pcb_polyarea_t *CirclePoly(Coord x, Coord y, Coord radius); +pcb_polyarea_t *OctagonPoly(Coord x, Coord y, Coord radius, int style); +pcb_polyarea_t *LinePoly(pcb_line_t * l, Coord thick); +pcb_polyarea_t *ArcPoly(pcb_arc_t * l, Coord thick); +pcb_polyarea_t *PinPoly(pcb_pin_t * l, Coord thick, Coord clear); +pcb_polyarea_t *BoxPolyBloated(pcb_box_t * box, Coord radius); +void frac_circle(pcb_pline_t *, Coord, Coord, pcb_vector_t, int); int InitClip(pcb_data_t * d, pcb_layer_t * l, pcb_polygon_t * p); void RestoreToPolygon(pcb_data_t *, int, void *, void *); void ClearFromPolygon(pcb_data_t *, int, void *, void *); @@ -82,10 +82,10 @@ pcb_bool IsPointInPolygon(Coord, Coord, Coord, pcb_polygon_t *); pcb_bool IsPointInPolygonIgnoreHoles(Coord, Coord, pcb_polygon_t *); pcb_bool IsRectangleInPolygon(Coord, Coord, Coord, Coord, pcb_polygon_t *); -pcb_bool isects(POLYAREA *, pcb_polygon_t *, pcb_bool); +pcb_bool isects(pcb_polyarea_t *, pcb_polygon_t *, pcb_bool); pcb_bool MorphPolygon(pcb_layer_t *, pcb_polygon_t *); -void NoHolesPolygonDicer(pcb_polygon_t * p, const pcb_box_t * clip, void (*emit) (PLINE *, void *), void *user_data); -void PolyToPolygonsOnLayer(pcb_data_t *, pcb_layer_t *, POLYAREA *, pcb_flag_t); +void NoHolesPolygonDicer(pcb_polygon_t * p, const pcb_box_t * clip, void (*emit) (pcb_pline_t *, void *), void *user_data); +void PolyToPolygonsOnLayer(pcb_data_t *, pcb_layer_t *, pcb_polyarea_t *, pcb_flag_t); void square_pin_factors(int style, double *xm, double *ym); Index: trunk/src/polygon1.c =================================================================== --- trunk/src/polygon1.c (revision 4801) +++ trunk/src/polygon1.c (revision 4802) @@ -135,11 +135,11 @@ } #ifdef DEBUG -static char *theState(VNODE * v); +static char *theState(pcb_vnode_t * v); -static void pline_dump(VNODE * v) +static void pline_dump(pcb_vnode_t * v) { - VNODE *s, *n; + pcb_vnode_t *s, *n; s = v; do { @@ -150,16 +150,16 @@ while ((v = v->next) != s); } -static void poly_dump(POLYAREA * p) +static void poly_dump(pcb_polyarea_t * p) { - POLYAREA *f = p; - PLINE *pl; + pcb_polyarea_t *f = p; + pcb_pline_t *pl; do { pl = p->contours; do { pline_dump(&pl->head); - fprintf(stderr, "NEXT PLINE\n"); + fprintf(stderr, "NEXT pcb_pline_t\n"); } while ((pl = pl->next) != NULL); fprintf(stderr, "NEXT POLY\n"); @@ -182,9 +182,9 @@ 1 means a new node was created and inserted 4 means the intersection was not on the dest point */ -static VNODE *node_add_single(VNODE * dest, pcb_vector_t po) +static pcb_vnode_t *node_add_single(pcb_vnode_t * dest, pcb_vector_t po) { - VNODE *p; + pcb_vnode_t *p; if (vect_equal(po, dest->point)) return dest; @@ -206,9 +206,9 @@ new_descriptor (C) 2006 harry eaton */ -static CVCList *new_descriptor(VNODE * a, char poly, char side) +static pcb_cvc_list_t *new_descriptor(pcb_vnode_t * a, char poly, char side) { - CVCList *l = (CVCList *) malloc(sizeof(CVCList)); + pcb_cvc_list_t *l = (pcb_cvc_list_t *) malloc(sizeof(pcb_cvc_list_t)); pcb_vector_t v; register double ang, dx, dy; @@ -229,13 +229,13 @@ */ if (vect_equal(v, vect_zero)) { if (side == 'P') { - if (a->prev->cvc_prev == (CVCList *) - 1) + if (a->prev->cvc_prev == (pcb_cvc_list_t *) - 1) a->prev->cvc_prev = a->prev->cvc_next = NULL; poly_ExclVertex(a->prev); vect_sub(v, a->prev->point, a->point); } else { - if (a->next->cvc_prev == (CVCList *) - 1) + if (a->next->cvc_prev == (pcb_cvc_list_t *) - 1) a->next->cvc_prev = a->next->cvc_next = NULL; poly_ExclVertex(a->next); vect_sub(v, a->next->point, a->point); @@ -270,13 +270,13 @@ 'N' for next. argument start is the head of the list of cvclists */ -static CVCList *insert_descriptor(VNODE * a, char poly, char side, CVCList * start) +static pcb_cvc_list_t *insert_descriptor(pcb_vnode_t * a, char poly, char side, pcb_cvc_list_t * start) { - CVCList *l, *newone, *big, *small; + pcb_cvc_list_t *l, *newone, *big, *small; if (!(newone = new_descriptor(a, poly, side))) return NULL; - /* search for the CVCList for this point */ + /* search for the pcb_cvc_list_t for this point */ if (!start) { start = newone; /* return is also new, so we know where start is */ start->head = newone; /* circular list */ @@ -287,7 +287,7 @@ do { assert(l->head); if (l->parent->point[0] == a->point[0] - && l->parent->point[1] == a->point[1]) { /* this CVCList is at our point */ + && l->parent->point[1] == a->point[1]) { /* this pcb_cvc_list_t is at our point */ start = l; newone->head = l->head; break; @@ -343,9 +343,9 @@ return 1 if new node in b, 2 if new node in a and 3 if new node in both */ -static VNODE *node_add_single_point(VNODE * a, pcb_vector_t p) +static pcb_vnode_t *node_add_single_point(pcb_vnode_t * a, pcb_vector_t p) { - VNODE *next_a, *new_node; + pcb_vnode_t *next_a, *new_node; next_a = a->next; @@ -352,7 +352,7 @@ new_node = node_add_single(a, p); assert(new_node != NULL); - new_node->cvc_prev = new_node->cvc_next = (CVCList *) - 1; + new_node->cvc_prev = new_node->cvc_next = (pcb_cvc_list_t *) - 1; if (new_node == a || new_node == next_a) return NULL; @@ -364,9 +364,9 @@ node_label (C) 2006 harry eaton */ -static unsigned int node_label(VNODE * pn) +static unsigned int node_label(pcb_vnode_t * pn) { - CVCList *first_l, *l; + pcb_cvc_list_t *first_l, *l; char this_poly; int region = UNKNWN; @@ -431,13 +431,13 @@ add_descriptors (C) 2006 harry eaton */ -static CVCList *add_descriptors(PLINE * pl, char poly, CVCList * list) +static pcb_cvc_list_t *add_descriptors(pcb_pline_t * pl, char poly, pcb_cvc_list_t * list) { - VNODE *node = &pl->head; + pcb_vnode_t *node = &pl->head; do { if (node->cvc_prev) { - assert(node->cvc_prev == (CVCList *) - 1 && node->cvc_next == (CVCList *) - 1); + assert(node->cvc_prev == (pcb_cvc_list_t *) - 1 && node->cvc_next == (pcb_cvc_list_t *) - 1); list = node->cvc_prev = insert_descriptor(node, poly, 'P', list); if (!node->cvc_prev) return NULL; @@ -450,7 +450,7 @@ return list; } -static inline void cntrbox_adjust(PLINE * c, pcb_vector_t p) +static inline void cntrbox_adjust(pcb_pline_t * c, pcb_vector_t p) { c->xmin = min(c->xmin, p[0]); c->xmax = max(c->xmax, p[0] + 1); @@ -462,8 +462,8 @@ typedef struct seg { pcb_box_t box; - VNODE *v; - PLINE *p; + pcb_vnode_t *v; + pcb_pline_t *p; int intersected; } seg; @@ -472,13 +472,13 @@ struct _insert_node_task { insert_node_task *next; seg *node_seg; - VNODE *new_node; + pcb_vnode_t *new_node; }; typedef struct info { double m, b; pcb_rtree_t *tree; - VNODE *v; + pcb_vnode_t *v; struct seg *s; jmp_buf *env, sego, *touch; int need_restart; @@ -486,7 +486,7 @@ } info; typedef struct contour_info { - PLINE *pa; + pcb_pline_t *pa; jmp_buf restart; jmp_buf *getout; int need_restart; @@ -552,7 +552,7 @@ } /* Prepend a deferred node-insertion task to a list */ -static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, VNODE * new_node) +static insert_node_task *prepend_insert_node_task(insert_node_task * list, seg * seg, pcb_vnode_t * new_node) { insert_node_task *task = (insert_node_task *) malloc(sizeof(*task)); task->node_seg = seg; @@ -578,7 +578,7 @@ struct seg *s = (struct seg *) b; pcb_vector_t s1, s2; int cnt; - VNODE *new_node; + pcb_vnode_t *new_node; /* When new nodes are added at the end of a pass due to an intersection * the segments may be altered. If either segment we're looking at has @@ -623,10 +623,10 @@ return R_DIR_NOT_FOUND; } -static void *make_edge_tree(PLINE * pb) +static void *make_edge_tree(pcb_pline_t * pb) { struct seg *s; - VNODE *bv; + pcb_vnode_t *bv; pcb_rtree_t *ans = r_create_tree(NULL, 0, 0); bv = &pb->head; do { @@ -688,11 +688,11 @@ static r_dir_t contour_bounds_touch(const pcb_box_t * b, void *cl) { contour_info *c_info = (contour_info *) cl; - PLINE *pa = c_info->pa; - PLINE *pb = (PLINE *) b; - PLINE *rtree_over; - PLINE *looping_over; - VNODE *av; /* node iterators */ + pcb_pline_t *pa = c_info->pa; + pcb_pline_t *pb = (pcb_pline_t *) b; + pcb_pline_t *rtree_over; + pcb_pline_t *looping_over; + pcb_vnode_t *av; /* node iterators */ struct info info; pcb_box_t box; jmp_buf restart; @@ -761,10 +761,10 @@ return R_DIR_NOT_FOUND; } -static int intersect_impl(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add) +static int intersect_impl(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) { - POLYAREA *t; - PLINE *pa; + pcb_polyarea_t *t; + pcb_pline_t *pa; contour_info c_info; int need_restart = 0; insert_node_task *task; @@ -780,7 +780,7 @@ a = t; } - for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of POLYAREA "a" */ + for (pa = a->contours; pa; pa = pa->next) { /* Loop over the contours of pcb_polyarea_t "a" */ pcb_box_t sb; jmp_buf out; int retval; @@ -833,7 +833,7 @@ return need_restart; } -static int intersect(jmp_buf * jb, POLYAREA * b, POLYAREA * a, int add) +static int intersect(jmp_buf * jb, pcb_polyarea_t * b, pcb_polyarea_t * a, int add) { int call_count = 1; while (intersect_impl(jb, b, a, add)) @@ -841,11 +841,11 @@ return 0; } -static void M_POLYAREA_intersect(jmp_buf * e, POLYAREA * afst, POLYAREA * bfst, int add) +static void M_pcb_polyarea_t_intersect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t * bfst, int add) { - POLYAREA *a = afst, *b = bfst; - PLINE *curcA, *curcB; - CVCList *the_list = NULL; + pcb_polyarea_t *a = afst, *b = bfst; + pcb_pline_t *curcA, *curcB; + pcb_cvc_list_t *the_list = NULL; if (a == NULL || b == NULL) error(err_bad_parm); @@ -876,9 +876,9 @@ } } while (add && (a = a->f) != afst); -} /* M_POLYAREA_intersect */ +} /* M_pcb_polyarea_t_intersect */ -static inline int cntrbox_inside(PLINE * c1, PLINE * c2) +static inline int cntrbox_inside(pcb_pline_t * c1, pcb_pline_t * c2) { assert(c1 != NULL && c2 != NULL); return ((c1->xmin >= c2->xmin) && (c1->ymin >= c2->ymin) && (c1->xmax <= c2->xmax) && (c1->ymax <= c2->ymax)); @@ -889,8 +889,8 @@ static r_dir_t count_contours_i_am_inside(const pcb_box_t * b, void *cl) { - PLINE *me = (PLINE *) cl; - PLINE *check = (PLINE *) b; + pcb_pline_t *me = (pcb_pline_t *) cl; + pcb_pline_t *check = (pcb_pline_t *) b; if (poly_ContourInContour(check, me)) return R_DIR_FOUND_CONTINUE; @@ -897,11 +897,11 @@ return R_DIR_NOT_FOUND; } -/* cntr_in_M_POLYAREA +/* cntr_in_M_pcb_polyarea_t returns poly is inside outfst ? pcb_true : pcb_false */ -static int cntr_in_M_POLYAREA(PLINE * poly, POLYAREA * outfst, pcb_bool test) +static int cntr_in_M_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * outfst, pcb_bool test) { - POLYAREA *outer = outfst; + pcb_polyarea_t *outer = outfst; heap_t *heap; assert(poly != NULL); @@ -922,7 +922,7 @@ if (heap_is_empty(heap)) break; - outer = (POLYAREA *) heap_remove_smallest(heap); + outer = (pcb_polyarea_t *) heap_remove_smallest(heap); r_search(outer->contour_tree, (pcb_box_t *) poly, NULL, count_contours_i_am_inside, poly, &cnt); switch (cnt) { @@ -942,11 +942,11 @@ while (1); heap_destroy(&heap); return pcb_false; -} /* cntr_in_M_POLYAREA */ +} /* cntr_in_M_pcb_polyarea_t */ #ifdef DEBUG -static char *theState(VNODE * v) +static char *theState(pcb_vnode_t * v) { static char u[] = "UNKNOWN"; static char i[] = "INSIDE"; @@ -969,9 +969,9 @@ } #ifdef DEBUG_ALL_LABELS -static void print_labels(PLINE * a) +static void print_labels(pcb_pline_t * a) { - VNODE *c = &a->head; + pcb_vnode_t *c = &a->head; do { DEBUGP("%#mD->%#mD labeled %s\n", c->point[0], c->point[1], c->next->point[0], c->next->point[1], theState(c)); @@ -988,10 +988,10 @@ (C) 1997 Alexey Nikitin, Michael Leonov */ -static pcb_bool label_contour(PLINE * a) +static pcb_bool label_contour(pcb_pline_t * a) { - VNODE *cur = &a->head; - VNODE *first_labelled = NULL; + pcb_vnode_t *cur = &a->head; + pcb_vnode_t *first_labelled = NULL; int label = UNKNWN; do { @@ -1017,13 +1017,13 @@ return pcb_false; } /* label_contour */ -static pcb_bool cntr_label_POLYAREA(PLINE * poly, POLYAREA * ppl, pcb_bool test) +static pcb_bool cntr_label_pcb_polyarea_t(pcb_pline_t * poly, pcb_polyarea_t * ppl, pcb_bool test) { assert(ppl != NULL && ppl->contours != NULL); if (poly->Flags.status == ISECTED) { label_contour(poly); /* should never get here when pcb_bool is pcb_true */ } - else if (cntr_in_M_POLYAREA(poly, ppl, test)) { + else if (cntr_in_M_pcb_polyarea_t(poly, ppl, test)) { if (test) return pcb_true; poly->Flags.status = INSIDE; @@ -1034,28 +1034,28 @@ poly->Flags.status = OUTSIDE; } return pcb_false; -} /* cntr_label_POLYAREA */ +} /* cntr_label_pcb_polyarea_t */ -static pcb_bool M_POLYAREA_label_separated(PLINE * afst, POLYAREA * b, pcb_bool touch) +static pcb_bool M_pcb_polyarea_t_label_separated(pcb_pline_t * afst, pcb_polyarea_t * b, pcb_bool touch) { - PLINE *curc = afst; + pcb_pline_t *curc = afst; for (curc = afst; curc != NULL; curc = curc->next) { - if (cntr_label_POLYAREA(curc, b, touch) && touch) + if (cntr_label_pcb_polyarea_t(curc, b, touch) && touch) return pcb_true; } return pcb_false; } -static pcb_bool M_POLYAREA_label(POLYAREA * afst, POLYAREA * b, pcb_bool touch) +static pcb_bool M_pcb_polyarea_t_label(pcb_polyarea_t * afst, pcb_polyarea_t * b, pcb_bool touch) { - POLYAREA *a = afst; - PLINE *curc; + pcb_polyarea_t *a = afst; + pcb_pline_t *curc; assert(a != NULL); do { for (curc = a->contours; curc != NULL; curc = curc->next) - if (cntr_label_POLYAREA(curc, b, touch)) { + if (cntr_label_pcb_polyarea_t(curc, b, touch)) { if (touch) return pcb_true; } @@ -1067,17 +1067,17 @@ /****************************************************************/ /* routines for temporary storing resulting contours */ -static void InsCntr(jmp_buf * e, PLINE * c, POLYAREA ** dst) +static void InsCntr(jmp_buf * e, pcb_pline_t * c, pcb_polyarea_t ** dst) { - POLYAREA *newp; + pcb_polyarea_t *newp; if (*dst == NULL) { - MemGet(*dst, POLYAREA); + MemGet(*dst, pcb_polyarea_t); (*dst)->f = (*dst)->b = *dst; newp = *dst; } else { - MemGet(newp, POLYAREA); + MemGet(newp, pcb_polyarea_t); newp->f = *dst; newp->b = (*dst)->b; newp->f->b = newp->b->f = newp; @@ -1089,8 +1089,8 @@ } /* InsCntr */ static void -PutContour(jmp_buf * e, PLINE * cntr, POLYAREA ** contours, PLINE ** holes, - POLYAREA * owner, POLYAREA * parent, PLINE * parent_contour) +PutContour(jmp_buf * e, pcb_pline_t * cntr, pcb_polyarea_t ** contours, pcb_pline_t ** holes, + pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) { assert(cntr != NULL); assert(cntr->Count > 2); @@ -1124,7 +1124,7 @@ } } /* PutContour */ -static inline void remove_contour(POLYAREA * piece, PLINE * prev_contour, PLINE * contour, int remove_rtree_entry) +static inline void remove_contour(pcb_polyarea_t * piece, pcb_pline_t * prev_contour, pcb_pline_t * contour, int remove_rtree_entry) { if (piece->contours == contour) piece->contours = contour->next; @@ -1141,7 +1141,7 @@ struct polyarea_info { pcb_box_t BoundingBox; - POLYAREA *pa; + pcb_polyarea_t *pa; }; static r_dir_t heap_it(const pcb_box_t * b, void *cl) @@ -1148,7 +1148,7 @@ { heap_t *heap = (heap_t *) cl; struct polyarea_info *pa_info = (struct polyarea_info *) b; - PLINE *p = pa_info->pa->contours; + pcb_pline_t *p = pa_info->pa->contours; if (p->Count == 0) return R_DIR_NOT_FOUND; /* how did this happen? */ heap_insert(heap, p->area, pa_info); @@ -1157,14 +1157,14 @@ struct find_inside_info { jmp_buf jb; - PLINE *want_inside; - PLINE *result; + pcb_pline_t *want_inside; + pcb_pline_t *result; }; static r_dir_t find_inside(const pcb_box_t * b, void *cl) { struct find_inside_info *info = (struct find_inside_info *) cl; - PLINE *check = (PLINE *) b; + pcb_pline_t *check = (pcb_pline_t *) b; /* Do test on check to see if it inside info->want_inside */ /* If it is: */ if (check->Flags.orient == PLF_DIR) { @@ -1177,10 +1177,10 @@ return R_DIR_NOT_FOUND; } -static void InsertHoles(jmp_buf * e, POLYAREA * dest, PLINE ** src) +static void InsertHoles(jmp_buf * e, pcb_polyarea_t * dest, pcb_pline_t ** src) { - POLYAREA *curc; - PLINE *curh, *container; + pcb_polyarea_t *curc; + pcb_pline_t *curh, *container; heap_t *heap; pcb_rtree_t *tree; int i; @@ -1270,7 +1270,7 @@ /* Need to check if this new hole means we need to kick out any old ones for reprocessing */ while (1) { struct find_inside_info info; - PLINE *prev; + pcb_pline_t *prev; info.want_inside = curh; @@ -1323,30 +1323,30 @@ } DIRECTION; /* Start Rule */ -typedef int (*S_Rule) (VNODE *, DIRECTION *); +typedef int (*S_Rule) (pcb_vnode_t *, DIRECTION *); /* Jump Rule */ -typedef int (*J_Rule) (char, VNODE *, DIRECTION *); +typedef int (*J_Rule) (char, pcb_vnode_t *, DIRECTION *); -static int UniteS_Rule(VNODE * cur, DIRECTION * initdir) +static int UniteS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) { *initdir = FORW; return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED); } -static int IsectS_Rule(VNODE * cur, DIRECTION * initdir) +static int IsectS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) { *initdir = FORW; return (NODE_LABEL(cur) == INSIDE) || (NODE_LABEL(cur) == SHARED); } -static int SubS_Rule(VNODE * cur, DIRECTION * initdir) +static int SubS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) { *initdir = FORW; return (NODE_LABEL(cur) == OUTSIDE) || (NODE_LABEL(cur) == SHARED2); } -static int XorS_Rule(VNODE * cur, DIRECTION * initdir) +static int XorS_Rule(pcb_vnode_t * cur, DIRECTION * initdir) { if (cur->Flags.status == INSIDE) { *initdir = BACKW; @@ -1359,19 +1359,19 @@ return pcb_false; } -static int IsectJ_Rule(char p, VNODE * v, DIRECTION * cdir) +static int IsectJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) { assert(*cdir == FORW); return (v->Flags.status == INSIDE || v->Flags.status == SHARED); } -static int UniteJ_Rule(char p, VNODE * v, DIRECTION * cdir) +static int UniteJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) { assert(*cdir == FORW); return (v->Flags.status == OUTSIDE || v->Flags.status == SHARED); } -static int XorJ_Rule(char p, VNODE * v, DIRECTION * cdir) +static int XorJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) { if (v->Flags.status == INSIDE) { *cdir = BACKW; @@ -1384,7 +1384,7 @@ return pcb_false; } -static int SubJ_Rule(char p, VNODE * v, DIRECTION * cdir) +static int SubJ_Rule(char p, pcb_vnode_t * v, DIRECTION * cdir) { if (p == 'B' && v->Flags.status == INSIDE) { *cdir = BACKW; @@ -1410,10 +1410,10 @@ * * returns pcb_true if an edge is found, pcb_false otherwise */ -static int jump(VNODE ** cur, DIRECTION * cdir, J_Rule rule) +static int jump(pcb_vnode_t ** cur, DIRECTION * cdir, J_Rule rule) { - CVCList *d, *start; - VNODE *e; + pcb_cvc_list_t *d, *start; + pcb_vnode_t *e; DIRECTION newone; if (!(*cur)->cvc_prev) { /* not a cross-vertex */ @@ -1452,9 +1452,9 @@ return pcb_false; } -static int Gather(VNODE * start, PLINE ** result, J_Rule v_rule, DIRECTION initdir) +static int Gather(pcb_vnode_t * start, pcb_pline_t ** result, J_Rule v_rule, DIRECTION initdir) { - VNODE *cur = start, *newn; + pcb_vnode_t *cur = start, *newn; DIRECTION dir = initdir; #ifdef DEBUG_GATHER DEBUGP("gather direction = %d\n", dir); @@ -1492,9 +1492,9 @@ return err_ok; } /* Gather */ -static void Collect1(jmp_buf * e, VNODE * cur, DIRECTION dir, POLYAREA ** contours, PLINE ** holes, J_Rule j_rule) +static void Collect1(jmp_buf * e, pcb_vnode_t * cur, DIRECTION dir, pcb_polyarea_t ** contours, pcb_pline_t ** holes, J_Rule j_rule) { - PLINE *p = NULL; /* start making contour */ + pcb_pline_t *p = NULL; /* start making contour */ int errc = err_ok; if ((errc = Gather(dir == FORW ? cur : cur->next, &p, j_rule, dir)) != err_ok) { if (p != NULL) @@ -1519,9 +1519,9 @@ } } -static void Collect(jmp_buf * e, PLINE * a, POLYAREA ** contours, PLINE ** holes, S_Rule s_rule, J_Rule j_rule) +static void Collect(jmp_buf * e, pcb_pline_t * a, pcb_polyarea_t ** contours, pcb_pline_t ** holes, S_Rule s_rule, J_Rule j_rule) { - VNODE *cur, *other; + pcb_vnode_t *cur, *other; DIRECTION dir; cur = &a->head; @@ -1537,10 +1537,10 @@ static int -cntr_Collect(jmp_buf * e, PLINE ** A, POLYAREA ** contours, PLINE ** holes, - int action, POLYAREA * owner, POLYAREA * parent, PLINE * parent_contour) +cntr_Collect(jmp_buf * e, pcb_pline_t ** A, pcb_polyarea_t ** contours, pcb_pline_t ** holes, + int action, pcb_polyarea_t * owner, pcb_polyarea_t * parent, pcb_pline_t * parent_contour) { - PLINE *tmprev; + pcb_pline_t *tmprev; if ((*A)->Flags.status == ISECTED) { switch (action) { @@ -1597,10 +1597,10 @@ return pcb_false; } /* cntr_Collect */ -static void M_B_AREA_Collect(jmp_buf * e, POLYAREA * bfst, POLYAREA ** contours, PLINE ** holes, int action) +static void M_B_AREA_Collect(jmp_buf * e, pcb_polyarea_t * bfst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action) { - POLYAREA *b = bfst; - PLINE **cur, **next, *tmp; + pcb_polyarea_t *b = bfst; + pcb_pline_t **cur, **next, *tmp; assert(b != NULL); do { @@ -1647,19 +1647,19 @@ } -static inline int contour_is_first(POLYAREA * a, PLINE * cur) +static inline int contour_is_first(pcb_polyarea_t * a, pcb_pline_t * cur) { return (a->contours == cur); } -static inline int contour_is_last(PLINE * cur) +static inline int contour_is_last(pcb_pline_t * cur) { return (cur->next == NULL); } -static inline void remove_polyarea(POLYAREA ** list, POLYAREA * piece) +static inline void remove_polyarea(pcb_polyarea_t ** list, pcb_polyarea_t * piece) { /* If this item was the start of the list, advance that pointer */ if (*list == piece) @@ -1674,11 +1674,11 @@ piece->f = piece->b = piece; } -static void M_POLYAREA_separate_isected(jmp_buf * e, POLYAREA ** pieces, PLINE ** holes, PLINE ** isected) +static void M_pcb_polyarea_separate_isected(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, pcb_pline_t ** isected) { - POLYAREA *a = *pieces; - POLYAREA *anext; - PLINE *curc, *next, *prev; + pcb_polyarea_t *a = *pieces; + pcb_polyarea_t *anext; + pcb_pline_t *curc, *next, *prev; int finished; if (a == NULL) @@ -1752,14 +1752,14 @@ struct find_inside_m_pa_info { jmp_buf jb; - POLYAREA *want_inside; - PLINE *result; + pcb_polyarea_t *want_inside; + pcb_pline_t *result; }; static r_dir_t find_inside_m_pa(const pcb_box_t * b, void *cl) { struct find_inside_m_pa_info *info = (struct find_inside_m_pa_info *) cl; - PLINE *check = (PLINE *) b; + pcb_pline_t *check = (pcb_pline_t *) b; /* Don't report for the main contour */ if (check->Flags.orient == PLF_DIR) return R_DIR_NOT_FOUND; @@ -1766,7 +1766,7 @@ /* Don't look at contours marked as being intersected */ if (check->Flags.status == ISECTED) return R_DIR_NOT_FOUND; - if (cntr_in_M_POLYAREA(check, info->want_inside, pcb_false)) { + if (cntr_in_M_pcb_polyarea_t(check, info->want_inside, pcb_false)) { info->result = check; longjmp(info->jb, 1); } @@ -1774,12 +1774,12 @@ } -static void M_POLYAREA_update_primary(jmp_buf * e, POLYAREA ** pieces, PLINE ** holes, int action, POLYAREA * bpa) +static void M_pcb_polyarea_t_update_primary(jmp_buf * e, pcb_polyarea_t ** pieces, pcb_pline_t ** holes, int action, pcb_polyarea_t * bpa) { - POLYAREA *a = *pieces; - POLYAREA *b; - POLYAREA *anext; - PLINE *curc, *next, *prev; + pcb_polyarea_t *a = *pieces; + pcb_polyarea_t *b; + pcb_polyarea_t *anext; + pcb_pline_t *curc, *next, *prev; pcb_box_t box; /* int inv_inside = 0; */ int del_inside = 0; @@ -1828,7 +1828,7 @@ && (a->contours->xmax <= box.X2) && (a->contours->ymax <= box.Y2)) && /* Then test properly */ - cntr_in_M_POLYAREA(a->contours, bpa, pcb_false)) { + cntr_in_M_pcb_polyarea_t(a->contours, bpa, pcb_false)) { /* Delete this contour, all children -> holes queue */ @@ -1859,7 +1859,7 @@ /* Loop whilst we find INSIDE contours to delete */ while (1) { struct find_inside_m_pa_info info; - PLINE *prev; + pcb_pline_t *prev; info.want_inside = bpa; @@ -1917,7 +1917,7 @@ next = curc->next; if (del_outside) - del_contour = curc->Flags.status != ISECTED && !cntr_in_M_POLYAREA(curc, bpa, pcb_false); + del_contour = curc->Flags.status != ISECTED && !cntr_in_M_pcb_polyarea_t(curc, bpa, pcb_false); /* Skip intersected contours */ if (curc->Flags.status == ISECTED) { @@ -1971,9 +1971,9 @@ } static void -M_POLYAREA_Collect_separated(jmp_buf * e, PLINE * afst, POLYAREA ** contours, PLINE ** holes, int action, pcb_bool maybe) +M_pcb_polyarea_t_Collect_separated(jmp_buf * e, pcb_pline_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) { - PLINE **cur, **next; + pcb_pline_t **cur, **next; for (cur = &afst; *cur != NULL; cur = next) { next = &((*cur)->next); @@ -1983,11 +1983,11 @@ } } -static void M_POLYAREA_Collect(jmp_buf * e, POLYAREA * afst, POLYAREA ** contours, PLINE ** holes, int action, pcb_bool maybe) +static void M_pcb_polyarea_t_Collect(jmp_buf * e, pcb_polyarea_t * afst, pcb_polyarea_t ** contours, pcb_pline_t ** holes, int action, pcb_bool maybe) { - POLYAREA *a = afst; - POLYAREA *parent = NULL; /* Quiet compiler warning */ - PLINE **cur, **next, *parent_contour; + pcb_polyarea_t *a = afst; + pcb_polyarea_t *parent = NULL; /* Quiet compiler warning */ + pcb_pline_t **cur, **next, *parent_contour; assert(a != NULL); while ((a = a->f) != afst); @@ -2024,7 +2024,7 @@ } /* determine if two polygons touch or overlap */ -pcb_bool Touching(POLYAREA * a, POLYAREA * b) +pcb_bool Touching(pcb_polyarea_t * a, pcb_polyarea_t * b) { jmp_buf e; int code; @@ -2036,11 +2036,11 @@ if (!poly_Valid(b)) return -1; #endif - M_POLYAREA_intersect(&e, a, b, pcb_false); + M_pcb_polyarea_t_intersect(&e, a, b, pcb_false); - if (M_POLYAREA_label(a, b, pcb_true)) + if (M_pcb_polyarea_t_label(a, b, pcb_true)) return pcb_true; - if (M_POLYAREA_label(b, a, pcb_true)) + if (M_pcb_polyarea_t_label(b, a, pcb_true)) return pcb_true; } else if (code == TOUCHES) @@ -2049,9 +2049,9 @@ } /* the main clipping routines */ -int poly_Boolean(const POLYAREA * a_org, const POLYAREA * b_org, POLYAREA ** res, int action) +int poly_Boolean(const pcb_polyarea_t * a_org, const pcb_polyarea_t * b_org, pcb_polyarea_t ** res, int action) { - POLYAREA *a = NULL, *b = NULL; + pcb_polyarea_t *a = NULL, *b = NULL; if (!poly_M_Copy0(&a, a_org) || !poly_M_Copy0(&b, b_org)) return err_no_memory; @@ -2060,11 +2060,11 @@ } /* poly_Boolean */ /* just like poly_Boolean but frees the input polys */ -int poly_Boolean_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** res, int action) +int poly_Boolean_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** res, int action) { - POLYAREA *a = ai, *b = bi; - PLINE *a_isected = NULL; - PLINE *p, *holes = NULL; + pcb_polyarea_t *a = ai, *b = bi; + pcb_pline_t *a_isected = NULL; + pcb_pline_t *p, *holes = NULL; jmp_buf e; int code; @@ -2104,17 +2104,17 @@ #endif /* intersect needs to make a list of the contours in a and b which are intersected */ - M_POLYAREA_intersect(&e, a, b, pcb_true); + M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); /* We could speed things up a lot here if we only processed the relevant contours */ /* NB: Relevant parts of a are labeled below */ - M_POLYAREA_label(b, a, pcb_false); + M_pcb_polyarea_t_label(b, a, pcb_false); *res = a; - M_POLYAREA_update_primary(&e, res, &holes, action, b); - M_POLYAREA_separate_isected(&e, res, &holes, &a_isected); - M_POLYAREA_label_separated(a_isected, b, pcb_false); - M_POLYAREA_Collect_separated(&e, a_isected, res, &holes, action, pcb_false); + M_pcb_polyarea_t_update_primary(&e, res, &holes, action, b); + M_pcb_polyarea_separate_isected(&e, res, &holes, &a_isected); + M_pcb_polyarea_t_label_separated(a_isected, b, pcb_false); + M_pcb_polyarea_t_Collect_separated(&e, a_isected, res, &holes, action, pcb_false); M_B_AREA_Collect(&e, b, res, &holes, action); poly_Free(&b); @@ -2140,11 +2140,11 @@ return code; } /* poly_Boolean_free */ -static void clear_marks(POLYAREA * p) +static void clear_marks(pcb_polyarea_t * p) { - POLYAREA *n = p; - PLINE *c; - VNODE *v; + pcb_polyarea_t *n = p; + pcb_pline_t *c; + pcb_vnode_t *v; do { for (c = n->contours; c; c = c->next) { @@ -2161,10 +2161,10 @@ /* compute the intersection and subtraction (divides "a" into two pieces) * and frees the input polys. This assumes that bi is a single simple polygon. */ -int poly_AndSubtract_free(POLYAREA * ai, POLYAREA * bi, POLYAREA ** aandb, POLYAREA ** aminusb) +int poly_AndSubtract_free(pcb_polyarea_t * ai, pcb_polyarea_t * bi, pcb_polyarea_t ** aandb, pcb_polyarea_t ** aminusb) { - POLYAREA *a = ai, *b = bi; - PLINE *p, *holes = NULL; + pcb_polyarea_t *a = ai, *b = bi; + pcb_pline_t *p, *holes = NULL; jmp_buf e; int code; @@ -2179,12 +2179,12 @@ if (!poly_Valid(b)) return -1; #endif - M_POLYAREA_intersect(&e, a, b, pcb_true); + M_pcb_polyarea_t_intersect(&e, a, b, pcb_true); - M_POLYAREA_label(a, b, pcb_false); - M_POLYAREA_label(b, a, pcb_false); + M_pcb_polyarea_t_label(a, b, pcb_false); + M_pcb_polyarea_t_label(b, a, pcb_false); - M_POLYAREA_Collect(&e, a, aandb, &holes, PBO_ISECT, pcb_false); + M_pcb_polyarea_t_Collect(&e, a, aandb, &holes, PBO_ISECT, pcb_false); InsertHoles(&e, *aandb, &holes); assert(poly_Valid(*aandb)); /* delete holes if any left */ @@ -2195,7 +2195,7 @@ holes = NULL; clear_marks(a); clear_marks(b); - M_POLYAREA_Collect(&e, a, aminusb, &holes, PBO_SUB, pcb_false); + M_pcb_polyarea_t_Collect(&e, a, aminusb, &holes, PBO_SUB, pcb_false); InsertHoles(&e, *aminusb, &holes); poly_Free(&a); poly_Free(&b); @@ -2218,27 +2218,27 @@ return code; } /* poly_AndSubtract_free */ -static inline int cntrbox_pointin(PLINE * c, pcb_vector_t p) +static inline int cntrbox_pointin(pcb_pline_t * c, pcb_vector_t p) { return (p[0] >= c->xmin && p[1] >= c->ymin && p[0] <= c->xmax && p[1] <= c->ymax); } -static inline int node_neighbours(VNODE * a, VNODE * b) +static inline int node_neighbours(pcb_vnode_t * a, pcb_vnode_t * b) { return (a == b) || (a->next == b) || (b->next == a) || (a->next == b->next); } -VNODE *poly_CreateNode(pcb_vector_t v) +pcb_vnode_t *poly_CreateNode(pcb_vector_t v) { - VNODE *res; + pcb_vnode_t *res; Coord *c; assert(v); - res = (VNODE *) calloc(1, sizeof(VNODE)); + res = (pcb_vnode_t *) calloc(1, sizeof(pcb_vnode_t)); if (res == NULL) return NULL; - /* bzero (res, sizeof (VNODE) - sizeof(pcb_vector_t)); */ + /* bzero (res, sizeof (pcb_vnode_t) - sizeof(pcb_vector_t)); */ c = res->point; *c++ = *v++; *c = *v; @@ -2245,11 +2245,11 @@ return res; } -void poly_IniContour(PLINE * c) +void poly_IniContour(pcb_pline_t * c) { if (c == NULL) return; - /* bzero (c, sizeof(PLINE)); */ + /* bzero (c, sizeof(pcb_pline_t)); */ c->head.next = c->head.prev = &c->head; c->xmin = c->ymin = 0x7fffffff; c->xmax = c->ymax = 0x80000000; @@ -2259,11 +2259,11 @@ c->radius = 0; } -PLINE *poly_NewContour(pcb_vector_t v) +pcb_pline_t *poly_NewContour(pcb_vector_t v) { - PLINE *res; + pcb_pline_t *res; - res = (PLINE *) calloc(1, sizeof(PLINE)); + res = (pcb_pline_t *) calloc(1, sizeof(pcb_pline_t)); if (res == NULL) return NULL; @@ -2277,9 +2277,9 @@ return res; } -void poly_ClrContour(PLINE * c) +void poly_ClrContour(pcb_pline_t * c) { - VNODE *cur; + pcb_vnode_t *cur; assert(c != NULL); while ((cur = c->head.next) != &c->head) { @@ -2289,9 +2289,9 @@ poly_IniContour(c); } -void poly_DelContour(PLINE ** c) +void poly_DelContour(pcb_pline_t ** c) { - VNODE *cur, *prev; + pcb_vnode_t *cur, *prev; if (*c == NULL) return; @@ -2315,10 +2315,10 @@ free(*c), *c = NULL; } -void poly_PreContour(PLINE * C, pcb_bool optimize) +void poly_PreContour(pcb_pline_t * C, pcb_bool optimize) { double area = 0; - VNODE *p, *c; + pcb_vnode_t *p, *c; pcb_vector_t p1, p2; assert(C != NULL); @@ -2368,9 +2368,9 @@ return R_DIR_FOUND_CONTINUE; } -void poly_InvContour(PLINE * c) +void poly_InvContour(pcb_pline_t * c) { - VNODE *cur, *next; + pcb_vnode_t *cur, *next; int r; assert(c != NULL); @@ -2389,7 +2389,7 @@ } } -void poly_ExclVertex(VNODE * node) +void poly_ExclVertex(pcb_vnode_t * node) { assert(node != NULL); if (node->cvc_next) { @@ -2400,7 +2400,7 @@ node->next->prev = node->prev; } -void poly_InclVertex(VNODE * after, VNODE * node) +void poly_InclVertex(pcb_vnode_t * after, pcb_vnode_t * node) { double a, b; assert(after != NULL); @@ -2417,7 +2417,7 @@ b = (node->point[0] - node->prev->prev->point[0]); b *= (node->prev->point[1] - node->prev->prev->point[1]); if (fabs(a - b) < EPSILON) { - VNODE *t = node->prev; + pcb_vnode_t *t = node->prev; t->prev->next = node; node->prev = t->prev; free(t); @@ -2424,9 +2424,9 @@ } } -pcb_bool poly_CopyContour(PLINE ** dst, PLINE * src) +pcb_bool poly_CopyContour(pcb_pline_t ** dst, pcb_pline_t * src) { - VNODE *cur, *newnode; + pcb_vnode_t *cur, *newnode; assert(src != NULL); *dst = NULL; @@ -2453,11 +2453,11 @@ /**********************************************************************/ /* polygon routines */ -pcb_bool poly_Copy0(POLYAREA ** dst, const POLYAREA * src) +pcb_bool poly_Copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * src) { *dst = NULL; if (src != NULL) - *dst = (POLYAREA *) calloc(1, sizeof(POLYAREA)); + *dst = (pcb_polyarea_t *) calloc(1, sizeof(pcb_polyarea_t)); if (*dst == NULL) return pcb_false; (*dst)->contour_tree = r_create_tree(NULL, 0, 0); @@ -2465,9 +2465,9 @@ return poly_Copy1(*dst, src); } -pcb_bool poly_Copy1(POLYAREA * dst, const POLYAREA * src) +pcb_bool poly_Copy1(pcb_polyarea_t * dst, const pcb_polyarea_t * src) { - PLINE *cur, **last = &dst->contours; + pcb_pline_t *cur, **last = &dst->contours; *last = NULL; dst->f = dst->b = dst; @@ -2481,7 +2481,7 @@ return pcb_true; } -void poly_M_Incl(POLYAREA ** list, POLYAREA * a) +void poly_M_Incl(pcb_polyarea_t ** list, pcb_polyarea_t * a) { if (*list == NULL) a->f = a->b = a, *list = a; @@ -2492,10 +2492,10 @@ } } -pcb_bool poly_M_Copy0(POLYAREA ** dst, const POLYAREA * srcfst) +pcb_bool poly_M_Copy0(pcb_polyarea_t ** dst, const pcb_polyarea_t * srcfst) { - const POLYAREA *src = srcfst; - POLYAREA *di; + const pcb_polyarea_t *src = srcfst; + pcb_polyarea_t *di; *dst = NULL; if (src == NULL) @@ -2509,9 +2509,9 @@ return pcb_true; } -pcb_bool poly_InclContour(POLYAREA * p, PLINE * c) +pcb_bool poly_InclContour(pcb_polyarea_t * p, pcb_pline_t * c) { - PLINE *tmp; + pcb_pline_t *tmp; if ((c == NULL) || (p == NULL)) return pcb_false; @@ -2577,7 +2577,7 @@ return R_DIR_FOUND_CONTINUE; } -int poly_InsideContour(PLINE * c, pcb_vector_t p) +int poly_InsideContour(pcb_pline_t * c, pcb_vector_t p) { struct pip info; pcb_box_t ray; @@ -2594,9 +2594,9 @@ return info.f; } -pcb_bool poly_CheckInside(POLYAREA * p, pcb_vector_t v0) +pcb_bool poly_CheckInside(pcb_polyarea_t * p, pcb_vector_t v0) { - PLINE *cur; + pcb_pline_t *cur; if ((p == NULL) || (v0 == NULL) || (p->contours == NULL)) return pcb_false; @@ -2610,9 +2610,9 @@ return pcb_false; } -pcb_bool poly_M_CheckInside(POLYAREA * p, pcb_vector_t v0) +pcb_bool poly_M_CheckInside(pcb_polyarea_t * p, pcb_vector_t v0) { - POLYAREA *cur; + pcb_polyarea_t *cur; if ((p == NULL) || (v0 == NULL)) return pcb_false; @@ -2699,10 +2699,10 @@ * Joseph O'Rourke, Cambridge University Press 1998, * ISBN 0-521-64010-5 Pbk, ISBN 0-521-64976-5 Hbk */ -static void poly_ComputeInteriorPoint(PLINE * poly, pcb_vector_t v) +static void poly_ComputeInteriorPoint(pcb_pline_t * poly, pcb_vector_t v) { - VNODE *pt1, *pt2, *pt3, *q; - VNODE *min_q = NULL; + pcb_vnode_t *pt1, *pt2, *pt3, *q; + pcb_vnode_t *min_q = NULL; double dist; double min_dist = 0.0; double dir = (poly->Flags.orient == PLF_DIR) ? 1. : -1; @@ -2759,7 +2759,7 @@ * common points between their contours. (Identical contours * are treated as being inside each other). */ -int poly_ContourInContour(PLINE * poly, PLINE * inner) +int poly_ContourInContour(pcb_pline_t * poly, pcb_pline_t * inner) { pcb_vector_t point; assert(poly != NULL); @@ -2777,7 +2777,7 @@ return 0; } -void poly_Init(POLYAREA * p) +void poly_Init(pcb_polyarea_t * p) { p->f = p->b = p; p->contours = NULL; @@ -2784,18 +2784,18 @@ p->contour_tree = r_create_tree(NULL, 0, 0); } -POLYAREA *poly_Create(void) +pcb_polyarea_t *poly_Create(void) { - POLYAREA *res; + pcb_polyarea_t *res; - if ((res = (POLYAREA *) malloc(sizeof(POLYAREA))) != NULL) + if ((res = (pcb_polyarea_t *) malloc(sizeof(pcb_polyarea_t))) != NULL) poly_Init(res); return res; } -void poly_FreeContours(PLINE ** pline) +void poly_FreeContours(pcb_pline_t ** pline) { - PLINE *pl; + pcb_pline_t *pl; while ((pl = *pline) != NULL) { *pline = pl->next; @@ -2803,9 +2803,9 @@ } } -void poly_Free(POLYAREA ** p) +void poly_Free(pcb_polyarea_t ** p) { - POLYAREA *cur; + pcb_polyarea_t *cur; if (*p == NULL) return; @@ -2821,7 +2821,7 @@ free(*p), *p = NULL; } -static pcb_bool inside_sector(VNODE * pn, pcb_vector_t p2) +static pcb_bool inside_sector(pcb_vnode_t * pn, pcb_vector_t p2) { pcb_vector_t cdir, ndir, pdir; int p_c, n_c, p_n; @@ -2842,9 +2842,9 @@ } /* inside_sector */ /* returns pcb_true if bad contour */ -pcb_bool poly_ChkContour(PLINE * a) +pcb_bool poly_ChkContour(pcb_pline_t * a) { - VNODE *a1, *a2, *hit1, *hit2; + pcb_vnode_t *a1, *a2, *hit1, *hit2; pcb_vector_t i1, i2; int icnt; @@ -2902,9 +2902,9 @@ return pcb_false; } -void poly_bbox(POLYAREA * p, pcb_box_t * b) +void poly_bbox(pcb_polyarea_t * p, pcb_box_t * b) { - PLINE *n; + pcb_pline_t *n; /*int cnt;*/ n = p->contours; @@ -2926,9 +2926,9 @@ } -pcb_bool poly_Valid(POLYAREA * p) +pcb_bool poly_Valid(pcb_polyarea_t * p) { - PLINE *c; + pcb_pline_t *c; if ((p == NULL) || (p->contours == NULL)) return pcb_false; @@ -2935,8 +2935,8 @@ if (p->contours->Flags.orient == PLF_INV || poly_ChkContour(p->contours)) { #ifndef NDEBUG - VNODE *v, *n; - DEBUGP("Invalid Outer PLINE\n"); + pcb_vnode_t *v, *n; + DEBUGP("Invalid Outer pcb_pline_t\n"); if (p->contours->Flags.orient == PLF_INV) DEBUGP("failed orient\n"); if (poly_ChkContour(p->contours)) @@ -2953,8 +2953,8 @@ for (c = p->contours->next; c != NULL; c = c->next) { if (c->Flags.orient == PLF_DIR || poly_ChkContour(c) || !poly_ContourInContour(p->contours, c)) { #ifndef NDEBUG - VNODE *v, *n; - DEBUGP("Invalid Inner PLINE orient = %d\n", c->Flags.orient); + pcb_vnode_t *v, *n; + DEBUGP("Invalid Inner pcb_pline_t orient = %d\n", c->Flags.orient); if (c->Flags.orient == PLF_DIR) DEBUGP("failed orient\n"); if (poly_ChkContour(c)) Index: trunk/src_plugins/export_ps/ps.c =================================================================== --- trunk/src_plugins/export_ps/ps.c (revision 4801) +++ trunk/src_plugins/export_ps/ps.c (revision 4802) @@ -1220,8 +1220,8 @@ { /* Ignore clip_box, just draw everything */ - VNODE *v; - PLINE *pl; + pcb_vnode_t *v; + pcb_pline_t *pl; const char *op; int len; double POLYGRID = ps_attribute_list[HA_polygrid].default_val.real_value; Index: trunk/src_plugins/gl/hidgl.c =================================================================== --- trunk/src_plugins/gl/hidgl.c (revision 4801) +++ trunk/src_plugins/gl/hidgl.c (revision 4802) @@ -511,9 +511,9 @@ free(vertices); } -void tesselate_contour(GLUtesselator * tobj, PLINE * contour, GLdouble * vertices, double scale) +void tesselate_contour(GLUtesselator * tobj, pcb_pline_t * contour, GLdouble * vertices, double scale) { - VNODE *vn = &contour->head; + pcb_vnode_t *vn = &contour->head; int offset = 0; /* If the contour is round, and hidgl_fill_circle would use @@ -550,7 +550,7 @@ static r_dir_t do_hole(const pcb_box_t * b, void *cl) { struct do_hole_info *info = cl; - PLINE *curc = (PLINE *) b; + pcb_pline_t *curc = (pcb_pline_t *) b; /* Ignore the outer contour - we draw it first explicitly */ if (curc->Flags.orient == PLF_DIR) { @@ -569,7 +569,7 @@ void hidgl_fill_pcb_polygon(pcb_polygon_t * poly, const pcb_box_t * clip_box, double scale) { int vertex_count = 0; - PLINE *contour; + pcb_pline_t *contour; struct do_hole_info info; int stencil_bit; Index: trunk/src_plugins/jostle/jostle.c =================================================================== --- trunk/src_plugins/jostle/jostle.c (revision 4801) +++ trunk/src_plugins/jostle/jostle.c (revision 4802) @@ -39,7 +39,7 @@ #include "misc_util.h" #include "obj_line.h" -/*#define DEBUG_POLYAREA*/ +/*#define DEBUG_pcb_polyarea_t*/ double vect_dist2(pcb_vector_t v1, pcb_vector_t v2); #define Vcpy2(r,a) {(r)[0] = (a)[0]; (r)[1] = (a)[1];} @@ -77,16 +77,16 @@ static const char jostle_syntax[] = "Jostle(diameter)"; /* DEBUG */ -static void DebugPOLYAREA(POLYAREA * s, char *color) +static void Debugpcb_polyarea_t(pcb_polyarea_t * s, char *color) { int *x, *y, n, i = 0; - PLINE *pl; - VNODE *v; - POLYAREA *p; + pcb_pline_t *pl; + pcb_vnode_t *v; + pcb_polyarea_t *p; pcb_hid_t *ddraw; pcb_hid_gc_t ddgc; -#ifndef DEBUG_POLYAREA +#ifndef DEBUG_pcb_polyarea_t return; #endif ddraw = gui->request_debug_draw(); @@ -122,16 +122,16 @@ } /*! - * \brief Find the bounding box of a POLYAREA. + * \brief Find the bounding box of a pcb_polyarea_t. * - * POLYAREAs linked by ->f/b are outlines.\n + * pcb_polyarea_ts linked by ->f/b are outlines.\n * n->contours->next would be the start of the inner holes (irrelevant * for bounding box). */ -static pcb_box_t POLYAREA_boundingBox(POLYAREA * a) +static pcb_box_t pcb_polyarea_t_boundingBox(pcb_polyarea_t * a) { - POLYAREA *n; - PLINE *pa; + pcb_polyarea_t *n; + pcb_pline_t *pa; pcb_box_t box; int first = 1; @@ -161,7 +161,7 @@ * as a pair of vectors PQ.\n * Make it long so it will intersect everything in the area. */ -static void POLYAREA_findXmostLine(POLYAREA * a, int side, pcb_vector_t p, pcb_vector_t q, int clearance) +static void pcb_polyarea_t_findXmostLine(pcb_polyarea_t * a, int side, pcb_vector_t p, pcb_vector_t q, int clearance) { int extra; p[0] = p[1] = 0; @@ -193,7 +193,7 @@ int kx, ky, minmax, dq, ckx, cky; Coord mm[2] = { MAX_COORD, -MAX_COORD }; pcb_vector_t mmp[2]; - VNODE *v; + pcb_vnode_t *v; switch (side) { case JNORTHWEST: @@ -280,13 +280,13 @@ return line; } -static pcb_line_t *MakeBypassLine(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, pcb_line_t * orig, POLYAREA ** expandp) +static pcb_line_t *MakeBypassLine(pcb_layer_t * layer, pcb_vector_t a, pcb_vector_t b, pcb_line_t * orig, pcb_polyarea_t ** expandp) { pcb_line_t *line; line = Createpcb_vector_tLineOnLayer(layer, a, b, orig->Thickness, orig->Clearance, orig->Flags); if (line && expandp) { - POLYAREA *p = LinePoly(line, line->Thickness + line->Clearance); + pcb_polyarea_t *p = LinePoly(line, line->Thickness + line->Clearance); poly_Boolean_free(*expandp, p, expandp, PBO_UNITE); } return line; @@ -311,7 +311,7 @@ * points a, b, c, d. Finally connect the dots and remove the * old straight line. */ -static int MakeBypassingLines(POLYAREA * brush, pcb_layer_t * layer, pcb_line_t * line, int side, POLYAREA ** expandp) +static int MakeBypassingLines(pcb_polyarea_t * brush, pcb_layer_t * layer, pcb_line_t * line, int side, pcb_polyarea_t ** expandp) { pcb_vector_t pA, pB, flatA, flatB, qA, qB; pcb_vector_t lA, lB; @@ -324,9 +324,9 @@ lB[0] = line->Point2.X; lB[1] = line->Point2.Y; - POLYAREA_findXmostLine(brush, side, flatA, flatB, line->Thickness / 2); - POLYAREA_findXmostLine(brush, rotateSide(side, 1), pA, pB, line->Thickness / 2); - POLYAREA_findXmostLine(brush, rotateSide(side, -1), qA, qB, line->Thickness / 2); + pcb_polyarea_t_findXmostLine(brush, side, flatA, flatB, line->Thickness / 2); + pcb_polyarea_t_findXmostLine(brush, rotateSide(side, 1), pA, pB, line->Thickness / 2); + pcb_polyarea_t_findXmostLine(brush, rotateSide(side, -1), qA, qB, line->Thickness / 2); hits = vect_inters2(lA, lB, qA, qB, a, junk) + vect_inters2(qA, qB, flatA, flatB, b, junk) + vect_inters2(pA, pB, flatA, flatB, c, junk) + vect_inters2(lA, lB, pA, pB, d, junk); @@ -348,9 +348,9 @@ struct info { pcb_box_t box; - POLYAREA *brush; + pcb_polyarea_t *brush; pcb_layer_t *layer; - POLYAREA *smallest; + pcb_polyarea_t *smallest; /*!< after cutting brush with line, the smallest chunk, which we * will go around on 'side'. */ @@ -370,7 +370,7 @@ { pcb_line_t *line = (pcb_line_t *) targ; struct info *info = private; - POLYAREA *lp, *copy, *tmp, *n, *smallest = NULL; + pcb_polyarea_t *lp, *copy, *tmp, *n, *smallest = NULL; pcb_vector_t p; int inside = 0, side, r; double small, big; @@ -496,7 +496,7 @@ static int jostle(int argc, const char **argv, Coord x, Coord y) { pcb_bool rel; - POLYAREA *expand; + pcb_polyarea_t *expand; float value; struct info info; int found; @@ -523,8 +523,8 @@ } END_LOOP; do { - info.box = POLYAREA_boundingBox(info.brush); - DebugPOLYAREA(info.brush, NULL); + info.box = pcb_polyarea_t_boundingBox(info.brush); + Debugpcb_polyarea_t(info.brush, NULL); pcb_fprintf(stderr, "search (%ms,%ms)->(%ms,%ms):\n", info.box.X1, info.box.Y1, info.box.X2, info.box.Y2); info.line = NULL; info.smallest = NULL; Index: trunk/src_plugins/polycombine/polycombine.c =================================================================== --- trunk/src_plugins/polycombine/polycombine.c (revision 4801) +++ trunk/src_plugins/polycombine/polycombine.c (revision 4802) @@ -38,10 +38,10 @@ #include "hid_actions.h" #include "obj_poly.h" -static POLYAREA *original_poly(pcb_polygon_t *p, pcb_bool *forward) +static pcb_polyarea_t *original_poly(pcb_polygon_t *p, pcb_bool *forward) { - PLINE *contour = NULL; - POLYAREA *np = NULL; + pcb_pline_t *contour = NULL; + pcb_polyarea_t *np = NULL; pcb_cardinal_t n; pcb_vector_t v; int hole = 0; @@ -94,7 +94,7 @@ struct poly_tree { pcb_polygon_t *polygon; pcb_bool forward; - POLYAREA *polyarea; + pcb_polyarea_t *polyarea; poly_tree *parent; poly_tree *child; poly_tree *prev; @@ -127,7 +127,7 @@ * contours can be assumed not to overlap, we can drill down in this * order: P1, P2, P3, P4, P5, P6. */ -static pcb_bool PolygonContainsPolygon(POLYAREA *outer, POLYAREA *inner) +static pcb_bool PolygonContainsPolygon(pcb_polyarea_t *outer, pcb_polyarea_t *inner) { /* int contours_isect;*/ /* Should check outer contours don't intersect? */ @@ -249,9 +249,9 @@ return to_insert; } -static POLYAREA *compute_polygon_recursive(poly_tree * root, POLYAREA * accumulate) +static pcb_polyarea_t *compute_polygon_recursive(poly_tree * root, pcb_polyarea_t * accumulate) { - POLYAREA *res; + pcb_polyarea_t *res; poly_tree *cur_node; for (cur_node = root; cur_node != NULL; cur_node = cur_node->next) { /* Process this element */ @@ -270,13 +270,13 @@ static int polycombine(int argc, const char **argv, Coord x, Coord y) { - POLYAREA *res; + pcb_polyarea_t *res; pcb_bool forward; - POLYAREA *np; + pcb_polyarea_t *np; /* bool outer; - POLYAREA *pa; - PLINE *pline; - VNODE *node; + pcb_polyarea_t *pa; + pcb_pline_t *pline; + pcb_vnode_t *node; pcb_polygon_t *Polygon;*/ pcb_layer_t *Layer = NULL; poly_tree *root = NULL;