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