2008-10-23 10:26:06 +00:00
|
|
|
/******************************************************/
|
2012-02-06 05:44:19 +00:00
|
|
|
/* class ZONE_SETTINGS used to handle zones parameters */
|
2008-10-23 10:26:06 +00:00
|
|
|
/******************************************************/
|
|
|
|
|
|
|
|
#ifndef WX_PRECOMP
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wx/wx.h>
|
2008-10-23 10:26:06 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* For compilers that support precompilation:
|
|
|
|
*/
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <wx/wxprec.h>
|
2008-10-23 10:26:06 +00:00
|
|
|
|
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
2008-10-23 10:26:06 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <pcbnew.h>
|
|
|
|
#include <zones.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <class_zone.h>
|
2008-10-23 10:26:06 +00:00
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_SETTINGS::ZONE_SETTINGS()
|
2008-10-23 10:26:06 +00:00
|
|
|
{
|
2012-01-29 19:29:19 +00:00
|
|
|
m_ZonePriority = 0;
|
2012-02-06 05:44:19 +00:00
|
|
|
m_FillMode = 0; // Mode for filling zone : 1 use segments, 0 use polygons
|
|
|
|
m_ZoneClearance = 200; // Clearance value
|
|
|
|
m_ZoneMinThickness = 100; // Min thickness value in filled areas
|
|
|
|
m_NetcodeSelection = 0; // Net code selection for the current zone
|
|
|
|
m_CurrentZone_Layer = 0; // Layer used to create the current zone
|
|
|
|
m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE; // Option to show the zone area (outlines only, short hatches or full hatches
|
|
|
|
|
|
|
|
m_ArcToSegmentsCount = ARC_APPROX_SEGMENTS_COUNT_LOW_DEF; // Option to select number of segments to approximate a circle
|
|
|
|
// ARC_APPROX_SEGMENTS_COUNT_LOW_DEF
|
|
|
|
// or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF segments
|
|
|
|
|
2011-11-30 21:15:56 +00:00
|
|
|
m_ThermalReliefGap = 200; // tickness of the gap in thermal reliefs
|
|
|
|
m_ThermalReliefCopperBridge = 200; // tickness of the copper bridge in thermal reliefs
|
2008-10-23 10:26:06 +00:00
|
|
|
|
2012-02-24 23:23:46 +00:00
|
|
|
m_PadConnection = THERMAL_PAD; // How pads are covered by copper in zone
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
m_Zone_45_Only = false;
|
2011-02-21 19:43:59 +00:00
|
|
|
|
|
|
|
cornerSmoothingType = SMOOTHING_NONE;
|
|
|
|
cornerRadius = 0;
|
2008-10-23 10:26:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
ZONE_SETTINGS& ZONE_SETTINGS::operator << ( const ZONE_CONTAINER& aSource )
|
2008-10-23 10:26:06 +00:00
|
|
|
{
|
2012-01-29 19:29:19 +00:00
|
|
|
m_ZonePriority = aSource.GetPriority();
|
|
|
|
m_FillMode = aSource.m_FillMode;
|
2008-12-12 21:30:07 +00:00
|
|
|
m_ZoneClearance = aSource.m_ZoneClearance;
|
|
|
|
m_ZoneMinThickness = aSource.m_ZoneMinThickness;
|
|
|
|
m_NetcodeSelection = aSource.GetNet();
|
|
|
|
m_CurrentZone_Layer = aSource.GetLayer();
|
|
|
|
m_Zone_HatchingStyle = aSource.GetHatchStyle();
|
|
|
|
m_ArcToSegmentsCount = aSource.m_ArcToSegmentsCount;
|
2011-11-30 21:15:56 +00:00
|
|
|
m_ThermalReliefGap = aSource.m_ThermalReliefGap;
|
|
|
|
m_ThermalReliefCopperBridge = aSource.m_ThermalReliefCopperBridge;
|
2012-02-24 23:23:46 +00:00
|
|
|
m_PadConnection = aSource.GetPadConnection();
|
2011-02-21 19:43:59 +00:00
|
|
|
cornerSmoothingType = aSource.GetCornerSmoothingType();
|
|
|
|
cornerRadius = aSource.GetCornerRadius();
|
2012-02-06 05:44:19 +00:00
|
|
|
|
|
|
|
return *this;
|
2008-10-23 10:26:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-06 05:44:19 +00:00
|
|
|
void ZONE_SETTINGS::ExportSetting( ZONE_CONTAINER& aTarget, bool aFullExport ) const
|
2008-10-23 10:26:06 +00:00
|
|
|
{
|
2008-12-03 10:32:53 +00:00
|
|
|
aTarget.m_FillMode = m_FillMode;
|
2008-12-12 21:30:07 +00:00
|
|
|
aTarget.m_ZoneClearance = m_ZoneClearance;
|
2008-11-22 20:50:30 +00:00
|
|
|
aTarget.m_ZoneMinThickness = m_ZoneMinThickness;
|
|
|
|
aTarget.m_Poly->SetHatch( m_Zone_HatchingStyle );
|
|
|
|
aTarget.m_ArcToSegmentsCount = m_ArcToSegmentsCount;
|
2011-11-30 21:15:56 +00:00
|
|
|
aTarget.m_ThermalReliefGap = m_ThermalReliefGap;
|
|
|
|
aTarget.m_ThermalReliefCopperBridge = m_ThermalReliefCopperBridge;
|
2012-02-24 23:23:46 +00:00
|
|
|
aTarget.SetPadConnection( m_PadConnection );
|
2011-02-21 19:43:59 +00:00
|
|
|
aTarget.SetCornerSmoothingType( cornerSmoothingType );
|
|
|
|
aTarget.SetCornerRadius( cornerRadius );
|
2012-02-06 05:44:19 +00:00
|
|
|
|
2008-12-12 21:30:07 +00:00
|
|
|
if( aFullExport )
|
2008-12-03 10:32:53 +00:00
|
|
|
{
|
2012-01-29 19:29:19 +00:00
|
|
|
aTarget.SetPriority( m_ZonePriority );
|
2008-12-03 10:32:53 +00:00
|
|
|
aTarget.SetNet( m_NetcodeSelection );
|
|
|
|
aTarget.SetLayer( m_CurrentZone_Layer );
|
|
|
|
}
|
2008-10-23 10:26:06 +00:00
|
|
|
}
|