1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.TXT for contributors.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you may find one here:
18  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19  * or you may search the http://www.gnu.org website for the version 2 license,
20  * or you may write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
22  */
23 
24 #ifndef PAD_SHAPES_H_
25 #define PAD_SHAPES_H_
26 
27 #include <string>
28 
29 /**
30  * The set of pad shapes, used with PAD::{Set,Get}Shape()
31  * DO NOT REORDER, legacy_plugin is dependent on the integer values
32  */
33 enum class PAD_SHAPE : int
34 {
35     CIRCLE,
36     RECT,
37     OVAL,
38     TRAPEZOID,
39     ROUNDRECT,
40 
41     // Rectangle with a chamfered corner ( and with rounded other corners).
42     CHAMFERED_RECT,
43     CUSTOM            // A shape defined by user, using a set of basic shapes
44                       // (thick segments, circles, arcs, polygons.
45 };
46 
PAD_SHAPE_T_asString(PAD_SHAPE a)47 static inline std::string PAD_SHAPE_T_asString( PAD_SHAPE a )
48 {
49     switch( a )
50     {
51     case PAD_SHAPE::CIRCLE:         return "PAD_SHAPE::CIRCLE";
52     case PAD_SHAPE::RECT:           return "PAD_SHAPE::RECT";
53     case PAD_SHAPE::OVAL:           return "PAD_SHAPE::OVAL";
54     case PAD_SHAPE::TRAPEZOID:      return "PAD_SHAPE::TRAPEZOID";
55     case PAD_SHAPE::ROUNDRECT:      return "PAD_SHAPE::ROUNDRECT";
56     case PAD_SHAPE::CHAMFERED_RECT: return "PAD_SHAPE::CHAMFERED_RECT";
57     case PAD_SHAPE::CUSTOM:         return "PAD_SHAPE::CUSTOM";
58     }
59 
60     return "";  // Just to quiet GCC.
61 };
62 
63 
64 /**
65  * The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
66  */
67 enum PAD_DRILL_SHAPE_T
68 {
69     PAD_DRILL_SHAPE_CIRCLE,
70     PAD_DRILL_SHAPE_OBLONG,
71 };
72 
73 
74 /**
75  * The set of pad shapes, used with PAD::{Set,Get}Attribute().
76  *
77  * The double name is for convenience of Python devs
78  */
79 enum class PAD_ATTRIB
80 {
81     PTH,     ///< Plated through hole pad
82     SMD,     ///< Smd pad, appears on the solder paste layer (default)
83     CONN,    ///< Like smd, does not appear on the solder paste layer (default)
84                         ///< note also has a special attribute in Gerber X files
85                         ///< Used for edgecard connectors for instance
86     NPTH,    ///< like PAD_PTH, but not plated
87                         ///< mechanical use only, no connection allowed
88 };
89 
90 
91 /**
92  * Ghe set of pad properties used in Gerber files (Draw files, and P&P files)
93  * to define some properties in fabrication or test files.
94  */
95 enum class PAD_PROP
96 {
97     NONE,                  ///< no special fabrication property
98     BGA,                   ///< Smd pad, used in BGA footprints
99     FIDUCIAL_GLBL,         ///< a fiducial (usually a smd) for the full board
100     FIDUCIAL_LOCAL,        ///< a fiducial (usually a smd) local to the parent footprint
101     TESTPOINT,             ///< a test point pad
102     HEATSINK,              ///< a pad used as heat sink, usually in SMD footprints
103     CASTELLATED            ///< a pad with a castellated through hole
104 };
105 
106 
107 #endif  // PAD_SHAPES_H_
108