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.

129 lines
4.2 KiB

14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
14 years ago
  1. /**
  2. * @file class_zone_settings.h
  3. * @brief Class ZONE_SETTINGS used to handle zones parameters in dialogs.
  4. */
  5. #ifndef ZONE_SETTINGS_H_
  6. #define ZONE_SETTINGS_H_
  7. #include "zones.h"
  8. class ZONE_CONTAINER;
  9. #define MAX_ZONE_CORNER_RADIUS_MILS 400
  10. /**
  11. * Class ZONE_SETTINGS
  12. * handles zones parameters.
  13. * Because a zone can be on copper or non copper layers, and can be also
  14. * a keepout area, some parameters are irrelevant depending on the type of zone
  15. */
  16. class ZONE_SETTINGS
  17. {
  18. public:
  19. enum {
  20. SMOOTHING_NONE,
  21. SMOOTHING_CHAMFER,
  22. SMOOTHING_FILLET,
  23. SMOOTHING_LAST
  24. };
  25. /// Mode for filling zone : 1 use segments, 0 use polygons
  26. int m_FillMode;
  27. int m_ZonePriority; ///< Priority (0 ... N) of the zone
  28. int m_ZoneClearance; ///< Clearance value
  29. int m_ZoneMinThickness; ///< Min thickness value in filled areas
  30. int m_NetcodeSelection; ///< Net code selection for the current zone
  31. LAYER_NUM m_CurrentZone_Layer; ///< Layer used to create the current zone
  32. /// Option to show the zone area (outlines only, short hatches or full hatches
  33. int m_Zone_HatchingStyle;
  34. /// Option to select number of segments to approximate a circle 16 or 32 segments.
  35. int m_ArcToSegmentsCount;
  36. long m_ThermalReliefGap; ///< thickness of the gap in thermal reliefs
  37. long m_ThermalReliefCopperBridge; ///< thickness of the copper bridge in thermal reliefs
  38. bool m_Zone_45_Only;
  39. private:
  40. int m_cornerSmoothingType; ///< Corner smoothing type
  41. unsigned int m_cornerRadius; ///< Corner chamfer distance / fillet radius
  42. ZoneConnection m_PadConnection;
  43. /* A zone outline can be a keepout zone.
  44. * It will be never filled, and DRC should test for pads, tracks and vias
  45. */
  46. bool m_isKeepout;
  47. /* For keepout zones only:
  48. * what is not allowed inside the keepout ( pads, tracks and vias )
  49. */
  50. bool m_keepoutDoNotAllowCopperPour;
  51. bool m_keepoutDoNotAllowVias;
  52. bool m_keepoutDoNotAllowTracks;
  53. public:
  54. ZONE_SETTINGS();
  55. /**
  56. * operator << ( const ZONE_CONTAINER& )
  57. * was Function ImportSetting
  58. * copies settings from a given zone into this object.
  59. * @param aSource: the given zone
  60. */
  61. ZONE_SETTINGS& operator << ( const ZONE_CONTAINER& aSource );
  62. /**
  63. * Function ExportSetting
  64. * copy settings to a given zone
  65. * @param aTarget: the given zone
  66. * @param aFullExport: if false: some parameters are NOT exported
  67. * because they must not be exported when export settings from a zone to others zones
  68. * Currently:
  69. * m_NetcodeSelection
  70. */
  71. void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const;
  72. void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; }
  73. int GetCornerSmoothingType() const { return m_cornerSmoothingType; }
  74. void SetCornerRadius( int aRadius )
  75. {
  76. if( aRadius > Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) )
  77. m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS );
  78. else if( aRadius < 0 )
  79. m_cornerRadius = 0;
  80. else
  81. m_cornerRadius = aRadius;
  82. };
  83. unsigned int GetCornerRadius() const { return m_cornerRadius; }
  84. ZoneConnection GetPadConnection() const { return m_PadConnection; }
  85. void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
  86. /**
  87. * Accessors to parameters used in Keepout zones:
  88. */
  89. const bool GetIsKeepout() const { return m_isKeepout; }
  90. const bool GetDoNotAllowCopperPour() const { return m_keepoutDoNotAllowCopperPour; }
  91. const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
  92. const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
  93. void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
  94. void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
  95. void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
  96. void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
  97. };
  98. #endif // ZONE_SETTINGS_H_