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.

110 lines
4.1 KiB

  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2007-2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
  5. * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file pcbnew.h
  26. */
  27. #ifndef PCBNEW_H
  28. #define PCBNEW_H
  29. #include <fctsys.h> // wxWidgets include.
  30. #include <base_struct.h> // IS_DRAGGED and IN_EDIT definitions.
  31. #include <dlist.h>
  32. #include <convert_to_biu.h> // to define Mils2iu() conversion function
  33. #include <layers_id_colors_and_visibility.h>
  34. // Arcs are approximated by segments: define the number of segments per 360 deg (KiCad uses 0.1
  35. // deg approximation). Be aware 3600 / ARC_APPROX_SEGMENTS_COUNT_LOW_DEF is an integer.
  36. #define ARC_APPROX_SEGMENTS_COUNT_LOW_DEF 16
  37. #define ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF 32
  38. // The new absolute-error-based algorithm uses the stored segment count as a hint on whether
  39. // to use ARC_HIGH_DEF or ARC_LOW_DEF. This defines the crossover point.
  40. #define SEGMENT_COUNT_CROSSOVER 24
  41. /* Flag used in locate functions. The locate ref point is the on grid cursor or the off
  42. * grid mouse cursor. */
  43. #define CURSEUR_ON_GRILLE (0 << 0)
  44. #define CURSEUR_OFF_GRILLE (1 << 0)
  45. #define IGNORE_LOCKED (1 << 1) ///< if module is locked, do not select for single module operation
  46. #define MATCH_LAYER (1 << 2) ///< if module not on current layer, do not select
  47. #define VISIBLE_ONLY (1 << 3) ///< if module not on a visible layer, do not select
  48. /// Flag used in locate routines (from which endpoint work)
  49. enum ENDPOINT_T {
  50. ENDPOINT_START = 0,
  51. ENDPOINT_END = 1
  52. };
  53. #define DIM_ANCRE_MODULE 3 // Anchor size (footprint center)
  54. // These are only here for algorithmic safety, not to tell the user what to do
  55. #define TEXTS_MIN_SIZE Mils2iu( 1 ) ///< Minimum text size in internal units (1 mil)
  56. #define TEXTS_MAX_SIZE Mils2iu( 10000 ) ///< Maximum text size in internal units (10 inches)
  57. #define TEXTS_MAX_WIDTH Mils2iu( 10000 ) ///< Maximum text width in internal units (10 inches)
  58. // Flag to force the SKETCH mode to display items (.m_Flags member)
  59. #define FORCE_SKETCH ( IS_DRAGGED | IN_EDIT )
  60. /* Name of the document footprint list
  61. * usually located in share/modules/footprints_doc
  62. * this is of the responsibility to users to create this file
  63. * if they want to have a list of footprints
  64. * default is "footprints_doc/footprints.pdf"
  65. */
  66. extern wxString g_DocModulesFileName;
  67. // variables
  68. extern bool g_Raccord_45_Auto;
  69. extern bool g_Alternate_Track_Posture;
  70. // Layer pair for auto routing and switch layers by hotkey
  71. extern PCB_LAYER_ID g_Route_Layer_TOP;
  72. extern PCB_LAYER_ID g_Route_Layer_BOTTOM;
  73. extern wxPoint g_Offset_Module; // Offset trace when moving footprint.
  74. /// List of segments of the trace currently being drawn.
  75. class TRACK;
  76. extern DLIST<TRACK> g_CurrentTrackList;
  77. #define g_CurrentTrackSegment g_CurrentTrackList.GetLast() ///< most recently created segment
  78. #define g_FirstTrackSegment g_CurrentTrackList.GetFirst() ///< first segment created
  79. /**
  80. * Helper function PythonPluginsReloadBase
  81. * Reload Python plugins if they are newer than
  82. * the already loaded, and load new plugins if any
  83. * It calls the LoadPlugins(bundlepath) Python method
  84. * see kicadplugins.i
  85. */
  86. void PythonPluginsReloadBase();
  87. #endif // PCBNEW_H