本文整理汇总了C++中ZONE_SETTINGS::SetCornerSmoothingType方法的典型用法代码示例。如果您正苦于以下问题:C++ ZONE_SETTINGS::SetCornerSmoothingType方法的具体用法?C++ ZONE_SETTINGS::SetCornerSmoothingType怎么用?C++ ZONE_SETTINGS::SetCornerSmoothingType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZONE_SETTINGS
的用法示例。
在下文中一共展示了ZONE_SETTINGS::SetCornerSmoothingType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransferDataFromWindow
bool DIALOG_NON_COPPER_ZONES_EDITOR::TransferDataFromWindow()
{
m_settings.SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
m_settings.SetCornerRadius( m_settings.GetCornerSmoothingType() == ZONE_SETTINGS::SMOOTHING_NONE
? 0 : m_cornerRadius.GetValue() );
if( !m_gridStyleRotation.Validate( -1800, 1800 ) )
return false;
m_settings.m_ZoneMinThickness = m_minWidth.GetValue();
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::NO_HATCH; break;
case 1: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_EDGE; break;
case 2: m_settings.m_Zone_HatchingStyle = ZONE_CONTAINER::DIAGONAL_FULL; break;
}
if( m_GridStyleCtrl->GetSelection() > 0 )
m_settings.m_FillMode = ZFM_HATCH_PATTERN;
else
m_settings.m_FillMode = ZFM_POLYGONS;
if( m_settings.m_FillMode == ZFM_HATCH_PATTERN )
{
int minThickness = m_minWidth.GetValue();
if( !m_gridStyleThickness.Validate( minThickness, INT_MAX ) )
return false;
if( !m_gridStyleGap.Validate( minThickness, INT_MAX ) )
return false;
}
m_settings.m_HatchFillTypeOrientation = m_gridStyleRotation.GetValue()/10.0; // value is returned in deci-degree
m_settings.m_HatchFillTypeThickness = m_gridStyleThickness.GetValue();
m_settings.m_HatchFillTypeGap = m_gridStyleGap.GetValue();
m_settings.m_HatchFillTypeSmoothingLevel = m_spinCtrlSmoothLevel->GetValue();
m_settings.m_HatchFillTypeSmoothingValue = m_spinCtrlSmoothValue->GetValue();
wxConfigBase* cfg = Kiface().KifaceSettings();
wxASSERT( cfg );
cfg->Write( ZONE_NET_OUTLINES_STYLE_KEY, (long) m_settings.m_Zone_HatchingStyle );
m_settings.m_Zone_45_Only = m_ConstrainOpt->GetValue();
// Get the layer selection for this zone
int layer = -1;
for( int ii = 0; ii < m_layers->GetItemCount(); ++ii )
{
if( m_layers->GetToggleValue( (unsigned) ii, 0 ) )
{
layer = ii;
break;
}
}
if( layer < 0 )
{
DisplayError( this, _( "No layer selected." ) );
return false;
}
*m_ptr = m_settings;
return true;
}
示例2: AcceptOptions
bool DIALOG_COPPER_ZONE::AcceptOptions( bool aPromptForErrors, bool aUseExportableSetupOnly )
{
switch( m_PadInZoneOpt->GetSelection() )
{
case 3:
// Pads are not covered
m_settings.SetPadConnection( PAD_NOT_IN_ZONE );
break;
case 2:
// Use thermal relief for THT pads
m_settings.SetPadConnection( THT_THERMAL );
break;
case 1:
// Use thermal relief for pads
m_settings.SetPadConnection( THERMAL_PAD );
break;
case 0:
// pads are covered by copper
m_settings.SetPadConnection( PAD_IN_ZONE );
break;
}
switch( m_OutlineAppearanceCtrl->GetSelection() )
{
case 0:
m_settings.m_Zone_HatchingStyle = CPolyLine::NO_HATCH;
break;
case 1:
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_EDGE;
break;
case 2:
m_settings.m_Zone_HatchingStyle = CPolyLine::DIAGONAL_FULL;
break;
}
m_settings.m_ArcToSegmentsCount = m_ArcApproximationOpt->GetSelection() == 1 ?
ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF :
ARC_APPROX_SEGMENTS_COUNT_LOW_DEF;
if( m_Config )
{
m_Config->Write( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) m_settings.m_Zone_HatchingStyle );
wxString filter = m_DoNotShowNetNameFilter->GetValue();
m_Config->Write( ZONE_NET_FILTER_STRING_KEY, filter );
}
m_netNameShowFilter = m_ShowNetNameFilter->GetValue();
m_settings.m_FillMode = (m_FillModeCtrl->GetSelection() == 0) ? 0 : 1;
wxString txtvalue = m_ZoneClearanceCtrl->GetValue();
m_settings.m_ZoneClearance = ReturnValueFromString( g_UserUnit, txtvalue );
// Test if this is a reasonable value for this parameter
// A too large value can hang Pcbnew
#define CLEARANCE_MAX_VALUE ZONE_CLEARANCE_MAX_VALUE_MIL*IU_PER_MILS
if( m_settings.m_ZoneClearance > CLEARANCE_MAX_VALUE )
{
wxString msg;
msg.Printf( _( "Clearance must be smaller than %f\" / %f mm." ),
ZONE_CLEARANCE_MAX_VALUE_MIL / 1000.0, ZONE_CLEARANCE_MAX_VALUE_MIL * 0.0254 );
DisplayError( this, msg );
return false;
}
txtvalue = m_ZoneMinThicknessCtrl->GetValue();
m_settings.m_ZoneMinThickness = ReturnValueFromString( g_UserUnit, txtvalue );
if( m_settings.m_ZoneMinThickness < (ZONE_THICKNESS_MIN_VALUE_MIL*IU_PER_MILS) )
{
wxString msg;
msg.Printf( _( "Minimum width must be larger than %f\" / %f mm." ),
ZONE_THICKNESS_MIN_VALUE_MIL / 1000.0, ZONE_THICKNESS_MIN_VALUE_MIL * 0.0254 );
DisplayError( this, msg );
return false;
}
m_settings.SetCornerSmoothingType( m_cornerSmoothingChoice->GetSelection() );
txtvalue = m_cornerSmoothingCtrl->GetValue();
m_settings.SetCornerRadius( ReturnValueFromString( g_UserUnit, txtvalue ) );
m_settings.m_ZonePriority = m_PriorityLevelCtrl->GetValue();
if( m_OrientEdgesOpt->GetSelection() == 0 )
m_settings.m_Zone_45_Only = false;
else
m_settings.m_Zone_45_Only = true;
m_settings.m_ThermalReliefGap = ReturnValueFromTextCtrl( *m_AntipadSizeValue );
m_settings.m_ThermalReliefCopperBridge = ReturnValueFromTextCtrl( *m_CopperWidthValue );
if( m_Config )
{
ConfigBaseWriteDouble( m_Config, ZONE_CLEARANCE_WIDTH_STRING_KEY,
(double) m_settings.m_ZoneClearance / IU_PER_MILS );
//.........这里部分代码省略.........
示例3: Begin_Zone
int PCB_EDIT_FRAME::Begin_Zone( wxDC* DC )
{
ZONE_SETTINGS zoneInfo = GetZoneSettings();
// verify if s_CurrentZone exists (could be deleted since last selection) :
int ii;
for( ii = 0; ii < GetBoard()->GetAreaCount(); ii++ )
{
if( s_CurrentZone == GetBoard()->GetArea( ii ) )
break;
}
if( ii >= GetBoard()->GetAreaCount() ) // Not found: could be deleted since last selection
{
s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL;
}
ZONE_CONTAINER* zone = GetBoard()->m_CurrentZoneContour;
// Verify if a new zone is allowed on this layer:
if( zone == NULL )
{
if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT && !IsCopperLayer( GetActiveLayer() ) )
{
DisplayError( this,
_( "Error: a keepout area is allowed only on copper layers" ) );
return 0;
}
}
// If no zone contour in progress, a new zone is being created,
if( zone == NULL )
{
zone = GetBoard()->m_CurrentZoneContour = new ZONE_CONTAINER( GetBoard() );
zone->SetFlags( IS_NEW );
zone->SetTimeStamp( GetNewTimeStamp() );
}
if( zone->GetNumCorners() == 0 ) // Start a new contour: init zone params (net, layer ...)
{
if( !s_CurrentZone ) // A new outline is created, from scratch
{
ZONE_EDIT_T edited;
// Init zone params to reasonable values
zone->SetLayer( GetActiveLayer() );
// Prompt user for parameters:
m_canvas->SetIgnoreMouseEvents( true );
if( zone->IsOnCopperLayer() )
{
// Put a zone on a copper layer
if( GetBoard()->GetHighLightNetCode() > 0 )
{
zoneInfo.m_NetcodeSelection = GetBoard()->GetHighLightNetCode();
zone->SetNetCode( zoneInfo.m_NetcodeSelection );
}
double tmp = ZONE_THERMAL_RELIEF_GAP_MIL;
wxConfigBase* cfg = Kiface().KifaceSettings();
cfg->Read( ZONE_THERMAL_RELIEF_GAP_STRING_KEY, &tmp );
zoneInfo.m_ThermalReliefGap = KiROUND( tmp * IU_PER_MILS);
tmp = ZONE_THERMAL_RELIEF_COPPER_WIDTH_MIL;
cfg->Read( ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY, &tmp );
zoneInfo.m_ThermalReliefCopperBridge = KiROUND( tmp * IU_PER_MILS );
tmp = ZONE_CLEARANCE_MIL;
cfg->Read( ZONE_CLEARANCE_WIDTH_STRING_KEY, &tmp );
zoneInfo.m_ZoneClearance = KiROUND( tmp * IU_PER_MILS );
tmp = ZONE_THICKNESS_MIL;
cfg->Read( ZONE_MIN_THICKNESS_WIDTH_STRING_KEY, &tmp );
zoneInfo.m_ZoneMinThickness = KiROUND( tmp * IU_PER_MILS );
zoneInfo.m_CurrentZone_Layer = zone->GetLayer();
if( GetToolId() == ID_PCB_KEEPOUT_AREA_BUTT )
{
zoneInfo.SetIsKeepout( true );
// Netcode, netname and some other settings are irrelevant,
// so ensure they are cleared
zone->SetNetCode( NETINFO_LIST::UNCONNECTED );
zoneInfo.SetCornerSmoothingType( ZONE_SETTINGS::SMOOTHING_NONE );
zoneInfo.SetCornerRadius( 0 );
edited = InvokeKeepoutAreaEditor( this, &zoneInfo );
}
else
{
zoneInfo.SetIsKeepout( false );
edited = InvokeCopperZonesEditor( this, &zoneInfo );
}
}
else // Put a zone on a non copper layer (technical layer)
{
zoneInfo.SetIsKeepout( false );
//.........这里部分代码省略.........