BOARD_ITEM::Draw()

This commit is contained in:
dickelbeck 2008-04-01 05:21:50 +00:00
parent c439e0da05
commit aa93f54d97
56 changed files with 755 additions and 830 deletions

View File

@ -10,6 +10,10 @@ email address.
+all +all
Tweaked class MsgPanel so that the screen drawing only happens from Tweaked class MsgPanel so that the screen drawing only happens from
its OnPaint() function. its OnPaint() function.
+pcbnew
Added virtual BOARD_ITEM::Draw() and forced all BOARD_ITEM derived classes
to implement it so that all these functions are also virtual.
Made the offset argument default to the new wxPoint BOARD_ITEM::ZeroOffset
2008-Mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Mar-30 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>

View File

@ -94,7 +94,7 @@ void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( Module ) if( Module )
{ {
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_COPY ); Module->Draw( DrawPanel, DC, GR_COPY );
Module->Display_Infos( this ); Module->Display_Infos( this );
} }

View File

@ -574,6 +574,11 @@ public:
} }
/**
* A value of wxPoint(0,0) which can be passed to the Draw() functions.
*/
static wxPoint ZeroOffset;
BOARD_ITEM* Next() const { return (BOARD_ITEM*) Pnext; } BOARD_ITEM* Next() const { return (BOARD_ITEM*) Pnext; }
BOARD_ITEM* Back() const { return (BOARD_ITEM*) Pback; } BOARD_ITEM* Back() const { return (BOARD_ITEM*) Pback; }
BOARD_ITEM* GetParent() const { return (BOARD_ITEM*) m_Parent; } BOARD_ITEM* GetParent() const { return (BOARD_ITEM*) m_Parent; }
@ -600,6 +605,18 @@ public:
void SetLayer( int aLayer ) { m_Layer = aLayer; } void SetLayer( int aLayer ) { m_Layer = aLayer; }
/**
* Function Draw
* overrides Draw() from EDA_BaseStruct in order to make it virtual
* without the default color argument, which is more appropriate for
* BOARD_ITEMs which have their own color information.
*/
virtual void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset )
{
}
/** /**
* Function IsOnLayer * Function IsOnLayer
* tests to see if this object is on the given layer. Is virtual so * tests to see if this object is on the given layer. Is virtual so

View File

@ -287,7 +287,7 @@ void WinEDA_PcbFrame::AutoMoveModulesOnPcb( wxDC* DC, bool PlaceModulesHorsPcb )
PutOnGrid( &m_CurrentScreen->m_Curseur ); PutOnGrid( &m_CurrentScreen->m_Curseur );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
Place_Module( Module, DC ); /* positionne Module et recalcule cadre */ Place_Module( Module, DC ); /* positionne Module et recalcule cadre */
current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille; current.x += Module->m_RealBoundaryBox.GetWidth() + pas_grille;
@ -309,7 +309,7 @@ void WinEDA_PcbFrame::FixeModule( MODULE* Module, bool Fixe )
if( Module ) /* Traitement du module */ if( Module ) /* Traitement du module */
{ {
Module->SetLocked( Fixe ); Module->SetLocked( Fixe );
Module->Display_Infos( this ); Module->Display_Infos( this );
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
@ -354,9 +354,9 @@ void WinEDA_PcbFrame::ReOrientModules( const wxString& ModuleMask,
if( WildCompareString( ModuleMask, Module->m_Reference->m_Text, FALSE ) ) if( WildCompareString( ModuleMask, Module->m_Reference->m_Text, FALSE ) )
{ {
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
Rotate_Module( NULL, Module, Orient, FALSE ); Rotate_Module( NULL, Module, Orient, FALSE );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
} }
} }

View File

@ -182,7 +182,7 @@ void WinEDA_PcbFrame::AutoPlaceModule( MODULE* Module, int place_mode, wxDC* DC
if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen if( Module->m_ModuleStatus & MODULE_to_PLACE ) // Erase from screen
{ {
NbModules++; NbModules++;
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
} }
else else
{ {
@ -379,13 +379,13 @@ int WinEDA_PcbFrame::GenPlaceBoard()
* et initialise les cellules du board a * et initialise les cellules du board a
* - HOLE pour les cellules occupees par un segment EDGE * - HOLE pour les cellules occupees par un segment EDGE
* - CELL_is_ZONE pour les cellules internes au contour EDGE (s'il est ferme) * - CELL_is_ZONE pour les cellules internes au contour EDGE (s'il est ferme)
* *
* la surface de placement (board) donne les cellules internes au contour * la surface de placement (board) donne les cellules internes au contour
* du pcb, et parmi celle-ci les cellules libres et les cellules deja occupees * du pcb, et parmi celle-ci les cellules libres et les cellules deja occupees
* *
* le bitmap des penalites donnent les cellules occupes par les modules, * le bitmap des penalites donnent les cellules occupes par les modules,
* augmentes d'une surface de penalite liee au nombre de pads du module * augmentes d'une surface de penalite liee au nombre de pads du module
* *
* le bitmap des penalites est mis a 0 * le bitmap des penalites est mis a 0
* l'occupation des cellules est laisse a 0 * l'occupation des cellules est laisse a 0
*/ */
@ -720,7 +720,7 @@ int TstRectangle( BOARD* Pcb, int ux0, int uy0, int ux1, int uy1, int side )
/* tst si la surface rectangulaire (ux,y0 .. ux,y1): /* tst si la surface rectangulaire (ux,y0 .. ux,y1):
* - est sur une zone libre ( retourne OCCUPED_By_MODULE sinon) * - est sur une zone libre ( retourne OCCUPED_By_MODULE sinon)
* - est sur la surface utile du board ( retourne OUT_OF_BOARD sinon) * - est sur la surface utile du board ( retourne OUT_OF_BOARD sinon)
* *
* retourne 0 si OK * retourne 0 si OK
*/ */
{ {
@ -873,7 +873,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
return -1; return -1;
pt_local_chevelu = local_liste_chevelu; pt_local_chevelu = local_liste_chevelu;
ii = nb_local_chevelu; ii = nb_local_chevelu;
cout = 0; cout = 0;
while( ii-- > 0 ) while( ii-- > 0 )
@ -892,18 +892,18 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
} }
/* Evaluation du cout du chevelu: */ /* Evaluation du cout du chevelu: */
dx = fx - ox; dx = fx - ox;
dy = fy - oy; dy = fy - oy;
dx = abs( dx ); dx = abs( dx );
dy = abs( dy ); dy = abs( dy );
if( dx < dy ) if( dx < dy )
EXCHG( dx, dy );/* dx >= dy */ EXCHG( dx, dy );/* dx >= dy */
/* cout de la distance: */ /* cout de la distance: */
icout = (float) dx * dx; icout = (float) dx * dx;
/* cout de l'inclinaison */ /* cout de l'inclinaison */
icout += 3 * (float) dy * dy; icout += 3 * (float) dy * dy;
icout = sqrt( icout ); icout = sqrt( icout );
@ -926,10 +926,10 @@ void Build_PlacedPads_List( BOARD* Pcb )
* des caract utiles des pads du PCB pour Placement Automatique ) * des caract utiles des pads du PCB pour Placement Automatique )
* Cette liste est restreinte a la liste des pads des modules deja places sur * Cette liste est restreinte a la liste des pads des modules deja places sur
* la carte. * la carte.
* *
* parametres: * parametres:
* adresse du buffer de classement = Pcb->ptr_pads; * adresse du buffer de classement = Pcb->ptr_pads;
* *
* Variables globales mise a jour: * Variables globales mise a jour:
* pointeur ptr_pads (adr de classement de la liste des pads) * pointeur ptr_pads (adr de classement de la liste des pads)
* nb_pads = nombre utile de pastilles classes * nb_pads = nombre utile de pastilles classes

View File

@ -79,12 +79,12 @@ static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent,
parent->DrawPanel->m_IgnoreMouseEvents = TRUE; parent->DrawPanel->m_IgnoreMouseEvents = TRUE;
WinEDA_ExecBlockCmdFrame* frame = new WinEDA_ExecBlockCmdFrame( parent, title ); WinEDA_ExecBlockCmdFrame* frame = new WinEDA_ExecBlockCmdFrame( parent, title );
nocmd = frame->ShowModal(); nocmd = frame->ShowModal();
frame->Destroy(); frame->Destroy();
parent->GetScreen()->m_Curseur = oldpos; parent->GetScreen()->m_Curseur = oldpos;
parent->DrawPanel->MouseToCursorSchema(); parent->DrawPanel->MouseToCursorSchema();
parent->DrawPanel->m_IgnoreMouseEvents = FALSE; parent->DrawPanel->m_IgnoreMouseEvents = FALSE;
@ -117,7 +117,7 @@ WinEDA_ExecBlockCmdFrame::WinEDA_ExecBlockCmdFrame( WinEDA_BasePcbFrame* parent,
fgSizer1 = new wxFlexGridSizer( 1, 1, 0, 0 ); fgSizer1 = new wxFlexGridSizer( 1, 1, 0, 0 );
fgSizer1->SetFlexibleDirection( wxBOTH ); fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
// Selection des options : // Selection des options :
m_Include_Modules = new wxCheckBox( this, -1, _( "Include Modules" ), wxDefaultPosition, wxDefaultSize, 0 ); m_Include_Modules = new wxCheckBox( this, -1, _( "Include Modules" ), wxDefaultPosition, wxDefaultSize, 0 );
m_Include_Modules->SetValue( Block_Include_Modules ); m_Include_Modules->SetValue( Block_Include_Modules );
@ -403,7 +403,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, bool era
int Color; int Color;
BASE_SCREEN* screen = panel->GetScreen(); BASE_SCREEN* screen = panel->GetScreen();
Color = YELLOW; Color = YELLOW;
GRSetDrawMode( DC, g_XorMode ); GRSetDrawMode( DC, g_XorMode );
/* Effacement ancien cadre */ /* Effacement ancien cadre */
@ -463,11 +463,11 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
{ {
NextS = module->Next(); NextS = module->Next();
if( module->HitTest( GetScreen()->BlockLocate ) ) if( module->HitTest( GetScreen()->BlockLocate ) )
{ {
module->m_Flags = 0; module->m_Flags = 0;
module->DeleteStructure(); module->DeleteStructure();
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
} }
} }
} }
@ -480,7 +480,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
{ {
NextS = pt_segm->Next(); NextS = pt_segm->Next();
if( pt_segm->HitTest( GetScreen()->BlockLocate ) ) if( pt_segm->HitTest( GetScreen()->BlockLocate ) )
{ {
/* la piste est ici bonne a etre efface */ /* la piste est ici bonne a etre efface */
pt_segm->DeleteStructure(); pt_segm->DeleteStructure();
} }
@ -491,7 +491,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
masque_layer = EDGE_LAYER; masque_layer = EDGE_LAYER;
if( Block_Include_Draw_Items ) if( Block_Include_Draw_Items )
masque_layer = ALL_LAYERS; masque_layer = ALL_LAYERS;
if( !Block_Include_Edges_Items ) if( !Block_Include_Edges_Items )
masque_layer &= ~EDGE_LAYER; masque_layer &= ~EDGE_LAYER;
@ -520,14 +520,12 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
break; break;
/* le texte est ici bon a etre efface */ /* le texte est ici bon a etre efface */
( (TEXTE_PCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); PtStruct->Draw( DrawPanel, DC, GR_XOR );
/* Suppression du texte en Memoire*/ /* Suppression du texte en Memoire*/
PtStruct->DeleteStructure(); PtStruct->DeleteStructure();
break; break;
case TYPEMIRE: case TYPEMIRE:
#undef STRUCT
#define STRUCT ( (MIREPCB*) PtStruct )
if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 ) if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 )
break; break;
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
@ -537,8 +535,6 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
break; break;
case TYPECOTATION: case TYPECOTATION:
#undef STRUCT
#define STRUCT ( (COTATION*) PtStruct )
if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 ) if( (g_TabOneLayerMask[STRUCT->GetLayer()] & masque_layer) == 0 )
break; break;
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
@ -561,29 +557,29 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
{ {
NextSegZ = pt_segm->Next(); NextSegZ = pt_segm->Next();
if( pt_segm->HitTest( GetScreen()->BlockLocate ) ) if( pt_segm->HitTest( GetScreen()->BlockLocate ) )
{ {
pt_segm->DeleteStructure(); pt_segm->DeleteStructure();
} }
} }
for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) ) if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) )
{ {
m_Pcb->Delete(m_Pcb->GetArea(ii)); m_Pcb->Delete(m_Pcb->GetArea(ii));
ii--; // because the current data was removed, ii points actually the next data ii--; // because the current data was removed, ii points actually the next data
} }
} }
} }
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
Compile_Ratsnest( DC, TRUE ); Compile_Ratsnest( DC, TRUE );
else else
{ {
m_Pcb->m_Status_Pcb = 0; /* we need (later) a full ratnest computation */ m_Pcb->m_Status_Pcb = 0; /* we need (later) a full ratnest computation */
build_liste_pads(); build_liste_pads();
} }
} }
@ -666,19 +662,19 @@ void WinEDA_BasePcbFrame::Block_Rotate( wxDC* DC )
while( track ) while( track )
{ {
if( track->HitTest( GetScreen()->BlockLocate ) ) if( track->HitTest( GetScreen()->BlockLocate ) )
{ {
RotatePoint( &track->m_Start, centre, 900 ); RotatePoint( &track->m_Start, centre, 900 );
RotatePoint( &track->m_End, centre, 900 ); RotatePoint( &track->m_End, centre, 900 );
} }
track = track->Next(); track = track->Next();
} }
for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) ) if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) )
{ {
m_Pcb->GetArea(ii)->Rotate(centre, 900); m_Pcb->GetArea(ii)->Rotate(centre, 900);
} }
} }
} }
masque_layer = EDGE_LAYER; masque_layer = EDGE_LAYER;
@ -848,14 +844,14 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
} }
track = (TRACK*) track->Pnext; track = (TRACK*) track->Pnext;
} }
for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) ) if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) )
{ {
m_Pcb->GetArea(ii)->Mirror( wxPoint(0, centerY) ); m_Pcb->GetArea(ii)->Mirror( wxPoint(0, centerY) );
m_Pcb->GetArea(ii)->SetLayer( ChangeSideNumLayer( m_Pcb->GetArea(ii)->GetLayer() ) ); m_Pcb->GetArea(ii)->SetLayer( ChangeSideNumLayer( m_Pcb->GetArea(ii)->GetLayer() ) );
} }
} }
} }
masque_layer = EDGE_LAYER; masque_layer = EDGE_LAYER;
@ -925,7 +921,7 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
break; break;
/* l'element est ici bon a etre modifie */ /* l'element est ici bon a etre modifie */
STRUCT->Mirror( wxPoint(0, centerY) ); STRUCT->Mirror( wxPoint(0, centerY) );
STRUCT->SetLayer( ChangeSideNumLayer( STRUCT->GetLayer() ) ); STRUCT->SetLayer( ChangeSideNumLayer( STRUCT->GetLayer() ) );
break; break;
@ -1018,13 +1014,13 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
} }
track = (TRACK*) track->Pnext; track = (TRACK*) track->Pnext;
} }
for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for ( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) ) if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) )
{ {
m_Pcb->GetArea(ii)->Move( MoveVector ); m_Pcb->GetArea(ii)->Move( MoveVector );
} }
} }
} }
masque_layer = EDGE_LAYER; masque_layer = EDGE_LAYER;
@ -1046,7 +1042,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
break; break;
/* l'element est ici bon a etre efface */ /* l'element est ici bon a etre efface */
STRUCT->m_Start += MoveVector; STRUCT->m_Start += MoveVector;
STRUCT->m_End += MoveVector; STRUCT->m_End += MoveVector;
break; break;
@ -1081,7 +1077,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
break; break;
/* l'element est ici bon a etre efface */ /* l'element est ici bon a etre efface */
( (COTATION*) PtStruct )->Move( wxPoint(MoveVector) ); ( (COTATION*) PtStruct )->Move( wxPoint(MoveVector) );
break; break;
default: default:
@ -1107,7 +1103,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
EDA_BaseStruct* PtStruct; EDA_BaseStruct* PtStruct;
int masque_layer; int masque_layer;
wxPoint oldpos; wxPoint oldpos;
wxPoint MoveVector = GetScreen()->BlockLocate.m_MoveVector; wxPoint MoveVector = GetScreen()->BlockLocate.m_MoveVector;
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
@ -1124,7 +1120,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
if( Block_Include_Modules ) if( Block_Include_Modules )
{ {
bool Show_Ratsnest_tmp = g_Show_Ratsnest; bool Show_Ratsnest_tmp = g_Show_Ratsnest;
g_Show_Ratsnest = false; g_Show_Ratsnest = false;
module = m_Pcb->m_Modules; module = m_Pcb->m_Modules;
oldpos = GetScreen()->m_Curseur; oldpos = GetScreen()->m_Curseur;
@ -1143,7 +1139,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
new_module->Pback = m_Pcb; new_module->Pback = m_Pcb;
m_Pcb->m_Modules->Pback = new_module; m_Pcb->m_Modules->Pback = new_module;
m_Pcb->m_Modules = new_module; m_Pcb->m_Modules = new_module;
GetScreen()->m_Curseur = module->m_Pos + MoveVector; GetScreen()->m_Curseur = module->m_Pos + MoveVector;
Place_Module( new_module, DC ); Place_Module( new_module, DC );
} }
@ -1160,7 +1156,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
{ {
next_track = track->Next(); next_track = track->Next();
if( track->HitTest( GetScreen()->BlockLocate ) ) if( track->HitTest( GetScreen()->BlockLocate ) )
{ {
/* la piste est ici bonne a etre deplacee */ /* la piste est ici bonne a etre deplacee */
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
new_track = track->Copy(); new_track = track->Copy();
@ -1181,7 +1177,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
while( segzone ) while( segzone )
{ {
if( segzone->HitTest( GetScreen()->BlockLocate ) ) if( segzone->HitTest( GetScreen()->BlockLocate ) )
{ {
new_segzone = (SEGZONE*) segzone->Copy(); new_segzone = (SEGZONE*) segzone->Copy();
new_segzone->Insert( m_Pcb, NULL ); new_segzone->Insert( m_Pcb, NULL );
new_segzone->m_Start += MoveVector; new_segzone->m_Start += MoveVector;
@ -1191,19 +1187,19 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
segzone = segzone->Next(); segzone = segzone->Next();
} }
unsigned imax = m_Pcb->GetAreaCount(); unsigned imax = m_Pcb->GetAreaCount();
for ( unsigned ii = 0; ii < imax; ii++ ) for ( unsigned ii = 0; ii < imax; ii++ )
{ {
if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) ) if( m_Pcb->GetArea(ii)->HitTest( GetScreen()->BlockLocate ) )
{ {
ZONE_CONTAINER * new_zone = new ZONE_CONTAINER(m_Pcb); ZONE_CONTAINER * new_zone = new ZONE_CONTAINER(m_Pcb);
new_zone->Copy( m_Pcb->GetArea(ii) ); new_zone->Copy( m_Pcb->GetArea(ii) );
new_zone->m_TimeStamp = GetTimeStamp(); new_zone->m_TimeStamp = GetTimeStamp();
new_zone->Move( MoveVector ); new_zone->Move( MoveVector );
m_Pcb->Add(new_zone); m_Pcb->Add(new_zone);
new_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); new_zone->Draw( DrawPanel, DC, GR_OR );
} }
} }
} }
masque_layer = EDGE_LAYER; masque_layer = EDGE_LAYER;
@ -1225,11 +1221,11 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
break; break;
if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) ) if( ! PtStruct->HitTest( GetScreen()->BlockLocate ) )
break; break;
/* l'element est ici bon a etre copie */ /* l'element est ici bon a etre copie */
DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb ); DRAWSEGMENT* new_drawsegment = new DRAWSEGMENT( m_Pcb );
new_drawsegment->Copy( STRUCT ); new_drawsegment->Copy( STRUCT );
new_drawsegment->Pnext = m_Pcb->m_Drawings; new_drawsegment->Pnext = m_Pcb->m_Drawings;
new_drawsegment->Pback = m_Pcb; new_drawsegment->Pback = m_Pcb;
m_Pcb->m_Drawings->Pback = new_drawsegment; m_Pcb->m_Drawings->Pback = new_drawsegment;
@ -1257,7 +1253,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb->m_Drawings = new_pcbtext; m_Pcb->m_Drawings = new_pcbtext;
/* Redessin du Texte */ /* Redessin du Texte */
new_pcbtext->m_Pos += MoveVector; new_pcbtext->m_Pos += MoveVector;
new_pcbtext->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); new_pcbtext->Draw( DrawPanel, DC, GR_OR );
break; break;
} }
@ -1277,7 +1273,7 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
m_Pcb->m_Drawings->Pback = new_mire; m_Pcb->m_Drawings->Pback = new_mire;
m_Pcb->m_Drawings = new_mire; m_Pcb->m_Drawings = new_mire;
new_mire->m_Pos += MoveVector; new_mire->m_Pos += MoveVector;
new_mire->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); new_mire->Draw( DrawPanel, DC, GR_OR );
break; break;
} }
@ -1296,8 +1292,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
new_cotation->Pback = m_Pcb; new_cotation->Pback = m_Pcb;
m_Pcb->m_Drawings->Pback = new_cotation; m_Pcb->m_Drawings->Pback = new_cotation;
m_Pcb->m_Drawings = new_cotation; m_Pcb->m_Drawings = new_cotation;
new_cotation->Move( MoveVector ); new_cotation->Move( MoveVector );
new_cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); new_cotation->Draw( DrawPanel, DC, GR_OR );
break; break;
} }

View File

@ -293,7 +293,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
DrawBlockStruct* PtBlock; DrawBlockStruct* PtBlock;
BASE_SCREEN* screen = panel->m_Parent->GetScreen(); BASE_SCREEN* screen = panel->m_Parent->GetScreen();
EDA_BaseStruct* item; BOARD_ITEM* item;
wxPoint move_offset; wxPoint move_offset;
MODULE* Currentmodule = g_EDA_Appl->m_ModuleEditFrame->m_Pcb->m_Modules; MODULE* Currentmodule = g_EDA_Appl->m_ModuleEditFrame->m_Pcb->m_Modules;
@ -320,11 +320,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPETEXTEMODULE:
( (TEXTE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
break;
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
( (EDGE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode ); item->Draw( panel, DC, g_XorMode, move_offset );
break; break;
default: default:
@ -337,7 +334,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( pad->m_Selected == 0 ) if( pad->m_Selected == 0 )
continue; continue;
pad->Draw( panel, DC, move_offset, g_XorMode ); pad->Draw( panel, DC, g_XorMode, move_offset );
} }
} }
} }
@ -365,11 +362,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPETEXTEMODULE:
( (TEXTE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode );
break;
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
( (EDGE_MODULE*) item )->Draw( panel, DC, move_offset, g_XorMode ); item->Draw( panel, DC, g_XorMode, move_offset );
break; break;
default: default:
@ -382,7 +376,7 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( pad->m_Selected == 0 ) if( pad->m_Selected == 0 )
continue; continue;
pad->Draw( panel, DC, move_offset, g_XorMode ); pad->Draw( panel, DC, g_XorMode, move_offset );
} }
} }
} }
@ -495,13 +489,13 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
( (EDGE_MODULE*) item )->m_Start.x += offset.x; ( (EDGE_MODULE*) item )->m_Start.x += offset.x;
( (EDGE_MODULE*) item )->m_Start.y += offset.y; ( (EDGE_MODULE*) item )->m_Start.y += offset.y;
( (EDGE_MODULE*) item )->m_End.x += offset.x; ( (EDGE_MODULE*) item )->m_End.x += offset.x;
( (EDGE_MODULE*) item )->m_End.y += offset.y; ( (EDGE_MODULE*) item )->m_End.y += offset.y;
( (EDGE_MODULE*) item )->m_Start0.x += offset.x; ( (EDGE_MODULE*) item )->m_Start0.x += offset.x;
( (EDGE_MODULE*) item )->m_Start0.y += offset.y; ( (EDGE_MODULE*) item )->m_Start0.y += offset.y;
( (EDGE_MODULE*) item )->m_End0.x += offset.x; ( (EDGE_MODULE*) item )->m_End0.x += offset.x;
( (EDGE_MODULE*) item )->m_End0.y += offset.y; ( (EDGE_MODULE*) item )->m_End0.y += offset.y;
break; break;
@ -596,7 +590,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
SETMIRROR( ( (TEXTE_MODULE*) item )->GetPosition().x ); SETMIRROR( ( (TEXTE_MODULE*) item )->GetPosition().x );
( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->GetPosition().x; ( (TEXTE_MODULE*) item )->m_Pos0.x = ( (TEXTE_MODULE*) item )->GetPosition().x;
break; break;
default: default:
; ;
} }
@ -650,7 +644,7 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->GetPosition(); ( (TEXTE_MODULE*) item )->m_Pos0 = ( (TEXTE_MODULE*) item )->GetPosition();
( (TEXTE_MODULE*) item )->m_Orient += 900; ( (TEXTE_MODULE*) item )->m_Orient += 900;
break; break;
default: default:
; ;
} }

View File

@ -7,6 +7,12 @@
#include "pcbnew.h" #include "pcbnew.h"
/* This is an odd place for this, but cvpcb won't link if it is
in class_board_item.cpp like I first tried it.
*/
wxPoint BOARD_ITEM::ZeroOffset(0,0);
/*****************/ /*****************/
/* Class BOARD: */ /* Class BOARD: */
/*****************/ /*****************/
@ -1037,7 +1043,7 @@ void BOARD::RedrawAreasOutlines(WinEDA_DrawPanel* panel, wxDC * aDC, int aDrawMo
{ {
ZONE_CONTAINER* edge_zone = GetArea(ii); ZONE_CONTAINER* edge_zone = GetArea(ii);
if( (aLayer < 0) || (aLayer == edge_zone->GetLayer()) ) if( (aLayer < 0) || (aLayer == edge_zone->GetLayer()) )
edge_zone->Draw( panel, aDC, wxPoint( 0, 0 ), aDrawMode ); edge_zone->Draw( panel, aDC, aDrawMode );
} }
} }

View File

@ -16,6 +16,7 @@
#include "Add_Mires.xpm" #include "Add_Mires.xpm"
/********************************************************/ /********************************************************/
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
/********************************************************/ /********************************************************/

View File

@ -69,7 +69,7 @@ wxString COTATION:: GetText( void )
/* Reutun the dimension text /* Reutun the dimension text
*/ */
{ {
return m_Text->m_Text; return m_Text->m_Text;
} }
@ -123,7 +123,7 @@ bool COTATION::ReadCotationDescr( FILE* File, int* LineNum )
if( Line[0] == 'G' ) if( Line[0] == 'G' )
{ {
int layer; int layer;
sscanf( Line + 2, " %d %d %lX", &m_Shape, &layer, &m_TimeStamp ); sscanf( Line + 2, " %d %d %lX", &m_Shape, &layer, &m_TimeStamp );
/* Mise a jour des param .layer des sous structures */ /* Mise a jour des param .layer des sous structures */
@ -234,22 +234,22 @@ void COTATION::Move(const wxPoint& offset)
* @param offset : moving vector * @param offset : moving vector
*/ */
{ {
m_Pos += offset; m_Pos += offset;
m_Text->m_Pos += offset; m_Text->m_Pos += offset;
Barre_ox += offset.x; Barre_oy += offset.y; Barre_ox += offset.x; Barre_oy += offset.y;
Barre_fx += offset.x; Barre_fy += offset.y; Barre_fx += offset.x; Barre_fy += offset.y;
TraitG_ox += offset.x; TraitG_oy += offset.y; TraitG_ox += offset.x; TraitG_oy += offset.y;
TraitG_fx += offset.x; TraitG_fy += offset.y; TraitG_fx += offset.x; TraitG_fy += offset.y;
TraitD_ox += offset.x; TraitD_oy += offset.y; TraitD_ox += offset.x; TraitD_oy += offset.y;
TraitD_fx += offset.x; TraitD_fy += offset.y; TraitD_fx += offset.x; TraitD_fy += offset.y;
FlecheG1_ox += offset.x; FlecheG1_oy += offset.y; FlecheG1_ox += offset.x; FlecheG1_oy += offset.y;
FlecheG1_fx += offset.x; FlecheG1_fy += offset.y; FlecheG1_fx += offset.x; FlecheG1_fy += offset.y;
FlecheG2_ox += offset.x; FlecheG2_oy += offset.y; FlecheG2_ox += offset.x; FlecheG2_oy += offset.y;
FlecheG2_fx += offset.x; FlecheG2_fy += offset.y; FlecheG2_fx += offset.x; FlecheG2_fy += offset.y;
FlecheD1_ox += offset.x; FlecheD1_oy += offset.y; FlecheD1_ox += offset.x; FlecheD1_oy += offset.y;
FlecheD1_fx += offset.x; FlecheD1_fy += offset.y; FlecheD1_fx += offset.x; FlecheD1_fy += offset.y;
FlecheD2_ox += offset.x; FlecheD2_oy += offset.y; FlecheD2_ox += offset.x; FlecheD2_oy += offset.y;
FlecheD2_fx += offset.x; FlecheD2_fy += offset.y; FlecheD2_fx += offset.x; FlecheD2_fy += offset.y;
} }
@ -262,30 +262,30 @@ void COTATION::Rotate(const wxPoint& centre, int angle)
* @param angle : Rotation angle in 0.1 degrees * @param angle : Rotation angle in 0.1 degrees
*/ */
{ {
RotatePoint( &m_Pos, centre, 900 ); RotatePoint( &m_Pos, centre, 900 );
RotatePoint( &m_Text->m_Pos, centre, 900 ); RotatePoint( &m_Text->m_Pos, centre, 900 );
m_Text->m_Orient += 900; m_Text->m_Orient += 900;
if( m_Text->m_Orient >= 3600 ) if( m_Text->m_Orient >= 3600 )
m_Text->m_Orient -= 3600; m_Text->m_Orient -= 3600;
if( (m_Text->m_Orient > 900) if( (m_Text->m_Orient > 900)
&& (m_Text->m_Orient <2700) ) && (m_Text->m_Orient <2700) )
m_Text->m_Orient -= 1800; m_Text->m_Orient -= 1800;
RotatePoint( &Barre_ox, &Barre_oy, centre.x, centre.y, 900 ); RotatePoint( &Barre_ox, &Barre_oy, centre.x, centre.y, 900 );
RotatePoint( &Barre_fx, &Barre_fy, centre.x, centre.y, 900 ); RotatePoint( &Barre_fx, &Barre_fy, centre.x, centre.y, 900 );
RotatePoint( &TraitG_ox, &TraitG_oy, centre.x, centre.y, 900 ); RotatePoint( &TraitG_ox, &TraitG_oy, centre.x, centre.y, 900 );
RotatePoint( &TraitG_fx, &TraitG_fy, centre.x, centre.y, 900 ); RotatePoint( &TraitG_fx, &TraitG_fy, centre.x, centre.y, 900 );
RotatePoint( &TraitD_ox, &TraitD_oy, centre.x, centre.y, 900 ); RotatePoint( &TraitD_ox, &TraitD_oy, centre.x, centre.y, 900 );
RotatePoint( &TraitD_fx, &TraitD_fy, centre.x, centre.y, 900 ); RotatePoint( &TraitD_fx, &TraitD_fy, centre.x, centre.y, 900 );
RotatePoint( &FlecheG1_ox, &FlecheG1_oy, centre.x, centre.y, 900 ); RotatePoint( &FlecheG1_ox, &FlecheG1_oy, centre.x, centre.y, 900 );
RotatePoint( &FlecheG1_fx, &FlecheG1_fy, centre.x, centre.y, 900 ); RotatePoint( &FlecheG1_fx, &FlecheG1_fy, centre.x, centre.y, 900 );
RotatePoint( &FlecheG2_ox, &FlecheG2_oy, centre.x, centre.y, 900 ); RotatePoint( &FlecheG2_ox, &FlecheG2_oy, centre.x, centre.y, 900 );
RotatePoint( &FlecheG2_fx, &FlecheG2_fy, centre.x, centre.y, 900 ); RotatePoint( &FlecheG2_fx, &FlecheG2_fy, centre.x, centre.y, 900 );
RotatePoint( &FlecheD1_ox, &FlecheD1_oy, centre.x, centre.y, 900 ); RotatePoint( &FlecheD1_ox, &FlecheD1_oy, centre.x, centre.y, 900 );
RotatePoint( &FlecheD1_fx, &FlecheD1_fy, centre.x, centre.y, 900 ); RotatePoint( &FlecheD1_fx, &FlecheD1_fy, centre.x, centre.y, 900 );
RotatePoint( &FlecheD2_ox, &FlecheD2_oy, centre.x, centre.y, 900 ); RotatePoint( &FlecheD2_ox, &FlecheD2_oy, centre.x, centre.y, 900 );
RotatePoint( &FlecheD2_fx, &FlecheD2_fy, centre.x, centre.y, 900 ); RotatePoint( &FlecheD2_fx, &FlecheD2_fy, centre.x, centre.y, 900 );
} }
@ -302,28 +302,28 @@ void COTATION::Mirror(const wxPoint& axis_pos)
{ {
#define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y ) #define INVERT( pos ) (pos) = axis_pos.y - ( (pos) - axis_pos.y )
#define INVERT_ANGLE( phi ) (phi) = -(phi) #define INVERT_ANGLE( phi ) (phi) = -(phi)
INVERT( m_Pos.y ); INVERT( m_Pos.y );
INVERT( m_Text->m_Pos.y ); INVERT( m_Text->m_Pos.y );
INVERT_ANGLE( m_Text->m_Orient ); INVERT_ANGLE( m_Text->m_Orient );
if( m_Text->m_Orient >= 3600 ) if( m_Text->m_Orient >= 3600 )
m_Text->m_Orient -= 3600; m_Text->m_Orient -= 3600;
if( (m_Text->m_Orient > 900) && (m_Text->m_Orient <2700) ) if( (m_Text->m_Orient > 900) && (m_Text->m_Orient <2700) )
m_Text->m_Orient -= 1800; m_Text->m_Orient -= 1800;
INVERT( Barre_oy ); INVERT( Barre_oy );
INVERT( Barre_fy ); INVERT( Barre_fy );
INVERT( TraitG_oy ); INVERT( TraitG_oy );
INVERT( TraitG_fy ); INVERT( TraitG_fy );
INVERT( TraitD_oy ); INVERT( TraitD_oy );
INVERT( TraitD_fy ); INVERT( TraitD_fy );
INVERT( FlecheG1_oy ); INVERT( FlecheG1_oy );
INVERT( FlecheG1_fy ); INVERT( FlecheG1_fy );
INVERT( FlecheG2_oy ); INVERT( FlecheG2_oy );
INVERT( FlecheG2_fy ); INVERT( FlecheG2_fy );
INVERT( FlecheD1_oy ); INVERT( FlecheD1_oy );
INVERT( FlecheD1_fy ); INVERT( FlecheD1_fy );
INVERT( FlecheD2_oy ); INVERT( FlecheD2_oy );
INVERT( FlecheD2_fy ); INVERT( FlecheD2_fy );
} }
/****************************************/ /****************************************/
@ -334,7 +334,7 @@ bool COTATION::Save( FILE* aFile ) const
return true; return true;
bool rc = false; bool rc = false;
if( fprintf( aFile, "$COTATION\n" ) != sizeof("$COTATION\n")-1 ) if( fprintf( aFile, "$COTATION\n" ) != sizeof("$COTATION\n")-1 )
goto out; goto out;
@ -384,19 +384,19 @@ bool COTATION::Save( FILE* aFile ) const
if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 ) if( fprintf( aFile, "$EndCOTATION\n" ) != sizeof("$EndCOTATION\n")-1 )
goto out; goto out;
rc = true; rc = true;
out: out:
return rc; return rc;
} }
/************************************************************************/ /************************************************************************/
void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int mode_color ) int mode_color, const wxPoint& offset )
/************************************************************************/ /************************************************************************/
/* impression de 1 cotation : serie de n segments + 1 texte /* impression de 1 cotation : serie de n segments + 1 texte
@ -408,7 +408,7 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
ox = offset.x; ox = offset.x;
oy = offset.y; oy = offset.y;
m_Text->Draw( panel, DC, offset, mode_color ); m_Text->Draw( panel, DC, mode_color, offset );
gcolor = g_DesignSettings.m_LayerColor[m_Layer]; gcolor = g_DesignSettings.m_LayerColor[m_Layer];
if( (gcolor & ITEM_NOT_SHOW) != 0 ) if( (gcolor & ITEM_NOT_SHOW) != 0 )
@ -416,7 +416,7 @@ void COTATION::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode( DC, mode_color ); GRSetDrawMode( DC, mode_color );
typeaff = DisplayOpt.DisplayDrawItems; typeaff = DisplayOpt.DisplayDrawItems;
width = m_Width; width = m_Width;
if( width / zoom < 2 ) if( width / zoom < 2 )
typeaff = FILAIRE; typeaff = FILAIRE;
@ -513,95 +513,95 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
} }
/* Localisation des SEGMENTS ?) */ /* Localisation des SEGMENTS ?) */
ux0 = Barre_ox; ux0 = Barre_ox;
uy0 = Barre_oy; uy0 = Barre_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = Barre_fx - ux0; dx = Barre_fx - ux0;
dy = Barre_fy - uy0; dy = Barre_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = TraitG_ox; ux0 = TraitG_ox;
uy0 = TraitG_oy; uy0 = TraitG_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = TraitG_fx - ux0; dx = TraitG_fx - ux0;
dy = TraitG_fy - uy0; dy = TraitG_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
/* detection : */ /* detection : */
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = TraitD_ox; ux0 = TraitD_ox;
uy0 = TraitD_oy; uy0 = TraitD_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = TraitD_fx - ux0; dx = TraitD_fx - ux0;
dy = TraitD_fy - uy0; dy = TraitD_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
/* detection : */ /* detection : */
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = FlecheD1_ox; ux0 = FlecheD1_ox;
uy0 = FlecheD1_oy; uy0 = FlecheD1_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = FlecheD1_fx - ux0; dx = FlecheD1_fx - ux0;
dy = FlecheD1_fy - uy0; dy = FlecheD1_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
/* detection : */ /* detection : */
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = FlecheD2_ox; ux0 = FlecheD2_ox;
uy0 = FlecheD2_oy; uy0 = FlecheD2_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = FlecheD2_fx - ux0; dx = FlecheD2_fx - ux0;
dy = FlecheD2_fy - uy0; dy = FlecheD2_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = FlecheG1_ox; ux0 = FlecheG1_ox;
uy0 = FlecheG1_oy; uy0 = FlecheG1_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = FlecheG1_fx - ux0; dx = FlecheG1_fx - ux0;
dy = FlecheG1_fy - uy0; dy = FlecheG1_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
return true; return true;
ux0 = FlecheG2_ox; ux0 = FlecheG2_ox;
uy0 = FlecheG2_oy; uy0 = FlecheG2_oy;
/* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */ /* recalcul des coordonnees avec ux0, uy0 = origine des coordonnees */
dx = FlecheG2_fx - ux0; dx = FlecheG2_fx - ux0;
dy = FlecheG2_fy - uy0; dy = FlecheG2_fy - uy0;
spot_cX = ref_pos.x - ux0; spot_cX = ref_pos.x - ux0;
spot_cY = ref_pos.y - uy0; spot_cY = ref_pos.y - uy0;
if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) ) if( DistanceTest( m_Width / 2, dx, dy, spot_cX, spot_cY ) )
@ -618,7 +618,7 @@ bool COTATION::HitTest( const wxPoint& ref_pos )
*/ */
bool COTATION::HitTest( EDA_Rect& refArea ) bool COTATION::HitTest( EDA_Rect& refArea )
{ {
if( refArea.Inside( m_Pos ) ) if( refArea.Inside( m_Pos ) )
return true; return true;
return false; return false;
} }

