pcb 4.1.1
An interactive printed circuit board layout editor.
|
Random box-related utilities. More...
Go to the source code of this file.
Data Structures | |
struct | cheap_point |
Defines | |
#define | ROTATEBOX_CW(box) |
Rotates box 90-degrees cw. | |
#define | ROTATEBOX_TO_NORTH(box, dir) |
#define | ROTATEBOX_FROM_NORTH(box, dir) |
#define | CENTER_X(b) ((b).X1 + ((b).X2 - (b).X1)/2) |
#define | CENTER_Y(b) ((b).Y1 + ((b).Y2 - (b).Y1)/2) |
Typedefs | |
typedef struct cheap_point | CheapPointType |
Enumerations | |
enum | direction_t { NORTH = 0, EAST = 1, SOUTH = 2, WEST = 3, NE = 4, SE = 5, SW = 6, NW, ALL = 8 } |
Functions | |
static bool | point_in_box (const BoxType *box, Coord X, Coord Y) |
static bool | point_in_closed_box (const BoxType *box, Coord X, Coord Y) |
static bool | box_is_good (const BoxType *b) |
static bool | box_intersect (const BoxType *a, const BoxType *b) |
static CheapPointType | closest_point_in_box (const CheapPointType *from, const BoxType *box) |
static bool | box_in_box (const BoxType *outer, const BoxType *inner) |
static BoxType | clip_box (const BoxType *box, const BoxType *clipbox) |
static BoxType | shrink_box (const BoxType *box, Coord amount) |
static BoxType | bloat_box (const BoxType *box, Coord amount) |
static BoxType | box_center (const BoxType *box) |
Construct a minimum box that touches the input box at the center. | |
static BoxType | box_corner (const BoxType *box) |
Construct a minimum box that touches the input box at the corner. | |
static BoxType | point_box (Coord X, Coord Y) |
Construct a box that holds a single point. | |
static void | close_box (BoxType *r) |
Close a bounding box by pushing its upper right corner. | |
static double | dist2_to_box (const CheapPointType *p, const BoxType *b) |
Return the square of the minimum distance from a point to some point inside a box. |
Random box-related utilities.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996 Thomas Nau
Copyright (C) 1998,1999,2000,2001 harry eaton
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact addresses for paper mail and Email: harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA haceaton@aplcomm.jhuapl.edu
Definition in file box.h.
#define CENTER_X | ( | b | ) | ((b).X1 + ((b).X2 - (b).X1)/2) |
Definition at line 92 of file box.h.
Referenced by CreateViaEdge(), ftherm_rect_in_reg(), RouteOne(), TargetPoint(), and TracePath().
#define CENTER_Y | ( | b | ) | ((b).Y1 + ((b).Y2 - (b).Y1)/2) |
Definition at line 93 of file box.h.
Referenced by CreateViaEdge(), ftherm_rect_in_reg(), RouteOne(), TargetPoint(), and TracePath().
#define ROTATEBOX_CW | ( | box | ) |
#define ROTATEBOX_FROM_NORTH | ( | box, | |
dir | |||
) |
do { Coord t;\ switch(dir) {\ case WEST: \ t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\ (box).X2 = (box).Y2; (box).Y2 = -t; break;\ case SOUTH: \ t = (box).X1; (box).X1 = -(box).X2; (box).X2 = -t;\ t = (box).Y1; (box).Y1 = -(box).Y2; (box).Y2 = -t; break;\ case EAST: \ t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\ (box).X2 = -(box).Y1; (box).Y1 = t; break;\ case NORTH: break;\ default: assert(0);\ }\ } while (0)
Definition at line 75 of file box.h.
Referenced by break_box_edge().
#define ROTATEBOX_TO_NORTH | ( | box, | |
dir | |||
) |
do { Coord t;\ switch(dir) {\ case EAST: \ t = (box).X1; (box).X1 = (box).Y1; (box).Y1 = -(box).X2;\ (box).X2 = (box).Y2; (box).Y2 = -t; break;\ case SOUTH: \ t = (box).X1; (box).X1 = -(box).X2; (box).X2 = -t;\ t = (box).Y1; (box).Y1 = -(box).Y2; (box).Y2 = -t; break;\ case WEST: \ t = (box).X1; (box).X1 = -(box).Y2; (box).Y2 = (box).X2;\ (box).X2 = -(box).Y1; (box).Y1 = t; break;\ case NORTH: break;\ default: assert(0);\ }\ } while (0)
Definition at line 60 of file box.h.
Referenced by __r_find_neighbor_rect_in_reg(), __r_find_neighbor_reg_in_sea(), break_box_edge(), and r_find_neighbor().
typedef struct cheap_point CheapPointType |
enum direction_t |
Definition at line 178 of file box.h.
References shrink_box().
Referenced by __Expand_this_rect(), __GatherBlockers(), bloat_routebox(), blocker_to_heap(), BreakManyEdges(), clearPoly(), moveable_edge(), and mtspace_query_rect().
Construct a minimum box that touches the input box at the center.
Definition at line 188 of file box.h.
References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by mtspace_remove(), and RouteOne().
Construct a minimum box that touches the input box at the corner.
Definition at line 203 of file box.h.
References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Definition at line 146 of file box.h.
References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by clip_box(), and TracePath().
Definition at line 124 of file box.h.
References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by clip_box(), CreateExpansionArea(), foib_rect_in_reg(), ftherm_rect_in_reg(), moveable_edge(), query_one(), and RouteOne().
static bool box_is_good | ( | const BoxType * | b | ) | [inline, static] |
Definition at line 118 of file box.h.
References BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by blocker_to_heap(), CreateViaEdge(), do_via_search(), moveable_edge(), mtspace_create_box(), mtspace_query_rect(), qloop(), and RouteOne().
Definition at line 154 of file box.h.
References box_in_box(), box_intersect(), MAX, MIN, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by blocker_to_heap(), clearPoly(), RouteOne(), and TracePath().
static void close_box | ( | BoxType * | r | ) | [inline, static] |
Close a bounding box by pushing its upper right corner.
Definition at line 231 of file box.h.
References BoxType::X2, and BoxType::Y2.
Referenced by do_via_search(), SetArcBoundingBox(), SetElementBoundingBox(), SetLineBoundingBox(), SetPadBoundingBox(), SetPinBoundingBox(), SetPolygonBoundingBox(), and SetTextBoundingBox().
static CheapPointType closest_point_in_box | ( | const CheapPointType * | from, |
const BoxType * | box | ||
) | [inline, static] |
Definition at line 131 of file box.h.
References point_in_box(), cheap_point::X, BoxType::X1, BoxType::X2, cheap_point::Y, BoxType::Y1, and BoxType::Y2.
Referenced by closest_point_in_routebox(), cost_to_layerless_box(), CreateBridge(), CreateEdge2(), CreateEdgeWithConflicts(), CreateExpansionArea(), dist2_to_box(), heap_append(), moveable_edge(), RouteOne(), and TracePath().
static double dist2_to_box | ( | const CheapPointType * | p, |
const BoxType * | b | ||
) | [inline, static] |
Return the square of the minimum distance from a point to some point inside a box.
The box is half-closed!
That is, the top-left corner is considered in the box, but the bottom-right corner is not.
Definition at line 246 of file box.h.
References closest_point_in_box(), Distance(), cheap_point::X, and cheap_point::Y.
Construct a box that holds a single point.
Definition at line 217 of file box.h.
References X, BoxType::X1, BoxType::X2, Y, BoxType::Y1, and BoxType::Y2.
Referenced by FindRouteBoxOnLayerGroup(), and SearchObjectByLocation().
Definition at line 106 of file box.h.
References BoxType::X1, BoxType::Y1, and BoxType::Y2.
Referenced by closest_point_in_box(), point_in_shrunk_box(), RD_DrawManhattanLine(), and TracePath().
Definition at line 112 of file box.h.
References BoxType::X1, BoxType::Y1, and BoxType::Y2.
Referenced by RD_DrawManhattanLine().
Definition at line 167 of file box.h.
References box, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by __found_one_on_lg(), add_via_sites(), bloat_box(), do_via_search(), ftherm_rect_in_reg(), IronDownAllUnfixedPaths(), moveable_edge(), and TracePath().