Commit 79eca85b authored by dickelbeck's avatar dickelbeck

Magnetism

parent c254c13e
This diff is collapsed.
......@@ -42,51 +42,47 @@ TRACK* Locate_Via( BOARD* Pcb, const wxPoint& pos, int layer )
* (TRACK*) adresse de la via
*/
{
TRACK* Track;
TRACK* track;
for( Track = Pcb->m_Track; Track != NULL; Track = Track->Next() )
for( track = Pcb->m_Track; track; track = track->Next() )
{
if( Track->Type() != TYPEVIA )
if( track->Type() != TYPEVIA )
continue;
if( Track->m_Start != pos )
if( track->m_Start != pos )
continue;
if( Track->GetState( BUSY | DELETED ) )
if( track->GetState( BUSY | DELETED ) )
continue;
if( layer < 0 )
return Track;
if( Track->IsOnLayer( layer ) )
return Track;
break;
if( track->IsOnLayer( layer ) )
break;
}
return NULL;
return track;
}
/*******************************************************************/
TRACK* Locate_Via_Area( BOARD* Pcb, const wxPoint& pos, int layer )
TRACK* Locate_Via_Area( TRACK* aStart, const wxPoint& pos, int layer )
/*******************************************************************/
/*
* Like Locate_Via, but finds any via covering the cursor position
*/
{
TRACK* Track;
TRACK* track;
for( Track = Pcb->m_Track; Track != NULL; Track = Track->Next() )
for( track = aStart; track; track = track->Next() )
{
if( Track->Type() != TYPEVIA )
if( track->Type() != TYPEVIA )
continue;
if(!Track->HitTest(pos))
if( !track->HitTest(pos) )
continue;
if( Track->GetState( BUSY | DELETED ) )
if( track->GetState( BUSY | DELETED ) )
continue;
if( layer < 0 )
return Track;
if( Track->IsOnLayer( layer ) )
return Track;
break;
if( track->IsOnLayer( layer ) )
break;
}
return NULL;
return track;
}
......
......@@ -77,7 +77,15 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int ox,
TRACK* Locate_Via( BOARD* Pcb, const wxPoint& pos, int layer = -1 );
TRACK* Locate_Via_Area( BOARD* Pcb, const wxPoint& pos, int layer = -1 );
/**
* Function Locate_Via_Area
* finds the first SEGVIA which covers the given aPos with a matching layer.
* @param aStart The starting TRACK or SEGVIA in the BOARD's list.
* @param aPos The wxPoint to HitTest() against.
* @param aLayer The layer to match, pass -1 for a don't care.
* @return TRACK* - actually a SEGVIA* if found, else NULL.
*/
TRACK* Locate_Via_Area( TRACK* aStart, const wxPoint& aPos, int aLayer = -1 );
TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr,
const wxPoint& pos, int masquelayer );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment