You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.7 KiB

4 years ago
18 years ago
14 years ago
4 years ago
14 years ago
14 years ago
4 years ago
14 years ago
18 years ago
14 years ago
14 years ago
14 years ago
14 years ago
18 years ago
4 years ago
14 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 1992-2022 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. #ifndef PAD_SHAPES_H_
  24. #define PAD_SHAPES_H_
  25. #include <string>
  26. /**
  27. * The set of pad shapes, used with PAD::{Set,Get}Shape()
  28. *
  29. * --> DO NOT REORDER, legacy_plugin is dependent on the integer values <--
  30. */
  31. enum class PAD_SHAPE : int
  32. {
  33. CIRCLE,
  34. RECTANGLE, // do not use just RECT: it collides in a header on MSYS2
  35. OVAL,
  36. TRAPEZOID,
  37. ROUNDRECT,
  38. // Rectangle with a chamfered corner ( and with rounded other corners).
  39. CHAMFERED_RECT,
  40. CUSTOM // A shape defined by user, using a set of basic shapes
  41. // (thick segments, circles, arcs, polygons).
  42. };
  43. static inline std::string PAD_SHAPE_T_asString( PAD_SHAPE a )
  44. {
  45. switch( a )
  46. {
  47. case PAD_SHAPE::CIRCLE: return "PAD_SHAPE::CIRCLE";
  48. case PAD_SHAPE::RECTANGLE: return "PAD_SHAPE::RECT";
  49. case PAD_SHAPE::OVAL: return "PAD_SHAPE::OVAL";
  50. case PAD_SHAPE::TRAPEZOID: return "PAD_SHAPE::TRAPEZOID";
  51. case PAD_SHAPE::ROUNDRECT: return "PAD_SHAPE::ROUNDRECT";
  52. case PAD_SHAPE::CHAMFERED_RECT: return "PAD_SHAPE::CHAMFERED_RECT";
  53. case PAD_SHAPE::CUSTOM: return "PAD_SHAPE::CUSTOM";
  54. }
  55. return ""; // Just to quiet GCC.
  56. };
  57. /**
  58. * The set of pad drill shapes, used with PAD::{Set,Get}DrillShape()
  59. */
  60. enum PAD_DRILL_SHAPE_T
  61. {
  62. PAD_DRILL_SHAPE_CIRCLE,
  63. PAD_DRILL_SHAPE_OBLONG,
  64. };
  65. /**
  66. * The set of pad shapes, used with PAD::{Set,Get}Attribute().
  67. *
  68. * The double name is for convenience of Python devs
  69. */
  70. enum class PAD_ATTRIB
  71. {
  72. PTH, ///< Plated through hole pad
  73. SMD, ///< Smd pad, appears on the solder paste layer (default)
  74. CONN, ///< Like smd, does not appear on the solder paste layer (default)
  75. ///< note also has a special attribute in Gerber X files
  76. ///< Used for edgecard connectors for instance
  77. NPTH, ///< like PAD_PTH, but not plated
  78. ///< mechanical use only, no connection allowed
  79. };
  80. /**
  81. * The set of pad properties used in Gerber files (Draw files, and P&P files)
  82. * to define some properties in fabrication or test files.
  83. */
  84. enum class PAD_PROP
  85. {
  86. NONE, ///< no special fabrication property
  87. BGA, ///< Smd pad, used in BGA footprints
  88. FIDUCIAL_GLBL, ///< a fiducial (usually a smd) for the full board
  89. FIDUCIAL_LOCAL, ///< a fiducial (usually a smd) local to the parent footprint
  90. TESTPOINT, ///< a test point pad
  91. HEATSINK, ///< a pad used as heat sink, usually in SMD footprints
  92. CASTELLATED ///< a pad with a castellated through hole
  93. };
  94. #endif // PAD_SHAPES_H_