Index: trunk/src/search.h =================================================================== --- trunk/src/search.h (revision 23239) +++ trunk/src/search.h (revision 23240) @@ -28,8 +28,8 @@ /* Search object by location routines */ -#ifndef PCB_SEARCH_H -#define PCB_SEARCH_H +#ifndef PCB_SEARCH_H +#define PCB_SEARCH_H #include "global_typedefs.h" #include "layer.h" @@ -42,7 +42,7 @@ /* --------------------------------------------------------------------------- * some define to check for 'type' in box */ -#define PCB_POINT_IN_BOX(x,y,b) \ +#define PCB_POINT_IN_BOX(x,y,b) \ (PCB_IS_BOX_NEGATIVE(b) ? \ ((x) >= (b)->X2 && (x) <= (b)->X1 && (y) >= (b)->Y2 && (y) <= (b)->Y1) \ : \ @@ -54,31 +54,31 @@ PCB_POINT_IN_BOX((v)->X+(v)->Thickness/2,(v)->Y+(v)->Thickness/2,(b)) \ ) -#define PCB_LINE_IN_BOX(l,b) \ +#define PCB_LINE_IN_BOX(l,b) \ (PCB_POINT_IN_BOX((l)->Point1.X,(l)->Point1.Y,(b)) && \ PCB_POINT_IN_BOX((l)->Point2.X,(l)->Point2.Y,(b))) -#define PCB_PAD_IN_BOX(p,b) PCB_LINE_IN_BOX((pcb_line_t *)(p),(b)) +#define PCB_PAD_IN_BOX(p,b) PCB_LINE_IN_BOX((pcb_line_t *)(p),(b)) -#define PCB_BOX_IN_BOX(b1,b) \ +#define PCB_BOX_IN_BOX(b1,b) \ ((b1)->X1 >= (b)->X1 && (b1)->X2 <= (b)->X2 && \ ((b1)->Y1 >= (b)->Y1 && (b1)->Y2 <= (b)->Y2)) -#define PCB_TEXT_IN_BOX(t,b) \ +#define PCB_TEXT_IN_BOX(t,b) \ (PCB_BOX_IN_BOX(&((t)->BoundingBox), (b))) -#define PCB_POLYGON_IN_BOX(p,b) \ +#define PCB_POLYGON_IN_BOX(p,b) \ (PCB_BOX_IN_BOX(&((p)->BoundingBox), (b))) -#define PCB_SUBC_IN_BOX(s,b) \ +#define PCB_SUBC_IN_BOX(s,b) \ (PCB_BOX_IN_BOX(&((s)->BoundingBox), (b))) -#define PCB_ELEMENT_IN_BOX(e,b) \ +#define PCB_ELEMENT_IN_BOX(e,b) \ (PCB_BOX_IN_BOX(&((e)->BoundingBox), (b))) /* the bounding box is much larger than the minimum, use it to decide it it is worth doing the expensive precise calculations */ -#define PCB_ARC_IN_BOX(a,b) \ +#define PCB_ARC_IN_BOX(a,b) \ ((PCB_BOX_TOUCHES_BOX(&((a)->BoundingBox), (b))) && (pcb_arc_in_box(a,b))) /* == the same but accept if any part of the object touches the box == */ @@ -99,7 +99,7 @@ || pcb_lines_intersect((l)->Point1.X,(l)->Point1.Y,(l)->Point2.X,(l)->Point2.Y, (b)->X2, (b)->Y2, (b)->X2, (b)->Y1) \ || PCB_LINE_IN_BOX((l), (b))) -#define PCB_XYLINE_ISECTS_BOX(x1,y1,x2,y2,b) \ +#define PCB_XYLINE_ISECTS_BOX(x1,y1,x2,y2,b) \ ( pcb_lines_intersect(x1,y1,x2,y2, (b)->X1, (b)->Y1, (b)->X2, (b)->Y1) \ || pcb_lines_intersect(x1,y1,x2,y2, (b)->X1, (b)->Y1, (b)->X1, (b)->Y2) \ || pcb_lines_intersect(x1,y1,x2,y2, (b)->X2, (b)->Y2, (b)->X1, (b)->Y2) \ @@ -109,25 +109,25 @@ #define PCB_PAD_TOUCHES_BOX(p,b) PCB_LINE_TOUCHES_BOX((pcb_line_t *)(p),(b)) /* a corner of either box is within the other, or edges cross */ -#define PCB_BOX_TOUCHES_BOX(b1,b2) \ +#define PCB_BOX_TOUCHES_BOX(b1,b2) \ ( PCB_POINT_IN_BOX((b1)->X1,(b1)->Y1,b2) || PCB_POINT_IN_BOX((b1)->X1,(b1)->Y2,b2) || PCB_POINT_IN_BOX((b1)->X2,(b1)->Y1,b2) || PCB_POINT_IN_BOX((b1)->X2,(b1)->Y2,b2) \ || PCB_POINT_IN_BOX((b2)->X1,(b2)->Y1,b1) || PCB_POINT_IN_BOX((b2)->X1,(b2)->Y2,b1) || PCB_POINT_IN_BOX((b2)->X2,(b2)->Y1,b1) || PCB_POINT_IN_BOX((b2)->X2,(b2)->Y2,b1) \ || pcb_lines_intersect((b1)->X1,(b1)->Y1, (b1)->X2,(b1)->Y1, (b2)->X1,(b2)->Y1, (b2)->X1,(b2)->Y2) \ || pcb_lines_intersect((b2)->X1,(b2)->Y1, (b2)->X2,(b2)->Y1, (b1)->X1,(b1)->Y1, (b1)->X1,(b1)->Y2)) -#define PCB_TEXT_TOUCHES_BOX(t,b) \ +#define PCB_TEXT_TOUCHES_BOX(t,b) \ (PCB_BOX_TOUCHES_BOX(&((t)->BoundingBox), (b))) -#define PCB_POLYGON_TOUCHES_BOX(p,b) \ +#define PCB_POLYGON_TOUCHES_BOX(p,b) \ (pcb_poly_is_rect_in_p((b)->X2, (b)->Y2, (b)->X1, (b)->Y1, (p))) -#define PCB_SUBC_TOUCHES_BOX(s,b) \ +#define PCB_SUBC_TOUCHES_BOX(s,b) \ (PCB_BOX_TOUCHES_BOX(&((s)->BoundingBox), (b))) -#define PCB_ELEMENT_TOUCHES_BOX(e,b) \ +#define PCB_ELEMENT_TOUCHES_BOX(e,b) \ (PCB_BOX_TOUCHES_BOX(&((e)->BoundingBox), (b))) -#define PCB_ARC_TOUCHES_BOX(a,b) \ +#define PCB_ARC_TOUCHES_BOX(a,b) \ (pcb_is_arc_in_rectangle((b)->X2, (b)->Y2, (b)->X1, (b)->Y1, (a)))