Code formatting.

This commit is contained in:
Maciej Suminski 2015-07-30 13:49:35 +02:00
parent 29cbaa206e
commit 4718b6d7c8
1 changed files with 14 additions and 22 deletions

View File

@ -1079,7 +1079,6 @@ static double calcMinArea( GENERAL_COLLECTOR& aCollector, KICAD_T aType )
BOARD_ITEM* item = aCollector[i];
if( item->Type() == aType )
best = std::min( best, calcArea( item ) );
}
return best;
@ -1095,7 +1094,6 @@ static double calcMaxArea( GENERAL_COLLECTOR& aCollector, KICAD_T aType )
BOARD_ITEM* item = aCollector[i];
if( item->Type() == aType )
best = std::max( best, calcArea( item ) );
}
return best;
@ -1183,9 +1181,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
case PCB_MODULE_T:
if( areaRatio > textToFeatureMinRatio &&
!txt->GetParent()->ViewBBox().Contains( txt->ViewBBox() ) )
{
rejected.insert( txt );
}
break;
default:
break;
@ -1209,13 +1205,11 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
double normalizedArea = calcRatio( calcArea( mod ), maxArea );
if( normalizedArea > footprintAreaRatio )
{
rejected.insert( mod );
}
}
}
}
}
if( aCollector.CountType( PCB_PAD_T ) > 0 )
{
@ -1255,7 +1249,8 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
if( track->GetNetCode() != via->GetNetCode() )
continue;
double lenRatio = (double) ( track->GetLength() + track->GetWidth() ) / (double) via->GetWidth();
double lenRatio = (double) ( track->GetLength() + track->GetWidth() ) /
(double) via->GetWidth();
if( lenRatio > trackViaLengthRatio )
rejected.insert( track );
@ -1274,6 +1269,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
double maxArea = 0.0;
for( int i = 0; i < aCollector.GetCount(); ++i )
{
if( TRACK* track = dyn_cast<TRACK*> ( aCollector[i] ) )
{
maxLength = std::max( track->GetLength(), maxLength );
@ -1284,6 +1280,7 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
double area = ( track->GetLength() + track->GetWidth() * track->GetWidth() );
maxArea = std::max(area, maxArea);
}
}
if( maxLength > 0.0 && minLength / maxLength < trackTrackLengthRatio && nTracks > 1 )
{
@ -1306,13 +1303,10 @@ void SELECTION_TOOL::guessSelectionCandidates( GENERAL_COLLECTOR& aCollector ) c
double ratio = maxArea / mod->GetFootprintRect().GetArea();
if( ratio < modulePadMinCoverRatio )
{
//printf("rejectModule\n");
rejected.insert( mod );
}
}
}
}
if( (unsigned) aCollector.GetCount() > rejected.size() ) // do not remove everything
{
@ -1350,12 +1344,10 @@ bool SELECTION_TOOL::SanitizeSelection()
// case 2: multi-item selection contains both the module and its pads - remove the pads
if( mod && m_selection.items.FindItem( mod ) >= 0 )
{
rejected.insert( item );
}
}
}
}
BOOST_FOREACH( BOARD_ITEM* item, rejected )
unselect( item );