some enhancements. See changelog

This commit is contained in:
CHARRAS
2008-01-28 18:44:14 +00:00
parent 2f1b4cd1d9
commit 44c0105709
32 changed files with 1465 additions and 3568 deletions
+37 -1
View File
@@ -134,7 +134,7 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
TraceLignePcb( xi, yi, xf, yf, -1, HOLE | CELL_is_EDGE, WRITE_CELL );
}
/* Create a starting point to create the zone filling */
/* Create a starting point to create the zone filling, from pads */
LISTE_PAD* pad;
int cells_count = 0;
for( ii = 0, pad = frame->m_Pcb->m_Pads; ii < frame->m_Pcb->m_NbPads; ii++, pad++ )
@@ -157,6 +157,42 @@ int ZONE_CONTAINER::Fill_Zone( WinEDA_PcbFrame* frame, wxDC* DC, bool verbose )
}
}
/* Create a starting point to create the zone filling, from vias and tracks */
TRACK* track;
for( track = frame->m_Pcb->m_Track; track != NULL; track = track->Next() )
{
if ( ! track->IsOnLayer( GetLayer() ) ) continue;
if ( track->GetNet() != GetNet() ) continue;
wxPoint pos = track->m_Start;
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
OrCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM, CELL_is_ZONE );
cells_count++;
}
}
pos = track->m_End;
if( m_Poly->TestPointInside( pos.x, pos.y ) )
{
pos -= Pcb->m_BoundaryBox.m_Pos;
ZoneStartFill.x = ( pos.x + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
ZoneStartFill.y = ( pos.y + (g_GridRoutingSize / 2) ) / g_GridRoutingSize;
BoardCell cell = GetCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM );
if ( (cell & CELL_is_EDGE) == 0 )
{
OrCell( ZoneStartFill.y, ZoneStartFill.x, BOTTOM, CELL_is_ZONE );
cells_count++;
}
}
}
if( cells_count == 0 )
{
if( verbose )