2007-08-15 02:43:03 +00:00
|
|
|
/*****************************************/
|
|
|
|
/* Routines generales d'affichage du PCB */
|
|
|
|
/*****************************************/
|
|
|
|
|
|
|
|
/* fichier tracepcb.cpp */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/*
|
2007-08-15 02:43:03 +00:00
|
|
|
* Routines d'affichage grille, Boite de coordonnees, Curseurs, marqueurs ...
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "pcbnew.h"
|
|
|
|
#include "autorout.h"
|
|
|
|
#include "pcbplot.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
|
|
|
/* Routines Locales : */
|
|
|
|
|
|
|
|
/* Variables Locales */
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************/
|
2007-08-15 02:43:03 +00:00
|
|
|
void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
2007-06-05 12:10:51 +00:00
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
/* Trace le PCB, et les elements complementaires ( axes, grille .. )
|
2007-08-15 02:43:03 +00:00
|
|
|
* pour l'ecran actif et ses sous ecran
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
{
|
2007-08-15 02:43:03 +00:00
|
|
|
MODULE* Module;
|
|
|
|
PCB_SCREEN* screen = GetScreen();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
if( !m_Pcb || !screen )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
ActiveScreen = screen;
|
|
|
|
GRSetDrawMode( DC, GR_COPY );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
if( EraseBg )
|
|
|
|
DrawPanel->EraseScreen( DC );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
DrawPanel->DrawBackGround( DC );
|
|
|
|
TraceWorkSheet( DC, screen, 0 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
Module = (MODULE*) m_Pcb->m_Modules;
|
|
|
|
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
|
|
|
|
{
|
|
|
|
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
Affiche_Status_Box();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
if( DrawPanel->ManageCurseur )
|
|
|
|
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
/* Reaffichage du curseur */
|
|
|
|
DrawPanel->Trace_Curseur( DC );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
screen->ClrRefreshReq();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/****************************************************************/
|
2007-08-15 02:43:03 +00:00
|
|
|
void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
|
2007-06-05 12:10:51 +00:00
|
|
|
/****************************************************************/
|
2007-08-15 02:43:03 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/* Trace le PCB, et les elements complementaires ( axes, grille .. )
|
2007-08-15 02:43:03 +00:00
|
|
|
* pour l'ecran actif et ses sous ecran
|
|
|
|
*/
|
2007-06-05 12:10:51 +00:00
|
|
|
{
|
2007-08-15 02:43:03 +00:00
|
|
|
PCB_SCREEN* Screen = GetScreen();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
if( !m_Pcb || !Screen )
|
|
|
|
return;
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
ActiveScreen = GetScreen();
|
|
|
|
GRSetDrawMode( DC, GR_COPY );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
if( EraseBg )
|
|
|
|
DrawPanel->EraseScreen( DC );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
DrawPanel->DrawBackGround( DC );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
Trace_Pcb( DC, GR_OR );
|
|
|
|
TraceWorkSheet( DC, GetScreen(), 0 );
|
|
|
|
Affiche_Status_Box();
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
/* Reaffichage des curseurs */
|
|
|
|
for( Screen = GetScreen(); Screen != NULL; Screen = Screen->Next() )
|
|
|
|
{
|
|
|
|
if( DrawPanel->ManageCurseur )
|
|
|
|
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
|
|
|
|
DrawPanel->Trace_Curseur( DC );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
2007-08-15 02:43:03 +00:00
|
|
|
|
2007-06-05 12:10:51 +00:00
|
|
|
/****************************************************/
|
2007-08-15 02:43:03 +00:00
|
|
|
void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
|
2007-06-05 12:10:51 +00:00
|
|
|
/****************************************************/
|
|
|
|
/* Trace l'ensemble des elements du PCB sur l'ecran actif*/
|
|
|
|
{
|
2007-08-15 02:43:03 +00:00
|
|
|
MARQUEUR* Marqueur;
|
|
|
|
MODULE* Module;
|
|
|
|
EDA_BaseStruct* PtStruct;
|
|
|
|
|
|
|
|
if( !m_Pcb )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Module = (MODULE*) m_Pcb->m_Modules;
|
|
|
|
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
|
|
|
|
{
|
|
|
|
bool display = true;
|
|
|
|
int MaskLay = ALL_CU_LAYERS;
|
|
|
|
|
|
|
|
if( Module->m_Flags & IS_MOVED )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if( !DisplayOpt.Show_Modules_Cmp )
|
|
|
|
{
|
2007-08-23 04:28:46 +00:00
|
|
|
if( Module->GetLayer() == CMP_N )
|
2007-08-15 02:43:03 +00:00
|
|
|
display = FALSE;
|
|
|
|
MaskLay &= ~CMP_LAYER;
|
|
|
|
}
|
|
|
|
if( !DisplayOpt.Show_Modules_Cu )
|
|
|
|
{
|
2007-10-07 18:24:15 +00:00
|
|
|
if( Module->GetLayer() == COPPER_LAYER_N )
|
2007-08-15 02:43:03 +00:00
|
|
|
display = FALSE;
|
|
|
|
MaskLay &= ~CUIVRE_LAYER;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( display )
|
|
|
|
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
|
|
|
|
else
|
|
|
|
Trace_Pads_Only( DrawPanel, DC, Module, 0, 0, MaskLay, mode );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Trace des elements particuliers de Drawings Pcb */
|
|
|
|
|
|
|
|
PtStruct = m_Pcb->m_Drawings;
|
|
|
|
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
|
|
|
|
{
|
|
|
|
if( PtStruct->m_Flags & IS_MOVED )
|
|
|
|
continue;
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
switch( PtStruct->Type() )
|
2007-08-15 02:43:03 +00:00
|
|
|
{
|
|
|
|
case TYPECOTATION:
|
|
|
|
( (COTATION*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPETEXTE:
|
|
|
|
( (TEXTE_PCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPEMIRE:
|
|
|
|
( (MIREPCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TYPEMARQUEUR: /* Trace des marqueurs */
|
|
|
|
Marqueur = (MARQUEUR*) PtStruct;
|
|
|
|
Marqueur->Draw( DrawPanel, DC, mode );
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Trace_Pistes( DrawPanel, m_Pcb, DC, mode );
|
|
|
|
if( g_HightLigt_Status )
|
|
|
|
DrawHightLight( DC, g_HightLigth_NetCode );
|
|
|
|
|
|
|
|
EDGE_ZONE* segment = m_Pcb->m_CurrentLimitZone;
|
|
|
|
for( ; segment != NULL; segment = (EDGE_ZONE*) segment->Pback )
|
|
|
|
{
|
|
|
|
if( segment->m_Flags & IS_MOVED )
|
|
|
|
continue;
|
|
|
|
Trace_DrawSegmentPcb( DrawPanel, DC, segment, mode );
|
|
|
|
}
|
|
|
|
|
|
|
|
Trace_PcbEdges( DC, mode );
|
|
|
|
DrawGeneralRatsnest( DC );
|
|
|
|
|
|
|
|
m_CurrentScreen->ClrRefreshReq();
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************/
|
2007-08-15 02:43:03 +00:00
|
|
|
void WinEDA_PcbFrame::Trace_PcbEdges( wxDC* DC, int mode_color )
|
2007-06-05 12:10:51 +00:00
|
|
|
/**************************************************************/
|
|
|
|
/* impression des contours ( edge pcb) : et draw */
|
|
|
|
{
|
2007-08-15 02:43:03 +00:00
|
|
|
EDA_BaseStruct* PtStruct;
|
|
|
|
|
|
|
|
if( !m_Pcb )
|
|
|
|
return;
|
|
|
|
for( PtStruct = m_Pcb->m_Drawings; PtStruct != NULL; PtStruct = PtStruct->Pnext )
|
|
|
|
{
|
|
|
|
if( PtStruct->m_Flags & IS_MOVED )
|
|
|
|
continue;
|
2007-09-01 12:00:30 +00:00
|
|
|
if( PtStruct->Type() != TYPEDRAWSEGMENT )
|
2007-08-15 02:43:03 +00:00
|
|
|
continue;
|
|
|
|
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) PtStruct, mode_color );
|
|
|
|
}
|
2007-06-05 12:10:51 +00:00
|
|
|
}
|