Speed load/unload of complex boards

Corrects an error in polyline estimation

Syncs graphics to world PNS by whole layer set rather than
individual layer at a time.

Prevents reloading of full pns TOOL_BASE during reset of tools unless
the tool is being activated.

Fixes: lp:1766626
* https://bugs.launchpad.net/kicad/+bug/1766626
This commit is contained in:
Seth Hillbrand 2018-04-24 16:28:13 -07:00 committed by jean-pierre charras
parent 458f9f5c97
commit 2a87117edc
4 changed files with 14 additions and 17 deletions

View File

@ -24,6 +24,8 @@
#include <vector>
#include <base_units.h>
#include <geometry/geometry_utils.h>
#include <geometry/shape_arc.h>
#include <geometry/shape_line_chain.h>
@ -209,7 +211,6 @@ const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline( double aAccuracy ) const
SHAPE_LINE_CHAIN rv;
double r = GetRadius();
double sa = GetStartAngle();
double step;
auto c = GetCenter();
int n;
@ -219,8 +220,7 @@ const SHAPE_LINE_CHAIN SHAPE_ARC::ConvertToPolyline( double aAccuracy ) const
}
else
{
step = 180 / M_PI * acos( r * ( 1.0 - aAccuracy ) / r );
n = std::abs( (int) ceil(m_centralAngle / step) );
n = GetArcToSegmentCount( r, From_User_Unit( MILLIMETRES, aAccuracy ), m_centralAngle );
}
for( int i = 0; i <= n ; i++ )

View File

@ -114,7 +114,8 @@ LENGTH_TUNER_TOOL::~LENGTH_TUNER_TOOL()
void LENGTH_TUNER_TOOL::Reset( RESET_REASON aReason )
{
TOOL_BASE::Reset( aReason );
if( aReason == RUN )
TOOL_BASE::Reset( aReason );
}

View File

@ -913,20 +913,15 @@ bool PNS_KICAD_IFACE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem )
for( auto seg : segs )
{
for( int layer = F_Cu; layer <= B_Cu; layer++ )
{
std::unique_ptr< PNS::SOLID > solid( new PNS::SOLID );
std::unique_ptr< PNS::SOLID > solid( new PNS::SOLID );
solid->SetLayer( layer );
solid->SetNet( -1 );
solid->SetParent( nullptr );
solid->SetShape( seg->Clone() );
solid->SetRoutable( false );
solid->SetLayers( LAYER_RANGE( F_Cu, B_Cu ) );
solid->SetNet( -1 );
solid->SetParent( nullptr );
solid->SetShape( seg );
solid->SetRoutable( false );
aWorld->Add( std::move( solid ) );
}
delete seg;
aWorld->Add( std::move( solid ) );
}
return true;

View File

@ -378,7 +378,8 @@ bool ROUTER_TOOL::Init()
void ROUTER_TOOL::Reset( RESET_REASON aReason )
{
TOOL_BASE::Reset( aReason );
if( aReason == RUN )
TOOL_BASE::Reset( aReason );
}