diff --git a/common/tool/tool_base.cpp b/common/tool/tool_base.cpp index a72a711d91..8615c93d36 100644 --- a/common/tool/tool_base.cpp +++ b/common/tool/tool_base.cpp @@ -50,42 +50,46 @@ EDA_ITEM* TOOL_BASE::getModelInt() const return m_toolMgr->GetModel(); } + void TOOL_BASE::attachManager( TOOL_MANAGER* aManager ) { m_toolMgr = aManager; - m_toolSettings = TOOL_SETTINGS ( this ); + m_toolSettings = TOOL_SETTINGS( this ); } -TOOL_SETTINGS::TOOL_SETTINGS ( TOOL_BASE *aTool ) + +TOOL_SETTINGS::TOOL_SETTINGS( TOOL_BASE* aTool ) { m_tool = aTool; - if(!aTool) + if( !aTool ) { m_config = NULL; return; } - // fixme: make independent of pcbnew (post-stable) - PCB_EDIT_FRAME *frame = aTool->getEditFrame (); + // fixme: make independent of pcbnew (post-stable) + PCB_EDIT_FRAME* frame = aTool->getEditFrame(); m_config = frame->GetSettings(); } -TOOL_SETTINGS::~TOOL_SETTINGS () -{ +TOOL_SETTINGS::~TOOL_SETTINGS() +{ } + TOOL_SETTINGS& TOOL_BASE::GetSettings() { return m_toolSettings; } -wxString TOOL_SETTINGS::getKeyName(const wxString& entryName) const + +wxString TOOL_SETTINGS::getKeyName( const wxString& aEntryName ) const { - wxString key ( m_tool->GetName() ); - key += wxT("."); - key += entryName; + wxString key( m_tool->GetName() ); + key += wxT( "." ); + key += aEntryName; return key; } diff --git a/include/tool/tool_settings.h b/include/tool/tool_settings.h index 499bcbafad..393afb0a79 100644 --- a/include/tool/tool_settings.h +++ b/include/tool/tool_settings.h @@ -38,37 +38,36 @@ class TOOL_BASE; class TOOL_SETTINGS { public: - TOOL_SETTINGS ( TOOL_BASE *aTool = NULL ); + TOOL_SETTINGS ( TOOL_BASE* aTool = NULL ); ~TOOL_SETTINGS (); template T Get( const wxString& aName, T aDefaultValue ) const { - if(!m_config) + if( !m_config ) return aDefaultValue; T tmp = aDefaultValue; - m_config->Read ( getKeyName( aName ), &tmp ); + m_config->Read( getKeyName( aName ), &tmp ); return tmp; } template void Set( const wxString& aName, const T &aValue ) { - if(!m_config) + if( !m_config ) return; - m_config->Write ( getKeyName( aName ), aValue ); + m_config->Write( getKeyName( aName ), aValue ); } private: - wxString getKeyName(const wxString& entryName) const; + wxString getKeyName( const wxString& aEntryName ) const; - wxConfigBase *m_config; - TOOL_BASE *m_tool; + wxConfigBase* m_config; + TOOL_BASE* m_tool; }; - -#endif \ No newline at end of file +#endif diff --git a/include/wxPcbStruct.h b/include/wxPcbStruct.h index e9d98cad8e..6d540dd9f7 100644 --- a/include/wxPcbStruct.h +++ b/include/wxPcbStruct.h @@ -395,7 +395,7 @@ public: void SaveSettings( wxConfigBase* aCfg ); // override virtual - wxConfigBase *GetSettings() { return config(); }; + wxConfigBase* GetSettings() { return config(); }; /** * Get the last net list read with the net list dialog box. diff --git a/pcbnew/router/pns_dp_meander_placer.cpp b/pcbnew/router/pns_dp_meander_placer.cpp index 6a9991ae07..dcce295826 100644 --- a/pcbnew/router/pns_dp_meander_placer.cpp +++ b/pcbnew/router/pns_dp_meander_placer.cpp @@ -99,7 +99,7 @@ bool PNS_DP_MEANDER_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) } if( m_originPair.Gap() < 0 ) - m_originPair.SetGap( Router()->Sizes().DiffPairGap() ); + m_originPair.SetGap( Router()->Sizes().DiffPairGap() ); if( !m_originPair.PLine().SegmentCount() || !m_originPair.NLine().SegmentCount() ) @@ -224,28 +224,28 @@ bool PNS_DP_MEANDER_PLACER::Move( const VECTOR2I& aP, PNS_ITEM* aEndItem ) { SEG base = baselineSegment( sp ); - DrawDebugSeg ( base, 3 ); + DrawDebugSeg( base, 3 ); - while(sp.indexP >= curIndexP) + while( sp.indexP >= curIndexP ) { - m_result.AddCorner( tunedP.CPoint(curIndexP), tunedN.CPoint(curIndexN) ); + m_result.AddCorner( tunedP.CPoint( curIndexP ), tunedN.CPoint( curIndexN ) ); curIndexP++; } - while(sp.indexN >= curIndexN) + while( sp.indexN >= curIndexN ) { - m_result.AddCorner( tunedP.CPoint(sp.indexP), tunedN.CPoint(curIndexN) ); + m_result.AddCorner( tunedP.CPoint( sp.indexP ), tunedN.CPoint( curIndexN ) ); curIndexN++; } m_result.MeanderSegment( base ); } - while(curIndexP < tunedP.PointCount() ) - m_result.AddCorner( tunedP.CPoint(curIndexP++), tunedN.CPoint(curIndexN) ); + while( curIndexP < tunedP.PointCount() ) + m_result.AddCorner( tunedP.CPoint( curIndexP++ ), tunedN.CPoint( curIndexN ) ); - while(curIndexN < tunedN.PointCount() ) - m_result.AddCorner( tunedP.CPoint(-1), tunedN.CPoint(curIndexN++) ); + while( curIndexN < tunedN.PointCount() ) + m_result.AddCorner( tunedP.CPoint( -1 ), tunedN.CPoint( curIndexN++ ) ); int dpLen = origPathLength(); diff --git a/pcbnew/router/pns_line_placer.cpp b/pcbnew/router/pns_line_placer.cpp index 8cff0be752..75dffe879f 100644 --- a/pcbnew/router/pns_line_placer.cpp +++ b/pcbnew/router/pns_line_placer.cpp @@ -366,7 +366,7 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) int effort = 0; bool rv = true, viaOk; - viaOk = buildInitialLine ( aP, initTrack ); + viaOk = buildInitialLine( aP, initTrack ); PNS_WALKAROUND walkaround( m_currentNode, Router() ); @@ -402,8 +402,8 @@ bool PNS_LINE_PLACER::rhWalkOnly( const VECTOR2I& aP, PNS_LINE& aNewHead ) PNS_OPTIMIZER::Optimize( &walkFull, effort, m_currentNode ); - if ( m_currentNode->CheckColliding( &walkFull ) ) - return false; + if( m_currentNode->CheckColliding( &walkFull ) ) + return false; m_head = walkFull; aNewHead = walkFull; @@ -927,7 +927,7 @@ void PNS_LINE_PLACER::removeLoops( PNS_NODE* aNode, PNS_LINE* aLatest ) if( !aLatest->SegmentCount() ) return; - if (aLatest->CLine().CPoint(0) == aLatest->CLine().CPoint(-1)) + if ( aLatest->CLine().CPoint( 0 ) == aLatest->CLine().CPoint( -1 ) ) return; aNode->Add( aLatest, true ); @@ -1025,14 +1025,18 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead ) { SHAPE_LINE_CHAIN l; - if(m_p_start == aP) + if( m_p_start == aP ) { l.Clear(); - } else { + } + else + { if( Settings().GetFreeAngleMode() && Settings().Mode() == RM_MarkObstacles ) { - l = SHAPE_LINE_CHAIN ( m_p_start, aP ); - } else { + l = SHAPE_LINE_CHAIN( m_p_start, aP ); + } + else + { l = m_direction.BuildInitialTrace( m_p_start, aP ); } @@ -1050,12 +1054,12 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead ) if( !m_placingVia ) return true; - PNS_VIA v ( makeVia ( aP ) ); - v.SetNet ( aHead.Net() ); + PNS_VIA v( makeVia( aP ) ); + v.SetNet( aHead.Net() ); - if ( m_currentMode == RM_MarkObstacles ) + if( m_currentMode == RM_MarkObstacles ) { - aHead.AppendVia ( v ); + aHead.AppendVia( v ); return true; } @@ -1066,9 +1070,7 @@ bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead ) if( v.PushoutForce( m_currentNode, lead, force, solidsOnly, 40 ) ) { - SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace( - m_p_start, - aP + force ); + SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace( m_p_start, aP + force ); aHead = PNS_LINE( aHead, line ); v.SetPos( v.Pos() + force ); diff --git a/pcbnew/router/pns_meander_skew_placer.cpp b/pcbnew/router/pns_meander_skew_placer.cpp index 98697fe34d..be1ba85e01 100644 --- a/pcbnew/router/pns_meander_skew_placer.cpp +++ b/pcbnew/router/pns_meander_skew_placer.cpp @@ -79,14 +79,14 @@ bool PNS_MEANDER_SKEW_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) } if( m_originPair.Gap() < 0 ) - m_originPair.SetGap ( Router()->Sizes().DiffPairGap() ); + m_originPair.SetGap( Router()->Sizes().DiffPairGap() ); if( !m_originPair.PLine().SegmentCount() || !m_originPair.NLine().SegmentCount() ) return false; - m_tunedPathP = topo.AssembleTrivialPath ( m_originPair.PLine().GetLink( 0 ) ); - m_tunedPathN = topo.AssembleTrivialPath ( m_originPair.NLine().GetLink( 0 ) ); + m_tunedPathP = topo.AssembleTrivialPath( m_originPair.PLine().GetLink( 0 ) ); + m_tunedPathN = topo.AssembleTrivialPath( m_originPair.NLine().GetLink( 0 ) ); m_world->Remove( m_originLine ); @@ -94,9 +94,9 @@ bool PNS_MEANDER_SKEW_PLACER::Start( const VECTOR2I& aP, PNS_ITEM* aStartItem ) m_currentEnd = VECTOR2I( 0, 0 ); if ( m_originPair.PLine().Net () == m_originLine->Net() ) - m_coupledLength = itemsetLength ( m_tunedPathN ); + m_coupledLength = itemsetLength( m_tunedPathN ); else - m_coupledLength = itemsetLength ( m_tunedPathP ); + m_coupledLength = itemsetLength( m_tunedPathP ); return true; } diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index 2c5f2d41a5..cd23d5cb99 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -1237,18 +1237,20 @@ PNS_SEGMENT* PNS_NODE::findRedundantSegment( PNS_SEGMENT* aSeg ) return NULL; } + void PNS_NODE::SetCollisionFilter( PNS_COLLISION_FILTER* aFilter ) { m_collisionFilter = aFilter; } -PNS_ITEM *PNS_NODE::FindItemByParent ( const BOARD_CONNECTED_ITEM *aParent ) + +PNS_ITEM *PNS_NODE::FindItemByParent( const BOARD_CONNECTED_ITEM* aParent ) { PNS_INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() ); BOOST_FOREACH( PNS_ITEM*item, *l_cur ) - if ( item->Parent() == aParent ) + if( item->Parent() == aParent ) return item; return NULL; -} \ No newline at end of file +} diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index 3ef4206efd..0f2fb49cb5 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -373,7 +373,7 @@ public: int RemoveByMarker( int aMarker ); void SetCollisionFilter( PNS_COLLISION_FILTER* aFilter ); - PNS_ITEM *FindItemByParent ( const BOARD_CONNECTED_ITEM *aParent ); + PNS_ITEM* FindItemByParent( const BOARD_CONNECTED_ITEM *aParent ); private: struct OBSTACLE_VISITOR; diff --git a/pcbnew/router/pns_router.cpp b/pcbnew/router/pns_router.cpp index 691894ee19..9619377f47 100644 --- a/pcbnew/router/pns_router.cpp +++ b/pcbnew/router/pns_router.cpp @@ -210,8 +210,9 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad ) if( aPad->GetShape() == PAD_CIRCLE ) { solid->SetShape( new SHAPE_CIRCLE( c, sz.x / 2 ) ); - } else { - + } + else + { if( orient == 0.0 || orient == 90.0 || orient == 180.0 || orient == 270.0 ) { if( orient == 90.0 || orient == 270.0 ) @@ -262,7 +263,9 @@ PNS_ITEM* PNS_ROUTER::syncPad( D_PAD* aPad ) delete solid; return NULL; } - } else { + } + else + { switch( aPad->GetShape() ) { // PAD_CIRCLE already handled above diff --git a/pcbnew/router/pns_routing_settings.cpp b/pcbnew/router/pns_routing_settings.cpp index ab76cac530..4ff25e31c4 100644 --- a/pcbnew/router/pns_routing_settings.cpp +++ b/pcbnew/router/pns_routing_settings.cpp @@ -43,9 +43,10 @@ PNS_ROUTING_SETTINGS::PNS_ROUTING_SETTINGS() m_inlineDragEnabled = false; } -void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const + +void PNS_ROUTING_SETTINGS::Save( TOOL_SETTINGS& aSettings ) const { - aSettings.Set( "Mode", (int)m_routingMode ); + aSettings.Set( "Mode", (int) m_routingMode ); aSettings.Set( "OptimizerEffort", (int) m_optimizerEffort ); aSettings.Set( "RemoveLoops", m_removeLoops ); aSettings.Set( "SmartPads", m_smartPads ); @@ -62,7 +63,8 @@ void PNS_ROUTING_SETTINGS::Save ( TOOL_SETTINGS& aSettings ) const aSettings.Set( "InlineDragEnabled", m_inlineDragEnabled ); } -void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings ) + +void PNS_ROUTING_SETTINGS::Load( const TOOL_SETTINGS& aSettings ) { m_routingMode = (PNS_MODE) aSettings.Get( "Mode", (int) RM_Walkaround ); m_optimizerEffort = (PNS_OPTIMIZATION_EFFORT) aSettings.Get( "OptimizerEffort", (int) OE_MEDIUM ); @@ -81,6 +83,7 @@ void PNS_ROUTING_SETTINGS::Load ( const TOOL_SETTINGS& aSettings ) m_inlineDragEnabled = aSettings.Get( "InlineDragEnabled", false ); } + const DIRECTION_45 PNS_ROUTING_SETTINGS::InitialDirection() const { if( m_startDiagonal ) diff --git a/pcbnew/router/pns_routing_settings.h b/pcbnew/router/pns_routing_settings.h index 3a175f92c1..f3900455c4 100644 --- a/pcbnew/router/pns_routing_settings.h +++ b/pcbnew/router/pns_routing_settings.h @@ -56,8 +56,8 @@ class PNS_ROUTING_SETTINGS public: PNS_ROUTING_SETTINGS(); - void Load ( const TOOL_SETTINGS& where ); - void Save ( TOOL_SETTINGS& where ) const; + void Load( const TOOL_SETTINGS& where ); + void Save( TOOL_SETTINGS& where ) const; ///> Returns the routing mode. PNS_MODE Mode() const { return m_routingMode; } @@ -130,7 +130,6 @@ public: int WalkaroundIterationLimit() const { return m_walkaroundIterationLimit; }; TIME_LIMIT WalkaroundTimeLimit() const; - void SetInlineDragEnabled ( bool aEnable ) { m_inlineDragEnabled = aEnable; } bool InlineDragEnabled( ) const { return m_inlineDragEnabled; } diff --git a/pcbnew/router/pns_shove.cpp b/pcbnew/router/pns_shove.cpp index e3a00c9787..1e3e22a108 100644 --- a/pcbnew/router/pns_shove.cpp +++ b/pcbnew/router/pns_shove.cpp @@ -337,7 +337,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSegment( PNS_LINE* aCurrent, PNS_S int rank = aCurrent->Rank(); shovedLine->SetRank( rank - 1 ); - if (!pushLine( shovedLine ) ) + if( !pushLine( shovedLine ) ) rv = SH_INCOMPLETE; } @@ -466,7 +466,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::onCollidingSolid( PNS_LINE* aCurrent, PNS_SOL #endif popLine(); - if ( !pushLine( walkaroundLine ) ) + + if( !pushLine( walkaroundLine ) ) return SH_INCOMPLETE; return SH_OK; @@ -620,7 +621,8 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::pushVia( PNS_VIA* aVia, const VECTOR2I& aForc { replaceItems( lp.first, lp.second ); lp.second->SetRank( aCurrentRank - 1 ); - if (! pushLine( lp.second ) ) + + if( !pushLine( lp.second ) ) return SH_INCOMPLETE; } else @@ -1120,7 +1122,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveMultiLines( const PNS_ITEMSET& aHeadSet st = shoveMainLoop(); - if ( st == SH_OK ) + if( st == SH_OK ) runOptimizer( m_currentNode, NULL ); m_currentNode->RemoveByMarker( MK_HEAD ); @@ -1169,7 +1171,7 @@ PNS_SHOVE::SHOVE_STATUS PNS_SHOVE::ShoveDraggingVia( PNS_VIA* aVia, const VECTOR st = pushVia( aVia, ( aWhere - aVia->Pos() ), 0 ); st = shoveMainLoop(); - if ( st == SH_OK ) + if( st == SH_OK ) runOptimizer( m_currentNode, NULL ); if( st == SH_OK || st == SH_HEAD_MODIFIED ) diff --git a/pcbnew/router/pns_solid.cpp b/pcbnew/router/pns_solid.cpp index 7682d51420..d728015833 100644 --- a/pcbnew/router/pns_solid.cpp +++ b/pcbnew/router/pns_solid.cpp @@ -31,7 +31,7 @@ const SHAPE_LINE_CHAIN PNS_SOLID::Hull( int aClearance, int aWalkaroundThickness ) const { - int cl = aClearance + (aWalkaroundThickness + 1)/ 2; + int cl = aClearance + ( aWalkaroundThickness + 1 )/ 2; switch( m_shape->Type() ) { @@ -51,7 +51,7 @@ const SHAPE_LINE_CHAIN PNS_SOLID::Hull( int aClearance, int aWalkaroundThickness case SH_SEGMENT: { - SHAPE_SEGMENT* seg = static_cast ( m_shape ); + SHAPE_SEGMENT* seg = static_cast( m_shape ); return SegmentHull( *seg, aClearance, aWalkaroundThickness ); } diff --git a/pcbnew/router/pns_topology.cpp b/pcbnew/router/pns_topology.cpp index b8d4191bfc..3ecbd6cbd9 100644 --- a/pcbnew/router/pns_topology.cpp +++ b/pcbnew/router/pns_topology.cpp @@ -129,6 +129,7 @@ bool PNS_TOPOLOGY::LeadingRatLine( const PNS_LINE* aTrack, SHAPE_LINE_CHAIN& aRa return true; } + PNS_ITEM* PNS_TOPOLOGY::NearestUnconnectedItem( PNS_JOINT* aStart, int* aAnchor, int aKindMask ) { std::set disconnected; @@ -320,8 +321,10 @@ int PNS_TOPOLOGY::DpNetPolarity( int aNet ) return MatchDpSuffix( refName, dummy1, dummy2 ); } + bool commonParallelProjection( SEG n, SEG p, SEG &pClip, SEG& nClip ); + bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair ) { int refNet = aStart->Net(); @@ -334,7 +337,7 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair ) m_world->AllItemsInNet( coupledNet, coupledItems ); - PNS_SEGMENT *coupledSeg = NULL, *refSeg; + PNS_SEGMENT* coupledSeg = NULL, *refSeg; int minDist = std::numeric_limits::max(); if( ( refSeg = dyn_cast( aStart ) ) != NULL ) @@ -365,8 +368,8 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair ) if( !coupledSeg ) return false; - std::auto_ptr lp ( m_world->AssembleLine( refSeg ) ); - std::auto_ptr ln ( m_world->AssembleLine( coupledSeg ) ); + std::auto_ptr lp( m_world->AssembleLine( refSeg ) ); + std::auto_ptr ln( m_world->AssembleLine( coupledSeg ) ); if( DpNetPolarity( refNet ) < 0 ) { @@ -374,13 +377,12 @@ bool PNS_TOPOLOGY::AssembleDiffPair( PNS_ITEM* aStart, PNS_DIFF_PAIR& aPair ) } int gap = -1 ; - if( refSeg->Seg().ApproxParallel( coupledSeg->Seg() ) ) { - - // Segments are parallel -> compute pair gap - const VECTOR2I refDir = refSeg->Anchor(1) - refSeg->Anchor(0); - const VECTOR2I displacement = refSeg->Anchor(1) - coupledSeg->Anchor(1); - gap = (int) abs( refDir.Cross( displacement ) / refDir.EuclideanNorm() ) - lp->Width(); - + if( refSeg->Seg().ApproxParallel( coupledSeg->Seg() ) ) + { + // Segments are parallel -> compute pair gap + const VECTOR2I refDir = refSeg->Anchor( 1 ) - refSeg->Anchor( 0 ); + const VECTOR2I displacement = refSeg->Anchor( 1 ) - coupledSeg->Anchor( 1 ); + gap = (int) abs( refDir.Cross( displacement ) / refDir.EuclideanNorm() ) - lp->Width(); } aPair = PNS_DIFF_PAIR( *lp, *ln ); diff --git a/pcbnew/router/pns_utils.cpp b/pcbnew/router/pns_utils.cpp index d4d2c2fbec..31eb78d094 100644 --- a/pcbnew/router/pns_utils.cpp +++ b/pcbnew/router/pns_utils.cpp @@ -81,22 +81,22 @@ const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance, } -static void MoveDiagonal( SEG& diagonal, const SHAPE_LINE_CHAIN& vertices, int clearance ) +static void MoveDiagonal( SEG& aDiagonal, const SHAPE_LINE_CHAIN& aVertices, int aClearance ) { int dist; - vertices.NearestPoint( diagonal, dist ); + aVertices.NearestPoint( aDiagonal, dist ); dist -= HULL_MARGIN; - VECTOR2I moveBy = (diagonal.A - diagonal.B).Perpendicular().Resize( dist - clearance ); - diagonal.A += moveBy; - diagonal.B += moveBy; + VECTOR2I moveBy = ( aDiagonal.A - aDiagonal.B ).Perpendicular().Resize( dist - aClearance ); + aDiagonal.A += moveBy; + aDiagonal.B += moveBy; } -const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance ) +const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int aClearance ) { // this defines the horizontal and vertical lines in the hull octagon - BOX2I box = convex.BBox( clearance + HULL_MARGIN ); + BOX2I box = convex.BBox( aClearance + HULL_MARGIN ); box.Normalize(); SEG topline = SEG( VECTOR2I( box.GetX(), box.GetY() + box.GetHeight() ), @@ -113,25 +113,25 @@ const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance ) VECTOR2I corner = box.GetOrigin() + box.GetSize(); SEG toprightline = SEG( corner, corner + VECTOR2I( box.GetHeight(), -box.GetHeight() ) ); - MoveDiagonal( toprightline, vertices, clearance ); + MoveDiagonal( toprightline, vertices, aClearance ); // bottom right diagonal corner = box.GetOrigin() + VECTOR2I( box.GetWidth(), 0 ); SEG bottomrightline = SEG( corner + VECTOR2I( box.GetHeight(), box.GetHeight() ), corner ); - MoveDiagonal( bottomrightline, vertices, clearance ); + MoveDiagonal( bottomrightline, vertices, aClearance ); // bottom left diagonal corner = box.GetOrigin(); SEG bottomleftline = SEG( corner, corner + VECTOR2I( -box.GetHeight(), box.GetHeight() ) ); - MoveDiagonal( bottomleftline, vertices, clearance ); + MoveDiagonal( bottomleftline, vertices, aClearance ); // top left diagonal corner = box.GetOrigin() + VECTOR2I( 0, box.GetHeight() ); SEG topleftline = SEG( corner + VECTOR2I( -box.GetHeight(), -box.GetHeight() ), corner ); - MoveDiagonal( topleftline, vertices, clearance ); + MoveDiagonal( topleftline, vertices, aClearance ); SHAPE_LINE_CHAIN octagon; octagon.SetClosed( true ); diff --git a/pcbnew/router/pns_utils.h b/pcbnew/router/pns_utils.h index 011bf3eee9..bc300a9332 100644 --- a/pcbnew/router/pns_utils.h +++ b/pcbnew/router/pns_utils.h @@ -37,8 +37,8 @@ class PNS_ITEM; const SHAPE_LINE_CHAIN OctagonalHull( const VECTOR2I& aP0, const VECTOR2I& aSize, int aClearance, int aChamfer ); -const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance, - int aWalkaroundThickness ); +const SHAPE_LINE_CHAIN SegmentHull( const SHAPE_SEGMENT& aSeg, int aClearance, + int aWalkaroundThickness ); /** * Function ConvexHull() @@ -48,7 +48,7 @@ const SHAPE_LINE_CHAIN SegmentHull ( const SHAPE_SEGMENT& aSeg, int aClearance, * @param clearance The minimum distance between polygon and hull. * @return A closed line chain describing the octagon. */ -const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int clearance ); +const SHAPE_LINE_CHAIN ConvexHull( const SHAPE_CONVEX& convex, int aClearance ); SHAPE_RECT ApproximateSegmentAsRect( const SHAPE_SEGMENT& aSeg ); @@ -59,5 +59,4 @@ void DrawDebugDirs( VECTOR2D aP, int aMask, int aColor ); OPT_BOX2I ChangedArea( const PNS_ITEM* aItemA, const PNS_ITEM* aItemB ); - #endif // __PNS_UTILS_H diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 8c0032a29f..4a8d14ec22 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -816,7 +816,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) } } - if(saveUndoBuffer) + if( saveUndoBuffer ) { frame->SaveCopyInUndoList( m_router->GetUndoBuffer(), UR_UNSPECIFIED ); m_router->ClearUndoBuffer(); diff --git a/pcbnew/router/time_limit.h b/pcbnew/router/time_limit.h index 9f086a2982..d917533866 100644 --- a/pcbnew/router/time_limit.h +++ b/pcbnew/router/time_limit.h @@ -33,7 +33,7 @@ public: void Restart(); void Set( int aMilliseconds ); - int Get () const { return m_limitMs; } + int Get() const { return m_limitMs; } private: int m_limitMs; diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 6c6a18f0a5..887a80e0dd 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -110,7 +110,7 @@ bool EDIT_TOOL::invokeInlineRouter() if( track || via ) { ROUTER_TOOL *theRouter = static_cast ( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) ); - assert ( theRouter ); + assert( theRouter ); if( !theRouter->PNSSettings().InlineDragEnabled() ) return false;