View File

@ -32,8 +32,8 @@ public:
{ {
return m_Pos; return m_Pos;
} }
bool ReadCotationDescr( FILE* File, int* LineNum ); bool ReadCotationDescr( FILE* File, int* LineNum );
/** /**
@ -41,9 +41,9 @@ public:
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/* supprime du chainage la structure Struct */ /* supprime du chainage la structure Struct */
void UnLink(); void UnLink();
@ -53,29 +53,30 @@ public:
void Copy( COTATION* source ); void Copy( COTATION* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int mode_color ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aColorMode, const wxPoint& offset = ZeroOffset );
/**
* Function Move
* @param offset : moving vector
*/
void Move(const wxPoint& offset);
/** /**
* Function Rotate * Function Move
* @param offset : Rotation point * @param offset : moving vector
* @param angle : Rotation angle in 0.1 degrees */
*/ void Move(const wxPoint& offset);
void Rotate(const wxPoint& centre, int angle);
/** /**
* Function Mirror * Function Rotate
* Mirror the Dimension , relative to a given horizontal axis * @param offset : Rotation point
* the text is not mirrored. only its position (and angle) is mirrored * @param angle : Rotation angle in 0.1 degrees
* the layer is not changed */
* @param axis_pos : vertical axis position void Rotate(const wxPoint& centre, int angle);
*/
void Mirror(const wxPoint& axis_pos); /**
* Function Mirror
* Mirror the Dimension , relative to a given horizontal axis
* the text is not mirrored. only its position (and angle) is mirrored
* the layer is not changed
* @param axis_pos : vertical axis position
*/
void Mirror(const wxPoint& axis_pos);
/** /**
* Function Display_Infos * Function Display_Infos
@ -83,9 +84,9 @@ public:
* about this object into the frame's message panel. * about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct. * Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
@ -93,17 +94,17 @@ public:
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( const wxPoint& ref_pos ); bool HitTest( const wxPoint& ref_pos );
/** /**
* Function HitTest (overlayed) * Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect. * For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect * @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_Rect& refArea ); bool HitTest( EDA_Rect& refArea );
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.

View File

@ -127,7 +127,7 @@ void EDGE_MODULE::SetDrawCoord()
/********************************************************************************/ /********************************************************************************/
void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode ) int draw_mode, const wxPoint& offset )
/********************************************************************************/ /********************************************************************************/
/* Affichage d'un segment contour de module : /* Affichage d'un segment contour de module :

View File

@ -60,10 +60,10 @@ public:
void SetDrawCoord(); void SetDrawCoord();
/* drawing functions */ /* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int draw_mode ); int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
void Draw3D( Pcb3D_GLCanvas* glcanvas );
/** /**
* Function Display_Infos * Function Display_Infos

View File

@ -182,7 +182,7 @@ bool MARKER::HitTest( const wxPoint& refPos )
/**********************************************************************/ /**********************************************************************/
void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode ) void MARKER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode, const wxPoint& offset )
/**********************************************************************/ /**********************************************************************/
/* /*

View File

@ -3,7 +3,7 @@
/***************************************/ /***************************************/
#ifndef CLASS_MARKER_H #ifndef CLASS_MARKER_H
#define CLASS_MARKER_H #define CLASS_MARKER_H
#include "base_struct.h" #include "base_struct.h"
@ -18,9 +18,9 @@ protected:
wxSize m_Size; ///< Size of the graphic symbol wxSize m_Size; ///< Size of the graphic symbol
DRC_ITEM m_drc; DRC_ITEM m_drc;
void init(); void init();
public: public:
MARKER( BOARD_ITEM* StructFather ); MARKER( BOARD_ITEM* StructFather );
@ -34,8 +34,8 @@ public:
* @param bText Text describing the second of the two conflicting objects * @param bText Text describing the second of the two conflicting objects
* @param bPos The position of the second of two objects * @param bPos The position of the second of two objects
*/ */
MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ); const wxString& bText, const wxPoint& bPos );
/** /**
* Constructor * Constructor
@ -44,14 +44,14 @@ public:
* @param aText Text describing the object * @param aText Text describing the object
* @param aPos The position of the object * @param aPos The position of the object
*/ */
MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ); const wxString& aText, const wxPoint& aPos );
~MARKER();
~MARKER();
void UnLink(); void UnLink();
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int DrawMode, const wxPoint& offset = ZeroOffset );
/** /**
@ -63,7 +63,7 @@ public:
return (wxPoint&) m_drc.GetPosition(); return (wxPoint&) m_drc.GetPosition();
} }
/** /**
* Function GetPos * Function GetPos
* returns the position of this MARKER, const. * returns the position of this MARKER, const.
@ -73,7 +73,7 @@ public:
return m_drc.GetPosition(); return m_drc.GetPosition();
} }
/** /**
* Function SetData * Function SetData
* fills in all the reportable data associated with a MARKER. * fills in all the reportable data associated with a MARKER.
@ -84,10 +84,10 @@ public:
* @param bText Text describing the second of the two conflicting objects * @param bText Text describing the second of the two conflicting objects
* @param bPos The position of the second of two objects * @param bPos The position of the second of two objects
*/ */
void SetData( int aErrorCode, const wxPoint& aMarkerPos, void SetData( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos, const wxString& aText, const wxPoint& aPos,
const wxString& bText, const wxPoint& bPos ); const wxString& bText, const wxPoint& bPos );
/** /**
* Function SetData * Function SetData
* fills in all the reportable data associated with a MARKER. * fills in all the reportable data associated with a MARKER.
@ -96,10 +96,10 @@ public:
* @param aText Text describing the object * @param aText Text describing the object
* @param aPos The position of the object * @param aPos The position of the object
*/ */
void SetData( int aErrorCode, const wxPoint& aMarkerPos, void SetData( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ); const wxString& aText, const wxPoint& aPos );
/** /**
* Function GetReporter * Function GetReporter
* returns the DRC_ITEM held within this MARKER so that its * returns the DRC_ITEM held within this MARKER so that its
@ -111,30 +111,30 @@ public:
return m_drc; return m_drc;
} }
/** /**
* Function Display_Infos * Function Display_Infos
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel. * about this object into the frame's message panel.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const bool Save( FILE* aFile ) const
{ {
// not implemented, this is here to satisfy BOARD_ITEM::Save() // not implemented, this is here to satisfy BOARD_ITEM::Save()
// "pure" virtual-ness // "pure" virtual-ness
return true; return true;
} }
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.

View File

@ -101,30 +101,30 @@ bool MIREPCB::Save( FILE* aFile ) const
return true; return true;
bool rc = false; bool rc = false;
if( fprintf( aFile, "$MIREPCB\n" ) != sizeof("$MIREPCB\n")-1 ) if( fprintf( aFile, "$MIREPCB\n" ) != sizeof("$MIREPCB\n")-1 )
goto out; goto out;
fprintf( aFile, "Po %X %d %d %d %d %d %8.8lX\n", fprintf( aFile, "Po %X %d %d %d %d %d %8.8lX\n",
m_Shape, m_Layer, m_Shape, m_Layer,
m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y,
m_Size, m_Width, m_TimeStamp ); m_Size, m_Width, m_TimeStamp );
if( fprintf( aFile, "$EndMIREPCB\n" ) != sizeof("$EndMIREPCB\n")-1 ) if( fprintf( aFile, "$EndMIREPCB\n" ) != sizeof("$EndMIREPCB\n")-1 )
goto out; goto out;
rc = true; rc = true;
out: out:
return rc; return rc;
} }
/**********************************************************/ /**********************************************************/
void MIREPCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void MIREPCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int mode_color ) int mode_color, const wxPoint& offset )
/**********************************************************/ /**********************************************************/
/* Affichage de 1 mire : 2 segments + 1 cercle /* Affichage de 1 mire : 2 segments + 1 cercle
@ -226,8 +226,8 @@ bool MIREPCB::HitTest( const wxPoint& refPos )
*/ */
bool MIREPCB::HitTest( EDA_Rect& refArea ) bool MIREPCB::HitTest( EDA_Rect& refArea )
{ {
if( refArea.Inside( m_Pos ) ) if( refArea.Inside( m_Pos ) )
return true; return true;
return false; return false;
} }

View File

@ -23,16 +23,16 @@ public:
{ {
return m_Pos; return m_Pos;
} }
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
bool ReadMirePcbDescr( FILE* File, int* LineNum ); bool ReadMirePcbDescr( FILE* File, int* LineNum );
/* supprime du chainage la structure Struct */ /* supprime du chainage la structure Struct */
@ -40,9 +40,9 @@ public:
void Copy( MIREPCB* source ); void Copy( MIREPCB* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int mode_color ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
@ -54,7 +54,7 @@ public:
/** /**
* Function HitTest (overlayed) * Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* For now, the anchor must be inside this rect. * For now, the anchor must be inside this rect.
* @param refArea : the given EDA_Rect * @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */

View File

@ -262,7 +262,7 @@ void MODULE::UnLink()
/**********************************************************/ /**********************************************************/
void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode ) int draw_mode, const wxPoint& offset )
/**********************************************************/ /**********************************************************/
/** Function Draw /** Function Draw
@ -273,46 +273,38 @@ void MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
* @param draw_mode = GR_OR, GR_XOR, GR_AND * @param draw_mode = GR_OR, GR_XOR, GR_AND
*/ */
{ {
D_PAD* pt_pad;
EDA_BaseStruct* PtStruct;
TEXTE_MODULE* PtTexte;
if( (m_Flags & DO_NOT_DRAW) ) if( (m_Flags & DO_NOT_DRAW) )
return; return;
/* Draw pads */ /* Draw pads */
pt_pad = m_Pads; D_PAD* pt_pad = m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{ {
if( pt_pad->m_Flags & IS_MOVED ) if( pt_pad->m_Flags & IS_MOVED )
continue; continue;
pt_pad->Draw( panel, DC, offset, draw_mode ); pt_pad->Draw( panel, DC, draw_mode, offset );
} }
/* Draws foootprint anchor */ // Draws foootprint anchor
DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode ); DrawAncre( panel, DC, offset, DIM_ANCRE_MODULE, draw_mode );
/* Draw graphic items */ /* Draw graphic items */
if( !(m_Reference->m_Flags & IS_MOVED) ) if( !(m_Reference->m_Flags & IS_MOVED) )
m_Reference->Draw( panel, DC, offset, draw_mode ); m_Reference->Draw( panel, DC, draw_mode, offset );
if( !(m_Value->m_Flags & IS_MOVED) )
m_Value->Draw( panel, DC, offset, draw_mode );
PtStruct = m_Drawings; if( !(m_Value->m_Flags & IS_MOVED) )
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext ) m_Value->Draw( panel, DC, draw_mode, offset );
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{ {
if( PtStruct->m_Flags & IS_MOVED ) if( item->m_Flags & IS_MOVED )
continue; continue;
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPETEXTEMODULE:
PtTexte = (TEXTE_MODULE*) PtStruct;
PtTexte->Draw( panel, DC, offset, draw_mode );
break;
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
( (EDGE_MODULE*) PtStruct )->Draw( panel, DC, offset, draw_mode ); item->Draw( panel, DC, draw_mode, offset );
break; break;
default: default:
@ -335,16 +327,12 @@ void MODULE::DrawEdgesOnly( WinEDA_DrawPanel* panel, wxDC* DC,
* @param draw_mode = GR_OR, GR_XOR, GR_AND * @param draw_mode = GR_OR, GR_XOR, GR_AND
*/ */
{ {
EDA_BaseStruct* PtStruct; for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
/* Draw graphic items */
PtStruct = m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{ {
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
( (EDGE_MODULE*) PtStruct )->Draw( panel, DC, offset, draw_mode ); item->Draw( panel, DC, draw_mode, offset );
break; break;
default: default:
@ -1082,9 +1070,9 @@ EDA_Rect MODULE::GetBoundingBox()
area.Merge( text_area ); area.Merge( text_area );
} }
// Add the Clearence shape size: (shape around the pads when the clearence is shown // Add the Clearence shape size: (shape around the pads when the clearence is shown
// Not optimized, but the draw cost is small (perhaps smaller than optimization) // Not optimized, but the draw cost is small (perhaps smaller than optimization)
area.Inflate(g_DesignSettings.m_TrackClearence, g_DesignSettings.m_TrackClearence); area.Inflate(g_DesignSettings.m_TrackClearence, g_DesignSettings.m_TrackClearence);
return area; return area;
} }

View File

@ -165,10 +165,10 @@ public:
* @param panel = draw panel, Used to know the clip box * @param panel = draw panel, Used to know the clip box
* @param DC = Current Device Context * @param DC = Current Device Context
* @param offset = draw offset (usually wxPoint(0,0) * @param offset = draw offset (usually wxPoint(0,0)
* @param draw_mode = GR_OR, GR_XOR.. * @param aDrawMode = GR_OR, GR_XOR..
*/ */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
const wxPoint& offset, int draw_mode );
void Draw3D( Pcb3D_GLCanvas* glcanvas ); void Draw3D( Pcb3D_GLCanvas* glcanvas );
void DrawEdgesOnly( WinEDA_DrawPanel* panel, wxDC* DC, void DrawEdgesOnly( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int draw_mode ); const wxPoint& offset, int draw_mode );

View File

@ -218,7 +218,7 @@ void D_PAD::UnLink()
/*******************************************************************************************/ /*******************************************************************************************/
void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode ) void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/*******************************************************************************************/ /*******************************************************************************************/
/** Draw a pad: /** Draw a pad:

View File

@ -66,7 +66,7 @@ public:
int m_physical_connexion; // variable used in rastnest computations int m_physical_connexion; // variable used in rastnest computations
// handle block number in track connection // handle block number in track connection
int m_zone_connexion; // variable used in rastnest computations int m_zone_connexion; // variable used in rastnest computations
// handle block number in zone connection // handle block number in zone connection
public: public:
@ -111,7 +111,9 @@ public:
/* drawing functions */ /* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset );
void Draw3D( Pcb3D_GLCanvas* glcanvas ); void Draw3D( Pcb3D_GLCanvas* glcanvas );
// others // others

View File

@ -146,7 +146,7 @@ out:
/**********************************************************************/ /**********************************************************************/
void TEXTE_PCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC, void TEXTE_PCB::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
const wxPoint& offset, int DrawMode ) int DrawMode, const wxPoint& offset )
/**********************************************************************/ /**********************************************************************/
/* /*

View File

@ -9,50 +9,49 @@
class TEXTE_PCB : public BOARD_ITEM, public EDA_TextStruct class TEXTE_PCB : public BOARD_ITEM, public EDA_TextStruct
{ {
public: public:
TEXTE_PCB( BOARD_ITEM* parent ); TEXTE_PCB( BOARD_ITEM* parent );
TEXTE_PCB( TEXTE_PCB* textepcb ); TEXTE_PCB( TEXTE_PCB* textepcb );
~TEXTE_PCB(); ~TEXTE_PCB();
/** /**
* Function GetPosition * Function GetPosition
* returns the position of this object. * returns the position of this object.
* @return wxPoint& - The position of this object, non-const so it * @return wxPoint& - The position of this object, non-const so it
* can be changed * can be changed
*/ */
wxPoint& GetPosition() wxPoint& GetPosition()
{ {
return m_Pos; // within EDA_TextStruct return m_Pos; // within EDA_TextStruct
} }
/* supprime du chainage la structure Struct */
void UnLink();
/* duplicate structure */
void Copy( TEXTE_PCB* source );
void Draw( WinEDA_DrawPanel * panel, wxDC * DC, /* supprime du chainage la structure Struct */
const wxPoint & offset, int DrawMode ); void UnLink();
/* duplicate structure */
void Copy( TEXTE_PCB* source );
void Draw( WinEDA_DrawPanel * panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
// File Operations:
int ReadTextePcbDescr( FILE* File, int* LineNum );
// File Operations:
int ReadTextePcbDescr( FILE* File, int* LineNum );
/** /**
* Function Save * Function Save
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/** /**
* Function Display_Infos * Function Display_Infos
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel. * about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct. * Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
@ -66,19 +65,19 @@ public:
{ {
return EDA_TextStruct::HitTest( refPos ); return EDA_TextStruct::HitTest( refPos );
} }
/** /**
* Function HitTest (overlayed) * Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object. * tests if the given EDA_Rect intersect this object.
* @param refArea the given EDA_Rect to test * @param refArea the given EDA_Rect to test
* @return bool - true if a hit, else false * @return bool - true if a hit, else false
*/ */
bool HitTest( EDA_Rect& refArea ) bool HitTest( EDA_Rect& refArea )
{ {
return EDA_TextStruct::HitTest( refArea ); return EDA_TextStruct::HitTest( refArea );
} }
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.
@ -93,13 +92,13 @@ public:
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */
virtual void Show( int nestLevel, std::ostream& os ); virtual void Show( int nestLevel, std::ostream& os );
#endif #endif
}; };
#endif // #define CLASS_PCB_TEXT_H #endif // #define CLASS_PCB_TEXT_H

