Formatting.

This commit is contained in:
Jeff Young 2020-12-02 18:42:37 +00:00
parent 9c968b0ef7
commit d06d35a74d
7 changed files with 38 additions and 33 deletions

View File

@ -41,7 +41,8 @@ enum LineMarker {
MK_VIOLATION = ( 1 << 3 ), MK_VIOLATION = ( 1 << 3 ),
MK_LOCKED = ( 1 << 4 ), MK_LOCKED = ( 1 << 4 ),
MK_DP_COUPLED = ( 1 << 5 ), MK_DP_COUPLED = ( 1 << 5 ),
MK_ALT_SHAPE = ( 1 << 6 ) MK_ALT_SHAPE = ( 1 << 6 ) // For instance, a simple annular ring when the pad has
// been dropped from a layer.
}; };

View File

@ -609,8 +609,10 @@ bool PNS_PCBNEW_RULE_RESOLVER::DpNetPair( const PNS::ITEM* aItem, int& aNetP, in
class PNS_PCBNEW_DEBUG_DECORATOR: public PNS::DEBUG_DECORATOR class PNS_PCBNEW_DEBUG_DECORATOR: public PNS::DEBUG_DECORATOR
{ {
public: public:
PNS_PCBNEW_DEBUG_DECORATOR( KIGFX::VIEW* aView = NULL ): PNS::DEBUG_DECORATOR(), PNS_PCBNEW_DEBUG_DECORATOR( KIGFX::VIEW* aView = NULL ) :
m_view( NULL ), m_items( NULL ) PNS::DEBUG_DECORATOR(),
m_view( NULL ),
m_items( NULL )
{ {
SetView( aView ); SetView( aView );
} }
@ -636,7 +638,7 @@ public:
m_view->Add( m_items ); m_view->Add( m_items );
} }
void AddPoint( VECTOR2I aP, int aColor, const std::string aName = "") override void AddPoint( VECTOR2I aP, int aColor, const std::string aName = "" ) override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -652,7 +654,7 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddBox( BOX2I aB, int aColor, const std::string aName = "" ) override void AddBox( BOX2I aB, int aColor, const std::string aName = "" ) override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -668,7 +670,7 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddSegment( SEG aS, int aColor, const std::string aName = "") override void AddSegment( SEG aS, int aColor, const std::string aName = "" ) override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -678,7 +680,8 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddDirections( VECTOR2D aP, int aMask, int aColor, const std::string aName = "") override void AddDirections( VECTOR2D aP, int aMask, int aColor,
const std::string aName = "" ) override
{ {
BOX2I b( aP - VECTOR2I( 10000, 10000 ), VECTOR2I( 20000, 20000 ) ); BOX2I b( aP - VECTOR2I( 10000, 10000 ), VECTOR2I( 20000, 20000 ) );
@ -693,7 +696,8 @@ public:
} }
} }
void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth, const std::string aName = "" ) override void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth,
const std::string aName = "" ) override
{ {
if( !m_view ) if( !m_view )
return; return;

View File

@ -1091,8 +1091,8 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
if( aEndItem ) if( aEndItem )
{ {
// The user has indicated a connection should be made. If either the // The user has indicated a connection should be made. If either the trace or
// trace or endItem is netless, then allow the connection by adopting the net of the other. // endItem is net-less, then allow the connection by adopting the net of the other.
if( m_currentNet <= 0 ) if( m_currentNet <= 0 )
{ {
m_currentNet = aEndItem->Net(); m_currentNet = aEndItem->Net();
@ -1238,8 +1238,8 @@ bool LINE_PLACER::UnfixRoute()
m_currentLayer = st.pts[0].layer; m_currentLayer = st.pts[0].layer;
m_head.SetLayer( m_currentLayer ); m_head.SetLayer( m_currentLayer );
m_tail.SetLayer( m_currentLayer ); m_tail.SetLayer( m_currentLayer );
m_head.RemoveVia( ); m_head.RemoveVia();
m_tail.RemoveVia( ); m_tail.RemoveVia();
if (m_shove) if (m_shove)
{ {
@ -1306,7 +1306,7 @@ void LINE_PLACER::removeLoops( NODE* aNode, LINE& aLatest )
if( !( line.ContainsLink( seg ) ) && line.SegmentCount() ) if( !( line.ContainsLink( seg ) ) && line.SegmentCount() )
{ {
for( auto ss : line.Links() ) for( LINKED_ITEM* ss : line.Links() )
toErase.insert( ss ); toErase.insert( ss );
removedCount++; removedCount++;

View File

@ -337,7 +337,7 @@ void ROUTER::updateView( NODE* aNode, ITEM_SET& aCurrent, bool aDragging )
m_iface->DisplayItem( item, -1, clearance, aDragging ); m_iface->DisplayItem( item, -1, clearance, aDragging );
} }
for( auto item : removed ) for( ITEM* item : removed )
m_iface->HideItem( item ); m_iface->HideItem( item );
} }
@ -348,9 +348,7 @@ void ROUTER::UpdateSizes( const SIZES_SETTINGS& aSizes )
// Change track/via size settings // Change track/via size settings
if( m_state == ROUTE_TRACK) if( m_state == ROUTE_TRACK)
{
m_placer->UpdateSizes( m_sizes ); m_placer->UpdateSizes( m_sizes );
}
} }
@ -390,10 +388,10 @@ void ROUTER::CommitRouting( NODE* aNode )
aNode->GetUpdatedItems( removed, added ); aNode->GetUpdatedItems( removed, added );
for( auto item : removed ) for( ITEM* item : removed )
m_iface->RemoveItem( item ); m_iface->RemoveItem( item );
for( auto item : added ) for( ITEM* item : added )
m_iface->AddItem( item ); m_iface->AddItem( item );
m_iface->Commit(); m_iface->Commit();
@ -406,9 +404,7 @@ bool ROUTER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinish )
bool rv = false; bool rv = false;
if( m_logger ) if( m_logger )
{
m_logger->Log( LOGGER::EVT_FIX, aP, aEndItem ); m_logger->Log( LOGGER::EVT_FIX, aP, aEndItem );
}
switch( m_state ) switch( m_state )
{ {

View File

@ -277,7 +277,7 @@ SHOVE::SHOVE_STATUS SHOVE::ProcessSingleLine( LINE& aCurrent, LINE& aObstacle, L
bool obstacleIsHead = false; bool obstacleIsHead = false;
for( auto s : aObstacle.Links() ) for( LINKED_ITEM* s : aObstacle.Links() )
{ {
if( s->Marker() & MK_HEAD ) if( s->Marker() & MK_HEAD )
{ {
@ -302,7 +302,10 @@ SHOVE::SHOVE_STATUS SHOVE::ProcessSingleLine( LINE& aCurrent, LINE& aObstacle, L
int clearance = getClearance( &aCurrent, &aObstacle ) + 1; int clearance = getClearance( &aCurrent, &aObstacle ) + 1;
#ifdef DEBUG #ifdef DEBUG
Dbg()->Message( wxString::Format( "shove process-single: cur net %d obs %d cl %d", aCurrent.Net(), aObstacle.Net(), clearance ) ); Dbg()->Message( wxString::Format( "shove process-single: cur net %d obs %d cl %d",
aCurrent.Net(),
aObstacle.Net(),
clearance ) );
#endif #endif
HULL_SET hulls; HULL_SET hulls;
@ -643,7 +646,7 @@ NODE* SHOVE::reduceSpringback( const ITEM_SET& aHeadSet, VIA_HANDLE& aDraggedVia
{ {
SPRINGBACK_TAG& spTag = m_nodeStack.back(); SPRINGBACK_TAG& spTag = m_nodeStack.back();
auto obs = spTag.m_node->CheckColliding( aHeadSet ); OPT<OBSTACLE> obs = spTag.m_node->CheckColliding( aHeadSet );
if( !obs && !spTag.m_locked ) if( !obs && !spTag.m_locked )
{ {
@ -870,7 +873,8 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingVia( ITEM* aCurrent, VIA* aObstacleVia )
// hole-to-hole is a mechanical constraint (broken drill bits), not an electrical // hole-to-hole is a mechanical constraint (broken drill bits), not an electrical
// one, so it has to be checked irrespective of matching nets. // one, so it has to be checked irrespective of matching nets.
// temporarily removed hole-to-hole collision check due to conflicts with the springback algorithm... // temporarily removed hole-to-hole collision check due to conflicts with the
// springback algorithm...
// we need to figure out a better solution here - TW // we need to figure out a better solution here - TW
holeCollision = false; //rr->CollideHoles( &currentLine->Via(), aObstacleVia, true, &mtvHoles ); holeCollision = false; //rr->CollideHoles( &currentLine->Via(), aObstacleVia, true, &mtvHoles );
} }
@ -1015,7 +1019,7 @@ void SHOVE::unwindLineStack( ITEM* aItem )
{ {
LINE* l = static_cast<LINE*>( aItem ); LINE* l = static_cast<LINE*>( aItem );
for( auto seg : l->Links() ) for( LINKED_ITEM* seg : l->Links() )
unwindLineStack( seg ); unwindLineStack( seg );
} }
} }
@ -1048,7 +1052,7 @@ void SHOVE::popLineStack( )
{ {
bool found = false; bool found = false;
for( auto s : l.Links() ) for( LINKED_ITEM* s : l.Links() )
{ {
if( i->ContainsLink( s ) ) if( i->ContainsLink( s ) )
{ {
@ -1479,12 +1483,10 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveDraggingVia( const VIA_HANDLE aOldVia, const VEC
m_newHead = OPT_LINE(); m_newHead = OPT_LINE();
m_draggedVia = NULL; m_draggedVia = NULL;
auto viaToDrag = findViaByHandle( m_currentNode, aOldVia ); VIA* viaToDrag = findViaByHandle( m_currentNode, aOldVia );
if( !viaToDrag ) if( !viaToDrag )
{
return SH_INCOMPLETE; return SH_INCOMPLETE;
}
// Pop NODEs containing previous shoves which are no longer necessary // Pop NODEs containing previous shoves which are no longer necessary
ITEM_SET headSet; ITEM_SET headSet;

View File

@ -406,12 +406,13 @@ const VECTOR2I TOOL_BASE::snapToItem( bool aEnabled, ITEM* aItem, VECTOR2I aP)
{ {
if( aItem->Kind() == ITEM::SEGMENT_T ) if( aItem->Kind() == ITEM::SEGMENT_T )
{ {
anchor = m_gridHelper->AlignToSegment( aP, static_cast<SEGMENT*>( li )->Seg() ); SEGMENT* seg = static_cast<SEGMENT*>( li );
anchor = m_gridHelper->AlignToSegment( aP, seg->Seg() );
} }
else if( aItem->Kind() == ITEM::ARC_T ) else if( aItem->Kind() == ITEM::ARC_T )
{ {
anchor = m_gridHelper->AlignToArc( aP, ARC* arc = static_cast<ARC*>( li );
*static_cast<const SHAPE_ARC*>( static_cast<ARC*>( li )->Shape() ) ); anchor = m_gridHelper->AlignToArc( aP, *static_cast<const SHAPE_ARC*>( arc->Shape() ) );
} }
} }

View File

@ -109,7 +109,8 @@ bool TOPOLOGY::LeadingRatLine( const LINE* aTrack, SHAPE_LINE_CHAIN& aRatLine )
if( !jt ) if( !jt )
return false; return false;
if( ( !track.EndsWithVia() && jt->LinkCount() >= 2 ) || ( track.EndsWithVia() && jt->LinkCount() >= 3 ) ) // we got something connected if( ( !track.EndsWithVia() && jt->LinkCount() >= 2 )
|| ( track.EndsWithVia() && jt->LinkCount() >= 3 ) ) // we got something connected
{ {
end = jt->Pos(); end = jt->Pos();
} }