KiCad PCB EDA Suite
ar_cell.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
5  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
6  * Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
7  *
8  * Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
9  *
10  * First copyright (C) Randy Nevin, 1989 (see PCBCA package)
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 
31 #ifndef _AR_CELL_H_
32 #define _AR_CELL_H_
33 
34 /* Bits characterizing cell */
35 #define CELL_IS_EMPTY 0x00
36 #define CELL_IS_HOLE 0x01 /* a conducting hole or obstacle */
37 #define CELL_IS_MODULE 0x02 /* auto placement occupied by a module */
38 #define CELL_IS_EDGE 0x20 /* Area and auto-placement: limiting cell contour (Board, Zone) */
39 #define CELL_IS_FRIEND 0x40 /* Area and auto-placement: cell part of the net */
40 #define CELL_IS_ZONE 0x80 /* Area and auto-placement: cell available */
41 
42 /* Bit masks for presence of obstacles to autorouting */
43 #define OCCUPE 1 /* Autorouting: obstacle tracks and vias. */
44 #define VIA_IMPOSSIBLE 2 /* Autorouting: obstacle for vias. */
45 #define CURRENT_PAD 4
46 
47 
48 /* traces radiating outward from a hole to a side or corner */
49 #define HOLE_NORTH 0x00000002L /* upward */
50 #define HOLE_NORTHEAST 0x00000004L /* upward and right */
51 #define HOLE_EAST 0x00000008L /* to the right */
52 #define HOLE_SOUTHEAST 0x00000010L /* downward and right */
53 #define HOLE_SOUTH 0x00000020L /* downward */
54 #define HOLE_SOUTHWEST 0x00000040L /* downward and left */
55 #define HOLE_WEST 0x00000080L /* to the left */
56 #define HOLE_NORTHWEST 0x00000100L /* upward and left */
57 
58 /* straight lines through the center */
59 #define LINE_HORIZONTAL 0x00000002L /* left-to-right line */
60 #define LINE_VERTICAL 0x00000004L /* top-to-bottom line */
61 
62 /* lines cutting across a corner, connecting adjacent sides */
63 #define CORNER_NORTHEAST 0x00000008L /* upper right corner */
64 #define CORNER_SOUTHEAST 0x00000010L /* lower right corner */
65 #define CORNER_SOUTHWEST 0x00000020L /* lower left corner */
66 #define CORNER_NORTHWEST 0x00000040L /* upper left corner */
67 
68 /* diagonal lines through the center */
69 #define DIAG_NEtoSW 0x00000080L /* northeast to southwest */
70 #define DIAG_SEtoNW 0x00000100L /* southeast to northwest */
71 
72 /* 135 degree angle side-to-far-corner lines */
73 #define BENT_NtoSE 0x00000200L /* north to southeast */
74 #define BENT_NtoSW 0x00000400L /* north to southwest */
75 #define BENT_EtoSW 0x00000800L /* east to southwest */
76 #define BENT_EtoNW 0x00001000L /* east to northwest */
77 #define BENT_StoNW 0x00002000L /* south to northwest */
78 #define BENT_StoNE 0x00004000L /* south to northeast */
79 #define BENT_WtoNE 0x00008000L /* west to northeast */
80 #define BENT_WtoSE 0x00010000L /* west to southeast */
81 
82 /* 90 degree corner-to-adjacent-corner lines */
83 #define ANGLE_NEtoSE 0x00020000L /* northeast to southeast */
84 #define ANGLE_SEtoSW 0x00040000L /* southeast to southwest */
85 #define ANGLE_SWtoNW 0x00080000L /* southwest to northwest */
86 #define ANGLE_NWtoNE 0x00100000L /* northwest to northeast */
87 
88 /* 45 degree angle side-to-near-corner lines */
89 #define SHARP_NtoNE 0x00200000L /* north to northeast */
90 #define SHARP_EtoNE 0x00400000L /* east to northeast */
91 #define SHARP_EtoSE 0x00800000L /* east to southeast */
92 #define SHARP_StoSE 0x01000000L /* south to southeast */
93 #define SHARP_StoSW 0x02000000L /* south to southwest */
94 #define SHARP_WtoSW 0x04000000L /* west to southwest */
95 #define SHARP_WtoNW 0x08000000L /* west to northwest */
96 #define SHARP_NtoNW 0x10000000L /* north to northwest */
97 
98 /* directions the cell can be reached from (point to previous cell) */
99 #define FROM_NOWHERE 0
100 #define FROM_NORTH 1
101 #define FROM_NORTHEAST 2
102 #define FROM_EAST 3
103 #define FROM_SOUTHEAST 4
104 #define FROM_SOUTH 5
105 #define FROM_SOUTHWEST 6
106 #define FROM_WEST 7
107 #define FROM_NORTHWEST 8
108 #define FROM_OTHERSIDE 9
109 
110 
111 #endif // __AR_CELL_H