View File

@ -106,7 +106,7 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source ) // copy structure
m_Type = source->m_Type; // 0: ref,1: val, others = 2..255 m_Type = source->m_Type; // 0: ref,1: val, others = 2..255
m_Orient = source->m_Orient; // orientation in 1/10 deg m_Orient = source->m_Orient; // orientation in 1/10 deg
m_Pos0 = source->m_Pos0; // text coordinates relatives to the footprint ancre, orient 0 m_Pos0 = source->m_Pos0; // text coordinates relatives to the footprint ancre, orient 0
// Text coordinate ref point is the text centre // Text coordinate ref point is the text centre
m_Size = source->m_Size; m_Size = source->m_Size;
m_Width = source->m_Width; m_Width = source->m_Width;
@ -201,23 +201,23 @@ void TEXTE_MODULE:: SetLocalCoord()
*/ */
EDA_Rect TEXTE_MODULE::GetTextRect(void) EDA_Rect TEXTE_MODULE::GetTextRect(void)
{ {
EDA_Rect area; EDA_Rect area;
int dx, dy; int dx, dy;
dx = ( m_Size.x * GetLength() ) / 2; dx = ( m_Size.x * GetLength() ) / 2;
dx = (dx * 10) / 9 ; /* letter size = 10/9 */ dx = (dx * 10) / 9 ; /* letter size = 10/9 */
dx += m_Width / 2; dx += m_Width / 2;
dy = ( m_Size.y + m_Width ) / 2; dy = ( m_Size.y + m_Width ) / 2;
wxPoint Org = m_Pos; // This is the position of the centre of the area wxPoint Org = m_Pos; // This is the position of the centre of the area
Org.x -= dx; Org.x -= dx;
Org.y -= dy; Org.y -= dy;
area.SetOrigin( Org); area.SetOrigin( Org);
area.SetHeight(2 * dy); area.SetHeight(2 * dy);
area.SetWidth(2 * dx); area.SetWidth(2 * dx);
area.Normalize(); area.Normalize();
return area; return area;
} }
/** /**
@ -229,11 +229,11 @@ EDA_Rect TEXTE_MODULE::GetTextRect(void)
bool TEXTE_MODULE::HitTest( const wxPoint& refPos ) bool TEXTE_MODULE::HitTest( const wxPoint& refPos )
{ {
wxPoint rel_pos; wxPoint rel_pos;
EDA_Rect area = GetTextRect(); EDA_Rect area = GetTextRect();
/* Rotate refPos to - angle /* Rotate refPos to - angle
* to test if refPos is within area (which is relative to an horizontal text) * to test if refPos is within area (which is relative to an horizontal text)
*/ */
rel_pos = refPos; rel_pos = refPos;
RotatePoint( &rel_pos, m_Pos, - GetDrawRotation() ); RotatePoint( &rel_pos, m_Pos, - GetDrawRotation() );
@ -249,25 +249,25 @@ bool TEXTE_MODULE::HitTest( const wxPoint& refPos )
*/ */
EDA_Rect TEXTE_MODULE::GetBoundingBox() EDA_Rect TEXTE_MODULE::GetBoundingBox()
{ {
// Calculate area without text fielsd: // Calculate area without text fielsd:
EDA_Rect text_area; EDA_Rect text_area;
int angle = GetDrawRotation(); int angle = GetDrawRotation();
wxPoint textstart, textend; wxPoint textstart, textend;
text_area = GetTextRect(); text_area = GetTextRect();
textstart = text_area.GetOrigin(); textstart = text_area.GetOrigin();
textend = text_area.GetEnd(); textend = text_area.GetEnd();
RotatePoint( &textstart, m_Pos, angle); RotatePoint( &textstart, m_Pos, angle);
RotatePoint( &textend, m_Pos, angle); RotatePoint( &textend, m_Pos, angle);
text_area.SetOrigin(textstart); text_area.SetOrigin(textstart);
text_area.SetEnd(textend); text_area.SetEnd(textend);
text_area.Normalize(); text_area.Normalize();
return text_area; return text_area;
} }
/******************************************************************************************/ /******************************************************************************************/
void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode ) void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/******************************************************************************************/ /******************************************************************************************/
/** Function Draw /** Function Draw

View File

@ -19,13 +19,13 @@ public:
wxPoint m_Pos; // Real (physical)coord wxPoint m_Pos; // Real (physical)coord
int m_Width; int m_Width;
wxPoint m_Pos0; // text coordinates relatives to the footprint ancre, orient 0 wxPoint m_Pos0; // text coordinates relatives to the footprint ancre, orient 0
// Text coordinate ref point is the text centre // Text coordinate ref point is the text centre
char m_Unused; // unused (reserved for future extensions) char m_Unused; // unused (reserved for future extensions)
char m_Miroir; // Show normal / mirror char m_Miroir; // Show normal / mirror
char m_NoShow; // 0: visible 1: invisible (bool) char m_NoShow; // 0: visible 1: invisible (bool)
char m_Type; // 0: ref,1: val, others = 2..255 char m_Type; // 0: ref,1: val, others = 2..255
int m_Orient; // orientation in 1/10 deg relative to the footprint int m_Orient; // orientation in 1/10 deg relative to the footprint
// Physical orient is m_Orient + m_Parent->m_Orient // Physical orient is m_Orient + m_Parent->m_Orient
wxSize m_Size; // text size wxSize m_Size; // text size
wxString m_Text; wxString m_Text;
@ -44,7 +44,7 @@ public:
return m_Pos; return m_Pos;
} }
/* supprime du chainage la structure Struct */ /* supprime du chainage la structure Struct */
void UnLink(); void UnLink();
@ -55,11 +55,11 @@ public:
int GetLength(); /* text length */ int GetLength(); /* text length */
int Pitch(); /* retourne le pas entre 2 caracteres */ int Pitch(); /* retourne le pas entre 2 caracteres */
int GetDrawRotation(); // Return text rotation for drawings and plotting int GetDrawRotation(); // Return text rotation for drawings and plotting
/** Function GetTextRect /** Function GetTextRect
* @return an EDA_Rect which gives the position and size of the text area (for the 0 orient text and footprint) * @return an EDA_Rect which gives the position and size of the text area (for the 0 orient text and footprint)
*/ */
EDA_Rect GetTextRect(void); EDA_Rect GetTextRect(void);
/** /**
* Function GetBoundingBox * Function GetBoundingBox
@ -67,7 +67,7 @@ public:
*/ */
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
void SetDrawCoord(); // mise a jour des coordonn<6E>s absolues de trac<61> void SetDrawCoord(); // mise a jour des coordonn<6E>s absolues de trac<61>
// a partir des coord relatives // a partir des coord relatives
void SetLocalCoord(); // mise a jour des coordonn<6E>s relatives void SetLocalCoord(); // mise a jour des coordonn<6E>s relatives
@ -77,26 +77,26 @@ public:
* writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format.
* @param aFile The FILE to write to. * @param aFile The FILE to write to.
* @return bool - true if success writing else false. * @return bool - true if success writing else false.
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
int ReadDescr( FILE* File, int* LineNum = NULL ); int ReadDescr( FILE* File, int* LineNum = NULL );
/* drawing functions */ /* drawing functions */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int draw_mode ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/** /**
* Function Display_Infos * Function Display_Infos
* has knowledge about the frame and how and where to put status information * has knowledge about the frame and how and where to put status information
* about this object into the frame's message panel. * about this object into the frame's message panel.
* Is virtual from EDA_BaseStruct. * Is virtual from EDA_BaseStruct.
* @param frame A WinEDA_DrawFrame in which to print status information. * @param frame A WinEDA_DrawFrame in which to print status information.
*/ */
void Display_Infos( WinEDA_DrawFrame* frame ); void Display_Infos( WinEDA_DrawFrame* frame );
/** /**
* Function HitTest * Function HitTest
* tests if the given wxPoint is within the bounds of this object. * tests if the given wxPoint is within the bounds of this object.
@ -115,7 +115,7 @@ public:
* @return bool - true if on given layer, else false. * @return bool - true if on given layer, else false.
*/ */
bool IsOnLayer( int aLayer ) const; bool IsOnLayer( int aLayer ) const;
/** /**
* Function IsOnOneOfTheseLayers * Function IsOnOneOfTheseLayers
* returns true if this object is on one of the given layers. Is virtual so * returns true if this object is on one of the given layers. Is virtual so
@ -127,9 +127,9 @@ public:
bool IsOnOneOfTheseLayers( int aLayerMask ) const; bool IsOnOneOfTheseLayers( int aLayerMask ) const;
*/ */
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.
@ -144,7 +144,7 @@ public:
/** /**
* Function Show * Function Show
* is used to output the object tree, currently for debugging only. * is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level * @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree. * of nesting of this object within the overall tree.
* @param os The ostream& to output to. * @param os The ostream& to output to.
*/ */

View File

@ -626,7 +626,7 @@ bool TRACK::Save( FILE* aFile ) const
/*********************************************************************/ /*********************************************************************/
void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ) void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& notUsed )
/*********************************************************************/ /*********************************************************************/
/** Draws the segment. /** Draws the segment.

View File

@ -146,7 +146,7 @@ public:
/* Display on screen: */ /* Display on screen: */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
/* divers */ /* divers */
int Shape() const { return m_Shape & 0xFF; } int Shape() const { return m_Shape & 0xFF; }

View File

@ -235,7 +235,7 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
/****************************************************************************************************/ /****************************************************************************************************/
void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset, int draw_mode ) void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/****************************************************************************************************/ /****************************************************************************************************/
/** Function Draw /** Function Draw

View File

@ -24,7 +24,7 @@ public:
THERMAL_PAD, // Use thermal relief for pads THERMAL_PAD, // Use thermal relief for pads
PAD_IN_ZONE // pads are covered by copper PAD_IN_ZONE // pads are covered by copper
}; };
wxString m_Netname; // Net Name wxString m_Netname; // Net Name
CPolyLine* m_Poly; // outlines CPolyLine* m_Poly; // outlines
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
@ -45,7 +45,7 @@ public:
wxPoint& GetPosition() wxPoint& GetPosition()
{ {
static wxPoint pos; static wxPoint pos;
return pos; return pos;
} }
@ -53,7 +53,7 @@ public:
{ {
}; };
/** /**
* Function copy * Function copy
* copy usefull data from the source. * copy usefull data from the source.
* flags and linked list pointers are NOT copied * flags and linked list pointers are NOT copied
@ -68,17 +68,16 @@ public:
* @param panel = current Draw Panel * @param panel = current Draw Panel
* @param DC = current Device Context * @param DC = current Device Context
* @param offset = Draw offset (usually wxPoint(0,0)) * @param offset = Draw offset (usually wxPoint(0,0))
* @param draw_mode = draw mode: OR, XOR .. * @param aDrawMode = GR_OR, GR_XOR, GR_COPY ..
*/ */
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
const wxPoint& offset, int draw_mode );
/** /**
* Function DrawWhileCreateOutline * Function DrawWhileCreateOutline
* Draws the zone outline when ir is created. * Draws the zone outline when ir is created.
* The moving edges are in XOR graphic mode, old segment in draw_mode graphic mode (usually GR_OR) * The moving edges are in XOR graphic mode, old segment in draw_mode graphic mode (usually GR_OR)
* The closing edge has its owm shape * The closing edge has its owm shape
* @param panel = current Draw Panel * @param panel = current Draw Panel
* @param DC = current Device Context * @param DC = current Device Context
* @param draw_mode = draw mode: OR, XOR .. * @param draw_mode = draw mode: OR, XOR ..
@ -168,7 +167,7 @@ public:
* @param mirror_ref = vertical axis position * @param mirror_ref = vertical axis position
*/ */
void Mirror( const wxPoint& mirror_ref ); void Mirror( const wxPoint& mirror_ref );
/** /**
* Function GetClass * Function GetClass
* returns the class name. * returns the class name.
@ -178,35 +177,35 @@ public:
{ {
return wxT( "ZONE_CONTAINER" ); return wxT( "ZONE_CONTAINER" );
} }
/** Acces to m_Poly parameters /** Acces to m_Poly parameters
*/ */
int GetNumCorners(void) int GetNumCorners(void)
{ {
return m_Poly->GetNumCorners(); return m_Poly->GetNumCorners();
} }
void RemoveAllContours(void) void RemoveAllContours(void)
{ {
m_Poly->RemoveAllContours(); m_Poly->RemoveAllContours();
} }
wxPoint GetCornerPosition(int aCornerIndex) wxPoint GetCornerPosition(int aCornerIndex)
{ {
return wxPoint(m_Poly->GetX(aCornerIndex), m_Poly->GetY(aCornerIndex)); return wxPoint(m_Poly->GetX(aCornerIndex), m_Poly->GetY(aCornerIndex));
} }
void SetCornerPosition(int aCornerIndex, wxPoint new_pos) void SetCornerPosition(int aCornerIndex, wxPoint new_pos)
{ {
m_Poly->SetX(aCornerIndex, new_pos.x); m_Poly->SetX(aCornerIndex, new_pos.x);
m_Poly->SetY(aCornerIndex, new_pos.y); m_Poly->SetY(aCornerIndex, new_pos.y);
} }
void AppendCorner( wxPoint position ) void AppendCorner( wxPoint position )
{ {
m_Poly->AppendCorner( position.x, position.y ); m_Poly->AppendCorner( position.x, position.y );
} }
}; };

View File

@ -162,7 +162,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
{ {
if( m_DC ) // Effacement ancien texte if( m_DC ) // Effacement ancien texte
{ {
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR ); CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
} }
if( m_Name->GetValue() != wxEmptyString ) if( m_Name->GetValue() != wxEmptyString )
@ -183,7 +183,7 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Affichage nouveau texte if( m_DC ) // Affichage nouveau texte
{ {
/* Redessin du Texte */ /* Redessin du Texte */
CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); CurrentCotation->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
} }
m_Parent->m_CurrentScreen->SetModify(); m_Parent->m_CurrentScreen->SetModify();
@ -201,12 +201,12 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
if( Cotation->m_Flags & IS_NEW ) if( Cotation->m_Flags & IS_NEW )
{ {
Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( Panel, DC, GR_XOR );
Cotation->DeleteStructure(); Cotation->DeleteStructure();
} }
else else
{ {
Cotation->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); Cotation->Draw( Panel, DC, GR_OR );
} }
} }
@ -262,7 +262,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
Ajuste_Details_Cotation( Cotation ); Ajuste_Details_Cotation( Cotation );
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( DrawPanel, DC, GR_XOR );
DrawPanel->ManageCurseur = Montre_Position_New_Cotation; DrawPanel->ManageCurseur = Montre_Position_New_Cotation;
DrawPanel->ForceCloseManageCurseur = Exit_EditCotation; DrawPanel->ForceCloseManageCurseur = Exit_EditCotation;
@ -276,7 +276,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
return Cotation; return Cotation;
} }
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Cotation->Draw( DrawPanel, DC, GR_OR );
Cotation->m_Flags = 0; Cotation->m_Flags = 0;
/* Insertion de la structure dans le Chainage .Drawings du PCB */ /* Insertion de la structure dans le Chainage .Drawings du PCB */
@ -309,7 +309,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
/* efface ancienne position */ /* efface ancienne position */
if( erase ) if( erase )
{ {
Cotation->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( panel, DC, GR_XOR );
} }
Cotation->SetLayer( screen->m_Active_Layer ); Cotation->SetLayer( screen->m_Active_Layer );
@ -345,7 +345,7 @@ static void Montre_Position_New_Cotation( WinEDA_DrawPanel* panel, wxDC* DC, boo
Ajuste_Details_Cotation( Cotation ); Ajuste_Details_Cotation( Cotation );
} }
Cotation->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( panel, DC, GR_XOR );
} }
@ -372,7 +372,7 @@ void WinEDA_PcbFrame::Delete_Cotation( COTATION* Cotation, wxDC* DC )
return; return;
if( DC ) if( DC )
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Cotation->Draw( DrawPanel, DC, GR_XOR );
Cotation->DeleteStructure(); Cotation->DeleteStructure();
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
} }

View File

@ -425,8 +425,8 @@ void WinEDA_TextModPropertiesFrame::TextModPropertiesAccept( wxCommandEvent& eve
m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules ); m_Parent->SaveCopyInUndoList( m_Parent->m_Pcb->m_Modules );
if( m_DC ) // Effacement ancien texte if( m_DC ) // Effacement ancien texte
{ {
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ), GR_XOR ); (m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ) );
} }
m_CurrentTextMod->m_Text = m_Name->GetValue(); m_CurrentTextMod->m_Text = m_Name->GetValue();
@ -465,8 +465,8 @@ void WinEDA_TextModPropertiesFrame::TextModPropertiesAccept( wxCommandEvent& eve
m_CurrentTextMod->SetDrawCoord(); m_CurrentTextMod->SetDrawCoord();
if( m_DC ) // Display new text if( m_DC ) // Display new text
{ {
m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, m_CurrentTextMod->Draw( m_Parent->DrawPanel, m_DC, GR_XOR,
(m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ), GR_XOR ); (m_CurrentTextMod->m_Flags & IS_MOVED) ? MoveVector : wxPoint( 0, 0 ) );
} }
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
( (MODULE*) m_CurrentTextMod->m_Parent )->m_LastEdit_Time = time( NULL ); ( (MODULE*) m_CurrentTextMod->m_Parent )->m_LastEdit_Time = time( NULL );

View File

@ -238,11 +238,11 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions
PropLeftSizer->Add( m_LayerCtrl, 0, wxGROW | wxALL, 5 ); PropLeftSizer->Add( m_LayerCtrl, 0, wxGROW | wxALL, 5 );
bool select = FALSE; bool select = FALSE;
wxString orient_list[5] = { wxString orient_list[5] = {
_( "Normal" ), wxT( "+ 90.0" ), wxT( "- 90.0" ), wxT( "180.0" ), _( "User" ) _( "Normal" ), wxT( "+ 90.0" ), wxT( "- 90.0" ), wxT( "180.0" ), _( "User" )
}; };
m_OrientCtrl = new wxRadioBox( m_PanelProperties, ID_LISTBOX_ORIENT_SELECT, _( "Orient" ), m_OrientCtrl = new wxRadioBox( m_PanelProperties, ID_LISTBOX_ORIENT_SELECT, _( "Orient" ),
wxDefaultPosition, wxSize( -1, -1 ), 5, orient_list, 1 ); wxDefaultPosition, wxSize( -1, -1 ), 5, orient_list, 1 );
PropLeftSizer->Add( m_OrientCtrl, 0, wxGROW | wxALL, 5 ); PropLeftSizer->Add( m_OrientCtrl, 0, wxGROW | wxALL, 5 );
@ -588,7 +588,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
EndModal( 1 ); EndModal( 1 );
if( m_DC ) if( m_DC )
m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); m_CurrentModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
if( m_DC ) if( m_DC )
m_Parent->DrawPanel->CursorOn( m_DC ); m_Parent->DrawPanel->CursorOn( m_DC );
} }

View File

@ -39,7 +39,7 @@ void WinEDA_ModuleEditFrame::Start_Move_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
{ {
if( Edge == NULL ) if( Edge == NULL )
return; return;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Edge->Draw( DrawPanel, DC, GR_XOR );
Edge->m_Flags |= IS_MOVED; Edge->m_Flags |= IS_MOVED;
MoveVector.x = MoveVector.y = 0; MoveVector.x = MoveVector.y = 0;
CursorInitialPosition = GetScreen()->m_Curseur; CursorInitialPosition = GetScreen()->m_Curseur;
@ -70,7 +70,7 @@ void WinEDA_ModuleEditFrame::Place_EdgeMod( EDGE_MODULE* Edge, wxDC* DC )
Edge->m_End0.x -= MoveVector.x; Edge->m_End0.x -= MoveVector.x;
Edge->m_End0.y -= MoveVector.y; Edge->m_End0.y -= MoveVector.y;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Edge->Draw( DrawPanel, DC, GR_OR );
Edge->m_Flags = 0; Edge->m_Flags = 0;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
@ -96,13 +96,13 @@ static void Move_Segment( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
if( erase ) if( erase )
{ {
Edge->Draw( panel, DC, MoveVector, GR_XOR ); Edge->Draw( panel, DC, GR_XOR, MoveVector );
} }
MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x); MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x);
MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y); MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y);
Edge->Draw( panel, DC, MoveVector, GR_XOR ); Edge->Draw( panel, DC, GR_XOR, MoveVector );
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
@ -125,7 +125,7 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
// if( erase ) // if( erase )
{ {
Edge->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); Edge->Draw( panel, DC, GR_XOR );
} }
Edge->m_End = screen->m_Curseur; Edge->m_End = screen->m_Curseur;
@ -136,7 +136,7 @@ static void ShowEdgeModule( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
RotatePoint( (int*) &Edge->m_End0.x, RotatePoint( (int*) &Edge->m_End0.x,
(int*) &Edge->m_End0.y, -Module->m_Orient ); (int*) &Edge->m_End0.y, -Module->m_Orient );
Edge->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); Edge->Draw( panel, DC, GR_XOR );
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
@ -193,17 +193,17 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC )
new_layer = Edge->GetLayer(); new_layer = Edge->GetLayer();
/* Ask for the new layer */ /* Ask for the new layer */
new_layer = SelectLayer( new_layer, FIRST_COPPER_LAYER, LAST_NO_COPPER_LAYER ); new_layer = SelectLayer( new_layer, FIRST_COPPER_LAYER, LAST_NO_COPPER_LAYER );
if( new_layer < 0 ) if( new_layer < 0 )
return; return;
if ( new_layer >= FIRST_COPPER_LAYER && new_layer <= LAST_COPPER_LAYER ) if ( new_layer >= FIRST_COPPER_LAYER && new_layer <= LAST_COPPER_LAYER )
/* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */ /* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */
{ {
if ( ! IsOK(this, _("The graphic item will be on a copper layer.It is very dangerous. Are you sure") ) ) if ( ! IsOK(this, _("The graphic item will be on a copper layer.It is very dangerous. Are you sure") ) )
return; return;
} }
SaveCopyInUndoList( Module ); SaveCopyInUndoList( Module );
@ -283,7 +283,7 @@ void WinEDA_ModuleEditFrame::Delete_Edge_Module( EDGE_MODULE* Edge, wxDC* DC )
} }
MODULE* Module = (MODULE*) Edge->m_Parent; MODULE* Module = (MODULE*) Edge->m_Parent;
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Edge->Draw( DrawPanel, DC, GR_XOR );
/* suppression d'un segment */ /* suppression d'un segment */
Edge ->DeleteStructure(); Edge ->DeleteStructure();
@ -306,15 +306,15 @@ static void Exit_EditEdge_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
if( Edge->m_Flags & IS_NEW ) /* effacement du nouveau contour */ if( Edge->m_Flags & IS_NEW ) /* effacement du nouveau contour */
{ {
MODULE* Module = (MODULE*) Edge->m_Parent; MODULE* Module = (MODULE*) Edge->m_Parent;
Edge->Draw( Panel, DC, MoveVector, GR_XOR ); Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge ->DeleteStructure(); Edge ->DeleteStructure();
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
} }
else else
{ {
Edge->Draw( Panel, DC, MoveVector, GR_XOR ); Edge->Draw( Panel, DC, GR_XOR, MoveVector );
Edge->m_Flags = 0; Edge->m_Flags = 0;
Edge->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); Edge->Draw( Panel, DC, GR_OR );
} }
} }
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
@ -390,7 +390,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
if( (Edge->m_Start0.x) != (Edge->m_End0.x) if( (Edge->m_Start0.x) != (Edge->m_End0.x)
|| (Edge->m_Start0.y) != (Edge->m_End0.y) ) || (Edge->m_Start0.y) != (Edge->m_End0.y) )
{ {
Edge->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Edge->Draw( DrawPanel, DC, GR_OR );
EDGE_MODULE* newedge = new EDGE_MODULE( Module ); EDGE_MODULE* newedge = new EDGE_MODULE( Module );
newedge->Copy( Edge ); newedge->Copy( Edge );
newedge->AddToChain( Edge ); newedge->AddToChain( Edge );

View File

@ -380,8 +380,8 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break; break;
case ID_POPUP_PCB_PLACE_MICROVIA: case ID_POPUP_PCB_PLACE_MICROVIA:
if ( ! ((PCB_SCREEN*)GetScreen())->IsMicroViaAcceptable() ) if ( ! ((PCB_SCREEN*)GetScreen())->IsMicroViaAcceptable() )
break; break;
case ID_POPUP_PCB_PLACE_VIA: case ID_POPUP_PCB_PLACE_VIA:
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
@ -521,10 +521,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
* and zone_cont->m_CornerSelection+1 * and zone_cont->m_CornerSelection+1
* and start move the new corner * and start move the new corner
*/ */
zone_cont->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_XOR ); zone_cont->Draw( DrawPanel, &dc, GR_XOR );
zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y ); zone_cont->m_Poly->InsertCorner( zone_cont->m_CornerSelection, pos.x, pos.y );
zone_cont->m_CornerSelection++; zone_cont->m_CornerSelection++;
zone_cont->Draw( DrawPanel, &dc, wxPoint( 0, 0 ), GR_XOR ); zone_cont->Draw( DrawPanel, &dc, GR_XOR );
Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, true ); Start_Move_Zone_Corner( &dc, zone_cont, zone_cont->m_CornerSelection, true );
break; break;
} }

View File

@ -155,11 +155,6 @@ void WinEDA_PcbFrame::Drawing_SetNewWidth( DRAWSEGMENT* DrawSegm, wxDC* DC )
void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC ) void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC )
/******************************************************************************/ /******************************************************************************/
{ {
DRAWSEGMENT* pt_segm;
TEXTE_PCB* pt_txt;
BOARD_ITEM* PtStruct;
BOARD_ITEM* PtNext;
COTATION* Cotation;
int layer = Segment->GetLayer(); int layer = Segment->GetLayer();
if( layer <= LAST_COPPER_LAYER ) if( layer <= LAST_COPPER_LAYER )
@ -178,39 +173,28 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
if( !IsOK( this, msg ) ) if( !IsOK( this, msg ) )
return; return;
PtStruct = m_Pcb->m_Drawings; BOARD_ITEM* PtNext;
for( ; PtStruct != NULL; PtStruct = PtNext ) for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = PtNext )
{ {
GetScreen()->SetModify(); GetScreen()->SetModify();
PtNext = PtStruct->Next(); PtNext = item->Next();
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPEDRAWSEGMENT: case TYPEDRAWSEGMENT:
pt_segm = (DRAWSEGMENT*) PtStruct; if( item->GetLayer() == layer )
if( pt_segm->GetLayer() == layer )
{ {
Trace_DrawSegmentPcb( DrawPanel, DC, pt_segm, GR_XOR ); Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) item, GR_XOR );
PtStruct ->DeleteStructure(); item->DeleteStructure();
} }
break; break;
case TYPETEXTE: case TYPETEXTE:
pt_txt = (TEXTE_PCB*) PtStruct;
if( pt_txt->GetLayer() == layer )
{
pt_txt->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR );
PtStruct ->DeleteStructure();
}
break;
case TYPECOTATION: case TYPECOTATION:
Cotation = (COTATION*) PtStruct; if( item->GetLayer() == layer )
if( Cotation->GetLayer() == layer )
{ {
Cotation->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); item->Draw( DrawPanel, DC, GR_XOR );
PtStruct ->DeleteStructure(); item->DeleteStructure();
} }
break; break;

View File

@ -356,7 +356,7 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
{ {
long PadLayerMask; long PadLayerMask;
bool error = FALSE; bool error = FALSE;
bool RastnestIsChanged = false; bool RastnestIsChanged = false;
if( m_DC ) if( m_DC )
m_Parent->DrawPanel->CursorOff( m_DC ); m_Parent->DrawPanel->CursorOff( m_DC );
@ -443,14 +443,14 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
if( m_DC ) if( m_DC )
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR ); CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
CurrentPad->m_PadShape = g_Pad_Master.m_PadShape; CurrentPad->m_PadShape = g_Pad_Master.m_PadShape;
CurrentPad->m_Attribut = g_Pad_Master.m_Attribut; CurrentPad->m_Attribut = g_Pad_Master.m_Attribut;
if (CurrentPad->m_Pos != g_Pad_Master.m_Pos ) if (CurrentPad->m_Pos != g_Pad_Master.m_Pos )
{ {
CurrentPad->m_Pos = g_Pad_Master.m_Pos; CurrentPad->m_Pos = g_Pad_Master.m_Pos;
RastnestIsChanged = true; RastnestIsChanged = true;
} }
/* compute the pos 0 value, i.e. pad position for module orient = 0 i.e. /* compute the pos 0 value, i.e. pad position for module orient = 0 i.e.
* refer to module origin (module position) */ * refer to module origin (module position) */
@ -466,29 +466,29 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
CurrentPad->m_DrillShape = g_Pad_Master.m_DrillShape; CurrentPad->m_DrillShape = g_Pad_Master.m_DrillShape;
CurrentPad->m_Offset = g_Pad_Master.m_Offset; CurrentPad->m_Offset = g_Pad_Master.m_Offset;
if ( CurrentPad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer ) if ( CurrentPad->m_Masque_Layer != g_Pad_Master.m_Masque_Layer )
{ {
RastnestIsChanged = true; RastnestIsChanged = true;
CurrentPad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer; CurrentPad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
} }
CurrentPad->SetPadName( g_Current_PadName ); CurrentPad->SetPadName( g_Current_PadName );
if ( CurrentPad->m_Netname != Current_PadNetName ) if ( CurrentPad->m_Netname != Current_PadNetName )
{ {
if( Current_PadNetName.IsEmpty() ) if( Current_PadNetName.IsEmpty() )
CurrentPad->SetNet( 0 ); CurrentPad->SetNet( 0 );
else else
{ {
const EQUIPOT* net = m_Parent->m_Pcb->FindNet( Current_PadNetName ); const EQUIPOT* net = m_Parent->m_Pcb->FindNet( Current_PadNetName );
if ( net ) if ( net )
{ {
RastnestIsChanged = true; RastnestIsChanged = true;
CurrentPad->m_Netname = Current_PadNetName; CurrentPad->m_Netname = Current_PadNetName;
CurrentPad->SetNet(net->GetNet()); CurrentPad->SetNet(net->GetNet());
} }
else else
DisplayError(this, _("Unknown netname, no change")); DisplayError(this, _("Unknown netname, no change"));
} }
} }
switch( CurrentPad->m_PadShape ) switch( CurrentPad->m_PadShape )
{ {
@ -530,7 +530,7 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
CurrentPad->Display_Infos( m_Parent ); CurrentPad->Display_Infos( m_Parent );
if( m_DC ) if( m_DC )
CurrentPad->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); CurrentPad->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
} }
@ -538,8 +538,8 @@ void WinEDA_PadPropertiesFrame::PadPropertiesAccept( wxCommandEvent& event )
if( m_DC ) if( m_DC )
m_Parent->DrawPanel->CursorOn( m_DC ); m_Parent->DrawPanel->CursorOn( m_DC );
if ( RastnestIsChanged ) // The net ratsnest must be recalculated if ( RastnestIsChanged ) // The net ratsnest must be recalculated
m_Parent->m_Pcb->m_Status_Pcb = 0; m_Parent->m_Pcb->m_Status_Pcb = 0;
} }

View File

@ -124,7 +124,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
pt_segm->SetLayer( l1 ); pt_segm->SetLayer( l1 );
if( Drc_On && BAD_DRC==m_drc->Drc( pt_segm, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( pt_segm, m_Pcb->m_Track ) )
{ {
/* Annulation du changement */ /* Annulation du changement */
ii = 0; pt_segm = pt_track; ii = 0; pt_segm = pt_track;
for( ; ii < nb_segm; ii++, pt_segm = (TRACK*) pt_segm->Pnext ) for( ; ii < nb_segm; ii++, pt_segm = (TRACK*) pt_segm->Pnext )
@ -177,7 +177,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
/* Avoid more than one via on the current location: */ /* Avoid more than one via on the current location: */
if( Locate_Via( m_Pcb, g_CurrentTrackSegment->m_End, g_CurrentTrackSegment->GetLayer() ) ) if( Locate_Via( m_Pcb, g_CurrentTrackSegment->m_End, g_CurrentTrackSegment->GetLayer() ) )
return false; return false;
pt_segm = g_FirstTrackSegment; pt_segm = g_FirstTrackSegment;
for( ii = 0; ii < g_TrackSegmentCount - 1; ii++, pt_segm = (TRACK*) pt_segm->Pnext ) for( ii = 0; ii < g_TrackSegmentCount - 1; ii++, pt_segm = (TRACK*) pt_segm->Pnext )
{ {
@ -192,7 +192,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) ) if( BAD_DRC==m_drc->Drc( g_CurrentTrackSegment, m_Pcb->m_Track ) )
/* DRC error, the change layer is not made */ /* DRC error, the change layer is not made */
return false; return false;
if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() ) // We must handle 2 segments if( g_TwoSegmentTrackBuild && g_CurrentTrackSegment->Back() ) // We must handle 2 segments
{ {
if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), m_Pcb->m_Track ) ) if( BAD_DRC == m_drc->Drc( g_CurrentTrackSegment->Back(), m_Pcb->m_Track ) )
@ -224,29 +224,29 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
/* Adjust the via layer pair */ /* Adjust the via layer pair */
switch ( Via->Shape() ) switch ( Via->Shape() )
{ {
case VIA_BLIND_BURIED: case VIA_BLIND_BURIED:
Via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer ); Via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
break; break;
case VIA_MICROVIA: // from external to the near neghbour inner layer
if ( old_layer == COPPER_LAYER_N )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_2;
else if ( old_layer == LAYER_CMP_N )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_Pcb->m_BoardSettings->m_CopperLayerCount - 2;
else if ( old_layer == LAYER_N_2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = COPPER_LAYER_N;
else if ( old_layer == m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_CMP_N;
// else error
Via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
Via->m_Width = g_DesignSettings.m_CurrentMicroViaSize;
break;
default: case VIA_MICROVIA: // from external to the near neghbour inner layer
// Usual via is from copper to component; layer pair is 0 and 0x0F. if ( old_layer == COPPER_LAYER_N )
Via->SetLayerPair( COPPER_LAYER_N, LAYER_CMP_N ); ((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_N_2;
break; else if ( old_layer == LAYER_CMP_N )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = m_Pcb->m_BoardSettings->m_CopperLayerCount - 2;
else if ( old_layer == LAYER_N_2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = COPPER_LAYER_N;
else if ( old_layer == m_Pcb->m_BoardSettings->m_CopperLayerCount - 2 )
((PCB_SCREEN*)GetScreen())->m_Active_Layer = LAYER_CMP_N;
// else error
Via->SetLayerPair( old_layer, ((PCB_SCREEN*)GetScreen())->m_Active_Layer );
Via->m_Width = g_DesignSettings.m_CurrentMicroViaSize;
break;
default:
// Usual via is from copper to component; layer pair is 0 and 0x0F.
Via->SetLayerPair( COPPER_LAYER_N, LAYER_CMP_N );
break;
} }
if( Drc_On && BAD_DRC==m_drc->Drc( Via, m_Pcb->m_Track ) ) if( Drc_On && BAD_DRC==m_drc->Drc( Via, m_Pcb->m_Track ) )
@ -255,10 +255,10 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
delete Via; delete Via;
((PCB_SCREEN*)GetScreen())->m_Active_Layer = old_layer; ((PCB_SCREEN*)GetScreen())->m_Active_Layer = old_layer;
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
// delete the track(s) added in Begin_Route() // delete the track(s) added in Begin_Route()
while( g_TrackSegmentCount > itmp ) while( g_TrackSegmentCount > itmp )
{ {
Delete_Segment( DC, g_CurrentTrackSegment ); Delete_Segment( DC, g_CurrentTrackSegment );
@ -266,9 +266,9 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
// use the form of SetCurItem() which does not write to the msg panel, // use the form of SetCurItem() which does not write to the msg panel,
// SCREEN::SetCurItem(), so the DRC error remains on screen. // SCREEN::SetCurItem(), so the DRC error remains on screen.
// WinEDA_PcbFrame::SetCurItem() calls Display_Infos(). // WinEDA_PcbFrame::SetCurItem() calls Display_Infos().
GetScreen()->SetCurItem( g_CurrentTrackSegment ); GetScreen()->SetCurItem( g_CurrentTrackSegment );
return false; return false;
} }
@ -316,7 +316,7 @@ bool WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
Affiche_Status_Box(); Affiche_Status_Box();
SetToolbars(); SetToolbars();
return true; return true;
} }
@ -477,10 +477,10 @@ void WinEDA_PcbFrame::Affiche_PadsNoConnect( wxDC* DC )
pt_pad = pt_chevelu->pad_start; pt_pad = pt_chevelu->pad_start;
if( pt_pad ) if( pt_pad )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL ); pt_pad->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
pt_pad = pt_chevelu->pad_end; pt_pad = pt_chevelu->pad_end;
if( pt_pad ) if( pt_pad )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL ); pt_pad->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
} }
} }

