Commit aab39d1d authored by dickelbeck's avatar dickelbeck

injected DLIST<> into many list heads, see change_log.txt

parent 67fa1ddb
...@@ -70,8 +70,8 @@ void Struct3D_Master::Copy( Struct3D_Master* pattern ) ...@@ -70,8 +70,8 @@ void Struct3D_Master::Copy( Struct3D_Master* pattern )
/***************************************************************/ /***************************************************************/
Struct3D_Master::Struct3D_Master( EDA_BaseStruct* StructFather ) : Struct3D_Master::Struct3D_Master( EDA_BaseStruct* aParent ) :
EDA_BaseStruct( StructFather, NOT_USED ) EDA_BaseStruct( aParent, NOT_USED )
/***************************************************************/ /***************************************************************/
{ {
m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0; m_MatScale.x = m_MatScale.y = m_MatScale.z = 1.0;
...@@ -102,8 +102,8 @@ Struct3D_Master:: ~Struct3D_Master() ...@@ -102,8 +102,8 @@ Struct3D_Master:: ~Struct3D_Master()
/***************************************************************/ /***************************************************************/
Struct3D_Shape::Struct3D_Shape( EDA_BaseStruct* StructFather ) : Struct3D_Shape::Struct3D_Shape( EDA_BaseStruct* aParent ) :
EDA_BaseStruct( StructFather, NOT_USED ) EDA_BaseStruct( aParent, NOT_USED )
/***************************************************************/ /***************************************************************/
{ {
m_3D_Coord = NULL; m_3D_Coord = NULL;
......
...@@ -197,7 +197,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -197,7 +197,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
/* draw tracks and vias : */ /* draw tracks and vias : */
for( track = pcb->m_Track; track != NULL; track = track->Next() ) for( track = pcb->m_Track; track != NULL; track = track->Next() )
{ {
if( track->Type() == TYPEVIA ) if( track->Type() == TYPE_VIA )
Draw3D_Via( (SEGVIA*) track ); Draw3D_Via( (SEGVIA*) track );
else else
Draw3D_Track( track ); Draw3D_Track( track );
...@@ -207,7 +207,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -207,7 +207,7 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
{ {
for( segzone = pcb->m_Zone; segzone != NULL; segzone = segzone->Next() ) for( segzone = pcb->m_Zone; segzone != NULL; segzone = segzone->Next() )
{ {
if( segzone->Type() == TYPEZONE ) if( segzone->Type() == TYPE_ZONE )
Draw3D_Track( segzone ); Draw3D_Track( segzone );
} }
} }
...@@ -218,11 +218,11 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List() ...@@ -218,11 +218,11 @@ GLuint Pcb3D_GLCanvas::CreateDrawGL_List()
{ {
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
Draw3D_DrawSegment( (DRAWSEGMENT*) PtStruct ); Draw3D_DrawSegment( (DRAWSEGMENT*) PtStruct );
break; break;
case TYPETEXTE: case TYPE_TEXTE:
Draw3D_DrawText( (TEXTE_PCB*) PtStruct ); Draw3D_DrawText( (TEXTE_PCB*) PtStruct );
break; break;
...@@ -513,10 +513,10 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas ) ...@@ -513,10 +513,10 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
{ {
switch( Struct->Type() ) switch( Struct->Type() )
{ {
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
break; break;
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
( (EDGE_MODULE*) Struct )->Draw3D( glcanvas ); ( (EDGE_MODULE*) Struct )->Draw3D( glcanvas );
break; break;
......
...@@ -70,7 +70,7 @@ public: ...@@ -70,7 +70,7 @@ public:
public: public:
Struct3D_Master( EDA_BaseStruct * StructFather ); Struct3D_Master( EDA_BaseStruct * aParent );
~Struct3D_Master(); ~Struct3D_Master();
Struct3D_Master* Next() const { return (Struct3D_Master*) Pnext; } Struct3D_Master* Next() const { return (Struct3D_Master*) Pnext; }
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
public: public:
Struct3D_Shape( EDA_BaseStruct * StructFather ); Struct3D_Shape( EDA_BaseStruct * aParent );
~Struct3D_Shape(); ~Struct3D_Shape();
Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; } Struct3D_Shape* Next() const { return (Struct3D_Shape*) Pnext; }
......
...@@ -5,6 +5,36 @@ Started 2007-June-11 ...@@ -5,6 +5,36 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2008-Dec-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew & gerbview
* added g_CurrentTrackList, and made g_CurrentTrackSegment and g_FirstTrackSegment
be #defines into this DLIST<TRACK>, see pcbnew.h.
* Switched datatype of BOARD::m_Track, BOARD::m_Zone, etc to DLIST<>.
This simplifies BOARD::~BOARD() somewhat, and adds automatic counting of list elements and encapsulation
of all list operations into DHEAD member functions, see common/dlist.cpp.
* Removed TRACK::Insert() since it no long fits with the new BOARD::m_Track and BOARD::m_Zone datatypes.
* Removed the g_UnDeleteStack support from <any>::UnLink(), this may leave a deficiency, but this code needs
to be external to UnLink() anyway.
* Made TRACK::SetNext() and TRACK::SetBack() private so they may not be used,
the only way to put a TRACK on a list is through DLIST<TRACK>::PushFront()
and other member functions of DLIST<TRACK>.
* Switched to std::vector<TRACK*> in track.cpp to hold the temporary static list.
* Made g_UnDeleteStack be a DLIST<TRACK>.
* renamed some KICAD_T to more closely match the corresponding classname.
* Changed to DLIST<> for almost all the list heads in BOARD.
++gerbview
* switched to GR_COPY mode for drawing so we can see the erasures. debugged
erasures in rs274d.cpp.
* Now using order specific TRACK loading, so erasures come after objects they
are intended to erase. Still need layer ordering and polygon ordering support, my todo.
I do not like DeleteStructList() and plan to migrate away from it, DLIST<>:DeletAll()
does something like it.
=======
2008-Dec-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2008-Dec-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++pcbnew ++pcbnew
...@@ -13,6 +43,7 @@ email address. ...@@ -13,6 +43,7 @@ email address.
results are same, but using segments can be better (faster redraw time) for polygons having a lot results are same, but using segments can be better (faster redraw time) for polygons having a lot
of segments (more than 10000) of segments (more than 10000)
>>>>>>> .r1441
2008-Dec-02 UPDATE Wayne Stambaugh <stambaughw@verizon.net> 2008-Dec-02 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================ ================================================================================
++build fixes ++build fixes
......
...@@ -156,8 +156,6 @@ void DHEAD::remove( EDA_BaseStruct* aElement ) ...@@ -156,8 +156,6 @@ void DHEAD::remove( EDA_BaseStruct* aElement )
aElement->SetList( 0 ); aElement->SetList( 0 );
--count; --count;
D( VerifyListIntegrity(); );
} }
#if defined(DEBUG) #if defined(DEBUG)
...@@ -191,6 +189,8 @@ void DHEAD::VerifyListIntegrity() ...@@ -191,6 +189,8 @@ void DHEAD::VerifyListIntegrity()
wxASSERT( item == NULL ); wxASSERT( item == NULL );
wxASSERT( i == count ); wxASSERT( i == count );
// printf("list %p has %d items.\n", this, count );
} }
#endif #endif
......
...@@ -51,15 +51,13 @@ void WinEDA_CvpcbFrame::CreateScreenCmp() ...@@ -51,15 +51,13 @@ void WinEDA_CvpcbFrame::CreateScreenCmp()
DrawFrame->SetStatusText( msg, 0 ); DrawFrame->SetStatusText( msg, 0 );
if( DrawFrame->m_Pcb->m_Modules ) if( DrawFrame->m_Pcb->m_Modules.GetCount() )
{ {
// there is only one module in the list // there is only one module in the list
DrawFrame->m_Pcb->m_Modules->DeleteStructure(); DrawFrame->m_Pcb->m_Modules.DeleteAll();
DrawFrame->m_Pcb->m_Modules = NULL;
} }
DrawFrame->m_Pcb->m_Modules = DrawFrame->Get_Module( FootprintName ); DrawFrame->m_Pcb->m_Modules.PushBack( DrawFrame->Get_Module( FootprintName ) );
DrawFrame->Zoom_Automatique( FALSE ); DrawFrame->Zoom_Automatique( FALSE );
if( DrawFrame->m_Draw3DFrame ) if( DrawFrame->m_Draw3DFrame )
......
...@@ -851,7 +851,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc ...@@ -851,7 +851,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
; ;
} }
SetStructFather( Struct, screen ); SetaParent( Struct, screen );
PickedList = (DrawPickedStruct*) PickedList->Next(); PickedList = (DrawPickedStruct*) PickedList->Next();
} }
...@@ -900,7 +900,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc ...@@ -900,7 +900,7 @@ static SCH_ITEM * CopyStruct( WinEDA_DrawPanel* panel, wxDC* DC, BASE_SCREEN* sc
RedrawOneStruct( panel, DC, NewDrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( panel, DC, NewDrawStruct, GR_DEFAULT_DRAWMODE );
SetStructFather( NewDrawStruct, screen ); SetaParent( NewDrawStruct, screen );
NewDrawStruct->SetNext( screen->EEDrawList ); NewDrawStruct->SetNext( screen->EEDrawList );
screen->EEDrawList = NewDrawStruct; screen->EEDrawList = NewDrawStruct;
} }
...@@ -1052,7 +1052,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1052,7 +1052,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
{ {
( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) Struct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL); ( (SCH_COMPONENT*) Struct )->ClearAnnotation(NULL);
SetStructFather( Struct, GetScreen() ); SetaParent( Struct, GetScreen() );
} }
PickedList = (DrawPickedStruct*) PickedList->Next(); PickedList = (DrawPickedStruct*) PickedList->Next();
} }
...@@ -1062,7 +1062,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1062,7 +1062,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
{ {
SCH_ITEM * Struct = PickedList->m_PickedStruct; SCH_ITEM * Struct = PickedList->m_PickedStruct;
Struct->SetNext( GetScreen()->EEDrawList ); Struct->SetNext( GetScreen()->EEDrawList );
SetStructFather( Struct, GetScreen() ); SetaParent( Struct, GetScreen() );
GetScreen()->EEDrawList = Struct; GetScreen()->EEDrawList = Struct;
PickedList = PickedList->Next(); PickedList = PickedList->Next();
} }
...@@ -1077,7 +1077,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC ) ...@@ -1077,7 +1077,7 @@ void WinEDA_SchematicFrame::PasteStruct( wxDC* DC )
( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp(); ( (SCH_COMPONENT*) DrawStruct )->m_TimeStamp = GetTimeStamp();
( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(NULL); ( (SCH_COMPONENT*) DrawStruct )->ClearAnnotation(NULL);
} }
SetStructFather( DrawStruct, GetScreen() ); SetaParent( DrawStruct, GetScreen() );
RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE ); RedrawOneStruct( DrawPanel, DC, DrawStruct, GR_DEFAULT_DRAWMODE );
DrawStruct->SetNext( GetScreen()->EEDrawList ); DrawStruct->SetNext( GetScreen()->EEDrawList );
GetScreen()->EEDrawList = DrawStruct; GetScreen()->EEDrawList = DrawStruct;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
/******************************************************************/ /******************************************************************/
void SetStructFather( EDA_BaseStruct* Struct, BASE_SCREEN* Screen ) void SetaParent( EDA_BaseStruct* Struct, BASE_SCREEN* Screen )
/******************************************************************/ /******************************************************************/
{ {
switch( Struct->Type() ) switch( Struct->Type() )
......
...@@ -371,7 +371,7 @@ DrawPickedStruct * BreakSegment(SCH_SCREEN * screen, wxPoint breakpoint, ...@@ -371,7 +371,7 @@ DrawPickedStruct * BreakSegment(SCH_SCREEN * screen, wxPoint breakpoint,
/* EECLASS.CPP */ /* EECLASS.CPP */
/**************/ /**************/
void SetStructFather(EDA_BaseStruct * Struct, BASE_SCREEN * Screen); void SetaParent(EDA_BaseStruct * Struct, BASE_SCREEN * Screen);
/***************/ /***************/
/* LIBALIAS.CPP */ /* LIBALIAS.CPP */
......
...@@ -43,6 +43,7 @@ set(GERBVIEW_SRCS ...@@ -43,6 +43,7 @@ set(GERBVIEW_SRCS
set(GERBVIEW_EXTRA_SRCS set(GERBVIEW_EXTRA_SRCS
../pcbnew/basepcbframe.cpp ../pcbnew/basepcbframe.cpp
../pcbnew/class_board.cpp ../pcbnew/class_board.cpp
../pcbnew/class_board_item.cpp
../pcbnew/class_board_connected_item.cpp ../pcbnew/class_board_connected_item.cpp
../pcbnew/class_drawsegment.cpp ../pcbnew/class_drawsegment.cpp
../pcbnew/class_drc_item.cpp ../pcbnew/class_drc_item.cpp
......
...@@ -25,7 +25,7 @@ void Affiche_Infos_PCB_Texte( WinEDA_BasePcbFrame* frame, TEXTE_PCB* pt_texte ) ...@@ -25,7 +25,7 @@ void Affiche_Infos_PCB_Texte( WinEDA_BasePcbFrame* frame, TEXTE_PCB* pt_texte )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
if( pt_texte->Type() == TYPECOTATION ) if( pt_texte->Type() == TYPE_COTATION )
Affiche_1_Parametre( frame, 1, _( "COTATION" ), pt_texte->m_Text, DARKGREEN ); Affiche_1_Parametre( frame, 1, _( "COTATION" ), pt_texte->m_Text, DARKGREEN );
else else
......
...@@ -398,7 +398,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) ...@@ -398,7 +398,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
/* this track segment must be duplicated */ /* this track segment must be duplicated */
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
TRACK* new_track = track->Copy(); TRACK* new_track = track->Copy();
new_track->Insert( m_Pcb, NULL );
m_Pcb->Add( new_track );
new_track->m_Start += delta; new_track->m_Start += delta;
new_track->m_End += delta; new_track->m_End += delta;
...@@ -417,7 +418,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC ) ...@@ -417,7 +418,8 @@ void WinEDA_BasePcbFrame::Block_Duplicate( wxDC* DC )
{ {
/* this zone segment must be duplicated */ /* this zone segment must be duplicated */
SEGZONE * new_zsegment = (SEGZONE*) zsegment->Copy(); SEGZONE * new_zsegment = (SEGZONE*) zsegment->Copy();
new_zsegment->Insert( m_Pcb, NULL );
m_Pcb->Add( new_zsegment );
new_zsegment->m_Start += delta; new_zsegment->m_Start += delta;
new_zsegment->m_End += delta; new_zsegment->m_End += delta;
......
...@@ -55,29 +55,19 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track ) ...@@ -55,29 +55,19 @@ TRACK* WinEDA_GerberFrame::Delete_Segment( wxDC* DC, TRACK* Track )
if( Track->m_Flags & IS_NEW ) // Trace en cours, on peut effacer le dernier segment if( Track->m_Flags & IS_NEW ) // Trace en cours, on peut effacer le dernier segment
{ {
if( g_TrackSegmentCount > 0 ) if( g_CurrentTrackList.GetCount() > 0 )
{ {
// modification du trace // modification du trace
Track = g_CurrentTrackSegment; delete g_CurrentTrackList.PopBack();
g_CurrentTrackSegment = g_CurrentTrackSegment->Back();
delete Track; if( g_CurrentTrackList.GetCount() && g_CurrentTrackSegment->Type() == TYPE_VIA )
g_TrackSegmentCount--;
if( g_TrackSegmentCount && (g_CurrentTrackSegment->Type() == TYPEVIA) )
{ {
Track = g_CurrentTrackSegment; delete g_CurrentTrackList.PopBack();
g_CurrentTrackSegment = g_CurrentTrackSegment->Back();
delete Track;
g_TrackSegmentCount--;
} }
if( g_CurrentTrackSegment )
g_CurrentTrackSegment->SetNext( NULL );
Affiche_Status_Box(); Affiche_Status_Box();
if( g_TrackSegmentCount == 0 ) if( g_CurrentTrackList.GetCount() == 0 )
{ {
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
DrawPanel->ForceCloseManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL;
......
...@@ -60,7 +60,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -60,7 +60,7 @@ void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
if( DrawStruct->Type() == TYPETRACK ) if( DrawStruct->Type() == TYPE_TRACK )
{ {
Delete_Segment( DC, (TRACK*) DrawStruct ); Delete_Segment( DC, (TRACK*) DrawStruct );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
......
...@@ -155,14 +155,14 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -155,14 +155,14 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
if( pcb_layer_number > LAST_COPPER_LAYER ) if( pcb_layer_number > LAST_COPPER_LAYER )
{ {
DRAWSEGMENT* drawitem = new DRAWSEGMENT( pcb, TYPEDRAWSEGMENT ); DRAWSEGMENT* drawitem = new DRAWSEGMENT( pcb, TYPE_DRAWSEGMENT );
drawitem->SetLayer( pcb_layer_number ); drawitem->SetLayer( pcb_layer_number );
drawitem->m_Start = track->m_Start; drawitem->m_Start = track->m_Start;
drawitem->m_End = track->m_End; drawitem->m_End = track->m_End;
drawitem->m_Width = track->m_Width; drawitem->m_Width = track->m_Width;
drawitem->SetNext( pcb->m_Drawings );
pcb->m_Drawings = drawitem; pcb->Add( drawitem );
} }
else else
{ {
...@@ -195,7 +195,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile, ...@@ -195,7 +195,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
newtrack->SetLayer( pcb_layer_number ); newtrack->SetLayer( pcb_layer_number );
} }
newtrack->Insert( pcb, NULL ); pcb->Add( newtrack );
} }
} }
......
...@@ -36,16 +36,11 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -36,16 +36,11 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
} }
} }
m_Pcb->m_Drawings->DeleteStructList(); m_Pcb->m_Drawings.DeleteAll();
m_Pcb->m_Drawings = NULL;
m_Pcb->m_Track->DeleteStructList(); m_Pcb->m_Track.DeleteAll();
m_Pcb->m_Track = NULL;
m_Pcb->m_NbSegmTrack = 0;
m_Pcb->m_Zone->DeleteStructList(); m_Pcb->m_Zone.DeleteAll();
m_Pcb->m_Zone = NULL;
m_Pcb->m_NbSegmZone = 0;
for( ; g_UnDeleteStackPtr != 0; ) for( ; g_UnDeleteStackPtr != 0; )
{ {
...@@ -66,12 +61,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query ) ...@@ -66,12 +61,8 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
m_Pcb->m_Status_Pcb = 0; m_Pcb->m_Status_Pcb = 0;
m_Pcb->m_NbLoclinks = 0; m_Pcb->m_NbLoclinks = 0;
m_Pcb->m_NbLinks = 0; m_Pcb->m_NbLinks = 0;
m_Pcb->m_NbPads = 0;
m_Pcb->m_NbNets = 0;
m_Pcb->m_NbNodes = 0; m_Pcb->m_NbNodes = 0;
m_Pcb->m_NbNoconnect = 0; m_Pcb->m_NbNoconnect = 0;
m_Pcb->m_NbSegmTrack = 0;
m_Pcb->m_NbSegmZone = 0;
/* Init parametres de gestion des ecrans PAD et PCB */ /* Init parametres de gestion des ecrans PAD et PCB */
SetBaseScreen( ActiveScreen = ScreenPcb ); SetBaseScreen( ActiveScreen = ScreenPcb );
...@@ -88,12 +79,8 @@ void WinEDA_GerberFrame::Erase_Zones( bool query ) ...@@ -88,12 +79,8 @@ void WinEDA_GerberFrame::Erase_Zones( bool query )
if( query && !IsOK( this, _( "Delete zones ?" ) ) ) if( query && !IsOK( this, _( "Delete zones ?" ) ) )
return; return;
if( m_Pcb->m_Zone ) m_Pcb->m_Zone.DeleteAll();
{
m_Pcb->m_Zone->DeleteStructList( );
m_Pcb->m_Zone = NULL;
m_Pcb->m_NbSegmZone = 0;
}
ScreenPcb->SetModify(); ScreenPcb->SetModify();
} }
...@@ -116,10 +103,10 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query ) ...@@ -116,10 +103,10 @@ void WinEDA_GerberFrame::Erase_Segments_Pcb( bool all_layers, bool query )
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
case TYPETEXTE: case TYPE_TEXTE:
case TYPECOTATION: case TYPE_COTATION:
case TYPEMIRE: case TYPE_MIRE:
if( PtStruct->GetLayer() == layer || layer < 0 ) if( PtStruct->GetLayer() == layer || layer < 0 )
PtStruct->DeleteStructure(); PtStruct->DeleteStructure();
break; break;
...@@ -177,7 +164,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query ) ...@@ -177,7 +164,7 @@ void WinEDA_GerberFrame::Erase_Textes_Pcb( bool query )
for( ; PtStruct != NULL; PtStruct = PtNext ) for( ; PtStruct != NULL; PtStruct = PtNext )
{ {
PtNext = PtStruct->Next(); PtNext = PtStruct->Next();
if( PtStruct->Type() == TYPETEXTE ) if( PtStruct->Type() == TYPE_TEXTE )
PtStruct->DeleteStructure(); PtStruct->DeleteStructure();
} }
......
...@@ -57,7 +57,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc ) ...@@ -57,7 +57,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
while( ( TrackLocate = Locate_Pistes( TrackLocate, layer, typeloc ) ) != NULL ) while( ( TrackLocate = Locate_Pistes( TrackLocate, layer, typeloc ) ) != NULL )
{ {
Track = TrackLocate; Track = TrackLocate;
if( TrackLocate->Type() == TYPEVIA ) if( TrackLocate->Type() == TYPE_VIA )
break; break;
TrackLocate = TrackLocate->Next(); TrackLocate = TrackLocate->Next();
} }
...@@ -67,7 +67,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc ) ...@@ -67,7 +67,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
} }
pt_texte_pcb = Locate_Texte_Pcb( (TEXTE_PCB*) m_Pcb->m_Drawings, typeloc ); pt_texte_pcb = Locate_Texte_Pcb( (TEXTE_PCB*) m_Pcb->m_Drawings.GetFirst(), typeloc );
if( pt_texte_pcb ) // texte type PCB localise if( pt_texte_pcb ) // texte type PCB localise
{ {
pt_texte_pcb->Display_Infos( this ); pt_texte_pcb->Display_Infos( this );
...@@ -79,7 +79,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc ) ...@@ -79,7 +79,7 @@ BOARD_ITEM* WinEDA_GerberFrame::Locate( int typeloc )
return DrawSegm; return DrawSegm;
} }
if( ( TrackLocate = Locate_Zone( (TRACK*) m_Pcb->m_Zone, if( ( TrackLocate = Locate_Zone( m_Pcb->m_Zone,
GetScreen()->m_Active_Layer, typeloc ) ) != NULL ) GetScreen()->m_Active_Layer, typeloc ) ) != NULL )
{ {
TrackLocate->Display_Infos( this ); TrackLocate->Display_Infos( this );
...@@ -112,7 +112,7 @@ DRAWSEGMENT* Locate_Segment_Pcb( BOARD* Pcb, int typeloc ) ...@@ -112,7 +112,7 @@ DRAWSEGMENT* Locate_Segment_Pcb( BOARD* Pcb, int typeloc )
PtStruct = Pcb->m_Drawings; PtStruct = Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() != TYPEDRAWSEGMENT ) if( PtStruct->Type() != TYPE_DRAWSEGMENT )
continue; continue;
pts = (DRAWSEGMENT*) PtStruct; pts = (DRAWSEGMENT*) PtStruct;
ux0 = pts->m_Start.x; uy0 = pts->m_Start.y; ux0 = pts->m_Start.x; uy0 = pts->m_Start.y;
...@@ -198,7 +198,7 @@ TRACK* Locate_Pistes( TRACK* start_adresse, wxPoint ref, int Layer ) ...@@ -198,7 +198,7 @@ TRACK* Locate_Pistes( TRACK* start_adresse, wxPoint ref, int Layer )
dx -= ux0; dy -= uy0; dx -= ux0; dy -= uy0;
spot_cX = ref.x - ux0; spot_cY = ref.y - uy0; spot_cX = ref.x - ux0; spot_cY = ref.y - uy0;
if( Track->Type() == TYPEVIA ) /* VIA rencontree */ if( Track->Type() == TYPE_VIA ) /* VIA rencontree */
{ {
if( (abs( spot_cX ) <= l_piste ) && (abs( spot_cY ) <=l_piste) ) if( (abs( spot_cX ) <= l_piste ) && (abs( spot_cY ) <=l_piste) )
{ {
...@@ -289,7 +289,7 @@ TEXTE_PCB* Locate_Texte_Pcb( TEXTE_PCB* pt_txt_pcb, int typeloc ) ...@@ -289,7 +289,7 @@ TEXTE_PCB* Locate_Texte_Pcb( TEXTE_PCB* pt_txt_pcb, int typeloc )
PtStruct = (EDA_BaseStruct*) pt_txt_pcb; PtStruct = (EDA_BaseStruct*) pt_txt_pcb;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() != TYPETEXTE ) if( PtStruct->Type() != TYPE_TEXTE )
continue; continue;
pt_txt_pcb = (TEXTE_PCB*) PtStruct; pt_txt_pcb = (TEXTE_PCB*) PtStruct;
......
...@@ -22,6 +22,7 @@ OBJECTS= \ ...@@ -22,6 +22,7 @@ OBJECTS= \
gerberframe.o\ gerberframe.o\
onrightclick.o\ onrightclick.o\
class_board.o\ class_board.o\
class_board_item.o\
class_drawsegment.o\ class_drawsegment.o\
class_track.o \ class_track.o \
class_drc_item.o \ class_drc_item.o \
......
...@@ -72,7 +72,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -72,7 +72,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
switch( DrawStruct->Type() ) switch( DrawStruct->Type() )
{ {
case TYPETRACK: case TYPE_TRACK:
// PopMenu->AppendSeparator(); // PopMenu->AppendSeparator();
// PopMenu->Append(ID_POPUP_PCB_EDIT_TRACK, _("Edit")); // PopMenu->Append(ID_POPUP_PCB_EDIT_TRACK, _("Edit"));
......
...@@ -102,6 +102,13 @@ static void fillRoundFlashTRACK( TRACK* aTrack, int Dcode_index, int aLayer, ...@@ -102,6 +102,13 @@ static void fillRoundFlashTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
NEGATE( aTrack->m_End.y ); NEGATE( aTrack->m_End.y );
aTrack->SetNet( Dcode_index ); aTrack->SetNet( Dcode_index );
aTrack->m_Shape = S_SPOT_CIRCLE; aTrack->m_Shape = S_SPOT_CIRCLE;
D(printf("%s: isDark=%s\n", __func__, isDark ? "true" : "false" );)
if( !isDark )
{
aTrack->m_Flags |= DRAW_ERASED;
}
} }
...@@ -148,6 +155,12 @@ static void fillOvalOrRectFlashTRACK( TRACK* aTrack, int Dcode_index, int aLaye ...@@ -148,6 +155,12 @@ static void fillOvalOrRectFlashTRACK( TRACK* aTrack, int Dcode_index, int aLaye
aTrack->m_Start.y -= len; aTrack->m_Start.y -= len;
aTrack->m_End.y += len; aTrack->m_End.y += len;
} }
D(printf("%s: isDark=%s\n", __func__, isDark ? "true" : "false" );)
if( !isDark )
{
aTrack->m_Flags |= DRAW_ERASED;
}
} }
...@@ -178,6 +191,12 @@ static void fillLineTRACK( TRACK* aTrack, int Dcode_index, int aLayer, ...@@ -178,6 +191,12 @@ static void fillLineTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
NEGATE( aTrack->m_End.y ); NEGATE( aTrack->m_End.y );
aTrack->SetNet( Dcode_index ); aTrack->SetNet( Dcode_index );
D(printf("%s: isDark=%s\n", __func__, isDark ? "true" : "false" );)
if( !isDark )
{
aTrack->m_Flags |= DRAW_ERASED;
}
} }
...@@ -190,16 +209,17 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index, ...@@ -190,16 +209,17 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
bool trigo_sens, bool multiquadrant, bool isDark ) bool trigo_sens, bool multiquadrant, bool isDark )
/*****************************************************************/ /*****************************************************************/
/* creation d'un arc: /*
* si multiquadrant == true arc de 0 a 360 degres creation d'un arc:
* et rel_center est la coordonn�e du centre relativement au startpoint si multiquadrant == true arc de 0 a 360 degres
* et rel_center est la coordonn�e du centre relativement au startpoint
* si multiquadrant == false arc de 0 � 90 entierement contenu dans le meme quadrant
* et rel_center est la coordonn�e du centre relativement au startpoint, si multiquadrant == false arc de 0 � 90 entierement contenu dans le meme quadrant
* mais en VALEUR ABSOLUE et le signe des valeurs x et y de rel_center doit et rel_center est la coordonn�e du centre relativement au startpoint,
* etre deduit de cette limite de 90 degres mais en VALEUR ABSOLUE et le signe des valeurs x et y de rel_center doit
* etre deduit de cette limite de 90 degres
*/ */
#endif #endif
...@@ -291,6 +311,12 @@ static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer, ...@@ -291,6 +311,12 @@ static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
NEGATE( aTrack->m_End.y ); NEGATE( aTrack->m_End.y );
aTrack->SetSubNet( -aTrack->GetSubNet() ); aTrack->SetSubNet( -aTrack->GetSubNet() );
if( !isDark )
{
D(printf("%s: isDark=false\n", __func__ );)
aTrack->m_Flags |= DRAW_ERASED;
}
} }
...@@ -811,16 +837,9 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -811,16 +837,9 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
case 1: // code D01 Draw line, exposure ON case 1: // code D01 Draw line, exposure ON
{ {
m_Exposure = true; m_Exposure = true;
SEGZONE* edge_poly, * last;
edge_poly = new SEGZONE( frame->m_Pcb );
last = (SEGZONE*) frame->m_Pcb->m_Zone; SEGZONE* edge_poly = new SEGZONE( frame->m_Pcb );
if( last ) frame->m_Pcb->m_Zone.Append( edge_poly );
while( last->Next() )
last = (SEGZONE*) last->Next();
edge_poly->Insert( frame->m_Pcb, last );
edge_poly->SetLayer( activeLayer ); edge_poly->SetLayer( activeLayer );
edge_poly->m_Width = 1; edge_poly->m_Width = 1;
...@@ -829,6 +848,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -829,6 +848,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
edge_poly->m_End = m_CurrentPos; edge_poly->m_End = m_CurrentPos;
NEGATE( edge_poly->m_End.y ); NEGATE( edge_poly->m_End.y );
edge_poly->SetNet( m_PolygonFillModeState ); edge_poly->SetNet( m_PolygonFillModeState );
m_PreviousPos = m_CurrentPos; m_PreviousPos = m_CurrentPos;
m_PolygonFillModeState = 1; m_PolygonFillModeState = 1;
break; break;
...@@ -862,10 +882,10 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -862,10 +882,10 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
{ {
case GERB_INTERPOL_LINEAR_1X: case GERB_INTERPOL_LINEAR_1X:
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillLineTRACK( track, dcode, activeLayer, fillLineTRACK( track, dcode, activeLayer,
m_PreviousPos, m_CurrentPos, m_PreviousPos, m_CurrentPos,
size.x, m_Exposure ^ m_ImageNegative ); size.x, !(m_LayerNegative ^ m_ImageNegative) );
break; break;
case GERB_INTERPOL_LINEAR_01X: case GERB_INTERPOL_LINEAR_01X:
...@@ -877,11 +897,11 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -877,11 +897,11 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
case GERB_INTERPOL_ARC_NEG: case GERB_INTERPOL_ARC_NEG:
case GERB_INTERPOL_ARC_POS: case GERB_INTERPOL_ARC_POS:
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillArcTRACK( track, dcode, activeLayer, fillArcTRACK( track, dcode, activeLayer,
m_PreviousPos, m_CurrentPos, m_IJPos, m_PreviousPos, m_CurrentPos, m_IJPos,
size.x, m_Iterpolation==GERB_INTERPOL_ARC_NEG ? false : true, size.x, m_Iterpolation==GERB_INTERPOL_ARC_NEG ? false : true,
m_360Arc_enbl, m_Exposure ^ m_ImageNegative ); m_360Arc_enbl, !(m_LayerNegative ^ m_ImageNegative) );
break; break;
default: default:
...@@ -913,20 +933,20 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -913,20 +933,20 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
case APT_LINE: // APT_LINE is not in the spec, don't know why it's here case APT_LINE: // APT_LINE is not in the spec, don't know why it's here
case APT_CIRCLE: case APT_CIRCLE:
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillRoundFlashTRACK( track, dcode, activeLayer, fillRoundFlashTRACK( track, dcode, activeLayer,
m_CurrentPos, m_CurrentPos,
size.x, true ^ m_ImageNegative ); size.x, !(m_LayerNegative ^ m_ImageNegative) );
break; break;
case APT_OVAL: case APT_OVAL:
case APT_RECT: case APT_RECT:
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillOvalOrRectFlashTRACK( track, dcode, activeLayer, fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
m_CurrentPos, size, m_CurrentPos, size,
aperture == APT_RECT ? S_SPOT_RECT : S_SPOT_OVALE, aperture == APT_RECT ? S_SPOT_RECT : S_SPOT_OVALE,
true ^ m_ImageNegative ); !(m_LayerNegative ^ m_ImageNegative) );
break; break;
case APT_MACRO: case APT_MACRO:
...@@ -949,7 +969,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -949,7 +969,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
int diameter = scale( p->params[1].GetValue( tool ), m_GerbMetric ); int diameter = scale( p->params[1].GetValue( tool ), m_GerbMetric );
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillRoundFlashTRACK( track, dcode, activeLayer, fillRoundFlashTRACK( track, dcode, activeLayer,
m_CurrentPos, m_CurrentPos,
diameter, exposure ); diameter, exposure );
...@@ -978,7 +998,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -978,7 +998,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
wxPoint midPoint( (start.x + end.x)/2, (start.y+end.y)/2 ); wxPoint midPoint( (start.x + end.x)/2, (start.y+end.y)/2 );
curPos += midPoint; curPos += midPoint;
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillOvalOrRectFlashTRACK( track, dcode, activeLayer, fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
curPos, size, S_SPOT_RECT, curPos, size, S_SPOT_RECT,
exposure ); exposure );
...@@ -993,7 +1013,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -993,7 +1013,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
size.y = msize.y; size.y = msize.y;
curPos += mapPt( p->params[3].GetValue( tool ), p->params[4].GetValue( tool ), m_GerbMetric ); curPos += mapPt( p->params[3].GetValue( tool ), p->params[4].GetValue( tool ), m_GerbMetric );
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillOvalOrRectFlashTRACK( track, dcode, activeLayer, fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
curPos, size, S_SPOT_RECT, curPos, size, S_SPOT_RECT,
exposure ); exposure );
...@@ -1012,7 +1032,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC, ...@@ -1012,7 +1032,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
curPos.y += size.y/2; curPos.y += size.y/2;
curPos.x += size.x/2; curPos.x += size.x/2;
track = new TRACK( frame->m_Pcb ); track = new TRACK( frame->m_Pcb );
track->Insert( frame->m_Pcb, NULL ); frame->m_Pcb->m_Track.Append( track );
fillOvalOrRectFlashTRACK( track, dcode, activeLayer, fillOvalOrRectFlashTRACK( track, dcode, activeLayer,
curPos, size, S_SPOT_RECT, curPos, size, S_SPOT_RECT,
exposure ); exposure );
......
...@@ -309,16 +309,28 @@ bool GERBER::ExecuteRS274XCommand( int command, char buff[GERBER_BUFZ], char*& t ...@@ -309,16 +309,28 @@ bool GERBER::ExecuteRS274XCommand( int command, char buff[GERBER_BUFZ], char*& t
case IMAGE_POLARITY: case IMAGE_POLARITY:
if( strnicmp( text, "NEG", 3 ) == 0 ) if( strnicmp( text, "NEG", 3 ) == 0 )
{
D(printf("%s: m_ImageNegative=true\n", __func__);)
m_ImageNegative = TRUE; m_ImageNegative = TRUE;
}
else else
{
D(printf("%s: m_ImageNegative=false\n", __func__);)
m_ImageNegative = FALSE; m_ImageNegative = FALSE;
}
break; break;
case LAYER_POLARITY: case LAYER_POLARITY:
if( *text == 'C' ) if( *text == 'C' )
{
D(printf("%s: m_LayerNegative=true\n", __func__);)
m_LayerNegative = TRUE; m_LayerNegative = TRUE;
}
else else
{
D(printf("%s: m_LayerNegative=false\n", __func__);)
m_LayerNegative = FALSE; m_LayerNegative = FALSE;
}
break; break;
case INCLUDE_FILE: case INCLUDE_FILE:
......
...@@ -80,7 +80,7 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -80,7 +80,7 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->DrawBackGround( DC ); DrawPanel->DrawBackGround( DC );
Trace_Gerber( DC, GR_OR, -1 ); Trace_Gerber( DC, GR_COPY, -1 );
TraceWorkSheet( DC, screen, 0 ); TraceWorkSheet( DC, screen, 0 );
Affiche_Status_Box(); Affiche_Status_Box();
...@@ -117,16 +117,15 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay ...@@ -117,16 +117,15 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
// Draw filled polygons // Draw filled polygons
#define NBMAX 20000 #define NBMAX 20000
TRACK* track;
int nbpoints = 0; int nbpoints = 0;
int nbpointsmax = NBMAX; int nbpointsmax = NBMAX;
int* coord = (int*) malloc( nbpointsmax * sizeof(int) * 2 ); int* coord = (int*) malloc( nbpointsmax * sizeof(int) * 2 );
int* ptcoord = coord; int* ptcoord = coord;
track = m_Pcb->m_Zone;
for( ; track != NULL; track = track->Next() ) for( TRACK* track = m_Pcb->m_Zone; track; track = track->Next() )
{ {
if ( printmasklayer != -1 ) if( printmasklayer != -1 && !(track->ReturnMaskLayer() & printmasklayer) )
if ( (track->ReturnMaskLayer() & printmasklayer) == 0 ) continue; continue;
if( track->GetNet() == 0 ) // StartPoint if( track->GetNet() == 0 ) // StartPoint
{ {
...@@ -134,15 +133,19 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay ...@@ -134,15 +133,19 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
{ {
int Color = g_DesignSettings.m_LayerColor[track->GetLayer()]; int Color = g_DesignSettings.m_LayerColor[track->GetLayer()];
int filled = (g_DisplayPolygonsModeSketch == 0) ? 1 : 0; int filled = (g_DisplayPolygonsModeSketch == 0) ? 1 : 0;
GRClosedPoly( &DrawPanel->m_ClipBox, DC, nbpoints, coord, GRClosedPoly( &DrawPanel->m_ClipBox, DC, nbpoints, coord,
filled, Color, Color ); filled, Color, Color );
} }
nbpoints = 2; nbpoints = 2;
ptcoord = coord; ptcoord = coord;
*ptcoord = track->m_Start.x; ptcoord++;
*ptcoord = track->m_Start.y; ptcoord++; *ptcoord++ = track->m_Start.x;
*ptcoord = track->m_End.x; ptcoord++; *ptcoord++ = track->m_Start.y;
*ptcoord = track->m_End.y; ptcoord++;
*ptcoord++ = track->m_End.x;
*ptcoord++ = track->m_End.y;
} }
else else
{ {
...@@ -153,13 +156,16 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay ...@@ -153,13 +156,16 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
ptcoord = coord + nbpointsmax; ptcoord = coord + nbpointsmax;
} }
nbpoints++; nbpoints++;
*ptcoord = track->m_End.x; ptcoord++;
*ptcoord = track->m_End.y; ptcoord++; *ptcoord++ = track->m_End.x;
*ptcoord++ = track->m_End.y;
} }
if( track->Next() == NULL ) // Last point if( track->Next() == NULL ) // Last point
{ {
int Color = g_DesignSettings.m_LayerColor[track->GetLayer()]; int Color = g_DesignSettings.m_LayerColor[track->GetLayer()];
int filled = (g_DisplayPolygonsModeSketch == 0) ? 1 : 0; int filled = (g_DisplayPolygonsModeSketch == 0) ? 1 : 0;
GRClosedPoly( &DrawPanel->m_ClipBox, DC, nbpoints, coord, GRClosedPoly( &DrawPanel->m_ClipBox, DC, nbpoints, coord,
filled, Color, Color ); filled, Color, Color );
} }
......
...@@ -29,7 +29,6 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_ ...@@ -29,7 +29,6 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
* @param printmasklayer = mask for allowed layer (=-1 to draw all layers) * @param printmasklayer = mask for allowed layer (=-1 to draw all layers)
*/ */
{ {
TRACK* Track;
int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer; int layer = ( (PCB_SCREEN*) panel->GetScreen() )->m_Active_Layer;
GERBER* gerber = g_GERBER_List[layer]; GERBER* gerber = g_GERBER_List[layer];
int dcode_hightlight = 0; int dcode_hightlight = 0;
...@@ -37,22 +36,21 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_ ...@@ -37,22 +36,21 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
if( gerber ) if( gerber )
dcode_hightlight = gerber->m_Selected_Tool; dcode_hightlight = gerber->m_Selected_Tool;
Track = Pcb->m_Track; for( TRACK* track = Pcb->m_Track; track; track = track->Next() )
for( ; Track != NULL; Track = Track->Next() )
{ {
if( printmasklayer != -1 ) if( !(track->ReturnMaskLayer() & printmasklayer) )
if( (Track->ReturnMaskLayer() & printmasklayer) == 0 )
continue; continue;
if( (dcode_hightlight == Track->GetNet()) if( dcode_hightlight == track->GetNet() && track->GetLayer()==layer )
&& (Track->GetLayer() == layer) ) Trace_Segment( panel, DC, track, draw_mode | GR_SURBRILL );
Trace_Segment( panel, DC, Track, draw_mode | GR_SURBRILL );
else else
Trace_Segment( panel, DC, Track, draw_mode ); Trace_Segment( panel, DC, track, draw_mode );
} }
} }
#if 1
/***********************************************************************************/ /***********************************************************************************/
void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode ) void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mode )
/***********************************************************************************/ /***********************************************************************************/
...@@ -70,13 +68,16 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo ...@@ -70,13 +68,16 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
int fillopt; int fillopt;
static bool show_err; static bool show_err;
if( track->m_Flags & DRAW_ERASED ) // draw in background color, used by classs TRACK in gerbview
{
color = g_DrawBgColor;
}
else
{
color = g_DesignSettings.m_LayerColor[track->GetLayer()]; color = g_DesignSettings.m_LayerColor[track->GetLayer()];
if( color & ITEM_NOT_SHOW ) if( color & ITEM_NOT_SHOW )
return; return;
zoom = panel->GetZoom();
GRSetDrawMode( DC, draw_mode );
if( draw_mode & GR_SURBRILL ) if( draw_mode & GR_SURBRILL )
{ {
if( draw_mode & GR_AND ) if( draw_mode & GR_AND )
...@@ -86,6 +87,11 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo ...@@ -86,6 +87,11 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
} }
if( color & HIGHT_LIGHT_FLAG ) if( color & HIGHT_LIGHT_FLAG )
color = ColorRefs[color & MASKCOLOR].m_LightColor; color = ColorRefs[color & MASKCOLOR].m_LightColor;
}
GRSetDrawMode( DC, draw_mode );
zoom = panel->GetZoom();
rayon = l_piste = track->m_Width >> 1; rayon = l_piste = track->m_Width >> 1;
...@@ -214,6 +220,8 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo ...@@ -214,6 +220,8 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
} }
} }
#endif
/*****************************************************************************************/ /*****************************************************************************************/
void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode ) void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int drawmode )
......
...@@ -34,8 +34,8 @@ void WinEDA_GerberFrame::UnDeleteItem( wxDC* DC ) ...@@ -34,8 +34,8 @@ void WinEDA_GerberFrame::UnDeleteItem( wxDC* DC )
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEVIA: case TYPE_VIA:
case TYPETRACK: case TYPE_TRACK:
for( ; item; item = next ) for( ; item; item = next )
{ {
next = item->Next(); next = item->Next();
...@@ -87,8 +87,8 @@ BOARD_ITEM* SaveItemEfface( BOARD_ITEM* PtItem, int nbitems ) ...@@ -87,8 +87,8 @@ BOARD_ITEM* SaveItemEfface( BOARD_ITEM* PtItem, int nbitems )
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case TYPEVIA: case TYPE_VIA:
case TYPETRACK: case TYPE_TRACK:
{ {
EDA_BaseStruct* Back = NULL; EDA_BaseStruct* Back = NULL;
g_UnDeleteStack[g_UnDeleteStackPtr - 1] = PtStruct; g_UnDeleteStack[g_UnDeleteStackPtr - 1] = PtStruct;
......
...@@ -22,27 +22,28 @@ enum KICAD_T { ...@@ -22,27 +22,28 @@ enum KICAD_T {
EOT = 0, // search types array terminator (End Of Types) EOT = 0, // search types array terminator (End Of Types)
TYPE_NOT_INIT = 0, TYPE_NOT_INIT = 0,
TYPEPCB, TYPE_PCB,
// Items in pcb // Items in pcb
PCB_EQUIPOT_STRUCT_TYPE, TYPE_EQUIPOT,
TYPEMODULE, TYPE_MODULE,
TYPEPAD, TYPE_PAD,
TYPEDRAWSEGMENT, TYPE_DRAWSEGMENT,
TYPETEXTE, TYPE_TEXTE,
TYPETEXTEMODULE, TYPE_TEXTE_MODULE,
TYPEEDGEMODULE, TYPE_EDGE_MODULE,
TYPETRACK, TYPE_TRACK,
TYPEZONE, TYPE_ZONE,
TYPEVIA, TYPE_VIA,
TYPEMARKER, TYPE_MARKER,
TYPECOTATION, TYPE_COTATION,
TYPEMIRE, TYPE_MIRE,
TYPESCREEN, TYPE_SCREEN,
TYPEBLOCK, TYPE_BLOCK,
TYPEZONE_UNUSED, TYPE_ZONE_UNUSED,
TYPEZONE_EDGE_CORNER, TYPE_ZONE_EDGE_CORNER,
TYPEZONE_CONTAINER, TYPE_ZONE_CONTAINER,
TYPE_BOARD_ITEM_LIST,
// Draw Items in schematic // Draw Items in schematic
DRAW_POLYLINE_STRUCT_TYPE, DRAW_POLYLINE_STRUCT_TYPE,
......
/**********************************************************************************************/ /**********************************************************************************************/
/* board_item_struct.h : Basic classes for BOARD_ITEM and BOARD_CONNECTED_ITEM descriptions */ /* board_item_struct.h : Classes BOARD_ITEM and BOARD_CONNECTED_ITEM */
/**********************************************************************************************/ /**********************************************************************************************/
#ifndef BOARD_ITEM_STRUCT_H #ifndef BOARD_ITEM_STRUCT_H
#define BOARD_ITEM_STRUCT_H #define BOARD_ITEM_STRUCT_H
/** #include <boost/ptr_container/ptr_vector.hpp>
* Class BOARD_ITEM
* is a base class for any item which can be embedded within the BOARD
* container class, and therefore instances of derived classes should only be
* found in PCBNEW or other programs that use class BOARD and its contents.
* The corresponding class in EESCHEMA is SCH_ITEM.
*/
/**
* Class BOARD_CONNECTED_ITEM
* This is a base class derived from BOARD_ITEM for items that can be connected
* mainly: tracks and pads
* Handle connection info
*
*/
/* Shapes for segments (graphic segments and tracks) ( .shape member ) */ /* Shapes for segments (graphic segments and tracks) ( .shape member ) */
...@@ -51,8 +37,8 @@ protected: ...@@ -51,8 +37,8 @@ protected:
public: public:
BOARD_ITEM( BOARD_ITEM* StructFather, KICAD_T idtype ) : BOARD_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
EDA_BaseStruct( StructFather, idtype ) EDA_BaseStruct( aParent, idtype )
, m_Layer( 0 ) , m_Layer( 0 )
{ {
} }
...@@ -62,6 +48,7 @@ public: ...@@ -62,6 +48,7 @@ public:
EDA_BaseStruct( src.m_Parent, src.Type() ) EDA_BaseStruct( src.m_Parent, src.Type() )
, m_Layer( src.m_Layer ) , m_Layer( src.m_Layer )
{ {
m_Flags = src.m_Flags;
} }
...@@ -130,9 +117,10 @@ public: ...@@ -130,9 +117,10 @@ public:
/** /**
* Function UnLink * Function UnLink
* detaches this object from its owner. * detaches this object from its owner. This base class implementation
* should work for all derived classes which are held in a DLIST<>.
*/ */
virtual void UnLink() = 0; virtual void UnLink();
/** /**
...@@ -183,6 +171,12 @@ public: ...@@ -183,6 +171,12 @@ public:
}; };
/**
* Class BOARD_CONNECTED_ITEM
* This is a base class derived from BOARD_ITEM for items that can be connected
* mainly: tracks and pads
* Handle connection info
*/
class BOARD_CONNECTED_ITEM : public BOARD_ITEM class BOARD_CONNECTED_ITEM : public BOARD_ITEM
{ {
protected: protected:
...@@ -196,7 +190,7 @@ protected: ...@@ -196,7 +190,7 @@ protected:
// handle block number in zone connection // handle block number in zone connection
public: public:
BOARD_CONNECTED_ITEM( BOARD_ITEM* StructFather, KICAD_T idtype ); BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype );
BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& src ); BOARD_CONNECTED_ITEM( const BOARD_CONNECTED_ITEM& src );
/** /**
...@@ -221,5 +215,117 @@ public: ...@@ -221,5 +215,117 @@ public:
void SetZoneSubNet( int aSubNetCode ); void SetZoneSubNet( int aSubNetCode );
}; };
class BOARD_ITEM_LIST : public BOARD_ITEM
{
typedef boost::ptr_vector<BOARD_ITEM> ITEM_ARRAY;
ITEM_ARRAY myItems;
BOARD_ITEM_LIST( const BOARD_ITEM_LIST& other ) :
BOARD_ITEM( NULL, TYPE_BOARD_ITEM_LIST )
{
// copy constructor is not supported, is private to cause compiler error
}
public:
BOARD_ITEM_LIST( BOARD_ITEM* aParent = NULL ) :
BOARD_ITEM( aParent, TYPE_BOARD_ITEM_LIST )
{}
//-----< satisfy some virtual functions >------------------------------
wxPoint& GetPosition()
{
static wxPoint dummy;
return dummy;
}
void Draw( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
int aDrawMode, const wxPoint& offset = ZeroOffset )
{
}
void UnLink()
{
/* if it were needed:
DHEAD* list = GetList();
wxASSERT( list );
list->remove( this );
*/
}
bool Save( FILE* aFile ) const
{
return true;
}
//-----</ satisfy some virtual functions >-----------------------------
/**
* Function GetCount
* returns the number of BOARD_ITEMs.
*/
int GetCount() const
{
return myItems.size();
}
void Append( BOARD_ITEM* aItem )
{
myItems.push_back( aItem );
}
BOARD_ITEM* Replace( int aIndex, BOARD_ITEM* aItem )
{
ITEM_ARRAY::auto_type ret = myItems.replace( aIndex, aItem );
return ret.release();
}
BOARD_ITEM* Remove( int aIndex )
{
ITEM_ARRAY::auto_type ret = myItems.release( myItems.begin()+aIndex );
return ret.release();
}
void Insert( int aIndex, BOARD_ITEM* aItem )
{
myItems.insert( myItems.begin()+aIndex, aItem );
}
BOARD_ITEM* At( int aIndex ) const
{
// we have varying sized objects and are using polymorphism, so we
// must return a pointer not a reference.
return (BOARD_ITEM*) &myItems[aIndex];
}
BOARD_ITEM* operator[]( int aIndex ) const
{
return At( aIndex );
}
void Delete( int aIndex )
{
myItems.erase( myItems.begin()+aIndex );
}
void PushBack( BOARD_ITEM* aItem )
{
Append( aItem );
}
BOARD_ITEM* PopBack()
{
if( GetCount() )
return Remove( GetCount()-1 );
return NULL;
}
};
#endif /* BOARD_ITEM_STRUCT_H */ #endif /* BOARD_ITEM_STRUCT_H */
...@@ -39,7 +39,7 @@ class DHEAD ...@@ -39,7 +39,7 @@ class DHEAD
protected: protected:
EDA_BaseStruct* first; ///< first element in list, or NULL if list empty EDA_BaseStruct* first; ///< first element in list, or NULL if list empty
EDA_BaseStruct* last; ///< last elment in list, or NULL if empty EDA_BaseStruct* last; ///< last elment in list, or NULL if empty
unsigned count; ///< how many elements are in the list unsigned count; ///< how many elements are in the list, automatically maintained.
bool meOwner; ///< I must delete the objects I hold in my destructor bool meOwner; ///< I must delete the objects I hold in my destructor
/** /**
...@@ -66,7 +66,10 @@ protected: ...@@ -66,7 +66,10 @@ protected:
/** /**
* Function insert * Function insert
* puts aNewElement just in front of aElementAfterMe in the list sequence. * puts aNewElement just in front of aElementAfterMe in the list sequence.
* If aElementAfterMe is NULL, then simply Append() * If aElementAfterMe is NULL, then simply append().
* @param aNewElement The element to insert.
* @param aElementAfterMe The element to insert \a aNewElement before,
* if NULL then append aNewElement onto end of list.
*/ */
void insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aElementAfterMe ); void insert( EDA_BaseStruct* aNewElement, EDA_BaseStruct* aElementAfterMe );
...@@ -210,9 +213,13 @@ public: ...@@ -210,9 +213,13 @@ public:
insert( aNewElement ); insert( aNewElement );
} }
void PushBack( T* aElement ) /**
* Function PushBack
* puts aNewElement at the end of the list sequence.
*/
void PushBack( T* aNewElement )
{ {
append( aElement ); append( aNewElement );
} }
//-----</ STL like functions >-------------------------------------- //-----</ STL like functions >--------------------------------------
......
...@@ -18,21 +18,23 @@ ...@@ -18,21 +18,23 @@
/* Bits indicateurs du membre .Status, pour pistes, modules... */ /* Bits indicateurs du membre .Status, pour pistes, modules... */
#define FLAG1 0x2000 /* flag libre pour calculs locaux */
#define FLAG0 0x1000 /* flag libre pour calculs locaux */ #define FLAG1 (1 << 13) /* flag libre pour calculs locaux */
#define BEGIN_ONPAD 0x800 /* flag indiquant un debut de segment sur pad */ #define FLAG0 (1 << 12) /* flag libre pour calculs locaux */
#define END_ONPAD 0x400 /* flag indiquant une fin de segment sur pad */ #define BEGIN_ONPAD (1 << 11) /* flag indiquant un debut de segment sur pad */
#define BUSY 0x0200 /* flag indiquant que la structure a deja #define END_ONPAD (1 << 10) /* flag indiquant une fin de segment sur pad */
#define BUSY (1 << 9) /* flag indiquant que la structure a deja
* ete examinee, dans certaines routines */ * ete examinee, dans certaines routines */
#define DELETED 0x0100 /* Bit flag de Status pour structures effacee #define DELETED (1 << 8) /* Bit flag de Status pour structures effacee
* et mises en chaine "DELETED" */ * et mises en chaine "DELETED" */
#define NO_TRACE 0x80 /* l'element ne doit pas etre affiche */ #define NO_TRACE (1 << 7) /* l'element ne doit pas etre affiche */
#define SURBRILL 0x20 /* element en surbrillance */
#define DRAG 0x10 /* segment en mode drag */ #define SURBRILL (1 << 5) /* element en surbrillance */
#define EDIT 0x8 /* element en cours d'edition */ #define DRAG (1 << 4) /* segment en mode drag */
#define SEGM_FIXE 0x04 /* segment FIXE ( pas d'effacement global ) */ #define EDIT (1 << 3) /* element en cours d'edition */
#define SEGM_AR 0x02 /* segment Auto_Route */ #define SEGM_FIXE (1 << 2) /* segment FIXE ( pas d'effacement global ) */
#define CHAIN 0x01 /* segment marque */ #define SEGM_AR (1 << 1) /* segment Auto_Route */
#define CHAIN (1 << 0) /* segment marque */
/* Layer identification (layer number) */ /* Layer identification (layer number) */
......
...@@ -511,7 +511,7 @@ public: ...@@ -511,7 +511,7 @@ public:
bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end ); bool MergeCollinearTracks( TRACK* track, wxDC* DC, int end );
void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC ); void Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC );
void SwitchLayer( wxDC* DC, int layer ); void SwitchLayer( wxDC* DC, int layer );
int Add_45_degrees_Segment( wxDC* DC, TRACK* pt_segm ); bool Add_45_degrees_Segment( wxDC* DC );
bool Genere_Pad_Connexion( wxDC* DC, int layer ); bool Genere_Pad_Connexion( wxDC* DC, int layer );
// zone handling // zone handling
......
...@@ -55,10 +55,10 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame ) ...@@ -55,10 +55,10 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
for( ii = 0, Struct = frame->m_Pcb->m_Track; Struct != NULL; Struct = Struct->Next() ) for( ii = 0, Struct = frame->m_Pcb->m_Track; Struct != NULL; Struct = Struct->Next() )
{ {
ii++; ii++;
if( Struct->Type() == TYPEVIA ) if( Struct->Type() == TYPE_VIA )
if( ( (SEGVIA*) Struct )->GetNet() == netcode ) if( ( (SEGVIA*) Struct )->GetNet() == netcode )
nb_vias++; nb_vias++;
if( Struct->Type() == TYPETRACK ) if( Struct->Type() == TYPE_TRACK )
if( ( (TRACK*) Struct )->GetNet() == netcode ) if( ( (TRACK*) Struct )->GetNet() == netcode )
lengthnet += ( (TRACK*) Struct )->GetLength(); lengthnet += ( (TRACK*) Struct )->GetLength();
} }
......
...@@ -41,7 +41,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On ) ...@@ -41,7 +41,7 @@ void WinEDA_PcbFrame::Attribut_Track( TRACK* track, wxDC* DC, bool Flag_On )
TRACK* Track; TRACK* Track;
int nb_segm; int nb_segm;
if( (track == NULL ) || (track->Type() == TYPEZONE) ) if( (track == NULL ) || (track->Type() == TYPE_ZONE) )
return; return;
DrawPanel->CursorOff( DC ); // Erase cursor shape DrawPanel->CursorOff( DC ); // Erase cursor shape
......
...@@ -458,7 +458,7 @@ int WinEDA_PcbFrame::GenPlaceBoard() ...@@ -458,7 +458,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
switch( PtStruct->Type() ) switch( PtStruct->Type() )
{ {
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
DrawSegm = (DRAWSEGMENT*) PtStruct; DrawSegm = (DRAWSEGMENT*) PtStruct;
if( DrawSegm->GetLayer() != EDGE_N ) if( DrawSegm->GetLayer() != EDGE_N )
break; break;
...@@ -471,7 +471,7 @@ int WinEDA_PcbFrame::GenPlaceBoard() ...@@ -471,7 +471,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
TraceSegmentPcb( m_Pcb, &TmpSegm, HOLE | CELL_is_EDGE, g_GridRoutingSize, WRITE_CELL ); TraceSegmentPcb( m_Pcb, &TmpSegm, HOLE | CELL_is_EDGE, g_GridRoutingSize, WRITE_CELL );
break; break;
case TYPETEXTE: case TYPE_TEXTE:
default: default:
break; break;
} }
...@@ -919,7 +919,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC ) ...@@ -919,7 +919,7 @@ float WinEDA_PcbFrame::Compute_Ratsnest_PlaceModule( wxDC* DC )
/********************************************/ /********************************************/
void Build_PlacedPads_List( BOARD* Pcb ) void Build_PlacedPads_List( BOARD* aPcb )
/********************************************/ /********************************************/
/* /*
...@@ -937,57 +937,29 @@ void Build_PlacedPads_List( BOARD* Pcb ) ...@@ -937,57 +937,29 @@ void Build_PlacedPads_List( BOARD* Pcb )
* m_Status_Pcb |= LISTE_PAD_OK * m_Status_Pcb |= LISTE_PAD_OK
*/ */
{ {
LISTE_PAD* pt_liste_pad; aPcb->m_Pads.clear();
MODULE* Module;
D_PAD* PtPad;
if( Pcb->m_Pads ) aPcb->m_NbNodes = 0;
MyFree( Pcb->m_Pads );
pt_liste_pad = Pcb->m_Pads = NULL; // Initialisation du buffer et des variables de travail
Pcb->m_NbPads = Pcb->m_NbNodes = 0; for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
/* Calcul du nombre de pads utiles */
Module = Pcb->m_Modules;
for( ; Module != NULL; Module = Module->Next() )
{ {
if( Module->m_ModuleStatus & MODULE_to_PLACE ) if( module->m_ModuleStatus & MODULE_to_PLACE )
continue; continue;
PtPad = (D_PAD*) Module->m_Pads;
for( ; PtPad != NULL; PtPad = PtPad->Next() )
{
Pcb->m_NbPads++;
}
}
/* Allocation memoire du buffer */ for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
if( Pcb->m_NbPads > 0 )
{
pt_liste_pad = Pcb->m_Pads
= (D_PAD**) MyMalloc( Pcb->m_NbPads * sizeof(D_PAD *) );
}
/* Initialisation du buffer et des variables de travail */
Module = Pcb->m_Modules;
for( ; (Module != NULL) && (pt_liste_pad != NULL); Module = Module->Next() )
{
if( Module->m_ModuleStatus & MODULE_to_PLACE )
continue;
PtPad = (D_PAD*) Module->m_Pads;
for( ; PtPad != NULL; PtPad = PtPad->Next() )
{ {
*pt_liste_pad = PtPad; aPcb->m_Pads.push_back( pad );
PtPad->SetSubNet( 0 ); pad->SetSubNet( 0 );
PtPad->SetSubRatsnest( 0 ); pad->SetSubRatsnest( 0 );
PtPad->SetParent( Module ); pad->SetParent( module );
if( PtPad->GetNet() ) if( pad->GetNet() )
Pcb->m_NbNodes++; aPcb->m_NbNodes++;
pt_liste_pad++;
} }
} }
Pcb->m_Status_Pcb |= LISTE_PAD_OK; aPcb->m_Status_Pcb |= LISTE_PAD_OK;
Pcb->m_Status_Pcb &= ~(LISTE_CHEVELU_OK | CHEVELU_LOCAL_OK); aPcb->m_Status_Pcb &= ~(LISTE_CHEVELU_OK | CHEVELU_LOCAL_OK);
adr_lowmem = buf_work; adr_lowmem = buf_work;
} }
...@@ -1217,7 +1189,7 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly() ...@@ -1217,7 +1189,7 @@ bool WinEDA_PcbFrame::SetBoardBoundaryBoxFromEdgesOnly()
PtStruct = m_Pcb->m_Drawings; PtStruct = m_Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() ) for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
if( PtStruct->Type() != TYPEDRAWSEGMENT ) if( PtStruct->Type() != TYPE_DRAWSEGMENT )
continue; continue;
succes = TRUE; succes = TRUE;
ptr = (DRAWSEGMENT*) PtStruct; ptr = (DRAWSEGMENT*) PtStruct;
......
...@@ -46,7 +46,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) ...@@ -46,7 +46,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
{ {
switch( GetScreen()->GetCurItem()->Type() ) switch( GetScreen()->GetCurItem()->Type() )
{ {
case TYPEPAD: case TYPE_PAD:
Pad = (D_PAD*) GetScreen()->GetCurItem(); Pad = (D_PAD*) GetScreen()->GetCurItem();
autoroute_net_code = Pad->GetNet(); autoroute_net_code = Pad->GetNet();
break; break;
...@@ -63,7 +63,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) ...@@ -63,7 +63,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
case ROUTE_MODULE: case ROUTE_MODULE:
Module = (MODULE*) GetScreen()->GetCurItem(); Module = (MODULE*) GetScreen()->GetCurItem();
if( (Module == NULL) || (Module->Type() != TYPEMODULE) ) if( (Module == NULL) || (Module->Type() != TYPE_MODULE) )
{ {
DisplayError( this, _( "Module not selected" ) ); return; DisplayError( this, _( "Module not selected" ) ); return;
} }
...@@ -71,7 +71,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode ) ...@@ -71,7 +71,7 @@ void WinEDA_PcbFrame::Autoroute( wxDC* DC, int mode )
case ROUTE_PAD: case ROUTE_PAD:
Pad = (D_PAD*) GetScreen()->GetCurItem(); Pad = (D_PAD*) GetScreen()->GetCurItem();
if( (Pad == NULL) || (Pad->Type() != TYPEPAD) ) if( (Pad == NULL) || (Pad->Type() != TYPE_PAD) )
{ {
DisplayError( this, _( "Pad not selected" ) ); return; DisplayError( this, _( "Pad not selected" ) ); return;
} }
......
...@@ -295,7 +295,7 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem ) ...@@ -295,7 +295,7 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
{ {
aItem->Display_Infos( this ); aItem->Display_Infos( this );
#if 1 && defined(DEBUG) #if 0 && defined(DEBUG)
aItem->Show( 0, std::cout ); aItem->Show( 0, std::cout );
#endif #endif
......
This diff is collapsed.
...@@ -319,8 +319,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -319,8 +319,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
item->Draw( panel, DC, g_XorMode, move_offset ); item->Draw( panel, DC, g_XorMode, move_offset );
break; break;
...@@ -361,8 +361,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -361,8 +361,8 @@ static void DrawMovingBlockOutlines( WinEDA_DrawPanel* panel, wxDC* DC,
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
item->Draw( panel, DC, g_XorMode, move_offset ); item->Draw( panel, DC, g_XorMode, move_offset );
break; break;
...@@ -389,14 +389,10 @@ void CopyMarkedItems( MODULE* module, wxPoint offset ) ...@@ -389,14 +389,10 @@ void CopyMarkedItems( MODULE* module, wxPoint offset )
/* Copy marked items, at new position = old position + offset /* Copy marked items, at new position = old position + offset
*/ */
{ {
BOARD_ITEM* item;
BOARD_ITEM* NewStruct;
if( module == NULL ) if( module == NULL )
return; return;
D_PAD* pad = module->m_Pads; for( D_PAD* pad = module->m_Pads; pad; pad = pad->Next() )
for( ; pad != NULL; pad = pad->Next() )
{ {
if( pad->m_Selected == 0 ) if( pad->m_Selected == 0 )
continue; continue;
...@@ -404,44 +400,38 @@ void CopyMarkedItems( MODULE* module, wxPoint offset ) ...@@ -404,44 +400,38 @@ void CopyMarkedItems( MODULE* module, wxPoint offset )
D_PAD* NewPad = new D_PAD( module ); D_PAD* NewPad = new D_PAD( module );
NewPad->Copy( pad ); NewPad->Copy( pad );
NewPad->m_Selected = IS_SELECTED; NewPad->m_Selected = IS_SELECTED;
NewPad->SetNext( module->m_Pads ); module->m_Pads.PushBack( NewPad );
NewPad->SetBack( module );
module->m_Pads->SetBack( NewPad );
module->m_Pads = NewPad;
} }
item = module->m_Drawings; for( BOARD_ITEM* item = module->m_Drawings; item; item->Next() )
for( ; item != NULL; item = item->Next() )
{ {
if( item->m_Selected == 0 ) if( item->m_Selected == 0 )
continue; continue;
item->m_Selected = 0; item->m_Selected = 0;
NewStruct = NULL;
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
NewStruct = new TEXTE_MODULE( module ); TEXTE_MODULE* textm;
( (TEXTE_MODULE*) NewStruct )->Copy( (TEXTE_MODULE*) item ); textm = new TEXTE_MODULE( module );
textm->Copy( (TEXTE_MODULE*) item );
textm->m_Selected = IS_SELECTED;
module->m_Drawings.PushFront( textm );
break; break;
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
NewStruct = new EDGE_MODULE( module ); EDGE_MODULE* edge;
( (EDGE_MODULE*) NewStruct )->Copy( (EDGE_MODULE*) item ); edge = new EDGE_MODULE( module );
edge->Copy( (EDGE_MODULE*) item );
edge->m_Selected = IS_SELECTED;
module->m_Drawings.PushFront( edge );
break; break;
default: default:
DisplayError( NULL, wxT( "Internal Err: CopyMarkedItems: type indefini" ) ); DisplayError( NULL, wxT( "Internal Err: CopyMarkedItems: type indefini" ) );
break; break;
} }
if( NewStruct == NULL )
break;
NewStruct->m_Selected = IS_SELECTED;
NewStruct->SetNext( module->m_Drawings );
NewStruct->SetBack( module );
module->m_Drawings->SetBack( module );
module->m_Drawings = NewStruct;
} }
MoveMarkedItems( module, offset ); MoveMarkedItems( module, offset );
...@@ -479,14 +469,14 @@ void MoveMarkedItems( MODULE* module, wxPoint offset ) ...@@ -479,14 +469,14 @@ void MoveMarkedItems( MODULE* module, wxPoint offset )
switch( item->Type() ) switch( item->Type() )
{ {
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
( (TEXTE_MODULE*) item )->GetPosition().x += offset.x; ( (TEXTE_MODULE*) item )->GetPosition().x += offset.x;
( (TEXTE_MODULE*) item )->GetPosition().y += offset.y; ( (TEXTE_MODULE*) item )->GetPosition().y += offset.y;
( (TEXTE_MODULE*) item )->m_Pos0.x += offset.x; ( (TEXTE_MODULE*) item )->m_Pos0.x += offset.x;
( (TEXTE_MODULE*) item )->m_Pos0.y += offset.y; ( (TEXTE_MODULE*) item )->m_Pos0.y += offset.y;
break; break;
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
( (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;
...@@ -578,7 +568,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset ) ...@@ -578,7 +568,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
SETMIRROR( ( (EDGE_MODULE*) item )->m_Start.x ); SETMIRROR( ( (EDGE_MODULE*) item )->m_Start.x );
( (EDGE_MODULE*) item )->m_Start0.x = ( (EDGE_MODULE*) item )->m_Start.x; ( (EDGE_MODULE*) item )->m_Start0.x = ( (EDGE_MODULE*) item )->m_Start.x;
SETMIRROR( ( (EDGE_MODULE*) item )->m_End.x ); SETMIRROR( ( (EDGE_MODULE*) item )->m_End.x );
...@@ -586,7 +576,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset ) ...@@ -586,7 +576,7 @@ void MirrorMarkedItems( MODULE* module, wxPoint offset )
( (EDGE_MODULE*) item )->m_Angle = -( (EDGE_MODULE*) item )->m_Angle; ( (EDGE_MODULE*) item )->m_Angle = -( (EDGE_MODULE*) item )->m_Angle;
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
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;
...@@ -632,14 +622,14 @@ void RotateMarkedItems( MODULE* module, wxPoint offset ) ...@@ -632,14 +622,14 @@ void RotateMarkedItems( MODULE* module, wxPoint offset )
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
ROTATE( ( (EDGE_MODULE*) item )->m_Start ); ROTATE( ( (EDGE_MODULE*) item )->m_Start );
( (EDGE_MODULE*) item )->m_Start0 = ( (EDGE_MODULE*) item )->m_Start; ( (EDGE_MODULE*) item )->m_Start0 = ( (EDGE_MODULE*) item )->m_Start;
ROTATE( ( (EDGE_MODULE*) item )->m_End ); ROTATE( ( (EDGE_MODULE*) item )->m_End );
( (EDGE_MODULE*) item )->m_End0 = ( (EDGE_MODULE*) item )->m_End; ( (EDGE_MODULE*) item )->m_End0 = ( (EDGE_MODULE*) item )->m_End;
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
ROTATE( ( (TEXTE_MODULE*) item )->GetPosition() ); ROTATE( ( (TEXTE_MODULE*) item )->GetPosition() );
( (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;
...@@ -708,7 +698,7 @@ int MarkItemsInBloc( MODULE* module, EDA_Rect& Rect ) ...@@ -708,7 +698,7 @@ int MarkItemsInBloc( MODULE* module, EDA_Rect& Rect )
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
pos = ( (EDGE_MODULE*) item )->m_Start; pos = ( (EDGE_MODULE*) item )->m_Start;
if( Rect.Inside( pos ) ) if( Rect.Inside( pos ) )
{ {
...@@ -723,7 +713,7 @@ int MarkItemsInBloc( MODULE* module, EDA_Rect& Rect ) ...@@ -723,7 +713,7 @@ int MarkItemsInBloc( MODULE* module, EDA_Rect& Rect )
} }
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
pos = ( (TEXTE_MODULE*) item )->GetPosition(); pos = ( (TEXTE_MODULE*) item )->GetPosition();
if( Rect.Inside( pos ) ) if( Rect.Inside( pos ) )
{ {
......
...@@ -167,7 +167,7 @@ void BOARDHEAD::UnInitBoard() ...@@ -167,7 +167,7 @@ void BOARDHEAD::UnInitBoard()
/*****************************************************/ /*****************************************************/
void PlaceCells( BOARD* Pcb, int net_code, int flag ) void PlaceCells( BOARD* aPcb, int net_code, int flag )
/*****************************************************/ /*****************************************************/
/* Initialise les cellules du board a la valeur HOLE et VIA_IMPOSSIBLE /* Initialise les cellules du board a la valeur HOLE et VIA_IMPOSSIBLE
...@@ -182,12 +182,6 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag ) ...@@ -182,12 +182,6 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
* si FORCE_PADS : tous les pads seront places meme ceux de meme net_code * si FORCE_PADS : tous les pads seront places meme ceux de meme net_code
*/ */
{ {
int ii;
LISTE_PAD* ptr;
TRACK* pt_segm;
TEXTE_PCB* PtText;
DRAWSEGMENT* DrawSegm;
BOARD_ITEM* PtStruct;
int ux0 = 0, uy0 = 0, ux1, uy1, dx, dy; int ux0 = 0, uy0 = 0, ux1, uy1, dx, dy;
int marge, via_marge; int marge, via_marge;
int masque_layer; int masque_layer;
...@@ -198,47 +192,50 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag ) ...@@ -198,47 +192,50 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
///////////////////////////////////// /////////////////////////////////////
// Placement des PADS sur le board // // Placement des PADS sur le board //
///////////////////////////////////// /////////////////////////////////////
ptr = (LISTE_PAD*) Pcb->m_Pads; ii = Pcb->m_NbPads;
for( ; ii > 0; ii--, ptr++ ) for( unsigned i=0; i<aPcb->m_Pads.size(); ++i )
{ {
if( (net_code != (*ptr)->GetNet() ) || (flag & FORCE_PADS) ) D_PAD* pad = aPcb->m_Pads[i];
if( net_code != pad->GetNet() || (flag & FORCE_PADS) )
{ {
Place_1_Pad_Board( Pcb, *ptr, HOLE, marge, WRITE_CELL ); Place_1_Pad_Board( aPcb, pad, HOLE, marge, WRITE_CELL );
} }
Place_1_Pad_Board( Pcb, *ptr, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL ); Place_1_Pad_Board( aPcb, pad, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL );
} }
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Placement des elements de modules sur PCB // // Placement des elements de modules sur PCB //
/////////////////////////////////////////////// ///////////////////////////////////////////////
PtStruct = Pcb->m_Modules; for( MODULE* module = aPcb->m_Modules; module; module = module->Next() )
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
BOARD_ITEM* PtModStruct = ( (MODULE*) PtStruct )->m_Drawings; for( BOARD_ITEM* item = module->m_Drawings; item; item = item->Next() )
for( ; PtModStruct != NULL; PtModStruct = PtModStruct->Next() )
{ {
switch( PtModStruct->Type() ) switch( item->Type() )
{ {
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
{ {
EDGE_MODULE* edge = (EDGE_MODULE*) item;
TRACK* TmpSegm = new TRACK( NULL ); TRACK* TmpSegm = new TRACK( NULL );
TmpSegm->SetLayer( ( (EDGE_MODULE*) PtModStruct )->GetLayer() );
TmpSegm->SetLayer( edge->GetLayer() );
if( TmpSegm->GetLayer() == EDGE_N ) if( TmpSegm->GetLayer() == EDGE_N )
TmpSegm->SetLayer( -1 ); TmpSegm->SetLayer( -1 );
TmpSegm->m_Start = ( (EDGE_MODULE*) PtModStruct )->m_Start; TmpSegm->m_Start = edge->m_Start;
TmpSegm->m_End = ( (EDGE_MODULE*) PtModStruct )->m_End; TmpSegm->m_End = edge->m_End;
TmpSegm->m_Shape = ( (EDGE_MODULE*) PtModStruct )->m_Shape; TmpSegm->m_Shape = edge->m_Shape;
TmpSegm->m_Width = ( (EDGE_MODULE*) PtModStruct )->m_Width; TmpSegm->m_Width = edge->m_Width;
TmpSegm->m_Param = ( (EDGE_MODULE*) PtModStruct )->m_Angle; TmpSegm->m_Param = edge->m_Angle;
TmpSegm->SetNet( -1 ); TmpSegm->SetNet( -1 );
TraceSegmentPcb( Pcb, TmpSegm, HOLE, marge, WRITE_CELL ); TraceSegmentPcb( aPcb, TmpSegm, HOLE, marge, WRITE_CELL );
TraceSegmentPcb( Pcb, TmpSegm, VIA_IMPOSSIBLE, via_marge, TraceSegmentPcb( aPcb, TmpSegm, VIA_IMPOSSIBLE, via_marge,
WRITE_OR_CELL ); WRITE_OR_CELL );
delete TmpSegm; delete TmpSegm;
break;
} }
break;
default: default:
break; break;
...@@ -249,16 +246,17 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag ) ...@@ -249,16 +246,17 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
//////////////////////////////////////////// ////////////////////////////////////////////
// Placement des contours et segments PCB // // Placement des contours et segments PCB //
//////////////////////////////////////////// ////////////////////////////////////////////
PtStruct = Pcb->m_Drawings; for( BOARD_ITEM* item = aPcb->m_Drawings; item; item = item->Next() )
for( ; PtStruct != NULL; PtStruct = PtStruct->Next() )
{ {
switch( PtStruct->Type() ) switch( item->Type() )
{ {
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
{ {
DRAWSEGMENT* DrawSegm;
int type_cell = HOLE; int type_cell = HOLE;
TRACK* TmpSegm = new TRACK( NULL ); TRACK* TmpSegm = new TRACK( NULL );
DrawSegm = (DRAWSEGMENT*) PtStruct; DrawSegm = (DRAWSEGMENT*) item;
TmpSegm->SetLayer( DrawSegm->GetLayer() ); TmpSegm->SetLayer( DrawSegm->GetLayer() );
if( DrawSegm->GetLayer() == EDGE_N ) if( DrawSegm->GetLayer() == EDGE_N )
{ {
...@@ -273,33 +271,42 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag ) ...@@ -273,33 +271,42 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
TmpSegm->m_Param = DrawSegm->m_Angle; TmpSegm->m_Param = DrawSegm->m_Angle;
TmpSegm->SetNet( -1 ); TmpSegm->SetNet( -1 );
TraceSegmentPcb( Pcb, TmpSegm, type_cell, marge, WRITE_CELL ); TraceSegmentPcb( aPcb, TmpSegm, type_cell, marge, WRITE_CELL );
// TraceSegmentPcb(Pcb, TmpSegm, VIA_IMPOSSIBLE, via_marge,WRITE_OR_CELL ); // TraceSegmentPcb(Pcb, TmpSegm, VIA_IMPOSSIBLE, via_marge,WRITE_OR_CELL );
delete TmpSegm; delete TmpSegm;
break;
} }
break;
case TYPE_TEXTE:
TEXTE_PCB* PtText;
PtText = (TEXTE_PCB*) item;
case TYPETEXTE:
PtText = (TEXTE_PCB*) PtStruct;
if( PtText->GetLength() == 0 ) if( PtText->GetLength() == 0 )
break; break;
ux0 = PtText->m_Pos.x; uy0 = PtText->m_Pos.y; ux0 = PtText->m_Pos.x; uy0 = PtText->m_Pos.y;
dx = PtText->Pitch() * PtText->GetLength(); dx = PtText->Pitch() * PtText->GetLength();
dy = PtText->m_Size.y + PtText->m_Width; dy = PtText->m_Size.y + PtText->m_Width;
/* Put bounding box (rectangle) on matrix */ /* Put bounding box (rectangle) on matrix */
dx /= 2; dy /= 2; /* dx et dy = demi dimensionx X et Y */ dx /= 2;
ux1 = ux0 + dx; uy1 = uy0 + dy; dy /= 2; /* dx et dy = demi dimensionx X et Y */
ux0 -= dx; uy0 -= dy;
ux1 = ux0 + dx;
uy1 = uy0 + dy;
ux0 -= dx;
uy0 -= dy;
masque_layer = g_TabOneLayerMask[PtText->GetLayer()]; masque_layer = g_TabOneLayerMask[PtText->GetLayer()];
TraceFilledRectangle( Pcb, ux0 - marge, uy0 - marge, ux1 + marge, uy1 + marge, TraceFilledRectangle( aPcb, ux0 - marge, uy0 - marge, ux1 + marge, uy1 + marge,
(int) (PtText->m_Orient), (int) (PtText->m_Orient),
masque_layer, HOLE, WRITE_CELL ); masque_layer, HOLE, WRITE_CELL );
TraceFilledRectangle( Pcb, ux0 - via_marge, uy0 - via_marge,
TraceFilledRectangle( aPcb, ux0 - via_marge, uy0 - via_marge,
ux1 + via_marge, uy1 + via_marge, ux1 + via_marge, uy1 + via_marge,
(int) (PtText->m_Orient), (int) (PtText->m_Orient),
masque_layer, VIA_IMPOSSIBLE, WRITE_OR_CELL ); masque_layer, VIA_IMPOSSIBLE, WRITE_OR_CELL );
...@@ -311,24 +318,23 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag ) ...@@ -311,24 +318,23 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
} }
/* Put tracks and vias on matrix */ /* Put tracks and vias on matrix */
pt_segm = Pcb->m_Track; for( TRACK* track = aPcb->m_Track; track; track = track->Next() )
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
if( net_code == pt_segm->GetNet() ) if( net_code == track->GetNet() )
continue; continue;
TraceSegmentPcb( Pcb, pt_segm, HOLE, marge, WRITE_CELL ); TraceSegmentPcb( aPcb, track, HOLE, marge, WRITE_CELL );
TraceSegmentPcb( Pcb, pt_segm, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL ); TraceSegmentPcb( aPcb, track, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL );
} }
/* Put zone filling on matrix */ // Put zone filling on matrix
pt_segm = (TRACK*) Pcb->m_Zone; for( SEGZONE* zone = aPcb->m_Zone; zone; zone = zone->Next() )
for( ; pt_segm != NULL; pt_segm = pt_segm->Next() )
{ {
if( net_code == pt_segm->GetNet() ) if( net_code == zone->GetNet() )
continue; continue;
TraceSegmentPcb( Pcb, pt_segm, HOLE, marge, WRITE_CELL );
TraceSegmentPcb( Pcb, pt_segm, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL ); TraceSegmentPcb( aPcb, zone, HOLE, marge, WRITE_CELL );
TraceSegmentPcb( aPcb, zone, VIA_IMPOSSIBLE, via_marge, WRITE_OR_CELL );
} }
} }
......
This diff is collapsed.
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#ifndef CLASS_BOARD_H #ifndef CLASS_BOARD_H
#define CLASS_BOARD_H #define CLASS_BOARD_H
#include "dlist.h"
class ZONE_CONTAINER; class ZONE_CONTAINER;
class EDA_BoardDesignSettings; class EDA_BoardDesignSettings;
...@@ -80,27 +84,27 @@ public: ...@@ -80,27 +84,27 @@ public:
int m_Unused; int m_Unused;
int m_Status_Pcb; // Flags used in ratsnet calculation and update int m_Status_Pcb; // Flags used in ratsnet calculation and update
EDA_BoardDesignSettings* m_BoardSettings; // Link to current design settings EDA_BoardDesignSettings* m_BoardSettings; // Link to current design settings
int m_NbNets; // Nets (equipotentielles) count
int m_NbNodes; // Active pads (pads attached to a net ) count int m_NbNodes; // Active pads (pads attached to a net ) count
int m_NbLinks; // Ratsnet count int m_NbLinks; // Ratsnet count
int m_NbLoclinks; // Rastests to shew while creating a track int m_NbLoclinks; // Rastests to shew while creating a track
int m_NbNoconnect; // Active ratsnet count (rastnest not alraedy connected by tracks int m_NbNoconnect; // Active ratsnet count (rastnest not alraedy connected by tracks
int m_NbSegmTrack; // Track items count
int m_NbSegmZone; // Zone items count DLIST<BOARD_ITEM> m_Drawings; // linked list of lines & texts
DLIST<MODULE> m_Modules; // linked list of MODULEs
BOARD_ITEM* m_Drawings; // linked list of lines & texts DLIST<EQUIPOT> m_Equipots; // linked list of nets
MODULE* m_Modules; // linked list of MODULEs
EQUIPOT* m_Equipots; // linked list of nets DLIST<TRACK> m_Track; // linked list of TRACKs and SEGVIAs
TRACK* m_Track; // linked list of TRACKs and SEGVIAs
SEGZONE* m_Zone; // linked list of SEGZONEs DLIST<SEGZONE> m_Zone; // linked list of SEGZONEs
D_PAD** m_Pads; // Entry for a sorted pad list (used in ratsnest calculations)
int m_NbPads; // Pad count std::vector<D_PAD*> m_Pads; // Entry for a sorted pad list (used in ratsnest calculations)
CHEVELU* m_Ratsnest; // Rastnest list CHEVELU* m_Ratsnest; // Rastnest list
CHEVELU* m_LocalRatsnest; // Rastnest list used while moving a footprint CHEVELU* m_LocalRatsnest; // Rastnest list used while moving a footprint
ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress ZONE_CONTAINER* m_CurrentZoneContour; // zone contour currently in progress
BOARD( EDA_BaseStruct* StructFather, WinEDA_BasePcbFrame* frame ); BOARD( EDA_BaseStruct* aParent, WinEDA_BasePcbFrame* frame );
~BOARD(); ~BOARD();
/** /**
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include "cvpcb.h" #include "cvpcb.h"
#endif #endif
BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* StructFather, KICAD_T idtype ) : BOARD_CONNECTED_ITEM::BOARD_CONNECTED_ITEM( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( StructFather, idtype ) BOARD_ITEM( aParent, idtype )
{ {
m_NetCode = 0; m_NetCode = 0;
m_Subnet = 0; m_Subnet = 0;
......
...@@ -36,6 +36,8 @@ wxString BOARD_ITEM::ShowShape( Track_Shapes aShape ) ...@@ -36,6 +36,8 @@ wxString BOARD_ITEM::ShowShape( Track_Shapes aShape )
} }
#if !defined(GERBVIEW)
/********************************************************/ /********************************************************/
wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
/********************************************************/ /********************************************************/
...@@ -53,17 +55,17 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -53,17 +55,17 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
switch( item->Type() ) switch( item->Type() )
{ {
case PCB_EQUIPOT_STRUCT_TYPE: case TYPE_EQUIPOT:
text << _( "Net" ) << ( (EQUIPOT*) item )->m_Netname << wxT( " " ) << text << _( "Net" ) << ( (EQUIPOT*) item )->m_Netname << wxT( " " ) <<
( (EQUIPOT*) item )->GetNet(); ( (EQUIPOT*) item )->GetNet();
break; break;
case TYPEMODULE: case TYPE_MODULE:
text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference(); text << _( "Footprint" ) << wxT( " " ) << ( (MODULE*) item )->GetReference();
text << wxT( " (" ) << aPcb->GetLayerName( item->m_Layer ).Trim() << wxT( ")" ); text << wxT( " (" ) << aPcb->GetLayerName( item->m_Layer ).Trim() << wxT( ")" );
break; break;
case TYPEPAD: case TYPE_PAD:
pad = (D_PAD *) this; pad = (D_PAD *) this;
text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName() text << _( "Pad" ) << wxT( " \"" ) << pad->ReturnStringPadName()
<< wxT( "\" (" ); << wxT( "\" (" );
...@@ -77,14 +79,14 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -77,14 +79,14 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference(); text << _( ") of " ) << ( (MODULE*) GetParent() )->GetReference();
break; break;
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
text << _( "Pcb Graphic" ) << wxT(": ") text << _( "Pcb Graphic" ) << wxT(": ")
<< ShowShape( (Track_Shapes) ((DRAWSEGMENT*)item)->m_Shape ) << ShowShape( (Track_Shapes) ((DRAWSEGMENT*)item)->m_Shape )
<< wxChar(' ') << _("Length:") << valeur_param( (int) ((DRAWSEGMENT*)item)->GetLength(), temp ) << wxChar(' ') << _("Length:") << valeur_param( (int) ((DRAWSEGMENT*)item)->GetLength(), temp )
<< _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPETEXTE: case TYPE_TEXTE:
text << _( "Pcb Text" ) << wxT( " " );; text << _( "Pcb Text" ) << wxT( " " );;
if( ( (TEXTE_PCB*) item )->m_Text.Len() < 12 ) if( ( (TEXTE_PCB*) item )->m_Text.Len() < 12 )
text << ( (TEXTE_PCB*) item )->m_Text; text << ( (TEXTE_PCB*) item )->m_Text;
...@@ -93,7 +95,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -93,7 +95,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
switch( ( (TEXTE_MODULE*) item )->m_Type ) switch( ( (TEXTE_MODULE*) item )->m_Type )
{ {
case TEXT_is_REFERENCE: case TEXT_is_REFERENCE:
...@@ -113,7 +115,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -113,7 +115,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
} }
break; break;
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
text << _( "Graphic" ) << wxT( " " ); text << _( "Graphic" ) << wxT( " " );
text << ShowShape( (Track_Shapes) ( (EDGE_MODULE*) item )->m_Shape ); text << ShowShape( (Track_Shapes) ( (EDGE_MODULE*) item )->m_Shape );
text << wxT( " (" ) << aPcb->GetLayerName( ((EDGE_MODULE*) item )->m_Layer ).Trim() << wxT( ")" ); text << wxT( " (" ) << aPcb->GetLayerName( ((EDGE_MODULE*) item )->m_Layer ).Trim() << wxT( ")" );
...@@ -121,7 +123,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -121,7 +123,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
<< ( (MODULE*) GetParent() )->GetReference(); << ( (MODULE*) GetParent() )->GetReference();
break; break;
case TYPETRACK: case TYPE_TRACK:
// deleting tracks requires all the information we can get to // deleting tracks requires all the information we can get to
// disambiguate all the choices under the cursor! // disambiguate all the choices under the cursor!
text << _( "Track" ) << wxT( " " ) << ((TRACK*)item)->ShowWidth(); text << _( "Track" ) << wxT( " " ) << ((TRACK*)item)->ShowWidth();
...@@ -135,7 +137,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -135,7 +137,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
<< wxT(" ") << _("Length:") << valeur_param( (int) ((TRACK*)item)->GetLength(), temp ); << wxT(" ") << _("Length:") << valeur_param( (int) ((TRACK*)item)->GetLength(), temp );
break; break;
case TYPEZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
text = _( "Zone Outline" ); text = _( "Zone Outline" );
{ {
ZONE_CONTAINER* area = (ZONE_CONTAINER*) this; ZONE_CONTAINER* area = (ZONE_CONTAINER*) this;
...@@ -169,7 +171,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -169,7 +171,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPEZONE: case TYPE_ZONE:
text = _( "Zone" ); text = _( "Zone" );
text << wxT( " " ); text << wxT( " " );
{ {
...@@ -185,7 +187,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -185,7 +187,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim(); text << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim();
break; break;
case TYPEVIA: case TYPE_VIA:
{ {
SEGVIA* via = (SEGVIA*) item; SEGVIA* via = (SEGVIA*) item;
text << _( "Via" ) << wxT( " " ) << via->ShowWidth(); text << _( "Via" ) << wxT( " " ) << via->ShowWidth();
...@@ -216,23 +218,23 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const ...@@ -216,23 +218,23 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
} }
break; break;
case TYPEMARKER: case TYPE_MARKER:
text << _( "Marker" ) << wxT( " @(" ) << ((MARKER*)item)->GetPos().x text << _( "Marker" ) << wxT( " @(" ) << ((MARKER*)item)->GetPos().x
<< wxT(",") << ((MARKER*)item)->GetPos().y << wxT(")"); << wxT(",") << ((MARKER*)item)->GetPos().y << wxT(")");
break; break;
case TYPECOTATION: case TYPE_COTATION:
text << _( "Dimension" ) << wxT( " \"" ) << ( (COTATION*) item )->GetText() << wxT( "\"" ); text << _( "Dimension" ) << wxT( " \"" ) << ( (COTATION*) item )->GetText() << wxT( "\"" );
break; break;
case TYPEMIRE: case TYPE_MIRE:
valeur_param( ((MIREPCB*)item)->m_Size, msg ); valeur_param( ((MIREPCB*)item)->m_Size, msg );
text << _( "Target" ) << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim() text << _( "Target" ) << _( " on " ) << aPcb->GetLayerName( item->GetLayer() ).Trim()
<< wxT( " " ) << _( "size" ) << wxT( " " ) << msg << wxT( " " ) << _( "size" ) << wxT( " " ) << msg
; ;
break; break;
case TYPEZONE_UNUSED: case TYPE_ZONE_UNUSED:
text << wxT( "Unused" ); text << wxT( "Unused" );
break; break;
...@@ -258,60 +260,60 @@ const char** BOARD_ITEM::MenuIcon() const ...@@ -258,60 +260,60 @@ const char** BOARD_ITEM::MenuIcon() const
switch( item->Type() ) switch( item->Type() )
{ {
case PCB_EQUIPOT_STRUCT_TYPE: case TYPE_EQUIPOT:
xpm = general_ratsnet_xpm; xpm = general_ratsnet_xpm;
break; break;
case TYPEMODULE: case TYPE_MODULE:
xpm = module_xpm; xpm = module_xpm;
break; break;
case TYPEPAD: case TYPE_PAD:
xpm = pad_xpm; xpm = pad_xpm;
break; break;
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
xpm = add_dashed_line_xpm; xpm = add_dashed_line_xpm;
break; break;
case TYPETEXTE: case TYPE_TEXTE:
xpm = add_text_xpm; xpm = add_text_xpm;
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
xpm = footprint_text_xpm; xpm = footprint_text_xpm;
break; break;
case TYPEEDGEMODULE: case TYPE_EDGE_MODULE:
xpm = show_mod_edge_xpm; xpm = show_mod_edge_xpm;
break; break;
case TYPETRACK: case TYPE_TRACK:
xpm = showtrack_xpm; xpm = showtrack_xpm;
break; break;
case TYPEZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
case TYPEZONE: case TYPE_ZONE:
xpm = add_zone_xpm; xpm = add_zone_xpm;
break; break;
case TYPEVIA: case TYPE_VIA:
xpm = pad_sketch_xpm; xpm = pad_sketch_xpm;
break; break;
case TYPEMARKER: case TYPE_MARKER:
xpm = pad_xpm; // @todo: create and use marker xpm xpm = pad_xpm; // @todo: create and use marker xpm
break; break;
case TYPECOTATION: case TYPE_COTATION:
xpm = add_cotation_xpm; xpm = add_cotation_xpm;
break; break;
case TYPEMIRE: case TYPE_MIRE:
xpm = add_mires_xpm; xpm = add_mires_xpm;
break; break;
case TYPEZONE_UNUSED: case TYPE_ZONE_UNUSED:
xpm = 0; // unused xpm = 0; // unused
break; break;
...@@ -323,3 +325,13 @@ const char** BOARD_ITEM::MenuIcon() const ...@@ -323,3 +325,13 @@ const char** BOARD_ITEM::MenuIcon() const
return (const char**) xpm; return (const char**) xpm;
} }
#endif // !defined(GERBVIEW)
void BOARD_ITEM::UnLink()
{
DLIST<BOARD_ITEM>* list = (DLIST<BOARD_ITEM>*) GetList();
wxASSERT( list );
if( list )
list->Remove( this );
}
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "wxstruct.h" #include "wxstruct.h"
COTATION::COTATION( BOARD_ITEM* StructFather ) : COTATION::COTATION( BOARD_ITEM* aParent ) :
BOARD_ITEM( StructFather, TYPECOTATION ) BOARD_ITEM( aParent, TYPE_COTATION )
{ {
m_Layer = DRAW_LAYER; m_Layer = DRAW_LAYER;
m_Width = 50; m_Width = 50;
...@@ -30,31 +30,6 @@ COTATION::~COTATION() ...@@ -30,31 +30,6 @@ COTATION::~COTATION()
} }
/* supprime du chainage la structure Struct
* les structures arrieres et avant sont chainees directement
*/
void COTATION::UnLink()
{
if( Back() )
{
if( Back()->Type() != TYPEPCB )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
((BOARD*) Back() )->m_Drawings = Next();
}
}
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/* Setup the dimension text */ /* Setup the dimension text */
void COTATION:: SetText( const wxString& NewText ) void COTATION:: SetText( const wxString& NewText )
{ {
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy; int FlecheG2_ox, FlecheG2_oy, FlecheG2_fx, FlecheG2_fy;
public: public:
COTATION( BOARD_ITEM* StructFather ); COTATION( BOARD_ITEM* aParent );
~COTATION(); ~COTATION();
COTATION* Next() const { return (COTATION*) Pnext; } COTATION* Next() const { return (COTATION*) Pnext; }
...@@ -47,9 +47,6 @@ public: ...@@ -47,9 +47,6 @@ public:
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/* supprime du chainage la structure Struct */
void UnLink();
/* Modification du texte de la cotation */ /* Modification du texte de la cotation */
void SetText( const wxString& NewText ); void SetText( const wxString& NewText );
wxString GetText( void ); wxString GetText( void );
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
#include "trigo.h" #include "trigo.h"
/* DRAWSEGMENT: constructor */ /* DRAWSEGMENT: constructor */
DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T idtype ) : DRAWSEGMENT::DRAWSEGMENT( BOARD_ITEM* aParent, KICAD_T idtype ) :
BOARD_ITEM( StructFather, idtype ) BOARD_ITEM( aParent, idtype )
{ {
m_Width = m_Flags = m_Shape = m_Type = m_Angle = 0; m_Width = m_Flags = m_Shape = m_Type = m_Angle = 0;
} }
...@@ -30,29 +30,6 @@ DRAWSEGMENT:: ~DRAWSEGMENT() ...@@ -30,29 +30,6 @@ DRAWSEGMENT:: ~DRAWSEGMENT()
} }
void DRAWSEGMENT::UnLink()
{
if( Back() )
{
if( Back()->Type() != TYPEPCB )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (BOARD*) Back() )->m_Drawings = Next();
}
}
/* erase forward link */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/*******************************************/ /*******************************************/
void DRAWSEGMENT::Copy( DRAWSEGMENT* source ) void DRAWSEGMENT::Copy( DRAWSEGMENT* source )
/*******************************************/ /*******************************************/
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
int m_Angle; // Used only for Arcs: Arc angle in 1/10 deg int m_Angle; // Used only for Arcs: Arc angle in 1/10 deg
public: public:
DRAWSEGMENT( BOARD_ITEM* StructFather, KICAD_T idtype = TYPEDRAWSEGMENT ); DRAWSEGMENT( BOARD_ITEM* aParent, KICAD_T idtype = TYPE_DRAWSEGMENT );
~DRAWSEGMENT(); ~DRAWSEGMENT();
DRAWSEGMENT* Next() const { return (DRAWSEGMENT*) Pnext; } DRAWSEGMENT* Next() const { return (DRAWSEGMENT*) Pnext; }
...@@ -57,12 +57,6 @@ public: ...@@ -57,12 +57,6 @@ public:
bool ReadDrawSegmentDescr( FILE* File, int* LineNum ); bool ReadDrawSegmentDescr( FILE* File, int* LineNum );
/**
* Function UnLink
* remove item from linked list.
*/
void UnLink();
void Copy( DRAWSEGMENT* source ); void Copy( DRAWSEGMENT* source );
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/******************************************/ /******************************************/
EDGE_MODULE::EDGE_MODULE( MODULE* parent ) : EDGE_MODULE::EDGE_MODULE( MODULE* parent ) :
BOARD_ITEM( parent, TYPEEDGEMODULE ) BOARD_ITEM( parent, TYPE_EDGE_MODULE )
{ {
m_Width = 0; m_Width = 0;
m_Shape = S_SEGMENT; m_Shape = S_SEGMENT;
...@@ -78,33 +78,6 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure ...@@ -78,33 +78,6 @@ void EDGE_MODULE:: Copy( EDGE_MODULE* source ) // copy structure
} }
} }
/********************************/
void EDGE_MODULE::UnLink()
/********************************/
{
/* Modification du chainage arriere */
if( Back() )
{
if( Back()->Type() != TYPEMODULE )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (MODULE*) Back() )->m_Drawings = Next();
}
}
/* Modification du chainage avant */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/***********************************/ /***********************************/
void EDGE_MODULE::SetDrawCoord() void EDGE_MODULE::SetDrawCoord()
/***********************************/ /***********************************/
...@@ -148,7 +121,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, ...@@ -148,7 +121,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
WinEDA_BasePcbFrame* frame; WinEDA_BasePcbFrame* frame;
MODULE* Module = NULL; MODULE* Module = NULL;
if( m_Parent && (m_Parent->Type() == TYPEMODULE) ) if( m_Parent && (m_Parent->Type() == TYPE_MODULE) )
Module = (MODULE*) m_Parent; Module = (MODULE*) m_Parent;
color = g_DesignSettings.m_LayerColor[m_Layer]; color = g_DesignSettings.m_LayerColor[m_Layer];
......
...@@ -33,11 +33,6 @@ public: ...@@ -33,11 +33,6 @@ public:
EDGE_MODULE* Back() const { return (EDGE_MODULE*) Pback; } EDGE_MODULE* Back() const { return (EDGE_MODULE*) Pback; }
/**
* Function UnLink
* remove item from linked list.
*/
/** /**
* Function GetPosition * Function GetPosition
* returns the position of this object. * returns the position of this object.
...@@ -48,10 +43,6 @@ public: ...@@ -48,10 +43,6 @@ public:
return m_Start; return m_Start;
} }
/* supprime du chainage la structure Struct */
void UnLink();
void Copy( EDGE_MODULE* source ); // copy structure void Copy( EDGE_MODULE* source ); // copy structure
/** /**
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
/*********************************************************/ /*********************************************************/
/* Constructeur de la classe EQUIPOT */ /* Constructeur de la classe EQUIPOT */
EQUIPOT::EQUIPOT( BOARD_ITEM* StructFather ) : EQUIPOT::EQUIPOT( BOARD_ITEM* aParent ) :
BOARD_ITEM( StructFather, PCB_EQUIPOT_STRUCT_TYPE ) BOARD_ITEM( aParent, TYPE_EQUIPOT )
{ {
SetNet( 0 ); SetNet( 0 );
m_NbNodes = m_NbLink = m_NbNoconn = 0; m_NbNodes = m_NbLink = m_NbNoconn = 0;
...@@ -51,31 +51,6 @@ wxPoint& EQUIPOT::GetPosition() ...@@ -51,31 +51,6 @@ wxPoint& EQUIPOT::GetPosition()
return dummy; return dummy;
} }
void EQUIPOT::UnLink()
{
/* Modification du chainage arriere */
if( Back() )
{
if( Back()->Type() != TYPEPCB )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (BOARD*) Back() )->m_Equipots = Next();
}
}
/* Modification du chainage avant */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/*********************************************************/ /*********************************************************/
int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum ) int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum )
/*********************************************************/ /*********************************************************/
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
CHEVELU* m_RatsnestStart; // pointeur sur debut de liste ratsnests du net CHEVELU* m_RatsnestStart; // pointeur sur debut de liste ratsnests du net
CHEVELU* m_RatsnestEnd; // pointeur sur fin de liste ratsnests du net CHEVELU* m_RatsnestEnd; // pointeur sur fin de liste ratsnests du net
EQUIPOT( BOARD_ITEM* StructFather ); EQUIPOT( BOARD_ITEM* aParent );
~EQUIPOT(); ~EQUIPOT();
EQUIPOT* Next() const { return (EQUIPOT*) Pnext; } EQUIPOT* Next() const { return (EQUIPOT*) Pnext; }
...@@ -40,10 +40,6 @@ public: ...@@ -40,10 +40,6 @@ public:
*/ */
wxPoint& GetPosition(); wxPoint& GetPosition();
/* Effacement memoire de la structure */
void UnLink();
/* Readind and writing data on files */ /* Readind and writing data on files */
int ReadEquipotDescr( FILE* File, int* LineNum ); int ReadEquipotDescr( FILE* File, int* LineNum );
......
...@@ -48,8 +48,8 @@ void MARKER::init() ...@@ -48,8 +48,8 @@ void MARKER::init()
m_Size.y = Default_MarkerBitmap[1]; m_Size.y = Default_MarkerBitmap[1];
} }
MARKER::MARKER( BOARD_ITEM* StructFather ) : MARKER::MARKER( BOARD_ITEM* aParent ) :
BOARD_ITEM( StructFather, TYPEMARKER ), BOARD_ITEM( aParent, TYPE_MARKER ),
m_drc() m_drc()
{ {
init(); init();
...@@ -59,7 +59,7 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) : ...@@ -59,7 +59,7 @@ MARKER::MARKER( BOARD_ITEM* StructFather ) :
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER::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 ) :
BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add() BOARD_ITEM( NULL, TYPE_MARKER ) // parent set during BOARD::Add()
{ {
init(); init();
...@@ -70,7 +70,7 @@ MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos, ...@@ -70,7 +70,7 @@ MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos, MARKER::MARKER( int aErrorCode, const wxPoint& aMarkerPos,
const wxString& aText, const wxPoint& aPos ) : const wxString& aText, const wxPoint& aPos ) :
BOARD_ITEM( NULL, TYPEMARKER ) // parent set during BOARD::Add() BOARD_ITEM( NULL, TYPE_MARKER ) // parent set during BOARD::Add()
{ {
init(); init();
......
...@@ -23,7 +23,7 @@ protected: ...@@ -23,7 +23,7 @@ protected:
public: public:
MARKER( BOARD_ITEM* StructFather ); MARKER( BOARD_ITEM* aParent );
/** /**
* Constructor * Constructor
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#include "pcbnew.h" #include "pcbnew.h"
MIREPCB::MIREPCB( BOARD_ITEM* StructFather ) : MIREPCB::MIREPCB( BOARD_ITEM* aParent ) :
BOARD_ITEM( StructFather, TYPEMIRE ) BOARD_ITEM( aParent, TYPE_MIRE )
{ {
m_Shape = 0; m_Shape = 0;
m_Size = 5000; m_Size = 5000;
...@@ -22,30 +22,6 @@ MIREPCB::~MIREPCB() ...@@ -22,30 +22,6 @@ MIREPCB::~MIREPCB()
} }
/***************************/
void MIREPCB::UnLink()
/***************************/
{
if( Back() )
{
if( Back()->Type() != TYPEPCB )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (BOARD*) Back() )->m_Drawings = Next();
}
}
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/**********************************/ /**********************************/
void MIREPCB::Copy( MIREPCB* source ) void MIREPCB::Copy( MIREPCB* source )
/**********************************/ /**********************************/
......
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
int m_Size; int m_Size;
public: public:
MIREPCB( BOARD_ITEM* StructFather ); MIREPCB( BOARD_ITEM* aParent );
~MIREPCB(); ~MIREPCB();
MIREPCB* Next() const { return (MIREPCB*) Pnext; } MIREPCB* Next() const { return (MIREPCB*) Pnext; }
...@@ -38,9 +38,6 @@ public: ...@@ -38,9 +38,6 @@ public:
bool ReadMirePcbDescr( FILE* File, int* LineNum ); bool ReadMirePcbDescr( FILE* File, int* LineNum );
/* supprime du chainage la structure Struct */
void UnLink();
void Copy( MIREPCB* source ); void Copy( MIREPCB* source );
void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset ); void Draw( WinEDA_DrawPanel* panel, wxDC* DC, int aDrawMode, const wxPoint& offset = ZeroOffset );
......
This diff is collapsed.
...@@ -39,8 +39,8 @@ class MODULE : public BOARD_ITEM ...@@ -39,8 +39,8 @@ class MODULE : public BOARD_ITEM
{ {
public: public:
wxPoint m_Pos; // Real coord on board wxPoint m_Pos; // Real coord on board
D_PAD* m_Pads; /* Pad list (linked list) */ DLIST<D_PAD> m_Pads; /* Pad list (linked list) */
BOARD_ITEM* m_Drawings; /* Graphic items list (linked list) */ DLIST<BOARD_ITEM> m_Drawings; /* Graphic items list (linked list) */
Struct3D_Master* m_3D_Drawings; /* First item of the 3D shapes (linked list)*/ Struct3D_Master* m_3D_Drawings; /* First item of the 3D shapes (linked list)*/
TEXTE_MODULE* m_Reference; // Component reference (U34, R18..) TEXTE_MODULE* m_Reference; // Component reference (U34, R18..)
TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..) TEXTE_MODULE* m_Value; // Component value (74LS00, 22K..)
...@@ -124,9 +124,6 @@ public: ...@@ -124,9 +124,6 @@ public:
void SetPosition( const wxPoint& newpos ); void SetPosition( const wxPoint& newpos );
void SetOrientation( int newangle ); void SetOrientation( int newangle );
/* Remove this from the linked list */
void UnLink();
/** /**
* Function IsLocked * Function IsLocked
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
/* classe D_PAD : constructeur */ /* classe D_PAD : constructeur */
/*******************************/ /*******************************/
D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPEPAD ) D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPE_PAD )
{ {
m_NumPadName = 0; m_NumPadName = 0;
m_Masque_Layer = CUIVRE_LAYER; m_Masque_Layer = CUIVRE_LAYER;
...@@ -34,7 +34,7 @@ D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPEPAD ) ...@@ -34,7 +34,7 @@ D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPEPAD )
m_Size.x = m_Size.y = 500; m_Size.x = m_Size.y = 500;
if( m_Parent && (m_Parent->Type() == TYPEMODULE) ) if( m_Parent && (m_Parent->Type() == TYPE_MODULE) )
{ {
m_Pos = ( (MODULE*) m_Parent )->GetPosition(); m_Pos = ( (MODULE*) m_Parent )->GetPosition();
} }
...@@ -202,36 +202,6 @@ void D_PAD::Copy( D_PAD* source ) ...@@ -202,36 +202,6 @@ void D_PAD::Copy( D_PAD* source )
} }
/**************************/
void D_PAD::UnLink()
/**************************/
/* supprime du chainage la structure Struct
* les structures arrieres et avant sont chainees directement
*/
{
/* Modification du chainage arriere */
if( Back() )
{
if( Back()->Type() != TYPEMODULE )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (MODULE*) Back() )->m_Pads = Next();
}
}
/* Modification du chainage avant */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/*******************************************************************************************/ /*******************************************************************************************/
void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset ) void D_PAD::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoint& offset )
/*******************************************************************************************/ /*******************************************************************************************/
......
...@@ -89,10 +89,6 @@ public: ...@@ -89,10 +89,6 @@ public:
m_Pos = aPos; m_Pos = aPos;
} }
/* remove from linked list */
void UnLink();
/* Reading and writing data on files */ /* Reading and writing data on files */
int ReadDescr( FILE* File, int* LineNum = NULL ); int ReadDescr( FILE* File, int* LineNum = NULL );
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/*******************/ /*******************/
TEXTE_PCB::TEXTE_PCB( BOARD_ITEM* parent ) : TEXTE_PCB::TEXTE_PCB( BOARD_ITEM* parent ) :
BOARD_ITEM( parent, TYPETEXTE ), BOARD_ITEM( parent, TYPE_TEXTE ),
EDA_TextStruct() EDA_TextStruct()
{ {
} }
...@@ -48,30 +48,6 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source ) ...@@ -48,30 +48,6 @@ void TEXTE_PCB::Copy( TEXTE_PCB* source )
} }
void TEXTE_PCB::UnLink()
{
/* Modification du chainage arriere */
if( Back() )
{
if( Back()->Type() != TYPEPCB )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (BOARD*) Back() )->m_Drawings = Next();
}
}
/* Modification du chainage avant */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/****************************************************************/ /****************************************************************/
int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum ) int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
/****************************************************************/ /****************************************************************/
...@@ -175,7 +151,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -175,7 +151,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
BOARD_ITEM* parent = (BOARD_ITEM*) m_Parent; BOARD_ITEM* parent = (BOARD_ITEM*) m_Parent;
wxASSERT( parent ); wxASSERT( parent );
if( parent->Type() == TYPECOTATION ) if( parent->Type() == TYPE_COTATION )
board = (BOARD*) parent->GetParent(); board = (BOARD*) parent->GetParent();
else else
board = (BOARD*) parent; board = (BOARD*) parent;
...@@ -183,7 +159,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -183,7 +159,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
frame->MsgPanel->EraseMsgBox(); frame->MsgPanel->EraseMsgBox();
if( m_Parent && m_Parent->Type() == TYPECOTATION ) if( m_Parent && m_Parent->Type() == TYPE_COTATION )
Affiche_1_Parametre( frame, 1, _( "COTATION" ), m_Text, DARKGREEN ); Affiche_1_Parametre( frame, 1, _( "COTATION" ), m_Text, DARKGREEN );
else else
Affiche_1_Parametre( frame, 1, _( "PCB Text" ), m_Text, DARKGREEN ); Affiche_1_Parametre( frame, 1, _( "PCB Text" ), m_Text, DARKGREEN );
......
...@@ -13,7 +13,6 @@ public: ...@@ -13,7 +13,6 @@ public:
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.
...@@ -25,10 +24,6 @@ public: ...@@ -25,10 +24,6 @@ public:
return m_Pos; // within EDA_TextStruct return m_Pos; // within EDA_TextStruct
} }
/* supprime du chainage la structure Struct */
void UnLink();
/* duplicate structure */ /* duplicate structure */
void Copy( TEXTE_PCB* source ); void Copy( TEXTE_PCB* source );
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/* Constructeur de TEXTE_MODULE */ /* Constructeur de TEXTE_MODULE */
TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM( parent, TYPETEXTEMODULE ) BOARD_ITEM( parent, TYPE_TEXTE_MODULE )
{ {
MODULE* Module = (MODULE*) m_Parent; MODULE* Module = (MODULE*) m_Parent;
...@@ -43,7 +43,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) : ...@@ -43,7 +43,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
m_Unused = 0; m_Unused = 0;
SetLayer( SILKSCREEN_N_CMP ); SetLayer( SILKSCREEN_N_CMP );
if( Module && (Module->Type() == TYPEMODULE) ) if( Module && (Module->Type() == TYPE_MODULE) )
{ {
m_Pos = Module->m_Pos; m_Pos = Module->m_Pos;
...@@ -205,33 +205,6 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source ) ...@@ -205,33 +205,6 @@ void TEXTE_MODULE::Copy( TEXTE_MODULE* source )
} }
/* Remove this from the linked list
* Update Pback and Pnext pointers
*/
void TEXTE_MODULE::UnLink()
{
/* Modification du chainage arriere */
if( Back() )
{
if( Back()->Type() != TYPEMODULE )
{
Back()->SetNext( Next() );
}
else /* Le chainage arriere pointe sur la structure "Pere" */
{
( (MODULE*) Back() )->m_Drawings = Next();
}
}
/* Modification du chainage avant */
if( Next() )
Next()->SetBack( Back() );
SetNext( 0 );
SetBack( 0 );
}
/******************************************/ /******************************************/
int TEXTE_MODULE:: GetLength() int TEXTE_MODULE:: GetLength()
/******************************************/ /******************************************/
......
...@@ -47,10 +47,6 @@ public: ...@@ -47,10 +47,6 @@ public:
return m_Pos; return m_Pos;
} }
/* supprime du chainage la structure Struct */
void UnLink();
void Copy( TEXTE_MODULE* source ); // copy structure void Copy( TEXTE_MODULE* source ); // copy structure
/* Gestion du texte */ /* Gestion du texte */
......
This diff is collapsed.
...@@ -18,6 +18,13 @@ ...@@ -18,6 +18,13 @@
class TRACK : public BOARD_CONNECTED_ITEM class TRACK : public BOARD_CONNECTED_ITEM
{ {
// make SetNext() and SetBack() private so that they may not be called from anywhere.
// list management is done on TRACKs using DLIST<TRACK> only.
private:
void SetNext( EDA_BaseStruct* aNext ) { Pnext = aNext; }
void SetBack( EDA_BaseStruct* aBack ) { Pback = aBack; }
public: public:
int m_Width; // 0 = line, > 0 = tracks, bus ... int m_Width; // 0 = line, > 0 = tracks, bus ...
wxPoint m_Start; // Line start point wxPoint m_Start; // Line start point
...@@ -38,7 +45,7 @@ protected: ...@@ -38,7 +45,7 @@ protected:
TRACK( const TRACK& track ); // protected so Copy() is used instead. TRACK( const TRACK& track ); // protected so Copy() is used instead.
public: public:
TRACK( BOARD_ITEM* StructFather, KICAD_T idtype = TYPETRACK ); TRACK( BOARD_ITEM* aParent, KICAD_T idtype = TYPE_TRACK );
/** /**
* Function Copy * Function Copy
...@@ -66,10 +73,6 @@ public: ...@@ -66,10 +73,6 @@ public:
EDA_Rect GetBoundingBox(); EDA_Rect GetBoundingBox();
/* Remove "this" from the linked list */
void UnLink();
/** /**
* 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.
...@@ -78,19 +81,6 @@ public: ...@@ -78,19 +81,6 @@ public:
*/ */
bool Save( FILE* aFile ) const; bool Save( FILE* aFile ) const;
/**
* Function Insert
* inserts a single TRACK, SEGVIA or SEGZONE, or a list of such,
* into the proper list within a BOARD, either at the
* list's front or immediately after the InsertPoint.
* If Insertpoint == NULL, then insert at the beginning of the proper list.
* If InsertPoint != NULL, then insert immediately after InsertPoint.
* TRACKs and SEGVIAs are put on the m_Track list, SEGZONE on the m_Zone list.
* @param aPcb The BOARD to insert into.
* @param InsertPoint See above
*/
void Insert( BOARD* aPcb, TRACK* InsertPoint );
/** /**
* Function GetBestInsertPoint * Function GetBestInsertPoint
* searches the "best" insertion point within the track linked list. * searches the "best" insertion point within the track linked list.
...@@ -167,8 +157,11 @@ public: ...@@ -167,8 +157,11 @@ public:
int IsPointOnEnds( const wxPoint& point, int min_dist = 0 ); int IsPointOnEnds( const wxPoint& point, int min_dist = 0 );
bool IsNull(); // return TRUE if segment lenght = 0 /**
* Function IsNull
* returns true if segment length is zero.
*/
bool IsNull();
/** /**
* Function Display_Infos * Function Display_Infos
...@@ -242,6 +235,14 @@ public: ...@@ -242,6 +235,14 @@ public:
*/ */
void Show( int nestLevel, std::ostream& os ); void Show( int nestLevel, std::ostream& os );
/**
* Function ShowState
* converts a set of state bits to a wxString
* @param stateBits Is an OR-ed together set of bits like BUSY, EDIT, etc.
*/
static wxString ShowState( int stateBits );
#endif #endif
}; };
...@@ -249,7 +250,7 @@ public: ...@@ -249,7 +250,7 @@ public:
class SEGZONE : public TRACK class SEGZONE : public TRACK
{ {
public: public:
SEGZONE( BOARD_ITEM* StructFather ); SEGZONE( BOARD_ITEM* aParent );
/** /**
* Function GetClass * Function GetClass
...@@ -269,7 +270,7 @@ public: ...@@ -269,7 +270,7 @@ public:
class SEGVIA : public TRACK class SEGVIA : public TRACK
{ {
public: public:
SEGVIA( BOARD_ITEM* StructFather ); SEGVIA( BOARD_ITEM* aParent );
SEGVIA( const SEGVIA& source ) : SEGVIA( const SEGVIA& source ) :
TRACK( source ) TRACK( source )
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/************************/ /************************/
ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) : ZONE_CONTAINER::ZONE_CONTAINER( BOARD* parent ) :
BOARD_ITEM( parent, TYPEZONE_CONTAINER ) BOARD_ITEM( parent, TYPE_ZONE_CONTAINER )
{ {
m_NetCode = -1; // Net number for fast comparisons m_NetCode = -1; // Net number for fast comparisons
......
...@@ -59,9 +59,6 @@ public: ...@@ -59,9 +59,6 @@ public:
*/ */
wxPoint& GetPosition(); wxPoint& GetPosition();
void UnLink( void )
{
};
/** /**
* Function copy * Function copy
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/* Class SCREEN: classe de gestion d'un affichage */ /* Class SCREEN: classe de gestion d'un affichage */
/***************************************************/ /***************************************************/
/* Constructeur de SCREEN */ /* Constructeur de SCREEN */
PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPESCREEN ) PCB_SCREEN::PCB_SCREEN( int idscreen ) : BASE_SCREEN( TYPE_SCREEN )
{ {
// a zero terminated list // a zero terminated list
static const int zoom_list[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 0 }; static const int zoom_list[] = { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 0 };
......
This diff is collapsed.
...@@ -36,86 +36,86 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { ...@@ -36,86 +36,86 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
// there are some restrictions on the order of items in the general case. // there are some restrictions on the order of items in the general case.
// all items in m_Drawings for instance should be contiguous. // all items in m_Drawings for instance should be contiguous.
// *** all items in a same list (shown here) must be contiguous **** // *** all items in a same list (shown here) must be contiguous ****
TYPEMARKER, // in m_markers TYPE_MARKER, // in m_markers
TYPETEXTE, // in m_Drawings TYPE_TEXTE, // in m_Drawings
TYPEDRAWSEGMENT, // in m_Drawings TYPE_DRAWSEGMENT, // in m_Drawings
TYPECOTATION, // in m_Drawings TYPE_COTATION, // in m_Drawings
TYPEMIRE, // in m_Drawings TYPE_MIRE, // in m_Drawings
TYPEVIA, // in m_Tracks TYPE_VIA, // in m_Tracks
TYPETRACK, // in m_Tracks TYPE_TRACK, // in m_Tracks
TYPEPAD, // in modules TYPE_PAD, // in modules
TYPETEXTEMODULE, // in modules TYPE_TEXTE_MODULE, // in modules
TYPEMODULE, // in m_Modules TYPE_MODULE, // in m_Modules
TYPEZONE, // in m_Zones TYPE_ZONE, // in m_Zones
TYPEZONE_CONTAINER, // in m_ZoneDescriptorList TYPE_ZONE_CONTAINER, // in m_ZoneDescriptorList
EOT EOT
}; };
/* /*
* const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = { * const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
* TYPETEXTE, * TYPE_TEXTE,
* TYPEDRAWSEGMENT, * TYPE_DRAWSEGMENT,
* TYPECOTATION, * TYPE_COTATION,
* TYPEVIA, * TYPE_VIA,
* TYPETRACK, * TYPE_TRACK,
* TYPEMODULE, * TYPE_MODULE,
* EOT * EOT
* }; * };
*/ */
const KICAD_T GENERAL_COLLECTOR::AllButZones[] = { const KICAD_T GENERAL_COLLECTOR::AllButZones[] = {
TYPEMARKER, TYPE_MARKER,
TYPETEXTE, TYPE_TEXTE,
TYPEDRAWSEGMENT, TYPE_DRAWSEGMENT,
TYPECOTATION, TYPE_COTATION,
TYPEMIRE, TYPE_MIRE,
TYPEVIA, TYPE_VIA,
TYPETRACK, TYPE_TRACK,
TYPEPAD, TYPE_PAD,
TYPETEXTEMODULE, TYPE_TEXTE_MODULE,
TYPEMODULE, TYPE_MODULE,
TYPEZONE_CONTAINER, // if it is visible on screen, it should be selectable TYPE_ZONE_CONTAINER, // if it is visible on screen, it should be selectable
EOT EOT
}; };
const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = { const KICAD_T GENERAL_COLLECTOR::ModuleItems[] = {
TYPEMODULE, TYPE_MODULE,
EOT EOT
}; };
const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = { const KICAD_T GENERAL_COLLECTOR::PadsOrModules[] = {
TYPEPAD, TYPE_PAD,
TYPEMODULE, TYPE_MODULE,
EOT EOT
}; };
const KICAD_T GENERAL_COLLECTOR::PadsTracksOrZones[] = { const KICAD_T GENERAL_COLLECTOR::PadsTracksOrZones[] = {
TYPEPAD, TYPE_PAD,
TYPEVIA, TYPE_VIA,
TYPETRACK, TYPE_TRACK,
TYPEZONE, TYPE_ZONE,
TYPEZONE_CONTAINER, TYPE_ZONE_CONTAINER,
EOT EOT
}; };
const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = { const KICAD_T GENERAL_COLLECTOR::ModulesAndTheirItems[] = {
TYPETEXTEMODULE, TYPE_TEXTE_MODULE,
TYPEEDGEMODULE, TYPE_EDGE_MODULE,
TYPEPAD, TYPE_PAD,
TYPEMODULE, TYPE_MODULE,
EOT EOT
}; };
const KICAD_T GENERAL_COLLECTOR::Tracks[] = { const KICAD_T GENERAL_COLLECTOR::Tracks[] = {
TYPETRACK, TYPE_TRACK,
TYPEVIA, TYPE_VIA,
EOT EOT
}; };
...@@ -142,7 +142,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -142,7 +142,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEPAD: case TYPE_PAD:
{ {
MODULE* m = (MODULE*) item->GetParent(); MODULE* m = (MODULE*) item->GetParent();
if( m->GetReference() == wxT( "Y2" ) ) if( m->GetReference() == wxT( "Y2" ) )
...@@ -152,31 +152,31 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -152,31 +152,31 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
} }
break; break;
case TYPEVIA: case TYPE_VIA:
breakhere++; breakhere++;
break; break;
case TYPETRACK: case TYPE_TRACK:
breakhere++; breakhere++;
break; break;
case TYPEZONE: case TYPE_ZONE:
breakhere++; breakhere++;
break; break;
case TYPETEXTE: case TYPE_TEXTE:
breakhere++; breakhere++;
break; break;
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
breakhere++; breakhere++;
break; break;
case TYPECOTATION: case TYPE_COTATION:
breakhere++; breakhere++;
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
{ {
TEXTE_MODULE* tm = (TEXTE_MODULE*) item; TEXTE_MODULE* tm = (TEXTE_MODULE*) item;
if( tm->m_Text == wxT( "10uH" ) ) if( tm->m_Text == wxT( "10uH" ) )
...@@ -186,7 +186,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -186,7 +186,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
} }
break; break;
case TYPEMODULE: case TYPE_MODULE:
{ {
MODULE* m = (MODULE*) item; MODULE* m = (MODULE*) item;
if( m->GetReference() == wxT( "C98" ) ) if( m->GetReference() == wxT( "C98" ) )
...@@ -206,7 +206,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -206,7 +206,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
switch( item->Type() ) switch( item->Type() )
{ {
case TYPEPAD: case TYPE_PAD:
// if pad is a thru hole, then it can be visible when its parent module is not. // if pad is a thru hole, then it can be visible when its parent module is not.
if( ( (D_PAD*) item )->m_Attribut != PAD_SMD ) // a hole is present, so multiple layers if( ( (D_PAD*) item )->m_Attribut != PAD_SMD ) // a hole is present, so multiple layers
...@@ -219,31 +219,31 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -219,31 +219,31 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
module = (MODULE*) item->GetParent(); module = (MODULE*) item->GetParent();
break; break;
case TYPEVIA: case TYPE_VIA:
break; break;
case TYPETRACK: case TYPE_TRACK:
break; break;
case TYPEZONE: case TYPE_ZONE:
break; break;
case TYPEZONE_CONTAINER: case TYPE_ZONE_CONTAINER:
break; break;
case TYPETEXTE: case TYPE_TEXTE:
break; break;
case TYPEDRAWSEGMENT: case TYPE_DRAWSEGMENT:
break; break;
case TYPECOTATION: case TYPE_COTATION:
break; break;
case TYPEMIRE: case TYPE_MIRE:
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
module = (MODULE*) item->GetParent(); module = (MODULE*) item->GetParent();
if( m_Guide->IgnoreMTextsMarkedNoShow() && ( (TEXTE_MODULE*) item )->m_NoShow ) if( m_Guide->IgnoreMTextsMarkedNoShow() && ( (TEXTE_MODULE*) item )->m_NoShow )
...@@ -259,7 +259,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -259,7 +259,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
} }
break; break;
case TYPEMODULE: case TYPE_MODULE:
module = (MODULE*) item; module = (MODULE*) item;
break; break;
...@@ -269,7 +269,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void* ...@@ -269,7 +269,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
// common tests: // common tests:
if( module ) // true from case TYPEPAD, TYPETEXTEMODULE, or TYPEMODULE if( module ) // true from case TYPE_PAD, TYPE_TEXTE_MODULE, or TYPE_MODULE
{ {
if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==COPPER_LAYER_N ) if( m_Guide->IgnoreModulesOnCu() && module->GetLayer()==COPPER_LAYER_N )
goto exit; goto exit;
......
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
* Function IgnoreZones * Function IgnoreZones
* @return bool - true if should ignore zones. * @return bool - true if should ignore zones.
virtual bool IgnoreZones() const = 0; virtual bool IgnoreZones() const = 0;
can simply omit from scanTypes[] TYPEZONE */ can simply omit from scanTypes[] TYPE_ZONE */
/** /**
* Function IgnoreMTextsOnCu * Function IgnoreMTextsOnCu
......
This diff is collapsed.
...@@ -30,7 +30,7 @@ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aColle ...@@ -30,7 +30,7 @@ static BOARD_ITEM* AllAreModulesAndReturnSmallestIfSo( GENERAL_COLLECTOR* aColle
for( int i = 0; i<count; ++i ) for( int i = 0; i<count; ++i )
{ {
if( (*aCollector)[i]->Type() != TYPEMODULE ) if( (*aCollector)[i]->Type() != TYPE_MODULE )
return NULL; return NULL;
} }
...@@ -131,7 +131,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -131,7 +131,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
for( int ii = 0; ii < m_Collector->GetCount(); ii++ ) for( int ii = 0; ii < m_Collector->GetCount(); ii++ )
{ {
item = (*m_Collector)[ii]; item = (*m_Collector)[ii];
if( item->Type() != TYPEZONE ) if( item->Type() != TYPE_ZONE )
continue; continue;
/* Found a TYPE ZONE */ /* Found a TYPE ZONE */
...@@ -151,9 +151,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode ) ...@@ -151,9 +151,9 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
} }
// If the count is 2, and first item is a pad or moduletext, and the 2nd item is its parent module: // If the count is 2, and first item is a pad or moduletext, and the 2nd item is its parent module:
else if( m_Collector->GetCount() == 2 else if( m_Collector->GetCount() == 2
&& ( (*m_Collector)[0]->Type() == TYPEPAD || (*m_Collector)[0]->Type() == && ( (*m_Collector)[0]->Type() == TYPE_PAD || (*m_Collector)[0]->Type() ==
TYPETEXTEMODULE ) TYPE_TEXTE_MODULE )
&& (*m_Collector)[1]->Type() == TYPEMODULE && (*m_Collector)[0]->GetParent()== && (*m_Collector)[1]->Type() == TYPE_MODULE && (*m_Collector)[0]->GetParent()==
(*m_Collector)[1] ) (*m_Collector)[1] )
{ {
item = (*m_Collector)[0]; item = (*m_Collector)[0];
...@@ -271,15 +271,12 @@ static bool Join( wxPoint* res, wxPoint a0, wxPoint a1, wxPoint b0, wxPoint b1 ) ...@@ -271,15 +271,12 @@ static bool Join( wxPoint* res, wxPoint a0, wxPoint a1, wxPoint b0, wxPoint b1 )
*/ */
bool Project( wxPoint* res, wxPoint on_grid, const TRACK* track ) bool Project( wxPoint* res, wxPoint on_grid, const TRACK* track )
{ {
wxPoint vec;
double t;
if( track->m_Start == track->m_End ) if( track->m_Start == track->m_End )
return false; return false;
vec = track->m_End-track->m_Start; wxPoint vec = track->m_End - track->m_Start;
t = double( on_grid.x - track->m_Start.x ) * vec.x + double t = double( on_grid.x - track->m_Start.x ) * vec.x +
double( on_grid.y - track->m_Start.y ) * vec.y; double( on_grid.y - track->m_Start.y ) * vec.y;
t /= (double) vec.x * vec.x + (double) vec.y * vec.y; t /= (double) vec.x * vec.x + (double) vec.y * vec.y;
...@@ -313,7 +310,7 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -313,7 +310,7 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
// D( printf( "currTrack=%p currItem=%p currTrack->Type()=%d currItem->Type()=%d\n", currTrack, currItem, currTrack ? currTrack->Type() : 0, currItem ? currItem->Type() : 0 ); ) // D( printf( "currTrack=%p currItem=%p currTrack->Type()=%d currItem->Type()=%d\n", currTrack, currItem, currTrack ? currTrack->Type() : 0, currItem ? currItem->Type() : 0 ); )
if( !currTrack && currItem && currItem->Type()==TYPEVIA && currItem->m_Flags ) if( !currTrack && currItem && currItem->Type()==TYPE_VIA && currItem->m_Flags )
{ {
// moving a VIA // moving a VIA
currTrack = (TRACK*) currItem; currTrack = (TRACK*) currItem;
...@@ -381,7 +378,7 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -381,7 +378,7 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
} }
else else
{ {
// D( printf( "skipping self\n" ); ) //D( printf( "skipping self\n" ); )
} }
} }
...@@ -390,8 +387,11 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -390,8 +387,11 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
int layer_mask = g_TabOneLayerMask[layer]; int layer_mask = g_TabOneLayerMask[layer];
TRACK* track = Locate_Pistes( m_Pcb->m_Track, layer_mask, CURSEUR_OFF_GRILLE ); TRACK* track = Locate_Pistes( m_Pcb->m_Track, layer_mask, CURSEUR_OFF_GRILLE );
if( !track || track->Type() != TYPETRACK ) if( !track || track->Type() != TYPE_TRACK )
{
// D(printf("!currTrack and track=%p not found, layer_mask=0x%X\n", track, layer_mask );)
return false; return false;
}
// D( printf( "Project\n" ); ) // D( printf( "Project\n" ); )
return Project( curpos, on_grid, track ); return Project( curpos, on_grid, track );
...@@ -413,13 +413,13 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -413,13 +413,13 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() ) for( TRACK* track = m_Pcb->m_Track; track; track = track->Next() )
{ {
if( track->Type() != TYPETRACK ) if( track->Type() != TYPE_TRACK )
continue; continue;
if( doCheckNet && currTrack && currTrack->GetNet() != track->GetNet() ) if( doCheckNet && currTrack && currTrack->GetNet() != track->GetNet() )
continue; continue;
if( (g_DesignSettings.m_LayerColor[track->GetLayer()] & ITEM_NOT_SHOW) ) if( g_DesignSettings.m_LayerColor[track->GetLayer()] & ITEM_NOT_SHOW )
continue; continue;
// omit the layer check if moving a via // omit the layer check if moving a via
...@@ -429,6 +429,8 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -429,6 +429,8 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
if( !track->HitTest( *curpos ) ) if( !track->HitTest( *curpos ) )
continue; continue;
D(printf( "have track prospect\n");)
if( Join( curpos, track->m_Start, track->m_End, currTrack->m_Start, currTrack->m_End ) ) if( Join( curpos, track->m_Start, track->m_End, currTrack->m_Start, currTrack->m_End ) )
{ {
// D(printf( "join currTrack->Type()=%d\n", currTrack->Type() );) // D(printf( "join currTrack->Type()=%d\n", currTrack->Type() );)
...@@ -448,8 +450,8 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame, ...@@ -448,8 +450,8 @@ static bool Magnetize( BOARD* m_Pcb, WinEDA_PcbFrame* frame,
double( curpos->y - track->m_End.y )); double( curpos->y - track->m_End.y ));
// if track not via, or if its a via dragging but not with its adjacent track // if track not via, or if its a via dragging but not with its adjacent track
if( currTrack->Type() != TYPEVIA if( currTrack->Type() != TYPE_VIA
|| ( currTrack->m_Start!=track->m_Start && currTrack->m_Start!=track->m_End )) || ( currTrack->m_Start != track->m_Start && currTrack->m_Start != track->m_End ))
{ {
if( distStart <= currTrack->m_Width/2 ) if( distStart <= currTrack->m_Width/2 )
{ {
......
...@@ -280,12 +280,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC ) ...@@ -280,12 +280,7 @@ COTATION* WinEDA_PcbFrame::Begin_Cotation( COTATION* Cotation, wxDC* DC )
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 */
Cotation->SetBack( m_Pcb ); m_Pcb->Add( Cotation );
Cotation->SetNext( m_Pcb->m_Drawings );
if( m_Pcb->m_Drawings )
m_Pcb->m_Drawings->SetBack( Cotation );
m_Pcb->m_Drawings = Cotation;
GetScreen()->SetModify(); GetScreen()->SetModify();
DrawPanel->ManageCurseur = NULL; DrawPanel->ManageCurseur = NULL;
......
...@@ -148,13 +148,13 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) ...@@ -148,13 +148,13 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
switch( objectToSync->Type() ) switch( objectToSync->Type() )
{ {
case TYPEMODULE: case TYPE_MODULE:
module = (MODULE*) objectToSync; module = (MODULE*) objectToSync;
sprintf( cmd, "$PART: \"%s\"", sprintf( cmd, "$PART: \"%s\"",
CONV_TO_UTF8( module->m_Reference->m_Text ) ); CONV_TO_UTF8( module->m_Reference->m_Text ) );
break; break;
case TYPEPAD: case TYPE_PAD:
module = (MODULE*) objectToSync->GetParent(); module = (MODULE*) objectToSync->GetParent();
pad = (D_PAD*) objectToSync; pad = (D_PAD*) objectToSync;
msg = pad->ReturnStringPadName(); msg = pad->ReturnStringPadName();
...@@ -163,7 +163,7 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync ) ...@@ -163,7 +163,7 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
CONV_TO_UTF8( msg ) ); CONV_TO_UTF8( msg ) );
break; break;
case TYPETEXTEMODULE: case TYPE_TEXTE_MODULE:
#define REFERENCE 0 #define REFERENCE 0
#define VALUE 1 #define VALUE 1
module = (MODULE*) objectToSync->GetParent(); module = (MODULE*) objectToSync->GetParent();
......
This diff is collapsed.
...@@ -735,7 +735,7 @@ void WinEDA_ModulePropertiesFrame::ReCreateFieldListBox() ...@@ -735,7 +735,7 @@ void WinEDA_ModulePropertiesFrame::ReCreateFieldListBox()
EDA_BaseStruct* item = m_CurrentModule->m_Drawings; EDA_BaseStruct* item = m_CurrentModule->m_Drawings;
while( item ) while( item )
{ {
if( item->Type() == TYPETEXTEMODULE ) if( item->Type() == TYPE_TEXTE_MODULE )
m_TextListBox->Append( ( (TEXTE_MODULE*) item )->m_Text ); m_TextListBox->Append( ( (TEXTE_MODULE*) item )->m_Text );
item = item->Next(); item = item->Next();
} }
...@@ -789,7 +789,7 @@ void WinEDA_ModulePropertiesFrame::EditOrDelTextModule( wxCommandEvent& event ) ...@@ -789,7 +789,7 @@ void WinEDA_ModulePropertiesFrame::EditOrDelTextModule( wxCommandEvent& event )
int jj = 2; int jj = 2;
while( item ) while( item )
{ {
if( item->Type() == TYPETEXTEMODULE ) if( item->Type() == TYPE_TEXTE_MODULE )
{ {
if( jj == TextType ) // Texte trouv if( jj == TextType ) // Texte trouv
{ {
......
...@@ -445,8 +445,8 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions( wxCommandEvent& event ) ...@@ -445,8 +445,8 @@ void WinEDA_PcbTracksDialog::AcceptPcbOptions( wxCommandEvent& event )
m_Parent->DisplayTrackSettings(); m_Parent->DisplayTrackSettings();
m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPEVIA ); m_Parent->AddHistory( g_DesignSettings.m_CurrentViaSize, TYPE_VIA );
m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPETRACK ); m_Parent->AddHistory( g_DesignSettings.m_CurrentTrackWidth, TYPE_TRACK );
EndModal( 1 ); EndModal( 1 );
} }
...@@ -462,7 +462,7 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type ) ...@@ -462,7 +462,7 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
switch( type ) switch( type )
{ {
case TYPETRACK: case TYPE_TRACK:
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_TrackWidthHistory[ii] == value ) if( g_DesignSettings.m_TrackWidthHistory[ii] == value )
...@@ -498,7 +498,7 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type ) ...@@ -498,7 +498,7 @@ void WinEDA_BasePcbFrame::AddHistory( int value, KICAD_T type )
break; break;
case TYPEVIA: case TYPE_VIA:
for( ii = 0; ii < HISTORY_NUMBER; ii++ ) for( ii = 0; ii < HISTORY_NUMBER; ii++ )
{ {
if( g_DesignSettings.m_ViaSizeHistory[ii] == value ) if( g_DesignSettings.m_ViaSizeHistory[ii] == value )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -38,12 +38,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC ) ...@@ -38,12 +38,8 @@ TEXTE_MODULE* WinEDA_BasePcbFrame::CreateTextModule( MODULE* Module, wxDC* DC )
Text = new TEXTE_MODULE( Module ); Text = new TEXTE_MODULE( Module );
/* Chainage de la nouvelle structure en tete de liste drawings */ /* Chainage de la nouvelle structure en tete de liste drawings */
Text->SetNext( Module->m_Drawings ); Module->m_Drawings.PushFront( Text );
Text->SetBack( Module );
if( Module->m_Drawings )
Module->m_Drawings->SetBack( Text );
Module->m_Drawings = Text;
Text->m_Flags = IS_NEW; Text->m_Flags = IS_NEW;
Text->m_Text = wxT( "text" ); Text->m_Text = wxT( "text" );
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment