diff --git a/pcbnew/router/pns_line.cpp b/pcbnew/router/pns_line.cpp index ce3f845a60..136d209987 100644 --- a/pcbnew/router/pns_line.cpp +++ b/pcbnew/router/pns_line.cpp @@ -47,7 +47,7 @@ PNS_LINE::PNS_LINE( const PNS_LINE& aOther ) : m_marker = aOther.m_marker; m_rank = aOther.m_rank; - copyLinks ( &aOther ); + copyLinks( &aOther ); } @@ -71,7 +71,7 @@ const PNS_LINE& PNS_LINE::operator=( const PNS_LINE& aOther ) m_marker = aOther.m_marker; m_rank = aOther.m_rank; - copyLinks ( &aOther ); + copyLinks( &aOther ); return *this; } @@ -97,7 +97,7 @@ void PNS_LINE::Mark( int aMarker ) } -void PNS_LINE::Unmark () +void PNS_LINE::Unmark() { if( m_segmentRefs ) { @@ -109,7 +109,7 @@ void PNS_LINE::Unmark () } -int PNS_LINE::Marker()const +int PNS_LINE::Marker() const { int marker = m_marker; diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 75dffe879f..8c86572960 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -66,22 +66,24 @@ PNS_LINE_PLACER::~PNS_LINE_PLACER() } -void PNS_LINE_PLACER::setWorld ( PNS_NODE* aWorld ) +void PNS_LINE_PLACER::setWorld( PNS_NODE* aWorld ) { m_world = aWorld; } -const PNS_VIA PNS_LINE_PLACER::makeVia ( const VECTOR2I& aP ) + +const PNS_VIA PNS_LINE_PLACER::makeVia( const VECTOR2I& aP ) { const PNS_LAYERSET layers( m_sizes.GetLayerTop(), m_sizes.GetLayerBottom() ); - return PNS_VIA ( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), -1, m_sizes.ViaType() ); + return PNS_VIA( aP, layers, m_sizes.ViaDiameter(), m_sizes.ViaDrill(), -1, m_sizes.ViaType() ); } bool PNS_LINE_PLACER::ToggleVia( bool aEnabled ) { m_placingVia = aEnabled; + if( !m_idle ) Move( m_currentEnd, NULL ); @@ -89,7 +91,6 @@ bool PNS_LINE_PLACER::ToggleVia( bool aEnabled ) } - void PNS_LINE_PLACER::setInitialDirection( const DIRECTION_45& aDirection ) { m_initial_direction = aDirection; @@ -357,8 +358,6 @@ bool PNS_LINE_PLACER::mergeHead() } - - bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) { PNS_LINE initTrack( m_head ); @@ -397,7 +396,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) } else if( m_placingVia && viaOk ) { - walkFull.AppendVia( makeVia ( walkFull.CPoint( -1 ) ) ); + walkFull.AppendVia( makeVia( walkFull.CPoint( -1 ) ) ); } PNS_OPTIMIZER::Optimize( &walkFull, effort, m_currentNode ); @@ -451,8 +450,8 @@ bool PNS_LINE_PLACER::rhShoveOnly ( const VECTOR2I& aP, PNS_LINE& aNewHead ) if( m_placingVia && viaOk ) { - PNS_VIA v1( makeVia ( l.CPoint( -1 ) ) ); - PNS_VIA v2( makeVia ( l2.CPoint( -1 ) ) ); + PNS_VIA v1( makeVia( l.CPoint( -1 ) ) ); + PNS_VIA v2( makeVia( l2.CPoint( -1 ) ) ); l.AppendVia( v1 ); l2.AppendVia( v2 ); @@ -863,6 +862,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem ) Router()->CommitRouting( m_lastNode ); m_idle = true; } + return true; } @@ -911,7 +911,7 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem ) m_placingVia = false; m_chainedPlacement = !pl.EndsWithVia(); m_splitSeg = false; - initPlacement( ); + initPlacement(); } else { diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index cd23d5cb99..5622eecc67 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -1097,7 +1097,7 @@ void PNS_NODE::GetUpdatedItems( ITEM_VECTOR& aRemoved, ITEM_VECTOR& aAdded ) return; BOOST_FOREACH( PNS_ITEM* item, m_override ) - aRemoved.push_back( item ); + aRemoved.push_back( item ); for( PNS_INDEX::ITEM_SET::iterator i = m_index->begin(); i != m_index->end(); ++i ) aAdded.push_back( *i ); diff --git a/pcbnew/router/pns_optimizer.cpp b/pcbnew/router/pns_optimizer.cpp index c32900fb88..f4ef9d1060 100644 --- a/pcbnew/router/pns_optimizer.cpp +++ b/pcbnew/router/pns_optimizer.cpp @@ -292,7 +292,7 @@ int LINE_RESTRICTIONS::allowedAngles( PNS_NODE* aWorld, const PNS_LINE* aLine, c for( int i = 0; i < n_dirs; i++ ) { - if( !(refDir.Angle( dirs[i] ) & angleMask ) ) + if( !( refDir.Angle( dirs[i] ) & angleMask ) ) outputMask &= ~refDir.Mask(); } } diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index ec00a0cbc1..c63bb9be7e 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -664,7 +664,7 @@ void PNS_ROUTER::DisplayItem( const PNS_ITEM* aItem, int aColor, int aClearance ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( aItem, m_previewItems ); if( aColor >= 0 ) - pitem->SetColor( KIGFX::COLOR4D ( aColor ) ); + pitem->SetColor( KIGFX::COLOR4D( aColor ) ); if( aClearance >= 0 ) pitem->SetClearance( aClearance ); @@ -828,7 +828,7 @@ void PNS_ROUTER::movePlacing( const VECTOR2I& aP, PNS_ITEM* aEndItem ) if( !item->OfKind( PNS_ITEM::LINE ) ) continue; - const PNS_LINE* l = static_cast (item); + const PNS_LINE* l = static_cast( item ); DisplayItem( l ); if( l->EndsWithVia() ) diff --git a/pcbnew/router/pns_shove.h b/pcbnew/router/pns_shove.h index 39800893a6..b228806365 100644 --- a/pcbnew/router/pns_shove.h +++ b/pcbnew/router/pns_shove.h @@ -63,7 +63,7 @@ public: SHOVE_STATUS ShoveLines( const PNS_LINE& aCurrentHead ); SHOVE_STATUS ShoveMultiLines( const PNS_ITEMSET& aHeadSet ); - SHOVE_STATUS ShoveDraggingVia( PNS_VIA*aVia, const VECTOR2I& aWhere, PNS_VIA** aNewVia ); + SHOVE_STATUS ShoveDraggingVia( PNS_VIA* aVia, const VECTOR2I& aWhere, PNS_VIA** aNewVia ); SHOVE_STATUS ProcessSingleLine( PNS_LINE* aCurrent, PNS_LINE* aObstacle, PNS_LINE* aShoved ); @@ -79,7 +79,7 @@ public: const PNS_LINE NewHead() const; - void SetInitialLine ( PNS_LINE* aInitial ); + void SetInitialLine( PNS_LINE* aInitial ); private: typedef std::vector HULL_SET; @@ -127,7 +127,7 @@ private: PNS_LINE* assembleLine( const PNS_SEGMENT* aSeg, int* aIndex = NULL ); - void replaceItems( PNS_ITEM *aOld, PNS_ITEM *aNew ); + void replaceItems( PNS_ITEM* aOld, PNS_ITEM* aNew ); template T* clone ( const T* aItem ) { @@ -142,7 +142,7 @@ private: SHOVE_STATUS shoveIteration( int aIter ); SHOVE_STATUS shoveMainLoop(); - int getClearance( PNS_ITEM *aA, PNS_ITEM *aB ) const; + int getClearance( PNS_ITEM* aA, PNS_ITEM* aB ) const; std::vector m_nodeStack; std::vector m_lineStack; diff --git a/pcbnew/router/pns_via.cpp b/pcbnew/router/pns_via.cpp index b038167d3d..8faee3f207 100644 --- a/pcbnew/router/pns_via.cpp +++ b/pcbnew/router/pns_via.cpp @@ -97,12 +97,12 @@ PNS_VIA* PNS_VIA::Clone ( ) const } -OPT_BOX2I PNS_VIA::ChangedArea ( const PNS_VIA* aOther ) const +OPT_BOX2I PNS_VIA::ChangedArea( const PNS_VIA* aOther ) const { if ( aOther->Pos() != Pos() ) { BOX2I tmp = Shape()->BBox(); - tmp.Merge ( aOther->Shape()->BBox() ); + tmp.Merge( aOther->Shape()->BBox() ); return tmp; } diff --git a/pcbnew/router/router_menus.h b/pcbnew/router/router_menus.h index d2d89a38bf..bf49a9a0d5 100644 --- a/pcbnew/router/router_menus.h +++ b/pcbnew/router/router_menus.h @@ -657,6 +657,7 @@ bool ROUTER_TOOL::onViaCommand( VIATYPE_T aType ) // Cannot place microvias or blind vias if not allowed (obvious) if( ( aType == VIA_BLIND_BURIED ) && ( !bds.m_BlindBuriedViaAllowed ) ) return false; + if( ( aType == VIA_MICROVIA ) && ( !bds.m_MicroViasAllowed ) ) return false; @@ -673,8 +674,8 @@ bool ROUTER_TOOL::onViaCommand( VIATYPE_T aType ) return false; } - sizes.SetViaType ( aType ); - m_router->ToggleViaPlacement( ); + sizes.SetViaType( aType ); + m_router->ToggleViaPlacement(); m_router->UpdateSizes( sizes ); m_router->Move( m_endSnapPoint, m_endItem ); // refresh