View File

@ -56,7 +56,7 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
InstallTextModOptionsFrame( Text, NULL, wxPoint( -1, -1 ) ); InstallTextModOptionsFrame( Text, NULL, wxPoint( -1, -1 ) );
Text->m_Flags = 0; Text->m_Flags = 0;
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Text->Draw( DrawPanel, DC, GR_OR );
Text->Display_Infos( this ); Text->Display_Infos( this );
@ -74,14 +74,14 @@ void WinEDA_BasePcbFrame::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
MODULE* module = (MODULE*) Text->m_Parent; MODULE* module = (MODULE*) Text->m_Parent;
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Text->Draw( DrawPanel, DC, GR_XOR );
Text->m_Orient += 900; Text->m_Orient += 900;
while( Text->m_Orient >= 1800 ) while( Text->m_Orient >= 1800 )
Text->m_Orient -= 1800; Text->m_Orient -= 1800;
/* Redessin du Texte */ /* Redessin du Texte */
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Text->Draw( DrawPanel, DC, GR_XOR );
Text->Display_Infos( this ); Text->Display_Infos( this );
@ -107,7 +107,7 @@ void WinEDA_BasePcbFrame::DeleteTextModule( TEXTE_MODULE* Text, wxDC* DC )
if( Text->m_Type == TEXT_is_DIVERS ) if( Text->m_Type == TEXT_is_DIVERS )
{ {
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Text->Draw( DrawPanel, DC, GR_XOR );
/* liberation de la memoire : */ /* liberation de la memoire : */
Text ->DeleteStructure(); Text ->DeleteStructure();
@ -137,10 +137,10 @@ static void ExitTextModule( WinEDA_DrawPanel* Panel, wxDC* DC )
return; return;
Module = (MODULE*) Text->m_Parent; Module = (MODULE*) Text->m_Parent;
Text->Draw( Panel, DC, MoveVector, GR_XOR ); Text->Draw( Panel, DC, GR_XOR, MoveVector );
/* Redessin du Texte */ /* Redessin du Texte */
Text->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); Text->Draw( Panel, DC, GR_OR );
Text->m_Flags = 0; Text->m_Flags = 0;
Module->m_Flags = 0; Module->m_Flags = 0;
@ -205,7 +205,7 @@ void WinEDA_BasePcbFrame::PlaceTexteModule( TEXTE_MODULE* Text, wxDC* DC )
GetScreen()->SetModify(); GetScreen()->SetModify();
/* Redessin du Texte */ /* Redessin du Texte */
Text->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Text->Draw( DrawPanel, DC, GR_OR );
} }
} }
@ -229,11 +229,11 @@ static void Show_MoveTexte_Module( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* effacement du texte : */ /* effacement du texte : */
if( erase ) if( erase )
Text->Draw( panel, DC, MoveVector, GR_XOR ); Text->Draw( panel, DC, GR_XOR, MoveVector );
MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x); MoveVector.x = -(screen->m_Curseur.x - CursorInitialPosition.x);
MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y); MoveVector.y = -(screen->m_Curseur.y - CursorInitialPosition.y);
/* Redessin du Texte */ /* Redessin du Texte */
Text->Draw( panel, DC, MoveVector, GR_XOR ); Text->Draw( panel, DC, GR_XOR, MoveVector );
} }

View File

@ -136,14 +136,14 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
* - Extremites Mself.m_Start et Mself.m_End * - Extremites Mself.m_Start et Mself.m_End
* - Contrainte: m_Start.x = m_End.x ( self verticale ) * - Contrainte: m_Start.x = m_End.x ( self verticale )
* ou m_Start.y = m_End.y ( self horizontale ) * ou m_Start.y = m_End.y ( self horizontale )
* *
* On doit determiner: * On doit determiner:
* Mself.nbrin = nombre de segments perpendiculaires a la direction * Mself.nbrin = nombre de segments perpendiculaires a la direction
* ( le serpention aura nbrin + 1 demicercles + 2 1/4 de cercle) * ( le serpention aura nbrin + 1 demicercles + 2 1/4 de cercle)
* Mself.lbrin = longueur d'un brin * Mself.lbrin = longueur d'un brin
* Mself.rayon = rayon des parties arrondies du serpentin * Mself.rayon = rayon des parties arrondies du serpentin
* Mself.delta = segments raccord entre extremites et le serpention lui meme * Mself.delta = segments raccord entre extremites et le serpention lui meme
* *
* Les equations sont * Les equations sont
* Mself.m_Size.x = 2*Mself.rayon + Mself.lbrin * Mself.m_Size.x = 2*Mself.rayon + Mself.lbrin
* Mself.m_Size.y = 2*Mself.delta + 2*Mself.nbrin*Mself.rayon * Mself.m_Size.y = 2*Mself.delta + 2*Mself.nbrin*Mself.rayon
@ -151,13 +151,13 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
+ (Mself.nbrin-2) * Mself.lbrin //longueur des brins sauf 1er et dernier + (Mself.nbrin-2) * Mself.lbrin //longueur des brins sauf 1er et dernier
+ (Mself.nbrin+1) * ( PI * Mself.rayon) // longueur des arrondis + (Mself.nbrin+1) * ( PI * Mself.rayon) // longueur des arrondis
+ Mself.lbrin/2 - Melf.rayon*2) // longueur du 1er et dernier brin + Mself.lbrin/2 - Melf.rayon*2) // longueur du 1er et dernier brin
* *
* Les contraintes sont: * Les contraintes sont:
* nbrin >= 2 * nbrin >= 2
* Mself.rayon < Mself.m_Size.x * Mself.rayon < Mself.m_Size.x
* Mself.m_Size.y = Mself.rayon*4 + 2*Mself.raccord * Mself.m_Size.y = Mself.rayon*4 + 2*Mself.raccord
* Mself.lbrin > Mself.rayon *2 * Mself.lbrin > Mself.rayon *2
* *
* Le calcul est conduit de la facon suivante: * Le calcul est conduit de la facon suivante:
* Initialement: * Initialement:
* nbrin = 2 * nbrin = 2
@ -165,7 +165,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
* puis: * puis:
* on augmente le nombre de brins jusqu'a la longueur desiree * on augmente le nombre de brins jusqu'a la longueur desiree
* ( le rayon est diminue si necessaire ) * ( le rayon est diminue si necessaire )
* *
*/ */
{ {
EDGE_MODULE* PtSegm, * LastSegm, * FirstSegm, * newedge; EDGE_MODULE* PtSegm, * LastSegm, * FirstSegm, * newedge;
@ -285,7 +285,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
Module->m_Attributs = MOD_VIRTUAL | MOD_CMS; Module->m_Attributs = MOD_VIRTUAL | MOD_CMS;
Module->m_Flags = 0; Module->m_Flags = 0;
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
/* Generation des elements speciaux: drawsegments */ /* Generation des elements speciaux: drawsegments */
LastSegm = (EDGE_MODULE*) Module->m_Drawings; LastSegm = (EDGE_MODULE*) Module->m_Drawings;
@ -472,7 +472,7 @@ MODULE* WinEDA_PcbFrame::Genere_Self( wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
return Module; return Module;
} }

View File

@ -266,7 +266,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
Module->Display_Infos( this ); Module->Display_Infos( this );
/* Effacement du module */ /* Effacement du module */
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
pt_pad = (D_PAD*) Module->m_Pads; pt_pad = (D_PAD*) Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
@ -345,7 +345,7 @@ void WinEDA_BasePcbFrame::Global_Import_Pad_Settings( D_PAD* Pad, wxDC* DC )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
GetScreen()->SetModify(); GetScreen()->SetModify();

View File

@ -69,21 +69,21 @@ void WinEDA_DrawPanel::PrintPage( wxDC* DC, bool Print_Sheet_Ref, int printmaskl
case TYPECOTATION: case TYPECOTATION:
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 ) if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break; break;
( (COTATION*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode ); ( (COTATION*) PtStruct )->Draw( this, DC, drawmode );
break; break;
case TYPETEXTE: case TYPETEXTE:
{ {
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 ) if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break; break;
( (TEXTE_PCB*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode ); ( (TEXTE_PCB*) PtStruct )->Draw( this, DC, drawmode );
break; break;
} }
case TYPEMIRE: case TYPEMIRE:
if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 ) if( (g_TabOneLayerMask[ PtStruct->GetLayer()] & printmasklayer) == 0 )
break; break;
( (MIREPCB*) PtStruct )->Draw( this, DC, wxPoint( 0, 0 ), drawmode ); ( (MIREPCB*) PtStruct )->Draw( this, DC, drawmode );
break; break;
case TYPEMARKER: /* Trace des marqueurs */ case TYPEMARKER: /* Trace des marqueurs */
@ -170,7 +170,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
{ {
if( (pt_pad->m_Masque_Layer & masklayer ) == 0 ) if( (pt_pad->m_Masque_Layer & masklayer ) == 0 )
continue; continue;
pt_pad->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); pt_pad->Draw( panel, DC, draw_mode );
} }
/* draw footprint graphic shapes */ /* draw footprint graphic shapes */
@ -180,7 +180,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
mlayer = SILKSCREEN_LAYER_CU; mlayer = SILKSCREEN_LAYER_CU;
else if( Module->GetLayer() == CMP_N ) else if( Module->GetLayer() == CMP_N )
mlayer = SILKSCREEN_LAYER_CMP; mlayer = SILKSCREEN_LAYER_CMP;
if( mlayer & masklayer ) if( mlayer & masklayer )
{ {
/* Analyse des autorisations de trace pour les textes VALEUR et REF */ /* Analyse des autorisations de trace pour les textes VALEUR et REF */
@ -192,9 +192,9 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
trace_val = FALSE; trace_val = FALSE;
if( trace_ref ) if( trace_ref )
Module->m_Reference->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); Module->m_Reference->Draw( panel, DC, draw_mode );
if( trace_val ) if( trace_val )
Module->m_Value->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); Module->m_Value->Draw( panel, DC, draw_mode );
} }
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
@ -206,7 +206,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
break; break;
TextMod = (TEXTE_MODULE*) PtStruct; TextMod = (TEXTE_MODULE*) PtStruct;
TextMod->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); TextMod->Draw( panel, DC, draw_mode );
break; break;
case TYPEEDGEMODULE: case TYPEEDGEMODULE:
@ -214,7 +214,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct; EDGE_MODULE* edge = (EDGE_MODULE*) PtStruct;
if( (g_TabOneLayerMask[edge->GetLayer()] & masklayer ) == 0 ) if( (g_TabOneLayerMask[edge->GetLayer()] & masklayer ) == 0 )
break; break;
edge->Draw( panel, DC, wxPoint( 0, 0 ), draw_mode ); edge->Draw( panel, DC, draw_mode );
break; break;
} }

View File

@ -162,7 +162,7 @@ MODULE* WinEDA_BasePcbFrame::Load_Module_From_Library( const wxString& library,
module->SetPosition( curspos ); module->SetPosition( curspos );
build_liste_pads(); build_liste_pads();
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); module->Draw( DrawPanel, DC, GR_OR );
} }
return module; return module;
@ -315,7 +315,7 @@ wxString WinEDA_BasePcbFrame::Select_1_Module_From_List(
* Mask = Filtre d'affichage( Mask = wxEmptyString pour listage non filtré ) * Mask = Filtre d'affichage( Mask = wxEmptyString pour listage non filtré )
* KeyWord = Liste de mots cles, Recherche limitee aux composants * KeyWord = Liste de mots cles, Recherche limitee aux composants
* ayant ces mots cles ( KeyWord = wxEmptyString pour listage de tous les modules ) * ayant ces mots cles ( KeyWord = wxEmptyString pour listage de tous les modules )
* *
* retourne wxEmptyString si abort ou probleme * retourne wxEmptyString si abort ou probleme
* ou le nom du module * ou le nom du module
*/ */

View File

@ -143,13 +143,13 @@ void WinEDA_MirePropertiesFrame::OnOkClick( wxCommandEvent& event )
/* Met a jour les differents parametres pour le composant en cours d'édition /* Met a jour les differents parametres pour le composant en cours d'édition
*/ */
{ {
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR ); m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
m_MirePcb->m_Width = m_MireWidthCtrl->GetValue(); m_MirePcb->m_Width = m_MireWidthCtrl->GetValue();
MireDefaultSize = m_MirePcb->m_Size = m_MireSizeCtrl->GetValue(); MireDefaultSize = m_MirePcb->m_Size = m_MireSizeCtrl->GetValue();
m_MirePcb->m_Shape = m_MireShape->GetSelection() ? 1 : 0; m_MirePcb->m_Shape = m_MireShape->GetSelection() ? 1 : 0;
m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); m_MirePcb->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
m_Parent->GetScreen()->SetModify(); m_Parent->GetScreen()->SetModify();
EndModal( 1 ); EndModal( 1 );
@ -163,8 +163,8 @@ void WinEDA_PcbFrame::Delete_Mire( MIREPCB* MirePcb, wxDC* DC )
if( MirePcb == NULL ) if( MirePcb == NULL )
return; return;
MirePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); MirePcb->Draw( DrawPanel, DC, GR_XOR );
MirePcb ->DeleteStructure(); MirePcb->DeleteStructure();
} }
@ -181,11 +181,11 @@ static void Exit_EditMire( WinEDA_DrawPanel* Panel, wxDC* DC )
if( MirePcb ) if( MirePcb )
{ {
/* Effacement de la mire */ /* Effacement de la mire */
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); MirePcb->Draw( Panel, DC, GR_XOR );
if( MirePcb->m_Flags & IS_NEW ) if( MirePcb->m_Flags & IS_NEW )
{ {
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); MirePcb->Draw( Panel, DC, GR_XOR );
MirePcb ->DeleteStructure(); MirePcb ->DeleteStructure();
MirePcb = NULL; MirePcb = NULL;
} }
@ -193,7 +193,7 @@ static void Exit_EditMire( WinEDA_DrawPanel* Panel, wxDC* DC )
{ {
MirePcb->m_Pos = OldPos; MirePcb->m_Pos = OldPos;
MirePcb->m_Flags = 0; MirePcb->m_Flags = 0;
MirePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); MirePcb->Draw( Panel, DC, GR_OR );
} }
} }
} }
@ -250,7 +250,7 @@ void WinEDA_PcbFrame::Place_Mire( MIREPCB* MirePcb, wxDC* DC )
if( MirePcb == NULL ) if( MirePcb == NULL )
return; return;
MirePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); MirePcb->Draw( DrawPanel, DC, GR_OR );
MirePcb->m_Flags = 0; MirePcb->m_Flags = 0;
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
@ -273,10 +273,10 @@ static void Montre_Position_Mire( WinEDA_DrawPanel* panel, wxDC* DC, bool erase
/* efface ancienne position */ /* efface ancienne position */
if( erase ) if( erase )
MirePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); MirePcb->Draw( panel, DC, GR_XOR );
MirePcb->m_Pos = screen->m_Curseur; MirePcb->m_Pos = screen->m_Curseur;
// Reaffichage // Reaffichage
MirePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); MirePcb->Draw( panel, DC, GR_XOR );
} }

View File

