Commit 1b39dfc7 authored by dickelbeck's avatar dickelbeck

highlight zone containers

parent 7750cf6d
...@@ -5,6 +5,13 @@ Started 2007-June-11 ...@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
Add ZONE_CONTAINER support to the ID_PCB_HIGHLIGHT_BUTT tool and
WinEDA_PcbFrame::DrawHightLight()
2008-Feb-18 UPDATE Dick Hollenbeck <dick@softplc.com> 2008-Feb-18 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================ ================================================================================
+pcbnew +pcbnew
......
...@@ -331,7 +331,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int ...@@ -331,7 +331,7 @@ void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int
// if PAD_SMD pad and high contrast mode // if PAD_SMD pad and high contrast mode
if( m_Attribut==PAD_SMD && DisplayOpt.ContrastModeDisplay ) if( (m_Attribut==PAD_SMD || m_Attribut==PAD_CONN) && DisplayOpt.ContrastModeDisplay )
{ {
// when routing tracks // when routing tracks
if( frame && frame->m_ID_current_state == ID_TRACK_BUTT ) if( frame && frame->m_ID_current_state == ID_TRACK_BUTT )
......
...@@ -93,11 +93,12 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = { ...@@ -93,11 +93,12 @@ const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = {
}; };
const KICAD_T GENERAL_COLLECTOR::PadsOrTracks[] = { const KICAD_T GENERAL_COLLECTOR::PadsTracksOrZones[] = {
TYPEPAD, TYPEPAD,
TYPEVIA, TYPEVIA,
TYPETRACK, TYPETRACK,
TYPEZONE, TYPEZONE,
TYPEZONE_CONTAINER,
EOT EOT
}; };
...@@ -368,20 +369,20 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[], ...@@ -368,20 +369,20 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
// see collectors.h // see collectors.h
SEARCH_RESULT TYPE_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* testData ) SEARCH_RESULT TYPE_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* testData )
{ {
// The Vist() function only visits the testItem if its type was in the // The Vist() function only visits the testItem if its type was in the
// the scanList, so therefore we can collect anything given to us here. // the scanList, so therefore we can collect anything given to us here.
Append( testItem ); Append( testItem );
return SEARCH_CONTINUE; // always when collecting return SEARCH_CONTINUE; // always when collecting
} }
void TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] ) void TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[] )
{ {
Empty(); // empty any existing collection Empty(); // empty any existing collection
// visit the board with the INSPECTOR (me). // visit the board with the INSPECTOR (me).
aBoard->Visit( this, // INSPECTOR* inspector aBoard->Visit( this, // INSPECTOR* inspector
NULL, // const void* testData, NULL, // const void* testData,
aScanList ); aScanList );
} }
......
This diff is collapsed.
...@@ -92,22 +92,22 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) ...@@ -92,22 +92,22 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
{ {
if( g_HightLigt_Status ) if( g_HightLigt_Status )
Hight_Light( DC ); Hight_Light( DC );
// use this scheme because of pad is higher priority than tracks in the // use this scheme because of pad is higher priority than tracks in the
// search, and finding a pad, instead of a track on a pad, // search, and finding a pad, instead of a track on a pad,
// allows us to fire a message to eescema. // allows us to fire a message to eescema.
GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide(); GENERAL_COLLECTORS_GUIDE guide = GetCollectorsGuide();
// optionally, modify the "guide" here as needed using its member functions // optionally, modify the "guide" here as needed using its member functions
m_Collector->Collect( m_Pcb, GENERAL_COLLECTOR::PadsOrTracks, m_Collector->Collect( m_Pcb, GENERAL_COLLECTOR::PadsTracksOrZones,
GetScreen()->RefPos( true ), guide ); GetScreen()->RefPos( true ), guide );
BOARD_ITEM* item = (*m_Collector)[0]; BOARD_ITEM* item = (*m_Collector)[0];
if( item ) if( item )
{ {
switch( item->Type() ) switch( item->Type() )
...@@ -117,7 +117,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) ...@@ -117,7 +117,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
Hight_Light( DC ); Hight_Light( DC );
SendMessageToEESCHEMA( item ); SendMessageToEESCHEMA( item );
return g_HightLigth_NetCode; return g_HightLigth_NetCode;
case TYPETRACK: case TYPETRACK:
case TYPEVIA: case TYPEVIA:
case TYPEZONE: case TYPEZONE:
...@@ -126,13 +126,18 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC ) ...@@ -126,13 +126,18 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
g_HightLigth_NetCode = ((TRACK*)item)->GetNet(); g_HightLigth_NetCode = ((TRACK*)item)->GetNet();
Hight_Light( DC ); Hight_Light( DC );
return g_HightLigth_NetCode; return g_HightLigth_NetCode;
case TYPEZONE_CONTAINER:
g_HightLigth_NetCode = ((ZONE_CONTAINER*)item)->GetNet();
Hight_Light( DC );
return g_HightLigth_NetCode;
default: default:
; // until somebody changes GENERAL_COLLECTOR::PadsOrTracks, ; // until somebody changes GENERAL_COLLECTOR::PadsOrTracks,
// this should not happen. // this should not happen.
} }
} }
return -1; // HitTest() failed. return -1; // HitTest() failed.
} }
...@@ -158,30 +163,37 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode ) ...@@ -158,30 +163,37 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
/* Turn On or OFF the HightLight for trcak and pads with the netcode "NetCode' /* Turn On or OFF the HightLight for trcak and pads with the netcode "NetCode'
*/ */
{ {
TRACK* pts;
MODULE* Module;
if( g_HightLigt_Status ) if( g_HightLigt_Status )
draw_mode = GR_SURBRILL | GR_OR; draw_mode = GR_SURBRILL | GR_OR;
else else
draw_mode = GR_AND | GR_SURBRILL; draw_mode = GR_AND | GR_SURBRILL;
Module = m_Pcb->m_Modules;
/* Redraw pads */ /* Redraw pads */
for( ; Module != NULL; Module = (MODULE*) Module->Pnext ) for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
{ {
Pad_Surbrillance( DrawPanel, DC, Module, NetCode ); Pad_Surbrillance( DrawPanel, DC, module, NetCode );
} }
/* Redraw track and vias: */ /* Redraw track and vias: */
for( pts = m_Pcb->m_Track; pts != NULL; pts = (TRACK*) pts->Pnext ) for( TRACK* pts = m_Pcb->m_Track; pts; pts = pts->Next() )
{ {
if( pts->GetNet() == NetCode ) if( pts->GetNet() == NetCode )
{ {
pts->Draw( DrawPanel, DC, draw_mode ); pts->Draw( DrawPanel, DC, draw_mode );
} }
} }
wxPoint zero(0,0); // construct outside loop for speed
// Redraw ZONE_CONTAINERS
BOARD::ZONE_CONTAINERS& zones = m_Pcb->m_ZoneDescriptorList;
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
{
if( (*zc)->GetNet() == NetCode )
{
(*zc)->Draw( DrawPanel, DC, zero, draw_mode );
}
}
} }
...@@ -193,12 +205,14 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel, ...@@ -193,12 +205,14 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
{ {
D_PAD* pt_pad; D_PAD* pt_pad;
wxPoint zero(0,0); // construct outside loop for speed
/* trace des pastilles */ /* trace des pastilles */
for( pt_pad = Module->m_Pads; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( pt_pad = Module->m_Pads; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{ {
if( pt_pad->GetNet() == NetCode ) if( pt_pad->GetNet() == NetCode )
{ {
pt_pad->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); pt_pad->Draw( panel, DC, zero, draw_mode );
} }
} }
} }
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