2014-10-23 17:53:38 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2018-02-18 09:09:13 +00:00
|
|
|
* Copyright (C) 2008-2018 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
|
|
|
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
2014-10-23 17:53:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
/**
|
|
|
|
* @file class_zone_settings.h
|
|
|
|
* @brief Class ZONE_SETTINGS used to handle zones parameters in dialogs.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZONE_SETTINGS_H_
|
|
|
|
#define ZONE_SETTINGS_H_
|
|
|
|
|
2018-05-25 14:56:04 +00:00
|
|
|
#include <zones.h>
|
|
|
|
#include <wx/dataview.h>
|
2012-02-24 23:23:46 +00:00
|
|
|
|
2017-12-04 18:06:47 +00:00
|
|
|
enum ZONE_FILL_MODE
|
|
|
|
{
|
2018-02-18 09:09:13 +00:00
|
|
|
ZFM_POLYGONS = 0, // fill zone with polygons
|
|
|
|
ZFM_SEGMENTS = 1, // fill zone with segments (legacy)
|
|
|
|
ZFM_HATCH_PATTERN = 2 // fill zone using a grid pattern
|
2017-12-04 18:06:47 +00:00
|
|
|
};
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class ZONE_SETTINGS
|
|
|
|
* handles zones parameters.
|
2012-07-13 18:55:29 +00:00
|
|
|
* Because a zone can be on copper or non copper layers, and can be also
|
|
|
|
* a keepout area, some parameters are irrelevant depending on the type of zone
|
2012-02-06 05:44:19 +00:00
|
|
|
*/
|
|
|
|
class ZONE_SETTINGS
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum {
|
2018-07-19 20:08:31 +00:00
|
|
|
SMOOTHING_UNDEFINED = -1,
|
|
|
|
SMOOTHING_NONE = 0,
|
2012-02-06 05:44:19 +00:00
|
|
|
SMOOTHING_CHAMFER,
|
|
|
|
SMOOTHING_FILLET,
|
|
|
|
SMOOTHING_LAST
|
|
|
|
};
|
|
|
|
|
2017-12-04 18:06:47 +00:00
|
|
|
ZONE_FILL_MODE m_FillMode;
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
int m_ZonePriority; ///< Priority (0 ... N) of the zone
|
|
|
|
|
|
|
|
int m_ZoneClearance; ///< Clearance value
|
|
|
|
int m_ZoneMinThickness; ///< Min thickness value in filled areas
|
2018-02-18 09:09:13 +00:00
|
|
|
int m_HatchFillTypeThickness; ///< Grid style shape: thickness of lines (if 0 -> solid shape)
|
|
|
|
int m_HatchFillTypeGap; ///< Grid style shape: clearance between lines (0 -> solid shape)
|
|
|
|
double m_HatchFillTypeOrientation; ///< Grid style shape: orientation of grid lines in degrees
|
|
|
|
int m_HatchFillTypeSmoothingLevel; ///< Grid pattern smoothing type, similar to corner smoothing type
|
|
|
|
///< 0 = no smoothing, 1 = fillet, >= 2 = arc
|
|
|
|
double m_HatchFillTypeSmoothingValue; ///< Grid pattern chamfer distance/fillet value
|
|
|
|
///< this is the ratio between the gap and the chamfer size
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
int m_NetcodeSelection; ///< Net code selection for the current zone
|
2014-06-24 16:17:18 +00:00
|
|
|
|
2018-01-30 12:55:02 +00:00
|
|
|
LSET m_Layers;
|
|
|
|
|
2017-03-13 03:19:33 +00:00
|
|
|
PCB_LAYER_ID m_CurrentZone_Layer; ///< Layer used to create the current zone
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
/// Option to show the zone area (outlines only, short hatches or full hatches
|
|
|
|
int m_Zone_HatchingStyle;
|
|
|
|
|
|
|
|
/// Option to select number of segments to approximate a circle 16 or 32 segments.
|
|
|
|
int m_ArcToSegmentsCount;
|
|
|
|
|
|
|
|
long m_ThermalReliefGap; ///< thickness of the gap in thermal reliefs
|
|
|
|
long m_ThermalReliefCopperBridge; ///< thickness of the copper bridge in thermal reliefs
|
|
|
|
|
|
|
|
bool m_Zone_45_Only;
|
|
|
|
|
|
|
|
private:
|
2012-07-13 18:55:29 +00:00
|
|
|
int m_cornerSmoothingType; ///< Corner smoothing type
|
|
|
|
unsigned int m_cornerRadius; ///< Corner chamfer distance / fillet radius
|
2012-02-24 23:23:46 +00:00
|
|
|
ZoneConnection m_PadConnection;
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
/* A zone outline can be a keepout zone.
|
|
|
|
* It will be never filled, and DRC should test for pads, tracks and vias
|
|
|
|
*/
|
|
|
|
bool m_isKeepout;
|
|
|
|
|
|
|
|
/* For keepout zones only:
|
|
|
|
* what is not allowed inside the keepout ( pads, tracks and vias )
|
|
|
|
*/
|
2012-07-14 16:27:25 +00:00
|
|
|
bool m_keepoutDoNotAllowCopperPour;
|
2012-07-13 18:55:29 +00:00
|
|
|
bool m_keepoutDoNotAllowVias;
|
|
|
|
bool m_keepoutDoNotAllowTracks;
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
public:
|
|
|
|
ZONE_SETTINGS();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* operator << ( const ZONE_CONTAINER& )
|
|
|
|
* was Function ImportSetting
|
|
|
|
* copies settings from a given zone into this object.
|
|
|
|
* @param aSource: the given zone
|
|
|
|
*/
|
|
|
|
ZONE_SETTINGS& operator << ( const ZONE_CONTAINER& aSource );
|
|
|
|
|
2018-05-25 14:56:04 +00:00
|
|
|
/**
|
|
|
|
* A helper routine for the various zone dialogs (copper, non-copper, keepout).
|
|
|
|
* @param aShowCopper indicates whether copper or technical layers should be shown
|
|
|
|
*/
|
|
|
|
void SetupLayersList( wxDataViewListCtrl* aList, PCB_BASE_FRAME* aFrame, bool aShowCopper );
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
/**
|
|
|
|
* Function ExportSetting
|
|
|
|
* copy settings to a given zone
|
|
|
|
* @param aTarget: the given zone
|
|
|
|
* @param aFullExport: if false: some parameters are NOT exported
|
|
|
|
* because they must not be exported when export settings from a zone to others zones
|
|
|
|
* Currently:
|
|
|
|
* m_NetcodeSelection
|
|
|
|
*/
|
|
|
|
void ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport = true ) const;
|
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
void SetCornerSmoothingType( int aType) { m_cornerSmoothingType = aType; }
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
int GetCornerSmoothingType() const { return m_cornerSmoothingType; }
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2015-05-15 12:49:11 +00:00
|
|
|
void SetCornerRadius( int aRadius );
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
unsigned int GetCornerRadius() const { return m_cornerRadius; }
|
2012-02-24 23:23:46 +00:00
|
|
|
|
|
|
|
ZoneConnection GetPadConnection() const { return m_PadConnection; }
|
|
|
|
void SetPadConnection( ZoneConnection aPadConnection ) { m_PadConnection = aPadConnection; }
|
|
|
|
|
2012-07-13 18:55:29 +00:00
|
|
|
/**
|
|
|
|
* Accessors to parameters used in Keepout zones:
|
|
|
|
*/
|
|
|
|
const bool GetIsKeepout() const { return m_isKeepout; }
|
2012-07-14 16:27:25 +00:00
|
|
|
const bool GetDoNotAllowCopperPour() const { return m_keepoutDoNotAllowCopperPour; }
|
2012-07-13 18:55:29 +00:00
|
|
|
const bool GetDoNotAllowVias() const { return m_keepoutDoNotAllowVias; }
|
|
|
|
const bool GetDoNotAllowTracks() const { return m_keepoutDoNotAllowTracks; }
|
|
|
|
|
|
|
|
void SetIsKeepout( bool aEnable ) { m_isKeepout = aEnable; }
|
2012-07-14 16:27:25 +00:00
|
|
|
void SetDoNotAllowCopperPour( bool aEnable ) { m_keepoutDoNotAllowCopperPour = aEnable; }
|
2012-07-13 18:55:29 +00:00
|
|
|
void SetDoNotAllowVias( bool aEnable ) { m_keepoutDoNotAllowVias = aEnable; }
|
|
|
|
void SetDoNotAllowTracks( bool aEnable ) { m_keepoutDoNotAllowTracks = aEnable; }
|
2012-02-06 05:44:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ZONE_SETTINGS_H_
|