@ -47,7 +47,7 @@ void Show_Pads_On_Off( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module )
pt_pad = module->m_Pads; pt_pad = module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{ {
pt_pad->Draw( panel, DC, g_Offset_Module, GR_XOR ); pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
} }
DisplayOpt.DisplayPadFill = pad_fill_tmp; DisplayOpt.DisplayPadFill = pad_fill_tmp;
@ -127,12 +127,12 @@ void WinEDA_PcbFrame::StartMove_Module( MODULE* module, wxDC* DC )
// effacement module a l'ecran: // effacement module a l'ecran:
if ( DC ) if ( DC )
{ {
int tmp = module->m_Flags; int tmp = module->m_Flags;
module->m_Flags |= DO_NOT_DRAW; module->m_Flags |= DO_NOT_DRAW;
DrawPanel->PostDirtyRect( module->GetBoundingBox() ); DrawPanel->PostDirtyRect( module->GetBoundingBox() );
module->m_Flags = tmp; module->m_Flags = tmp;
} }
// Reaffichage // Reaffichage
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
@ -200,7 +200,7 @@ void Exit_Module( WinEDA_DrawPanel* Panel, wxDC* DC )
pcbframe->Rotate_Module( NULL, module, ModuleInitOrient, FALSE ); pcbframe->Rotate_Module( NULL, module, ModuleInitOrient, FALSE );
if( ModuleInitLayer != module->GetLayer() ) if( ModuleInitLayer != module->GetLayer() )
pcbframe->m_Pcb->Change_Side_Module( module, NULL ); pcbframe->m_Pcb->Change_Side_Module( module, NULL );
module->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); module->Draw( Panel, DC, GR_OR );
} }
g_Drag_Pistes_On = FALSE; g_Drag_Pistes_On = FALSE;
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
@ -300,8 +300,8 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
/* Erase rastnest if needed /* Erase rastnest if needed
* Dirty rectangle is not used here because usually using a XOR draw mode gives good results (very few artefacts) for ratsnest * Dirty rectangle is not used here because usually using a XOR draw mode gives good results (very few artefacts) for ratsnest
*/ */
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
DrawGeneralRatsnest( DC ); DrawGeneralRatsnest( DC );
@ -327,7 +327,7 @@ bool WinEDA_PcbFrame::Delete_Module( MODULE* module, wxDC* DC, bool aAskBeforeDe
ReCompile_Ratsnest_After_Changes( DC ); ReCompile_Ratsnest_After_Changes( DC );
// redraw the area where the module was // redraw the area where the module was
if ( DC ) if ( DC )
DrawPanel->PostDirtyRect( module->GetBoundingBox() ); DrawPanel->PostDirtyRect( module->GetBoundingBox() );
return TRUE; return TRUE;
} }
@ -362,12 +362,12 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
{ {
m_Status_Pcb &= ~( LISTE_CHEVELU_OK | CONNEXION_OK); m_Status_Pcb &= ~( LISTE_CHEVELU_OK | CONNEXION_OK);
if( DC && m_PcbFrame ) if( DC && m_PcbFrame )
{ {
int tmp = Module->m_Flags; int tmp = Module->m_Flags;
Module->m_Flags |= DO_NOT_DRAW; Module->m_Flags |= DO_NOT_DRAW;
m_PcbFrame->DrawPanel->PostDirtyRect( Module->GetBoundingBox() ); m_PcbFrame->DrawPanel->PostDirtyRect( Module->GetBoundingBox() );
Module->m_Flags = tmp; Module->m_Flags = tmp;
} }
/* Effacement chevelu general si necessaire */ /* Effacement chevelu general si necessaire */
if( DC && g_Show_Ratsnest ) if( DC && g_Show_Ratsnest )
@ -514,13 +514,13 @@ void BOARD::Change_Side_Module( MODULE* Module, wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
if ( m_PcbFrame ) if ( m_PcbFrame )
Module->Display_Infos( m_PcbFrame ); Module->Display_Infos( m_PcbFrame );
if( !(Module->m_Flags & IS_MOVED) ) /* Inversion simple */ if( !(Module->m_Flags & IS_MOVED) ) /* Inversion simple */
{ {
if( DC && m_PcbFrame ) if( DC && m_PcbFrame )
{ {
Module->Draw( m_PcbFrame->DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( m_PcbFrame->DrawPanel, DC, GR_OR );
/* affichage chevelu general si necessaire */ /* affichage chevelu general si necessaire */
m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC ); m_PcbFrame->ReCompile_Ratsnest_After_Changes( DC );
@ -671,7 +671,7 @@ void WinEDA_BasePcbFrame::Place_Module( MODULE* module, wxDC* DC )
module->SetPosition( newpos ); module->SetPosition( newpos );
if( DC ) if( DC )
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); module->Draw( DrawPanel, DC, GR_OR );
/* Tracage des segments dragges et liberation memoire */ /* Tracage des segments dragges et liberation memoire */
if( g_DragSegmentList ) if( g_DragSegmentList )
@ -723,10 +723,10 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
{ {
if( DC ) if( DC )
{ {
int tmp = module->m_Flags; int tmp = module->m_Flags;
module->m_Flags |= DO_NOT_DRAW; module->m_Flags |= DO_NOT_DRAW;
DrawPanel->PostDirtyRect( module->GetBoundingBox() ); DrawPanel->PostDirtyRect( module->GetBoundingBox() );
module->m_Flags = tmp; module->m_Flags = tmp;
/* Reaffichage chevelu general si necessaire */ /* Reaffichage chevelu general si necessaire */
if( g_Show_Ratsnest ) if( g_Show_Ratsnest )
@ -756,7 +756,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
{ {
if( !(module->m_Flags & IS_MOVED) ) /* Rotation simple */ if( !(module->m_Flags & IS_MOVED) ) /* Rotation simple */
{ {
module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); module->Draw( DrawPanel, DC, GR_OR );
/* Reaffichage chevelu general si necessaire */ /* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes( DC ); ReCompile_Ratsnest_After_Changes( DC );
@ -792,7 +792,7 @@ void DrawModuleOutlines( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* module )
pt_pad = module->m_Pads; pt_pad = module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext ) for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{ {
pt_pad->Draw( panel, DC, g_Offset_Module, GR_XOR ); pt_pad->Draw( panel, DC, GR_XOR, g_Offset_Module );
} }
DisplayOpt.DisplayPadFill = pad_fill_tmp; DisplayOpt.DisplayPadFill = pad_fill_tmp;

View File

@ -36,10 +36,10 @@ static void Exit_Move_Pad( WinEDA_DrawPanel* Panel, wxDC* DC )
if( pad == NULL ) if( pad == NULL )
return; return;
pad->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); pad->Draw( Panel, DC, GR_XOR );
pad->m_Flags = 0; pad->m_Flags = 0;
pad->m_Pos = Pad_OldPos; pad->m_Pos = Pad_OldPos;
pad->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); pad->Draw( Panel, DC, GR_XOR );
/* Pad Move en cours : remise a l'etat d'origine */ /* Pad Move en cours : remise a l'etat d'origine */
if( g_Drag_Pistes_On ) if( g_Drag_Pistes_On )
{ {
@ -72,9 +72,10 @@ static void Show_Pad_Move( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
D_PAD* pad = s_CurrentSelectedPad; D_PAD* pad = s_CurrentSelectedPad;
if( erase ) if( erase )
pad->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); pad->Draw( panel, DC, GR_XOR );
pad->m_Pos = screen->m_Curseur; pad->m_Pos = screen->m_Curseur;
pad->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); pad->Draw( panel, DC, GR_XOR );
if( !g_Drag_Pistes_On ) if( !g_Drag_Pistes_On )
return; return;
@ -141,7 +142,7 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
*/ */
{ {
if( DC ) if( DC )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); pt_pad->Draw( DrawPanel, DC, GR_XOR );
pt_pad->m_PadShape = g_Pad_Master.m_PadShape; pt_pad->m_PadShape = g_Pad_Master.m_PadShape;
pt_pad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer; pt_pad->m_Masque_Layer = g_Pad_Master.m_Masque_Layer;
@ -178,7 +179,7 @@ void WinEDA_BasePcbFrame::Import_Pad_Settings( D_PAD* pt_pad, wxDC* DC )
pt_pad->ComputeRayon(); pt_pad->ComputeRayon();
if( DC ) if( DC )
pt_pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); pt_pad->Draw( DrawPanel, DC, GR_XOR );
( (MODULE*) pt_pad->m_Parent )->m_LastEdit_Time = time( NULL ); ( (MODULE*) pt_pad->m_Parent )->m_LastEdit_Time = time( NULL );
} }
@ -247,7 +248,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, wxDC* DC )
/* Redessin du module */ /* Redessin du module */
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->Display_Infos( this ); Pad->Display_Infos( this );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
@ -301,9 +302,9 @@ void WinEDA_BasePcbFrame::StartMovePad( D_PAD* Pad, wxDC* DC )
DrawPanel->ForceCloseManageCurseur = Exit_Move_Pad; DrawPanel->ForceCloseManageCurseur = Exit_Move_Pad;
/* Draw the pad (SKETCH mode) */ /* Draw the pad (SKETCH mode) */
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Pad->Draw( DrawPanel, DC, GR_XOR );
Pad->m_Flags |= IS_MOVED; Pad->m_Flags |= IS_MOVED;
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Pad->Draw( DrawPanel, DC, GR_XOR );
/* Build the list of track segments to drag if the command is a drag pad*/ /* Build the list of track segments to drag if the command is a drag pad*/
if( g_Drag_Pistes_On ) if( g_Drag_Pistes_On )
@ -329,7 +330,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Module = (MODULE*) Pad->m_Parent; Module = (MODULE*) Pad->m_Parent;
/* Placement du pad */ /* Placement du pad */
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Pad->Draw( DrawPanel, DC, GR_XOR );
/* Save old module */ /* Save old module */
Pad->m_Pos = Pad_OldPos; SaveCopyInUndoList( m_Pcb->m_Modules ); Pad->m_Pos = Pad_OldPos; SaveCopyInUndoList( m_Pcb->m_Modules );
@ -345,7 +346,7 @@ void WinEDA_BasePcbFrame::PlacePad( D_PAD* Pad, wxDC* DC )
Pad->m_Flags = 0; Pad->m_Flags = 0;
Pad->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Pad->Draw( DrawPanel, DC, GR_OR );
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->m_LastEdit_Time = time( NULL ); Module->m_LastEdit_Time = time( NULL );
@ -386,7 +387,7 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
GetScreen()->SetModify(); GetScreen()->SetModify();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
EXCHG( Pad->m_Size.x, Pad->m_Size.y ); EXCHG( Pad->m_Size.x, Pad->m_Size.y );
EXCHG( Pad->m_Drill.x, Pad->m_Drill.y ); EXCHG( Pad->m_Drill.x, Pad->m_Drill.y );
@ -400,5 +401,5 @@ void WinEDA_BasePcbFrame::RotatePad( D_PAD* Pad, wxDC* DC )
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Pad->Display_Infos( this ); Pad->Display_Infos( this );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }

View File

@ -86,7 +86,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveBasicShape( wxDC* DC,
} }
if( DC ) if( DC )
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
return Module; return Module;
} }
@ -102,12 +102,12 @@ static void Exit_Muonde( WinEDA_DrawFrame* frame, wxDC* DC )
{ {
if( Module->m_Flags & IS_NEW ) if( Module->m_Flags & IS_NEW )
{ {
Module->Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( frame->DrawPanel, DC, GR_XOR );
Module ->DeleteStructure(); Module ->DeleteStructure();
} }
else else
{ {
Module->Draw( frame->DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( frame->DrawPanel, DC, GR_XOR );
} }
} }
@ -273,7 +273,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWaveComponent( wxDC* DC, int shape_type )
} }
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
@ -404,13 +404,13 @@ void WinEDA_SetParamShapeFrame::ReadDataShapeDescr( wxCommandEvent& event )
* Unit=MM * Unit=MM
* XScale=271.501 * XScale=271.501
* YScale=1.00133 * YScale=1.00133
* *
* $COORD * $COORD
* 0 0.6112600148417837 * 0 0.6112600148417837
* 0.001851851851851852 0.6104800531118608 * 0.001851851851851852 0.6104800531118608
* .... * ....
* $ENDCOORD * $ENDCOORD
* *
* Each line is the X Y coord (normalised units from 0 to 1) * Each line is the X Y coord (normalised units from 0 to 1)
*/ */
{ {
@ -644,7 +644,7 @@ MODULE* WinEDA_PcbFrame::Create_MuWavePolygonShape( wxDC* DC )
PolyEdges = NULL; PolyEdges = NULL;
Module->Set_Rectangle_Encadrement(); Module->Set_Rectangle_Encadrement();
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();
return Module; return Module;
@ -685,7 +685,7 @@ void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module )
} }
/* Effacement du module: */ /* Effacement du module: */
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); Module->Draw( DrawPanel, DC, GR_XOR );
/* Calcul de la dimension actuelle */ /* Calcul de la dimension actuelle */
gap_size = next_pad->m_Pos0.x - pad->m_Pos0.x - pad->m_Size.x; gap_size = next_pad->m_Pos0.x - pad->m_Pos0.x - pad->m_Size.x;
@ -728,5 +728,5 @@ void WinEDA_PcbFrame::Edit_Gap( wxDC* DC, MODULE* Module )
RotatePoint( &(next_pad->m_Pos.x), &(next_pad->m_Pos.y), RotatePoint( &(next_pad->m_Pos.x), &(next_pad->m_Pos.y),
Module->m_Pos.x, Module->m_Pos.y, Module->m_Orient ); Module->m_Pos.x, Module->m_Pos.y, Module->m_Orient );
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }

View File

@ -215,7 +215,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Effacement ancien texte if( m_DC ) // Effacement ancien texte
{ {
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR ); CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
} }
if( !m_Name->GetValue().IsEmpty() ) if( !m_Name->GetValue().IsEmpty() )
@ -238,7 +238,7 @@ void WinEDA_TextPCBPropertiesFrame::OnOkClick( wxCommandEvent& event )
if( m_DC ) // Affichage nouveau texte if( m_DC ) // Affichage nouveau texte
{ {
/* Redessin du Texte */ /* Redessin du Texte */
CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); CurrentTextPCB->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
} }
m_Parent->m_CurrentScreen->SetModify(); m_Parent->m_CurrentScreen->SetModify();
EndModal( 1 ); EndModal( 1 );
@ -260,9 +260,9 @@ void Exit_Texte_Pcb( WinEDA_DrawPanel* Panel, wxDC* DC )
if( TextePcb ) if( TextePcb )
{ {
TextePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( Panel, DC, GR_XOR );
TextePcb->m_Pos = old_pos; TextePcb->m_Pos = old_pos;
TextePcb->Draw( Panel, DC, wxPoint( 0, 0 ), GR_OR ); TextePcb->Draw( Panel, DC, GR_OR );
TextePcb->m_Flags = 0; TextePcb->m_Flags = 0;
} }
@ -284,7 +284,7 @@ void WinEDA_PcbFrame::Place_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
return; return;
TextePcb->CreateDrawData(); TextePcb->CreateDrawData();
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); TextePcb->Draw( DrawPanel, DC, GR_OR );
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
SetCurItem( NULL ); SetCurItem( NULL );
@ -303,7 +303,7 @@ void WinEDA_PcbFrame::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC )
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
old_pos = TextePcb->m_Pos; old_pos = TextePcb->m_Pos;
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( DrawPanel, DC, GR_XOR );
TextePcb->m_Flags |= IS_MOVED; TextePcb->m_Flags |= IS_MOVED;
TextePcb->Display_Infos( this ); TextePcb->Display_Infos( this );
DrawPanel->ManageCurseur = Move_Texte_Pcb; DrawPanel->ManageCurseur = Move_Texte_Pcb;
@ -327,12 +327,12 @@ static void Move_Texte_Pcb( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
/* effacement du texte : */ /* effacement du texte : */
if( erase ) if( erase )
TextePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( panel, DC, GR_XOR );
TextePcb->m_Pos = panel->m_Parent->m_CurrentScreen->m_Curseur; TextePcb->m_Pos = panel->m_Parent->m_CurrentScreen->m_Curseur;
/* Redessin du Texte */ /* Redessin du Texte */
TextePcb->Draw( panel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( panel, DC, GR_XOR );
} }
@ -343,7 +343,7 @@ void WinEDA_PcbFrame::Delete_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
if( TextePcb == NULL ) if( TextePcb == NULL )
return; return;
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( DrawPanel, DC, GR_XOR );
/* Suppression du texte en Memoire*/ /* Suppression du texte en Memoire*/
TextePcb ->DeleteStructure(); TextePcb ->DeleteStructure();
@ -403,7 +403,7 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
return; return;
/* effacement du texte : */ /* effacement du texte : */
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); TextePcb->Draw( DrawPanel, DC, GR_XOR );
TextePcb->m_Orient += angle; TextePcb->m_Orient += angle;
@ -415,7 +415,7 @@ void WinEDA_PcbFrame::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
TextePcb->CreateDrawData(); TextePcb->CreateDrawData();
/* Redessin du Texte */ /* Redessin du Texte */
TextePcb->Draw( DrawPanel, DC, wxPoint( 0, 0 ), drawmode ); TextePcb->Draw( DrawPanel, DC, drawmode );
TextePcb->Display_Infos( this ); TextePcb->Display_Infos( this );
m_CurrentScreen->SetModify(); m_CurrentScreen->SetModify();

View File

@ -254,8 +254,8 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
/* Affiche Liaison */ /* Affiche Liaison */
GRLine( &DrawPanel->m_ClipBox, DC, segm_oX, segm_oY, segm_fX, segm_fY, 0, WHITE | GR_XOR ); GRLine( &DrawPanel->m_ClipBox, DC, segm_oX, segm_oY, segm_fX, segm_fY, 0, WHITE | GR_XOR );
pt_cur_ch->pad_start->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL ); pt_cur_ch->pad_start->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR | GR_SURBRILL ); pt_cur_ch->pad_end->Draw( DrawPanel, DC, GR_OR | GR_SURBRILL );
success = Route_1_Trace( this, DC, two_sides, row_source, col_source, success = Route_1_Trace( this, DC, two_sides, row_source, col_source,
row_target, col_target, pt_cur_ch ); row_target, col_target, pt_cur_ch );
@ -288,8 +288,8 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, LIGHTCYAN ); Affiche_1_Parametre( this, 72, wxT( "NoConn" ), msg, LIGHTCYAN );
/* Effacement des affichages de routage sur l'ecran */ /* Effacement des affichages de routage sur l'ecran */
pt_cur_ch->pad_start->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_AND ); pt_cur_ch->pad_start->Draw( DrawPanel, DC, GR_AND );
pt_cur_ch->pad_end->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_AND ); pt_cur_ch->pad_end->Draw( DrawPanel, DC, GR_AND );
if( stop ) if( stop )
break; break;

View File

@ -184,15 +184,13 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
} }
#endif #endif
wxPoint zero(0,0); // construct outside loop for speed
// Redraw ZONE_CONTAINERS // Redraw ZONE_CONTAINERS
BOARD::ZONE_CONTAINERS& zones = m_Pcb->m_ZoneDescriptorList; BOARD::ZONE_CONTAINERS& zones = m_Pcb->m_ZoneDescriptorList;
for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc ) for( BOARD::ZONE_CONTAINERS::iterator zc = zones.begin(); zc!=zones.end(); ++zc )
{ {
if( (*zc)->GetNet() == NetCode ) if( (*zc)->GetNet() == NetCode )
{ {
(*zc)->Draw( DrawPanel, DC, zero, draw_mode ); (*zc)->Draw( DrawPanel, DC, draw_mode );
} }
} }
@ -221,14 +219,12 @@ 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, zero, draw_mode ); pt_pad->Draw( panel, DC, draw_mode );
} }
} }
} }

View File

@ -36,7 +36,7 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
/* Trace les pads d'un module en mode SKETCH. /* Trace les pads d'un module en mode SKETCH.
* Utilisee pour afficher les pastilles d'un module lorsque celui ci n'est * Utilisee pour afficher les pastilles d'un module lorsque celui ci n'est
* pas affiche par les options d'affichage des Modules * pas affiche par les options d'affichage des Modules
* *
* Les pads affiches doivent apparaitre sur les couches donnees par * Les pads affiches doivent apparaitre sur les couches donnees par
* MasqueLayer * MasqueLayer
*/ */
@ -58,7 +58,7 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module,
{ {
if( (pt_pad->m_Masque_Layer & MasqueLayer) == 0 ) if( (pt_pad->m_Masque_Layer & MasqueLayer) == 0 )
continue; continue;
pt_pad->Draw( panel, DC, wxPoint( ox, oy ), draw_mode ); pt_pad->Draw( panel, DC, draw_mode, wxPoint( ox, oy ) );
} }
frame->m_DisplayPadFill = tmp; frame->m_DisplayPadFill = tmp;

