mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Some minor fixes to prepare the new zone filling algo (no filled polygon thickness)
This commit is contained in:
parent
072fc4f8cb
commit
b7f4113f96
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -65,6 +65,18 @@ static const wxChar EnableSvgImport[] = wxT( "EnableSvgImport" );
|
|||||||
*/
|
*/
|
||||||
static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
|
static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allow legacy canvas to be shown in GTK3. Legacy canvas is generally pretty
|
||||||
|
* broken, but this avoids code in an ifdef where it could become broken
|
||||||
|
* on other platforms
|
||||||
|
*/
|
||||||
|
static const wxChar AllowLegacyCanvasInGtk3[] = wxT( "AllowLegacyCanvasInGtk3" );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw zones in pcbnew with the stroked outline.
|
||||||
|
*/
|
||||||
|
static const wxChar ForceThickZones[] = wxT( "ForceThickZones" );
|
||||||
|
|
||||||
} // namespace KEYS
|
} // namespace KEYS
|
||||||
|
|
||||||
|
|
||||||
@ -143,7 +155,9 @@ ADVANCED_CFG::ADVANCED_CFG()
|
|||||||
// Init defaults - this is done in case the config doesn't exist,
|
// Init defaults - this is done in case the config doesn't exist,
|
||||||
// then the values will remain as set here.
|
// then the values will remain as set here.
|
||||||
m_enableSvgImport = false;
|
m_enableSvgImport = false;
|
||||||
|
m_allowLegacyCanvasInGtk3 = false;
|
||||||
m_realTimeConnectivity = true;
|
m_realTimeConnectivity = true;
|
||||||
|
m_forceThickOutlinesInZones = true;
|
||||||
|
|
||||||
loadFromConfigFile();
|
loadFromConfigFile();
|
||||||
}
|
}
|
||||||
@ -180,12 +194,30 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
|||||||
configParams.push_back(
|
configParams.push_back(
|
||||||
new PARAM_CFG_BOOL( true, AC_KEYS::EnableSvgImport, &m_enableSvgImport, false ) );
|
new PARAM_CFG_BOOL( true, AC_KEYS::EnableSvgImport, &m_enableSvgImport, false ) );
|
||||||
|
|
||||||
|
configParams.push_back( new PARAM_CFG_BOOL(
|
||||||
|
true, AC_KEYS::AllowLegacyCanvasInGtk3, &m_allowLegacyCanvasInGtk3, false ) );
|
||||||
|
|
||||||
configParams.push_back(
|
configParams.push_back(
|
||||||
new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) );
|
new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity, &m_realTimeConnectivity, false ) );
|
||||||
|
|
||||||
|
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ForceThickZones,
|
||||||
|
&m_forceThickOutlinesInZones, true ) );
|
||||||
|
|
||||||
wxConfigLoadSetups( &aCfg, configParams );
|
wxConfigLoadSetups( &aCfg, configParams );
|
||||||
|
|
||||||
dumpCfg( configParams );
|
dumpCfg( configParams );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool ADVANCED_CFG::AllowLegacyCanvas() const
|
||||||
|
{
|
||||||
|
// default is to allow
|
||||||
|
bool allow = true;
|
||||||
|
|
||||||
|
// on GTK3, check the config
|
||||||
|
#ifdef __WXGTK3__
|
||||||
|
allow = m_allowLegacyCanvasInGtk3;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return allow;
|
||||||
|
}
|
||||||
|
@ -1512,7 +1512,7 @@ int SHAPE_POLY_SET::TotalVertices() const
|
|||||||
|
|
||||||
SHAPE_POLY_SET::POLYGON SHAPE_POLY_SET::ChamferPolygon( unsigned int aDistance, int aIndex )
|
SHAPE_POLY_SET::POLYGON SHAPE_POLY_SET::ChamferPolygon( unsigned int aDistance, int aIndex )
|
||||||
{
|
{
|
||||||
return chamferFilletPolygon( CORNER_MODE::CHAMFERED, aDistance, aIndex );
|
return chamferFilletPolygon( CORNER_MODE::CHAMFERED, aDistance, aIndex, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 2014 KiCad Developers, see CHANGELOG.TXT for contributors.
|
* Copyright (C) 2014 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@ -78,6 +78,27 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool m_realTimeConnectivity;
|
bool m_realTimeConnectivity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Force filled polygons with outlines in zone -- To be removed after testing
|
||||||
|
* default = true (legacy mode)
|
||||||
|
*/
|
||||||
|
bool m_forceThickOutlinesInZones;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper to determine if legacy canvas is allowed (according to platform
|
||||||
|
* and config)
|
||||||
|
* @return true if legacy canvas should be shown
|
||||||
|
*/
|
||||||
|
bool AllowLegacyCanvas() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/*
|
||||||
|
* These settings are private, as there is extra logic provide by helper
|
||||||
|
* functions above.
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool m_allowLegacyCanvasInGtk3;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ADVANCED_CFG();
|
ADVANCED_CFG();
|
||||||
|
|
||||||
|
@ -1187,7 +1187,7 @@ class SHAPE_POLY_SET : public SHAPE
|
|||||||
* @return POLYGON - the chamfered/filleted version of the polygon.
|
* @return POLYGON - the chamfered/filleted version of the polygon.
|
||||||
*/
|
*/
|
||||||
POLYGON chamferFilletPolygon( CORNER_MODE aMode, unsigned int aDistance,
|
POLYGON chamferFilletPolygon( CORNER_MODE aMode, unsigned int aDistance,
|
||||||
int aIndex, int aErrorMax = -1 );
|
int aIndex, int aErrorMax );
|
||||||
|
|
||||||
///> Returns true if the polygon set has any holes that touch share a vertex.
|
///> Returns true if the polygon set has any holes that touch share a vertex.
|
||||||
bool hasTouchingHoles( const POLYGON& aPoly ) const;
|
bool hasTouchingHoles( const POLYGON& aPoly ) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user