diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index be4625c400..cb60db9c12 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -872,9 +872,9 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) case PCB_ZONE_T: if( aMode == ADD_APPEND ) - m_Zone.PushBack( (SEGZONE*) aBoardItem ); + m_SegZoneDeprecated.PushBack( (SEGZONE*) aBoardItem ); else - m_Zone.PushFront( (SEGZONE*) aBoardItem ); + m_SegZoneDeprecated.PushFront( (SEGZONE*) aBoardItem ); break; @@ -967,7 +967,7 @@ void BOARD::Remove( BOARD_ITEM* aBoardItem ) break; case PCB_ZONE_T: - m_Zone.Remove( (SEGZONE*) aBoardItem ); + m_SegZoneDeprecated.Remove( (SEGZONE*) aBoardItem ); break; case PCB_DIMENSION_T: @@ -1015,7 +1015,7 @@ int BOARD::GetNumSegmTrack() const int BOARD::GetNumSegmZone() const { - return m_Zone.GetCount(); + return m_SegZoneDeprecated.GetCount(); } @@ -1075,7 +1075,7 @@ EDA_RECT BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const } // Check segment zones - for( TRACK* track = m_Zone; track; track = track->Next() ) + for( TRACK* track = m_SegZoneDeprecated; track; track = track->Next() ) { if( !hasItems ) area = track->GetBoundingBox(); @@ -1303,7 +1303,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s break; case PCB_ZONE_T: - result = IterateForward( m_Zone, inspector, testData, p ); + result = IterateForward( m_SegZoneDeprecated, inspector, testData, p ); ++p; break; diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 81a048eef4..7a83b699db 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -238,13 +238,14 @@ public: private: - DLIST m_Drawings; // linked list of lines & texts + DLIST m_Drawings; // linked list of lines & texts public: - DLIST m_Modules; // linked list of MODULEs - DLIST m_Track; // linked list of TRACKs and VIAs - DLIST m_Zone; // linked list of SEGZONEs + DLIST m_Modules; // linked list of MODULEs + DLIST m_Track; // linked list of TRACKs and VIAs + DLIST m_SegZoneDeprecated; // linked list of SEGZONEs, for really very old boards + // should be removed one day DLIST_ITERATOR_WRAPPER Tracks() { return DLIST_ITERATOR_WRAPPER(m_Track); } DLIST_ITERATOR_WRAPPER Modules() { return DLIST_ITERATOR_WRAPPER(m_Modules); } @@ -268,7 +269,7 @@ public: bool IsEmpty() const { return m_Drawings.GetCount() == 0 && m_Modules.GetCount() == 0 && - m_Track.GetCount() == 0 && m_Zone.GetCount() == 0; + m_Track.GetCount() == 0 && m_SegZoneDeprecated.GetCount() == 0; } void Move( const wxPoint& aMoveVector ) override; diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index e4c7a9866d..ccb0ac4735 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -501,8 +501,8 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* aPcb ) // When reading from a file most of the items will already be in the correct order. // Searching from the back therefore takes us from n^2 to essentially 0. - if( Type() == PCB_ZONE_T ) - track = aPcb->m_Zone.GetLast(); + if( Type() == PCB_ZONE_T ) // Deprecated items, only found in very old boards + track = aPcb->m_SegZoneDeprecated.GetLast(); else track = aPcb->m_Track.GetLast(); @@ -512,8 +512,8 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* aPcb ) return track->Next(); } - if( Type() == PCB_ZONE_T ) - return aPcb->m_Zone.GetFirst(); + if( Type() == PCB_ZONE_T ) // Deprecated + return aPcb->m_SegZoneDeprecated.GetFirst(); else return aPcb->m_Track.GetFirst(); } diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index ba238b8157..6b4c8ab6ad 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -662,7 +662,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) break; case ID_POPUP_PCB_REMOVE_FILLED_AREAS_IN_ALL_ZONES: // Remove all zones : - GetBoard()->m_Zone.DeleteAll(); // remove zone segments used to fill zones. + GetBoard()->m_SegZoneDeprecated.DeleteAll(); // remove deprecated zone segments used + // to fill zones in very old boards. for( int ii = 0; ii < GetBoard()->GetAreaCount(); ii++ ) { diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 0db934cc1d..9010ca76c8 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -1064,12 +1064,6 @@ static void CreateRoutesSection( FILE* aFile, BOARD* aPcb ) for( track = aPcb->m_Track; track; track = track->Next() ) nbitems++; - for( track = aPcb->m_Zone; track; track = track->Next() ) - { - if( track->Type() == PCB_ZONE_T ) - nbitems++; - } - tracklist = (TRACK**) operator new( (nbitems + 1)* sizeof( TRACK* ) ); nbitems = 0; @@ -1077,12 +1071,6 @@ static void CreateRoutesSection( FILE* aFile, BOARD* aPcb ) for( track = aPcb->m_Track; track; track = track->Next() ) tracklist[nbitems++] = track; - for( track = aPcb->m_Zone; track; track = track->Next() ) - { - if( track->Type() == PCB_ZONE_T ) - tracklist[nbitems++] = track; - } - tracklist[nbitems] = NULL; qsort( tracklist, nbitems, sizeof(TRACK*), TrackListSortByNetcode ); @@ -1255,23 +1243,6 @@ static void CreateTracksInfoData( FILE* aFile, BOARD* aPcb ) } } - for( track = aPcb->m_Zone; track; track = track->Next() ) - { - if( last_width != track->GetWidth() ) // Find a thickness already used. - { - for( ii = 0; ii < trackinfo.size(); ii++ ) - { - if( trackinfo[ii] == track->GetWidth() ) - break; - } - - if( ii == trackinfo.size() ) // not found - trackinfo.push_back( track->GetWidth() ); - - last_width = track->GetWidth(); - } - } - // Write data fputs( "$TRACKS\n", aFile ); diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index 8ae93adb94..96e2c98762 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -227,8 +227,8 @@ void NETINFO_MAPPING::Update() } } - // Segzones - for( SEGZONE* zone = m_board->m_Zone; zone; zone = zone->Next() ) + // Segzones (should be removed: used only in very old boards) + for( SEGZONE* zone = m_board->m_SegZoneDeprecated; zone; zone = zone->Next() ) nets.insert( zone->GetNetCode() ); // Prepare the new mapping diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index d9e7900534..389fed9e76 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -160,8 +160,8 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( BOARD* aBoard ) for( MODULE* module = aBoard->m_Modules; module; module = module->Next() ) m_view->Add( module ); - // Segzones (equivalent of ZONE_CONTAINER for legacy boards) - for( SEGZONE* zone = aBoard->m_Zone; zone; zone = zone->Next() ) + // Segzones (deprecated, equivalent of ZONE_CONTAINERfilled areas for very old boards) + for( SEGZONE* zone = aBoard->m_SegZoneDeprecated; zone; zone = zone->Next() ) m_view->Add( zone ); // DRC markers diff --git a/pcbnew/pcb_legacy_draw_utils.cpp b/pcbnew/pcb_legacy_draw_utils.cpp index c7d67377e1..17826f269a 100644 --- a/pcbnew/pcb_legacy_draw_utils.cpp +++ b/pcbnew/pcb_legacy_draw_utils.cpp @@ -157,9 +157,9 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* DC, GR_DRAWMODE aDrawMode, const track->Draw( aPanel, DC, aDrawMode ); } - // SEGZONE is outdated, only her for compatibility with + // SEGZONE is deprecated, only for compatibility with // very old designs - for( SEGZONE* zone = m_Zone; zone; zone = zone->Next() ) + for( SEGZONE* zone = m_SegZoneDeprecated; zone; zone = zone->Next() ) { if( zone->IsMoving() ) continue; diff --git a/pcbnew/plot_board_layers.cpp b/pcbnew/plot_board_layers.cpp index 41041b8f97..8929b64ae3 100644 --- a/pcbnew/plot_board_layers.cpp +++ b/pcbnew/plot_board_layers.cpp @@ -139,9 +139,9 @@ void PlotSilkScreen( BOARD *aBoard, PLOTTER* aPlotter, LSET aLayerMask, aPlotter->EndBlock( NULL ); - // Plot segments used to fill zone areas (outdated, but here for old boards + // Plot segments used to fill zone areas (deprecated, but here for very old boards // compatibility): - for( SEGZONE* seg = aBoard->m_Zone; seg; seg = seg->Next() ) + for( SEGZONE* seg = aBoard->m_SegZoneDeprecated; seg; seg = seg->Next() ) { if( !aLayerMask[ seg->GetLayer() ] ) continue; @@ -545,8 +545,8 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, aPlotter->EndBlock( NULL ); - // Plot zones (outdated, for old boards compatibility): - for( TRACK* track = aBoard->m_Zone; track; track = track->Next() ) + // Plot zones (deprecated, for very old boards compatibility): + for( TRACK* track = aBoard->m_SegZoneDeprecated; track; track = track->Next() ) { if( !aLayerMask[track->GetLayer()] ) continue; diff --git a/pcbnew/print_board_functions.cpp b/pcbnew/print_board_functions.cpp index b44b396f05..8759797c1e 100644 --- a/pcbnew/print_board_functions.cpp +++ b/pcbnew/print_board_functions.cpp @@ -213,8 +213,8 @@ void PCB_EDIT_FRAME::PrintPage( wxDC* aDC, } } - // Outdated: only for compatibility to old boards - for( TRACK* track = Pcb->m_Zone; track; track = track->Next() ) + // Deprecated: only for compatibility with very old boards + for( TRACK* track = Pcb->m_SegZoneDeprecated; track; track = track->Next() ) { if( !( aPrintMask & track->GetLayerSet() ).any() ) continue; diff --git a/pcbnew/swap_layers.cpp b/pcbnew/swap_layers.cpp index be781bbb8b..1a7adbf428 100644 --- a/pcbnew/swap_layers.cpp +++ b/pcbnew/swap_layers.cpp @@ -406,8 +406,8 @@ void PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event ) } } - // Change zones. - for( TRACK* segm = GetBoard()->m_Zone; segm; segm = segm->Next() ) + // Change deprecated zones segments, only found in very old boards. + for( TRACK* segm = GetBoard()->m_SegZoneDeprecated; segm; segm = segm->Next() ) { OnModify(); int jj = segm->GetLayer(); diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index f5c4973b95..46f63f88dc 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -152,8 +152,8 @@ static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem ) for( int ii = 0; ii < aPcb->GetAreaCount(); ii++ ) itemsList.push_back( aPcb->GetArea( ii ) ); - // Append zones segm: - for( item = aPcb->m_Zone; item != NULL; item = item->Next() ) + // Append zones segm (deprecated items): + for( item = aPcb->m_SegZoneDeprecated; item != NULL; item = item->Next() ) itemsList.push_back( item ); NETINFO_LIST& netInfo = aPcb->GetNetInfo(); diff --git a/pcbnew/zone_filler.cpp b/pcbnew/zone_filler.cpp index d4aaaf64cb..e618852e3a 100644 --- a/pcbnew/zone_filler.cpp +++ b/pcbnew/zone_filler.cpp @@ -206,8 +206,8 @@ bool ZONE_FILLER::Fill( std::vector aZones, bool aCheck ) } } - // Remove segment zones - m_board->m_Zone.DeleteAll(); + // Remove deprecaded segment zones (only found in very old boards) + m_board->m_SegZoneDeprecated.DeleteAll(); if( m_progressReporter ) { diff --git a/pcbnew/zones_by_polygon_fill_functions.cpp b/pcbnew/zones_by_polygon_fill_functions.cpp index 3d69d0da35..4a472713f1 100644 --- a/pcbnew/zones_by_polygon_fill_functions.cpp +++ b/pcbnew/zones_by_polygon_fill_functions.cpp @@ -72,9 +72,10 @@ void PCB_EDIT_FRAME::Delete_OldZone_Fill( SEGZONE* aZone, timestamp_t aTimestamp else TimeStamp = aZone->GetTimeStamp(); // Save reference time stamp (aZone will be deleted) + // SEGZONE is a deprecated item, only used for compatibility with very old boards SEGZONE* next; - for( SEGZONE* zone = GetBoard()->m_Zone; zone != NULL; zone = next ) + for( SEGZONE* zone = GetBoard()->m_SegZoneDeprecated; zone != NULL; zone = next ) { next = zone->Next();