Fix whitespace errors

This commit is contained in:
Tomasz Wlostowski 2021-02-25 17:18:13 +01:00
parent 04d058d60a
commit 87ea540953
13 changed files with 87 additions and 94 deletions

View File

@ -375,7 +375,7 @@ bool DRAGGER::dragViaWalkaround( const VIA_HANDLE& aHandle, NODE* aNode, const V
m_lastNode->Add( draggedLine );
}
}
}
}
return true;
}

View File

@ -1623,7 +1623,7 @@ void PNS_KICAD_IFACE::SetView( KIGFX::VIEW* aView )
delete m_debugDecorator;
auto dec = new PNS_PCBNEW_DEBUG_DECORATOR( );
auto dec = new PNS_PCBNEW_DEBUG_DECORATOR();
m_debugDecorator = dec;
if( ADVANCED_CFG::GetCfg().m_ShowRouterDebugGraphics )

View File

@ -206,8 +206,6 @@ bool LINE::Walkaround( const SHAPE_LINE_CHAIN& aObstacle, SHAPE_LINE_CHAIN& aPat
std::vector<VERTEX> vts;
auto findVertex = [&]( VECTOR2I pos) -> VERTEX*
{
for( VERTEX& v : vts )

View File

@ -298,7 +298,7 @@ private:
* colliding solid or non-movable items. Movable segments are ignored, as they'll be
* handled later by the shove algorithm.
*/
bool routeHead( const VECTOR2I& aP, LINE& aNewHead);
bool routeHead( const VECTOR2I& aP, LINE& aNewHead );
/**
* Perform a single routing algorithm step, for the end point \a aP.
@ -309,10 +309,10 @@ private:
void routeStep( const VECTOR2I& aP );
///< Route step walk around mode.
bool rhWalkOnly( const VECTOR2I& aP, LINE& aNewHead);
bool rhWalkOnly( const VECTOR2I& aP, LINE& aNewHead );
///< Route step shove mode.
bool rhShoveOnly( const VECTOR2I& aP, LINE& aNewHead);
bool rhShoveOnly( const VECTOR2I& aP, LINE& aNewHead );
///< Route step mark obstacles mode.
bool rhMarkObstacles( const VECTOR2I& aP, LINE& aNewHead );

View File

@ -347,7 +347,7 @@ static bool pointInside2( const SHAPE_LINE_CHAIN& aL, const VECTOR2I& aP )
bool KEEP_TOPOLOGY_CONSTRAINT::Check( int aVertex1, int aVertex2, const LINE* aOriginLine,
const SHAPE_LINE_CHAIN& aCurrentPath,
const SHAPE_LINE_CHAIN& aReplacement )
{
{
SHAPE_LINE_CHAIN encPoly = aOriginLine->CLine().Slice( aVertex1, aVertex2 );
// fixme: this is a remarkably shitty implementation...
@ -364,15 +364,15 @@ bool KEEP_TOPOLOGY_CONSTRAINT::Check( int aVertex1, int aVertex2, const LINE* aO
for( JOINT* j : joints )
{
if ( j->Net() == aOriginLine->Net() )
if( j->Net() == aOriginLine->Net() )
continue;
if ( pointInside2( encPoly, j->Pos() ) )
if( pointInside2( encPoly, j->Pos() ) )
{
bool falsePositive = false;
for( int k = 0; k < encPoly.PointCount(); k++)
for( int k = 0; k < encPoly.PointCount(); k++ )
{
if(encPoly.CPoint(k) == j->Pos() )
if( encPoly.CPoint(k) == j->Pos() )
{
falsePositive = true;
break;
@ -409,8 +409,8 @@ void OPTIMIZER::ClearConstraints()
void OPTIMIZER::AddConstraint ( OPT_CONSTRAINT *aConstraint )
{
m_constraints.push_back(aConstraint);
{
m_constraints.push_back( aConstraint );
}
@ -420,7 +420,7 @@ bool OPTIMIZER::checkConstraints( int aVertex1, int aVertex2, LINE* aOriginLine,
{
for( OPT_CONSTRAINT* c : m_constraints )
{
if ( !c->Check( aVertex1, aVertex2, aOriginLine, aCurrentPath, aReplacement ) )
if( !c->Check( aVertex1, aVertex2, aOriginLine, aCurrentPath, aReplacement ) )
return false;
}
@ -590,27 +590,27 @@ bool OPTIMIZER::Optimize( LINE* aLine, LINE* aResult )
bool hasArcs = aLine->ArcCount();
bool rv = false;
if ( m_effortLevel & PRESERVE_VERTEX )
if( m_effortLevel & PRESERVE_VERTEX )
{
auto c = new PRESERVE_VERTEX_CONSTRAINT( m_world, m_preservedVertex );
AddConstraint( c );
}
if ( m_effortLevel & RESTRICT_VERTEX_RANGE )
if( m_effortLevel & RESTRICT_VERTEX_RANGE )
{
auto c = new RESTRICT_VERTEX_RANGE_CONSTRAINT( m_world, m_restrictedVertexRange.first,
m_restrictedVertexRange.second );
AddConstraint( c );
}
if ( m_effortLevel & RESTRICT_AREA )
if( m_effortLevel & RESTRICT_AREA )
{
auto c = new AREA_CONSTRAINT( m_world, m_restrictArea, m_restrictAreaIsStrict );
AddConstraint( c );
}
if ( m_effortLevel & KEEP_TOPOLOGY )
if( m_effortLevel & KEEP_TOPOLOGY )
{
auto c = new KEEP_TOPOLOGY_CONSTRAINT( m_world );
AddConstraint( c );
@ -672,7 +672,7 @@ bool OPTIMIZER::mergeStep( LINE* aLine, SHAPE_LINE_CHAIN& aCurrentPath, int step
bool ok = false;
if ( !checkColliding( aLine, bypass ) )
if( !checkColliding( aLine, bypass ) )
{
//printf("Chk-constraints: %d %d\n", n, n+step+1 );
ok = checkConstraints ( n, n + step + 1, aLine, aCurrentPath, bypass );
@ -932,7 +932,7 @@ int OPTIMIZER::smartPadsSingle( LINE* aLine, ITEM* aPad, bool aEnd, int aEndVert
DIRECTION_45 dir_bkout( breakout.CSegment( -1 ) );
if(!connect.SegmentCount())
if( !connect.SegmentCount() )
continue;
int ang1 = dir_bkout.Angle( DIRECTION_45( connect.CSegment( 0 ) ) );
@ -1108,7 +1108,7 @@ int findCoupledVertices( const VECTOR2I& aVertex, const SEG& aOrigSeg,
SEG s = aCoupled.CSegment( i );
VECTOR2I projOverCoupled = s.LineProject ( aVertex );
if( s.ApproxParallel ( aOrigSeg ) )
if( s.ApproxParallel( aOrigSeg ) )
{
int64_t dist = int64_t{(( projOverCoupled - aVertex ).EuclideanNorm())} - aPair->Width();
@ -1240,7 +1240,7 @@ bool OPTIMIZER::mergeDpStep( DIFF_PAIR* aPair, bool aTryP, int step )
deltaUni = aPair->CoupledLength ( newRef, coupledPath ) - clenPre + budget;
if ( coupledBypass( m_world, aPair, aTryP, newRef, bypass, coupledPath, newCoup ) )
if( coupledBypass( m_world, aPair, aTryP, newRef, bypass, coupledPath, newCoup ) )
{
deltaCoupled = aPair->CoupledLength( newRef, newCoup ) - clenPre + budget;
@ -1253,7 +1253,7 @@ bool OPTIMIZER::mergeDpStep( DIFF_PAIR* aPair, bool aTryP, int step )
return true;
}
}
else if( deltaUni >= 0 && verifyDpBypass ( m_world, aPair, aTryP, newRef, coupledPath ) )
else if( deltaUni >= 0 && verifyDpBypass( m_world, aPair, aTryP, newRef, coupledPath ) )
{
newRef.Simplify();
coupledPath.Simplify();
@ -1389,7 +1389,7 @@ bool tightenSegment( bool dir, NODE *aNode, const LINE& cur, const SHAPE_LINE_CH
int da = a.Length();
int db = b.Length();
if ( da < db )
if( da < db )
guide = a;
else
guide = b;
@ -1401,9 +1401,9 @@ bool tightenSegment( bool dir, NODE *aNode, const LINE& cur, const SHAPE_LINE_CH
int current = step;
SHAPE_LINE_CHAIN snew;
while (step > 1)
while( step > 1 )
{
LINE l ( cur );
LINE l( cur );
snew.Clear();
snew.Append( a.A );
@ -1444,27 +1444,27 @@ void Tighten( NODE *aNode, const SHAPE_LINE_CHAIN& aOldLine, const LINE& aNewLin
{
LINE tmp;
if ( aNewLine.SegmentCount() < 3 )
if( aNewLine.SegmentCount() < 3 )
return;
SHAPE_LINE_CHAIN current ( aNewLine.CLine() );
for (int step = 0; step < 3; step++)
for( int step = 0; step < 3; step++)
{
current.Simplify();
for ( int i = 0; i <= current.SegmentCount() - 3; i++)
for( int i = 0; i <= current.SegmentCount() - 3; i++)
{
SHAPE_LINE_CHAIN l_in, l_out;
l_in = current.Slice(i, i+3);
for (int dir = 0; dir < 1; dir++)
for( int dir = 0; dir < 1; dir++)
{
if( tightenSegment( dir ? true : false, aNode, aNewLine, l_in, l_out ) )
{
SHAPE_LINE_CHAIN opt = current;
opt.Replace(i, i+3, l_out);
opt.Replace(i, i + 3, l_out);
auto optArea = std::abs(shovedArea( aOldLine, opt ));
auto prevArea = std::abs(shovedArea( aOldLine, current ));

View File

@ -203,8 +203,6 @@ private:
NODE* m_world;
int m_collisionKindMask;
int m_effortLevel;
bool m_keepPostures;
VECTOR2I m_preservedVertex;
std::pair<int, int> m_restrictedVertexRange;
@ -275,7 +273,6 @@ public:
private:
BOX2I m_allowedArea;
bool m_allowedAreaStrict;
};
@ -306,7 +303,6 @@ public:
const SHAPE_LINE_CHAIN& aCurrentPath,
const SHAPE_LINE_CHAIN& aReplacement ) override;
private:
VECTOR2I m_v;
};
@ -325,7 +321,6 @@ public:
const SHAPE_LINE_CHAIN& aCurrentPath,
const SHAPE_LINE_CHAIN& aReplacement ) override;
private:
int m_start;
int m_end;
};

View File

@ -154,7 +154,7 @@ bool ROUTER::StartDragging( const VECTOR2I& aP, ITEM_SET aStartItems, int aDragM
m_dragger->SetMode( aDragMode );
m_dragger->SetWorld( m_world.get() );
m_dragger->SetLogger( m_logger );
m_dragger->SetDebugDecorator ( m_iface->GetDebugDecorator () );
m_dragger->SetDebugDecorator( m_iface->GetDebugDecorator() );
m_logger->Clear();
@ -163,7 +163,7 @@ bool ROUTER::StartDragging( const VECTOR2I& aP, ITEM_SET aStartItems, int aDragM
m_logger->Log( LOGGER::EVT_START_DRAG, aP, aStartItems[0] );
}
if( m_dragger->Start ( aP, aStartItems ) )
if( m_dragger->Start( aP, aStartItems ) )
{
m_state = DRAG_SEGMENT;
}
@ -367,7 +367,7 @@ bool ROUTER::StartRouting( const VECTOR2I& aP, ITEM* aStartItem, int aLayer )
m_placer->UpdateSizes( m_sizes );
m_placer->SetLayer( aLayer );
m_placer->SetDebugDecorator( m_iface->GetDebugDecorator () );
m_placer->SetDebugDecorator( m_iface->GetDebugDecorator() );
m_placer->SetLogger( m_logger );
m_logger->Clear();
@ -796,7 +796,7 @@ void ROUTER::BreakSegment( ITEM *aItem, const VECTOR2I& aP )
LINE_PLACER placer( this );
if ( placer.SplitAdjacentSegments( node, aItem, aP ) )
if( placer.SplitAdjacentSegments( node, aItem, aP ) )
{
CommitRouting( node );
}

View File

@ -112,6 +112,6 @@ private:
std::map<int, int> m_layerPairs;
};
};
}
#endif // __PNS_SIZES_SETTINGS_H