View File

@ -32,7 +32,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
{ {
MODULE* Module; MODULE* Module;
PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* screen = (PCB_SCREEN*)GetScreen();
if( !m_Pcb || !screen ) if( !m_Pcb || !screen )
return; return;
@ -46,11 +46,11 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->DrawBackGround( DC ); DrawPanel->DrawBackGround( DC );
TraceWorkSheet( DC, screen, 0 ); TraceWorkSheet( DC, screen, 0 );
/* Redraw the footprint */ /* Redraw the footprint */
Module = (MODULE*) m_Pcb->m_Modules; Module = (MODULE*) m_Pcb->m_Modules;
for( ; Module != NULL; Module = (MODULE*) Module->Pnext ) for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
{ {
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); Module->Draw( DrawPanel, DC, GR_OR );
} }
Affiche_Status_Box(); Affiche_Status_Box();
@ -72,7 +72,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
/* Draw the BOARD, and others elements : axis, grid .. /* Draw the BOARD, and others elements : axis, grid ..
*/ */
{ {
PCB_SCREEN* Screen = (PCB_SCREEN*)GetScreen(); PCB_SCREEN* Screen = (PCB_SCREEN*)GetScreen();
if( !m_Pcb || !Screen ) if( !m_Pcb || !Screen )
return; return;
@ -87,105 +87,100 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
Trace_Pcb( DC, GR_OR ); Trace_Pcb( DC, GR_OR );
TraceWorkSheet( DC, GetScreen(), 0 ); TraceWorkSheet( DC, GetScreen(), 0 );
Affiche_Status_Box(); Affiche_Status_Box();
if( DrawPanel->ManageCurseur ) if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Redraw the cursor */
DrawPanel->Trace_Curseur( DC ); // Redraw the cursor
DrawPanel->Trace_Curseur( DC );
} }
#define DRAW_CUR_LAYER_LAST 1
/****************************************************/ /****************************************************/
void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode ) void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
/****************************************************/ /****************************************************/
/* Redraw the BOARD items but not cursors, axis or grid */ /* Redraw the BOARD items but not cursors, axis or grid */
{ {
MODULE* Module;
EDA_BaseStruct* PtStruct;
if( !m_Pcb ) if( !m_Pcb )
return; return;
Module = (MODULE*) m_Pcb->m_Modules; for( MODULE* module = m_Pcb->m_Modules; module; module = module->Next() )
for( ; Module != NULL; Module = (MODULE*) Module->Pnext )
{ {
bool display = true; bool display = true;
int MaskLay = ALL_CU_LAYERS; int layerMask = ALL_CU_LAYERS;
if( Module->m_Flags & IS_MOVED ) if( module->m_Flags & IS_MOVED )
continue; continue;
if( !DisplayOpt.Show_Modules_Cmp ) if( !DisplayOpt.Show_Modules_Cmp )
{ {
if( Module->GetLayer() == CMP_N ) if( module->GetLayer() == CMP_N )
display = FALSE; display = FALSE;
MaskLay &= ~CMP_LAYER; layerMask &= ~CMP_LAYER;
} }
if( !DisplayOpt.Show_Modules_Cu ) if( !DisplayOpt.Show_Modules_Cu )
{ {
if( Module->GetLayer() == COPPER_LAYER_N ) if( module->GetLayer() == COPPER_LAYER_N )
display = FALSE; display = FALSE;
MaskLay &= ~CUIVRE_LAYER; layerMask &= ~CUIVRE_LAYER;
} }
if( display ) if( display )
Module->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode ); module->Draw( DrawPanel, DC, mode );
else else
Trace_Pads_Only( DrawPanel, DC, Module, 0, 0, MaskLay, mode ); Trace_Pads_Only( DrawPanel, DC, module, 0, 0, layerMask, mode );
} }
/* Draw the graphic items */
PtStruct = m_Pcb->m_Drawings; // Draw the graphic items
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext ) for( BOARD_ITEM* item = m_Pcb->m_Drawings; item; item = item->Next() )
{ {
if( PtStruct->m_Flags & IS_MOVED ) if( item->m_Flags & IS_MOVED )
continue; continue;
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPECOTATION: case TYPECOTATION:
( (COTATION*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
break;
case TYPETEXTE: case TYPETEXTE:
( (TEXTE_PCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode );
break;
case TYPEMIRE: case TYPEMIRE:
( (MIREPCB*) PtStruct )->Draw( DrawPanel, DC, wxPoint( 0, 0 ), mode ); item->Draw( DrawPanel, DC, mode );
break; break;
case TYPEDRAWSEGMENT: case TYPEDRAWSEGMENT:
Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) PtStruct, mode ); Trace_DrawSegmentPcb( DrawPanel, DC, (DRAWSEGMENT*) item, mode );
break; break;
default: default:
break; break;
} }
} }
Trace_Pistes( DrawPanel, m_Pcb, DC, mode );
if( g_HightLigt_Status )
DrawHightLight( DC, g_HightLigth_NetCode );
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
// Areas must be drawn here only if not moved or dragged,
// because these areas are drawn by ManageCursor() in a specific manner
if ( (edge_zone->m_Flags & (IN_EDIT | IS_DRAGGED | IS_MOVED)) == 0 )
edge_zone->Draw( DrawPanel, DC, mode );
}
// draw the BOARD's markers. // draw the BOARD's markers.
for( unsigned i=0; i<m_Pcb->m_markers.size(); ++i ) for( unsigned i=0; i<m_Pcb->m_markers.size(); ++i )
{ {
m_Pcb->m_markers[i]->Draw( DrawPanel, DC, mode ); m_Pcb->m_markers[i]->Draw( DrawPanel, DC, mode );
} }
Trace_Pistes( DrawPanel, m_Pcb, DC, mode );
if( g_HightLigt_Status )
DrawHightLight( DC, g_HightLigth_NetCode );
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea(ii);
// Areas must be drawn here only if not moved or dragged,
// because these areas are drawn by ManageCursor() in a specific manner
if ( (edge_zone->m_Flags & (IN_EDIT | IS_DRAGGED | IS_MOVED)) == 0 )
edge_zone->Draw( DrawPanel, DC, wxPoint(0,0), mode);
}
DrawGeneralRatsnest( DC ); DrawGeneralRatsnest( DC );
m_CurrentScreen->ClrRefreshReq(); m_CurrentScreen->ClrRefreshReq();

View File

@ -65,7 +65,7 @@ void WinEDA_PcbFrame::UnDeleteItem( wxDC* DC )
g_UnDeleteStack[g_UnDeleteStackPtr] = NULL; g_UnDeleteStack[g_UnDeleteStackPtr] = NULL;
((MODULE*) item)->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); ((MODULE*) item)->Draw( DrawPanel, DC, GR_OR );
item->SetState( DELETED, OFF ); /* Creal DELETED flag */ item->SetState( DELETED, OFF ); /* Creal DELETED flag */
item->m_Flags = 0; item->m_Flags = 0;

View File

@ -492,12 +492,12 @@ MODULE* WinEDA_ExchangeModuleFrame::Change_1_Module( MODULE* PtModule,
m_WinMsg->WriteText( wxT( "Ok\n" ) ); m_WinMsg->WriteText( wxT( "Ok\n" ) );
/* Effacement a l'ecran de l'ancien module */ /* Effacement a l'ecran de l'ancien module */
PtModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_XOR ); PtModule->Draw( m_Parent->DrawPanel, m_DC, GR_XOR );
m_Parent->Exchange_Module( this, PtModule, NewModule ); m_Parent->Exchange_Module( this, PtModule, NewModule );
/* Affichage du nouveau module */ /* Affichage du nouveau module */
NewModule->Draw( m_Parent->DrawPanel, m_DC, wxPoint( 0, 0 ), GR_OR ); NewModule->Draw( m_Parent->DrawPanel, m_DC, GR_OR );
Maj_ListeCmp( NewModule->m_Reference->m_Text, oldnamecmp, namecmp, ShowError ); Maj_ListeCmp( NewModule->m_Reference->m_Text, oldnamecmp, namecmp, ShowError );
@ -550,7 +550,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
/* Mise a jour des autres parametres */ /* Mise a jour des autres parametres */
NewModule->m_TimeStamp = OldModule->m_TimeStamp; NewModule->m_TimeStamp = OldModule->m_TimeStamp;
NewModule->m_Path = OldModule->m_Path; NewModule->m_Path = OldModule->m_Path;
/* mise a jour des netnames ( lorsque c'est possible) */ /* mise a jour des netnames ( lorsque c'est possible) */
pt_pad = NewModule->m_Pads; pt_pad = NewModule->m_Pads;
@ -646,7 +646,7 @@ bool WinEDA_PcbFrame::RecreateCmpFileFromBoard()
{ {
fprintf( FichCmp, "\nBeginCmp\n" ); fprintf( FichCmp, "\nBeginCmp\n" );
fprintf( FichCmp, "TimeStamp = %8.8lX\n", Module->m_TimeStamp ); fprintf( FichCmp, "TimeStamp = %8.8lX\n", Module->m_TimeStamp );
fprintf( FichCmp, "Path = %s\n", CONV_TO_UTF8(Module->m_Path) ); fprintf( FichCmp, "Path = %s\n", CONV_TO_UTF8(Module->m_Path) );
fprintf( FichCmp, "Reference = %s;\n", fprintf( FichCmp, "Reference = %s;\n",
!Module->m_Reference->m_Text.IsEmpty() ? !Module->m_Reference->m_Text.IsEmpty() ?
CONV_TO_UTF8( Module->m_Reference->m_Text ) : "[NoRef]" ); CONV_TO_UTF8( Module->m_Reference->m_Text ) : "[NoRef]" );

View File

@ -260,7 +260,7 @@ void WinEDA_PcbFrame::Start_Move_Zone_Drag_Outline_Edge( wxDC* DC,
*/ */
{ {
zone_container->m_Flags = IS_DRAGGED; zone_container->m_Flags = IS_DRAGGED;
zone_container->m_CornerSelection = corner_id; zone_container->m_CornerSelection = corner_id;
DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse; DrawPanel->ManageCurseur = Show_Zone_Corner_Or_Outline_While_Move_Mouse;
DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines; DrawPanel->ForceCloseManageCurseur = Abort_Zone_Move_Corner_Or_Outlines;
s_CursorLastPosition = s_CornerInitialPosition = GetScreen()->m_Curseur; s_CursorLastPosition = s_CornerInitialPosition = GetScreen()->m_Curseur;
@ -312,7 +312,7 @@ void WinEDA_PcbFrame::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
if( DC ) if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); zone_container->Draw( DrawPanel, DC, GR_OR );
GetScreen()->SetModify(); GetScreen()->SetModify();
s_AddCutoutToCurrentZone = false; s_AddCutoutToCurrentZone = false;
s_CurrentZone = NULL; s_CurrentZone = NULL;
@ -353,7 +353,7 @@ void WinEDA_PcbFrame::Remove_Zone_Corner( wxDC* DC, ZONE_CONTAINER* zone_contain
if( zone_container->m_Poly->GetNumCorners() <= 3 ) if( zone_container->m_Poly->GetNumCorners() <= 3 )
{ {
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); zone_container->Draw( DrawPanel, DC, GR_XOR );
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp );
m_Pcb->Delete( zone_container ); m_Pcb->Delete( zone_container );
return; return;
@ -392,7 +392,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent; WinEDA_PcbFrame* pcbframe = (WinEDA_PcbFrame*) Panel->m_Parent;
ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) pcbframe->GetCurItem(); ZONE_CONTAINER* zone_container = (ZONE_CONTAINER*) pcbframe->GetCurItem();
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); zone_container->Draw( Panel, DC, GR_XOR );
if( zone_container->m_Flags == IS_MOVED ) if( zone_container->m_Flags == IS_MOVED )
{ {
@ -418,7 +418,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( WinEDA_DrawPanel* Panel, wxDC* DC )
zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y ); zone_container->m_Poly->MoveCorner( zone_container->m_CornerSelection, pos.x, pos.y );
} }
} }
zone_container->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); zone_container->Draw( Panel, DC, GR_XOR );
Panel->ManageCurseur = NULL; Panel->ManageCurseur = NULL;
Panel->ForceCloseManageCurseur = NULL; Panel->ForceCloseManageCurseur = NULL;
@ -441,7 +441,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC
if( erase ) /* Undraw edge in old position*/ if( erase ) /* Undraw edge in old position*/
{ {
zone->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); zone->Draw( Panel, DC, GR_XOR );
} }
wxPoint pos = pcbframe->GetScreen()->m_Curseur; wxPoint pos = pcbframe->GetScreen()->m_Curseur;
@ -462,7 +462,7 @@ void Show_Zone_Corner_Or_Outline_While_Move_Mouse( WinEDA_DrawPanel* Panel, wxDC
else else
zone->m_Poly->MoveCorner( zone->m_CornerSelection, pos.x, pos.y ); zone->m_Poly->MoveCorner( zone->m_CornerSelection, pos.x, pos.y );
zone->Draw( Panel, DC, wxPoint( 0, 0 ), GR_XOR ); zone->Draw( Panel, DC, GR_XOR );
} }
@ -510,12 +510,12 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
if( diag == ZONE_ABORT ) if( diag == ZONE_ABORT )
return 0; return 0;
((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer; // Set by the dialog frame ((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer; // Set by the dialog frame
} }
else /* Start a new contour: init zone params (net and layer) from an existing zone */ else /* Start a new contour: init zone params (net and layer) from an existing zone */
{ {
((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer = s_CurrentZone->GetLayer(); ((PCB_SCREEN*)GetScreen())->m_Active_Layer = s_Zone_Layer = s_CurrentZone->GetLayer();
s_Zone_Hatching = s_CurrentZone->m_Poly->GetHatchStyle(); s_Zone_Hatching = s_CurrentZone->m_Poly->GetHatchStyle();
} }
@ -737,7 +737,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ ) for( int ii = 0; ii < m_Pcb->GetAreaCount(); ii++ )
{ {
ZONE_CONTAINER* edge_zone = m_Pcb->GetArea( ii ); ZONE_CONTAINER* edge_zone = m_Pcb->GetArea( ii );
edge_zone->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); edge_zone->Draw( DrawPanel, DC, GR_XOR );
} }
zone_container->SetLayer( s_Zone_Layer ); zone_container->SetLayer( s_Zone_Layer );
@ -777,7 +777,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
int ncont = zone_container->m_Poly->GetContour( zone_container->m_CornerSelection ); int ncont = zone_container->m_Poly->GetContour( zone_container->m_CornerSelection );
if( DC ) if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_XOR ); zone_container->Draw( DrawPanel, DC, GR_XOR );
Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); // Remove fill segments Delete_Zone_Fill( DC, NULL, zone_container->m_TimeStamp ); // Remove fill segments
@ -788,7 +788,7 @@ void WinEDA_PcbFrame::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* zone_contai
{ {
zone_container->m_Poly->RemoveContour( ncont ); zone_container->m_Poly->RemoveContour( ncont );
if( DC ) if( DC )
zone_container->Draw( DrawPanel, DC, wxPoint( 0, 0 ), GR_OR ); zone_container->Draw( DrawPanel, DC, GR_OR );
} }
GetScreen()->SetModify(); GetScreen()->SetModify();
} }

View File

@ -550,7 +550,6 @@ void WinEDA_DrawPanel::EraseScreen( wxDC* DC )
/***************************************************/ /***************************************************/
void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event ) void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
/***************************************************/ /***************************************************/
#if 1 // new code without multiple calls to ReDraw()
{ {
wxPaintDC paintDC( this ); wxPaintDC paintDC( this );
EDA_Rect tmp; EDA_Rect tmp;
@ -622,72 +621,6 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
} }
#else // old code
{
wxPaintDC paintDC( this );
EDA_Rect tmp;
wxRect PaintClipBox;
wxPoint org;
static int counter;
++counter;
PrepareGraphicContext( &paintDC );
tmp = m_ClipBox;
org = m_ClipBox.GetOrigin();
wxRegionIterator upd( GetUpdateRegion() ); // get the update rect list
while( upd )
{
PaintClipBox = upd.GetRect();
upd++;
PaintClipBox.x += org.x;
PaintClipBox.y += org.y;
#if 0
printf( "PaintClipBox[%d]=(%d, %d, %d, %d)\n",
counter,
PaintClipBox.x,
PaintClipBox.y,
PaintClipBox.width,
PaintClipBox.height );
#endif
#ifdef WX_ZOOM
m_ClipBox.m_Pos.x = PaintClipBox.x * GetZoom();
m_ClipBox.m_Pos.y = PaintClipBox.y * GetZoom();
m_ClipBox.m_Size.x = PaintClipBox.m_Size.x * GetZoom();
m_ClipBox.m_Size.y = PaintClipBox.m_Size.y * GetZoom();
PaintClipBox = m_ClipBox;
#else
m_ClipBox.SetX( PaintClipBox.GetX() );
m_ClipBox.SetY( PaintClipBox.GetY() );
m_ClipBox.SetWidth( PaintClipBox.GetWidth() );
m_ClipBox.SetHeight( PaintClipBox.GetHeight() );
#endif
wxDCClipper* dcclip = new wxDCClipper( paintDC, PaintClipBox );
ReDraw( &paintDC, TRUE );
delete dcclip;
}
m_ClipBox = tmp;
event.Skip();
}
#endif
/****************************************************/ /****************************************************/
void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg ) void WinEDA_DrawPanel::ReDraw( wxDC* DC, bool erasebg )
/****************************************************/ /****************************************************/

View File

@ -74,3 +74,12 @@ edges editable.
2) final solution: get rid of requirement for tracks buried within a zone. 2) final solution: get rid of requirement for tracks buried within a zone.
Reivew the GEDA source code and other sources to gather ideas before doing 2). Reivew the GEDA source code and other sources to gather ideas before doing 2).
2008-Mar-31 Assigned To:
asked by: Dick Hollenbeck
================================================================================
EESCHEMA:
Derive all eeschema classes from SCH_ITEM, not EDA_BaseStruct.
Move the virtual EDA_BaseStruct::Draw() function into SCH_ITEM, so that
there is no EDA_BaseStruct::Draw() function.
Make the KICAD_T spelling mimic the class names.