diff --git a/common/gal/color4d.cpp b/common/gal/color4d.cpp index 823232bd50..bc71f45bcb 100644 --- a/common/gal/color4d.cpp +++ b/common/gal/color4d.cpp @@ -110,37 +110,6 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor ) } - COLOR4D& COLOR4D::SetToLegacyHighlightColor() - { - EDA_COLOR_T legacyColor = GetNearestLegacyColor( *this ); - EDA_COLOR_T highlightColor = g_ColorRefs[legacyColor].m_LightColor; - - // The alpha channel is not modified. Only R, G, B values are set, - // because legacy color does not know the alpha chanel. - - r = g_ColorRefs[highlightColor].m_Red / 255.0; - g = g_ColorRefs[highlightColor].m_Green / 255.0; - b = g_ColorRefs[highlightColor].m_Blue / 255.0; - - return *this; - } - - - COLOR4D& COLOR4D::SetToNearestLegacyColor() - { - EDA_COLOR_T legacyColor = GetNearestLegacyColor( *this ); - - // The alpha channel is not modified. Only R, G, B values are set, - // because legacy color does not know the alpha chanel. - - r = g_ColorRefs[legacyColor].m_Red / 255.0; - g = g_ColorRefs[legacyColor].m_Green / 255.0; - b = g_ColorRefs[legacyColor].m_Blue / 255.0; - - return *this; - } - - unsigned int COLOR4D::ToU32() const { return ToColour().GetRGB(); @@ -157,109 +126,6 @@ COLOR4D::COLOR4D( EDA_COLOR_T aColor ) a = c.Alpha() / 255.0; } - - EDA_COLOR_T COLOR4D::GetNearestLegacyColor( const COLOR4D &aColor ) - { - // Cache layer implemented here, because all callers are using wxColour - static std::map< unsigned int, unsigned int > nearestCache; - static double hues[NBCOLORS]; - static double values[NBCOLORS]; - - unsigned int colorInt = aColor.ToU32(); - - auto search = nearestCache.find( colorInt ); - - if( search != nearestCache.end() ) - return static_cast<EDA_COLOR_T>( search->second ); - - // First use ColorFindNearest to check for exact matches - EDA_COLOR_T nearest = ColorFindNearest( aColor.r * 255.0, aColor.g * 255.0, aColor.b * 255.0 ); - - if( COLOR4D( nearest ) == aColor ) - { - nearestCache.insert( std::pair< unsigned int, unsigned int >( - colorInt, static_cast<unsigned int>( nearest ) ) ); - return nearest; - } - - // If not, use hue and value to match. - // Hue will be NAN for grayscale colors. - // The legacy color palette is a grid across hue and value. - // We can exploit that to find a good match -- hue is most apparent to the user. - // So, first we determine the closest hue match, and then the closest value from that - // "grid row" in the legacy palette. - - double h, s, v; - aColor.ToHSV( h, s, v ); - - double minDist = 360.0; - double legacyHue = 0.0; - - if( std::isnan( h ) ) - { - legacyHue = NAN; - } - else - { - for( EDA_COLOR_T candidate = ::BLACK; - candidate < NBCOLORS; candidate = NextColor( candidate ) ) - { - double ch; - - if( hues[candidate] == 0.0 && values[candidate] == 0.0 ) - { - COLOR4D candidate4d( candidate ); - double cs, cv; - - candidate4d.ToHSV( ch, cs, cv ); - - values[candidate] = cv; - // Set the hue to non-zero for black so that we won't do this more than once - hues[candidate] = ( cv == 0.0 ) ? 1.0 : ch; - } - else - { - ch = hues[candidate]; - } - - if( fabs( ch - h ) < minDist ) - { - minDist = fabs( ch - h ); - legacyHue = ch; - } - } - } - - // Now we have the desired hue; let's find the nearest value - minDist = 1.0; - for( EDA_COLOR_T candidate = ::BLACK; - candidate < NBCOLORS; candidate = NextColor( candidate ) ) - { - // If the target hue is NAN, we didn't extract the value for any colors above - if( std::isnan( legacyHue ) ) - { - double ch, cs, cv; - COLOR4D candidate4d( candidate ); - candidate4d.ToHSV( ch, cs, cv ); - values[candidate] = cv; - hues[candidate] = ( cv == 0.0 ) ? 1.0 : ch; - } - - if( ( std::isnan( legacyHue ) != std::isnan( hues[candidate] ) ) || hues[candidate] != legacyHue ) - continue; - - if( fabs( values[candidate] - v ) < minDist ) - { - minDist = fabs( values[candidate] - v ); - nearest = candidate; - } - } - - nearestCache.insert( std::pair< unsigned int, unsigned int >( - colorInt, static_cast<unsigned int>( nearest ) ) ); - - return nearest; - } #endif namespace KIGFX { diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index 65aeee9262..bf76000a54 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -46,7 +46,6 @@ #include <ws_draw_item.h> #include <page_info.h> #include <title_block.h> -#include <advanced_config.h> /** * Definition for enabling and disabling scroll bar setting trace output. See the @@ -641,10 +640,9 @@ EDA_DRAW_PANEL_GAL::GAL_TYPE EDA_DRAW_FRAME::LoadCanvasTypeSetting() canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE; } - // Coerce the value into a GAL type when Legacy is not available - // Default to Cairo, and on the first, user will be prompted for OpenGL - if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE - && !ADVANCED_CFG::GetCfg().AllowLegacyCanvas() ) + // Legacy canvas no longer supported. Switch to Cairo, and on the first instantiation + // the user will be prompted to switch to OpenGL + if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) { #ifdef __WXMAC__ // Cairo renderer doesn't handle Retina displays diff --git a/common/widgets/gal_options_panel.cpp b/common/widgets/gal_options_panel.cpp index 0269328b05..485882f607 100644 --- a/common/widgets/gal_options_panel.cpp +++ b/common/widgets/gal_options_panel.cpp @@ -66,16 +66,13 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI wxBoxSizer* sLeftSizer = new wxBoxSizer( wxVERTICAL ); m_mainSizer->Add( sLeftSizer, 1, wxALL | wxEXPAND, 0 ); - // @todo LEGACY: not required when legacy is gone - const wxString galOnlySuffix = _( " (not supported in Legacy Toolset)" ); - /* * Grid settings subpanel */ { + wxStaticBox* sGridOpts = new wxStaticBox( this, wxID_ANY, _( "Grid Options" ) ); wxStaticBoxSizer* sGridSettings; - sGridSettings = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, _( "Grid Options" ) + galOnlySuffix ), wxVERTICAL ); + sGridSettings = new wxStaticBoxSizer( sGridOpts, wxVERTICAL ); wxString m_gridStyleChoices[] = { _( "Dots" ), @@ -136,16 +133,8 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI * Cursor settings subpanel */ { - wxString cursorDisplayTitle = _( "Cursor Options" ); - - // cursor is not shown in legacy on OSX - // @todo LEGACY remove this -#ifdef __APPLE__ - cursorDisplayTitle += galOnlySuffix; -#endif - auto sCursorSettings = new wxStaticBoxSizer( new wxStaticBox( this, - wxID_ANY, cursorDisplayTitle ), wxVERTICAL ); + wxID_ANY, _( "Cursor Options" ) ), wxVERTICAL ); sLeftSizer->Add( sCursorSettings, 1, wxTOP | wxRIGHT | wxEXPAND, 5 ); @@ -162,19 +151,9 @@ GAL_OPTIONS_PANEL::GAL_OPTIONS_PANEL( wxWindow* aParent, KIGFX::GAL_DISPLAY_OPTI m_cursorShape->SetSelection( 0 ); m_cursorShape->SetToolTip( _( "Cursor shape for drawing, placement and movement tools" ) ); - sCursorSettings->Add( m_cursorShape, 0, wxALL | wxEXPAND, 5 ); -#ifdef __APPLE__ - // Whole section is galOnly on OSX; no need for further qualifier here m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, _( "Always show crosshairs" ) ); -#else - // User a shorter galOnly qualifier as otherwise the label is obnoxiously long - // @todo LEGACY remove this - m_forceCursorDisplay = new wxCheckBox( this, wxID_ANY, - _( "Always show crosshairs (not in Legacy)" ) ); -#endif - sCursorSettings->Add( m_forceCursorDisplay, 0, wxALL | wxEXPAND, 5 ); } } diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 16050cc643..7095a53a0e 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1123,8 +1123,6 @@ void GERBVIEW_FRAME::ActivateGalCanvas() m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); } - m_colorsSettings->SetLegacyMode( false ); - galCanvas->GetGAL()->SetGridColor( GetLayerColor( LAYER_GERBVIEW_GRID ) ); SetPageSettings( GetPageSettings() ); diff --git a/gerbview/hotkeys.cpp b/gerbview/hotkeys.cpp index d1f12dd6c4..90bcb8abfd 100644 --- a/gerbview/hotkeys.cpp +++ b/gerbview/hotkeys.cpp @@ -83,12 +83,6 @@ static EDA_HOTKEY HkSwitch2NextCopperLayer( _HKI( "Switch to Next Layer" ), static EDA_HOTKEY HkSwitch2PreviousCopperLayer( _HKI( "Switch to Previous Layer" ), HK_SWITCH_LAYER_TO_PREVIOUS, '-' ); -static EDA_HOTKEY HkCanvasDefault( _HKI( "Switch to Legacy Toolset" ), - HK_CANVAS_LEGACY, -#ifdef __WXMAC__ - GR_KB_ALT + -#endif - WXK_F9 ); static EDA_HOTKEY HkCanvasOpenGL( _HKI( "Switch to Modern Toolset with hardware-accelerated graphics (recommended)" ), HK_CANVAS_OPENGL, #ifdef __WXMAC__ @@ -115,7 +109,6 @@ EDA_HOTKEY* gerbviewHotkeyList[] = { &HkSwitchHighContrastMode, &HkSwitch2NextCopperLayer, &HkSwitch2PreviousCopperLayer, - &HkCanvasDefault, &HkCanvasOpenGL, &HkCanvasCairo, &HkMeasureTool, diff --git a/include/gal/color4d.h b/include/gal/color4d.h index cdbf88d542..94eed1730e 100644 --- a/include/gal/color4d.h +++ b/include/gal/color4d.h @@ -103,25 +103,6 @@ public: */ COLOR4D LegacyMix( COLOR4D aColor ) const; - /** - * Function SetToLegacyHighlightColor() - * Sets the color to the "light" version of the nearest matching - * legacy color (see g_ColorRefs in colors.cpp). - */ - COLOR4D& SetToLegacyHighlightColor(); - - /** - * Function SetToNearestLegacyColor() - * Sets the color to the nearest matching - * legacy color (see g_ColorRefs in colors.cpp). - */ - COLOR4D& SetToNearestLegacyColor(); - - COLOR4D AsLegacyColor() const - { - return COLOR4D( COLOR4D::GetNearestLegacyColor( *this ) ); - } - /** * Packs the color into an unsigned int for compatibility with legacy canvas. * Note that this is a lossy downsampling and also that the alpha channel is lost. @@ -132,11 +113,6 @@ public: * Unpacks from a unsigned int in the legacy EDA_COLOR_T format. */ void FromU32( unsigned int aPackedColor ); - - /** - * Determines the "nearest" EDA_COLOR_T according to ColorFindNearest - */ - static EDA_COLOR_T GetNearestLegacyColor( const COLOR4D &aColor ); #endif /* WX_COMPATIBLITY */ diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 6f84f2f85b..afbdd212e5 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -355,15 +355,6 @@ public: */ void Compile_Ratsnest( bool aDisplayStatus ); - /** - * function Displays the general ratsnest - * Only ratsnest with the status bit CH_VISIBLE is set are displayed - * @param aDC = the current device context (can be NULL) - * @param aNetcode if > 0, Display only the ratsnest relative to the - * corresponding net_code - */ - void DrawGeneralRatsnest( wxDC* aDC, int aNetcode = 0 ); - /* Functions relative to Undo/redo commands: */ /** diff --git a/include/widgets/color_swatch.h b/include/widgets/color_swatch.h index c2a233635c..b356d642b1 100644 --- a/include/widgets/color_swatch.h +++ b/include/widgets/color_swatch.h @@ -45,8 +45,6 @@ public: * @param aParent parent window * @param aColor initial swatch color * @param aID id to use when sending swatch events - * @param aArbitraryColors true to allow selection of any 32 bits color for GAL canvas, - * and false to allow a selection from a set of colors accepted by the legacy canvas. */ COLOR_SWATCH( wxWindow* aParent, KIGFX::COLOR4D aColor, int aID, KIGFX::COLOR4D aBackground ); diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 147dd81e01..15db206493 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -172,8 +172,6 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a module->Delete( boardItem ); } - board->m_Status_Pcb = 0; // it is done in the legacy view (ratsnest perhaps?) - break; // Board items @@ -207,9 +205,6 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a if( !( changeFlags & CHT_DONE ) ) board->Remove( module ); // handles connectivity - - // Clear flags to indicate, that the ratsnest, list of nets & pads are not valid anymore - board->m_Status_Pcb = 0; } break; diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 1b753ff920..57f4ebd7ff 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -115,7 +115,6 @@ BOARD::BOARD() : m_fileFormatVersionAtLoad = LEGACY_BOARD_FILE_VERSION; m_colorsSettings = &dummyColorsSettings; - m_Status_Pcb = 0; // Status word: bit 1 = calculate. m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the // zone contour currently in progress @@ -836,8 +835,6 @@ void BOARD::SetElementVisibility( GAL_LAYER_ID aLayer, bool isEnabled ) zone->SetLocalRatsnestVisible( isEnabled ); } - m_Status_Pcb = 0; - break; } @@ -909,9 +906,6 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, ADD_MODE aMode ) else m_Modules.PushFront( (MODULE*) aBoardItem ); - // Because the list of pads has changed, reset the status - // This indicate the list of pad and nets must be recalculated before use - m_Status_Pcb = 0; break; case PCB_DIMENSION_T: diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 985bc8cf12..0ab16bfbf2 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -236,10 +236,6 @@ public: const wxString &GetFileName() const { return m_fileName; } - /// Flags used in ratsnest calculation and update. - int m_Status_Pcb; - - private: DLIST<BOARD_ITEM> m_Drawings; // linked list of lines & texts diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 7567194e5e..29305f6f7b 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -250,7 +250,6 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event ) // run all the tests, with no UI at this time. m_Messages->Clear(); wxSafeYield(); // Allows time slice to refresh the Messages - m_brdEditor->GetBoard()->m_Status_Pcb = 0; // Force full connectivity and ratsnest calculations m_tester->RunTests(m_Messages); m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab diff --git a/pcbnew/dialogs/dialog_exchange_footprints.cpp b/pcbnew/dialogs/dialog_exchange_footprints.cpp index 441e081f76..0038c5eb2f 100644 --- a/pcbnew/dialogs/dialog_exchange_footprints.cpp +++ b/pcbnew/dialogs/dialog_exchange_footprints.cpp @@ -449,8 +449,6 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aSrc, MODULE* aDest, BOARD_COMMIT& aCommit.Remove( aSrc ); aCommit.Add( aDest ); - // @todo LEGACY should be unnecessary - GetBoard()->m_Status_Pcb = 0; aDest->ClearFlags(); } diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 5bd23e4b5e..2ea6217216 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -1572,9 +1572,6 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow() commit.Push( _( "Modify pad" ) ); - if( rastnestIsChanged ) // The net ratsnest must be recalculated - m_board->m_Status_Pcb = 0; - return true; } diff --git a/pcbnew/dialogs/panel_pcbnew_settings.cpp b/pcbnew/dialogs/panel_pcbnew_settings.cpp index 64cc2fe9ac..fa8ad509a9 100644 --- a/pcbnew/dialogs/panel_pcbnew_settings.cpp +++ b/pcbnew/dialogs/panel_pcbnew_settings.cpp @@ -49,6 +49,7 @@ bool PANEL_PCBNEW_SETTINGS::TransferDataToWindow() rotationAngle = AngleToStringDegrees( (double)m_Frame->GetRotationAngle() ); m_RotationAngle->SetValue( rotationAngle ); + // JEY TODO: clean out legacy-routing settings m_TrackAutodel->SetValue( m_Frame->Settings().m_legacyAutoDeleteOldTrack ); m_Track_45_Only_Ctrl->SetValue( m_Frame->Settings().m_legacyUse45DegreeTracks ); m_Segments_45_Only_Ctrl->SetValue( m_Frame->Settings().m_use45DegreeGraphicSegments ); diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index d1f3085572..e89465fa80 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -105,6 +105,7 @@ void DRC::addMarkerToPcb( MARKER_PCB* aMarker ) { // In legacy routing mode, do not add markers to the board. // only shows the drc error message + // JEY TODO: clear out the legacyRoutingMode stuff... if( m_drcInLegacyRoutingMode ) { m_pcbEditorFrame->SetMsgPanel( aMarker ); diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 34cb5d6f84..42b2a8d1cf 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -188,12 +188,6 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ArchiveModulesOnBoard( true ); break; - case ID_GEN_IMPORT_GRAPHICS_FILE: - InvokeDialogImportGfxBoard( this ); - GetGalCanvas()->Refresh(); - break; - - default: wxLogDebug( wxT( "PCB_EDIT_FRAME::Process_Special_Functions() unknown event id %d" ), id ); break; diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 3dda17735c..f95ee2e0d8 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -580,9 +580,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in if( !converted ) UpdateFileHistory( GetBoard()->GetFileName() ); - // Rebuild the new pad list (for drc and ratsnet control ...) - GetBoard()->m_Status_Pcb = 0; - // Select netclass Default as current netclass (it always exists) SetCurrentNetClass( NETCLASS::Default ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index e562c93dea..f50b88521a 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -104,7 +104,6 @@ BEGIN_EVENT_TABLE( FOOTPRINT_EDIT_FRAME, PCB_BASE_FRAME ) EVT_TOOL( ID_MODEDIT_CREATE_NEW_LIB, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_ADD_LIBRARY, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_SHEET_SET, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) - EVT_TOOL( ID_GEN_IMPORT_GRAPHICS_FILE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( wxID_PRINT, FOOTPRINT_EDIT_FRAME::ToPrinter ) EVT_TOOL( ID_MODEDIT_EDIT_MODULE, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_CHECK, FOOTPRINT_EDIT_FRAME::Process_Special_Functions ) diff --git a/pcbnew/footprint_editor_utils.cpp b/pcbnew/footprint_editor_utils.cpp index f0a77be1e3..cfa8812d23 100644 --- a/pcbnew/footprint_editor_utils.cpp +++ b/pcbnew/footprint_editor_utils.cpp @@ -460,14 +460,6 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) } break; - case ID_GEN_IMPORT_GRAPHICS_FILE: - if( GetBoard()->m_Modules ) - { - InvokeDialogImportGfxModule( this, GetBoard()->m_Modules ); - GetGalCanvas()->Refresh(); - } - break; - default: wxLogDebug( wxT( "FOOTPRINT_EDIT_FRAME::Process_Special_Functions error" ) ); break; diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index e291a78b33..95471841cc 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -329,7 +329,6 @@ MODULE* FOOTPRINT_EDIT_FRAME::Import_Module( const wxString& aName ) module->SetPosition( wxPoint( 0, 0 ) ); - GetBoard()->m_Status_Pcb = 0; GetBoard()->BuildListOfNets(); updateView(); @@ -858,8 +857,6 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew ) } newmodule->ClearFlags(); - // @todo LEGACY should be unnecessary - mainpcb->m_Status_Pcb = 0; return true; } diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 26a4e60759..c1f05914c7 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -187,12 +187,6 @@ static EDA_HOTKEY HkDecreaseLineWidth( _HKI( "Decrease Line Width" ), HK_DEC_LIN static EDA_HOTKEY HkSetGridOrigin( _HKI( "Set Grid Origin" ), HK_SET_GRID_ORIGIN, 'S' ); static EDA_HOTKEY HkResetGridOrigin( _HKI( "Reset Grid Origin" ), HK_RESET_GRID_ORIGIN, 'Z' ); -static EDA_HOTKEY HkCanvasDefault( _HKI( "Switch to Legacy Toolset (not all features will be available" ), - HK_CANVAS_LEGACY, -#ifdef __WXMAC__ - GR_KB_ALT + -#endif - WXK_F9 ); static EDA_HOTKEY HkCanvasOpenGL( _HKI( "Switch to Modern Toolset with hardware-accelerated graphics (recommended)" ), HK_CANVAS_OPENGL, #ifdef __WXMAC__ @@ -477,7 +471,6 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = // Display &HkSwitchHighContrastMode, - &HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, NULL @@ -514,7 +507,6 @@ EDA_HOTKEY* module_edit_Hotkey_List[] = { // Display &HkSwitchHighContrastMode, - &HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, NULL diff --git a/pcbnew/import_gfx/dialog_import_gfx.cpp b/pcbnew/import_gfx/dialog_import_gfx.cpp index 8e38933970..5c950efdd5 100644 --- a/pcbnew/import_gfx/dialog_import_gfx.cpp +++ b/pcbnew/import_gfx/dialog_import_gfx.cpp @@ -379,17 +379,3 @@ void DIALOG_IMPORT_GFX::updatePcbImportOffsets_mm() } -// Used only in legacy canvas by the board editor. -bool InvokeDialogImportGfxBoard( PCB_BASE_FRAME* aCaller ) -{ - // Legacy R.I.P. - return true; -} - - -// Used only in legacy canvas by the footprint editor. -bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ) -{ - // Legacy R.I.P. - return true; -} diff --git a/pcbnew/invoke_pcb_dialog.h b/pcbnew/invoke_pcb_dialog.h index 27457ef232..1ceb6cbd36 100644 --- a/pcbnew/invoke_pcb_dialog.h +++ b/pcbnew/invoke_pcb_dialog.h @@ -95,23 +95,6 @@ void Invoke3DShapeLibsDownloaderWizard( wxWindow* aCaller ); void InvokePluginOptionsEditor( wxWindow* aCaller, const wxString& aNickname, const wxString& aPluginType, const wxString& aOptions, wxString* aResult ); -/** - * Shows the modal DIALOG_IMPORT_GFX for importing a DXF file to a board. - - * @param aCaller is the wxTopLevelWindow which is invoking the dialog. - * @return true if the import was made. - */ -bool InvokeDialogImportGfxBoard( PCB_BASE_FRAME* aCaller ); - -/** - * shows the modal DIALOG_IMPORT_GFX for importing a DXF file as footprint outlines. - * - * @param aCaller is the wxTopLevelWindow which is invoking the dialog. - * @param aModule is the footprint currently edited. - * @return true if the import was made. - */ -bool InvokeDialogImportGfxModule( PCB_BASE_FRAME* aCaller, MODULE* aModule ); - /** * Function InvokeExportSVG * shows the Export SVG dialog diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 7fa760345e..7bf4f40203 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -110,7 +110,6 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) if( !Clear_Pcb( true ) ) return false; - GetBoard()->m_Status_Pcb = 0; newModule = new MODULE( *aModule ); newModule->SetParent( GetBoard() ); newModule->SetLink( aModule->GetTimeStamp() ); diff --git a/pcbnew/microwave.cpp b/pcbnew/microwave.cpp index 727e7b8574..0dcbd23f93 100644 --- a/pcbnew/microwave.cpp +++ b/pcbnew/microwave.cpp @@ -236,7 +236,6 @@ MODULE* PCB_EDIT_FRAME::Create_MuWaveComponent( int shape_type ) } module->CalculateBoundingBox(); - GetBoard()->m_Status_Pcb = 0; OnModify(); return module; } @@ -538,7 +537,6 @@ MODULE* PCB_EDIT_FRAME::Create_MuWavePolygonShape() edge->SetWidth( 0 ); PolyEdges.clear(); module->CalculateBoundingBox(); - GetBoard()->m_Status_Pcb = 0; OnModify(); return module; } diff --git a/pcbnew/netinfo.h b/pcbnew/netinfo.h index 171f56ed71..00bc0329d9 100644 --- a/pcbnew/netinfo.h +++ b/pcbnew/netinfo.h @@ -558,7 +558,6 @@ private: * Function buildPadsFullList * creates the pad list, and initializes: * m_Pads (list of pads) - * set m_Status_Pcb = LISTE_PAD_OK; * and clear for all pads in list the m_SubRatsnest member; * clear m_Pcb->m_FullRatsnest */ @@ -587,13 +586,6 @@ private: #define START_ON_TRACK 0x40 #define END_ON_TRACK 0x80 -/* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */ -enum StatusPcbFlags { - - RATSNEST_ITEM_LOCAL_OK = 4, /* current MODULE ratsnest is Ok */ - DO_NOT_SHOW_GENERAL_RASTNEST = 0x20 /* Do not display the general - * ratsnest (used in module moves) */ -}; #endif // CLASS_NETINFO_ diff --git a/pcbnew/netinfo_list.cpp b/pcbnew/netinfo_list.cpp index e21d242434..6552b11397 100644 --- a/pcbnew/netinfo_list.cpp +++ b/pcbnew/netinfo_list.cpp @@ -140,8 +140,6 @@ void NETINFO_LIST::AppendNet( NETINFO_ITEM* aNewElement ) * Compute and update the net_codes for PADS et and equipots (.m_NetCode member) * net_codes are >= 1 (net_code = 0 means not connected) * Update the net buffer - * Must be called after editing pads (netname, or deleting) or after read a netlist - * set to 1 flag NET_CODE_OK of m_Pcb->m_Status_Pcb; * m_Pcb->m_NbNodes and m_Pcb->m_NbNets are updated * Be aware NETINFO_ITEM* BOARD::FindNet( const wxString& aNetname ) * when search a net by its net name does a binary search diff --git a/pcbnew/pad_edit_functions.cpp b/pcbnew/pad_edit_functions.cpp index a5af6f6d17..5f4d3e1201 100644 --- a/pcbnew/pad_edit_functions.cpp +++ b/pcbnew/pad_edit_functions.cpp @@ -109,7 +109,6 @@ static wxString GetNextPadName( wxString aPadName ) */ void PCB_BASE_FRAME::AddPad( MODULE* aModule, bool draw ) { - m_Pcb->m_Status_Pcb = 0; aModule->SetLastEditTime(); D_PAD* pad = new D_PAD( aModule ); @@ -168,8 +167,6 @@ void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery ) return; } - m_Pcb->m_Status_Pcb = 0; - GetBoard()->PadDelete( aPad ); // Update the bounding box diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index fb0121f8cd..b19216a709 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -209,7 +209,6 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module ) module->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment module->SetTimeStamp( GetNewTimeStamp() ); - GetBoard()->m_Status_Pcb = 0; // Put it on FRONT layer, // (Can be stored flipped if the lib is an archive built from a board) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index f65fb491d6..0bd037fb9b 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -146,7 +146,6 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME ) EVT_MENU( ID_GEN_IMPORT_SPECCTRA_SESSION,PCB_EDIT_FRAME::ImportSpecctraSession ) EVT_MENU( ID_GEN_IMPORT_SPECCTRA_DESIGN, PCB_EDIT_FRAME::ImportSpecctraDesign ) - EVT_MENU( ID_GEN_IMPORT_GRAPHICS_FILE, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions ) EVT_MENU( ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, PCB_EDIT_FRAME::Process_Special_Functions ) @@ -611,7 +610,6 @@ void PCB_EDIT_FRAME::ActivateGalCanvas() PCB_BASE_EDIT_FRAME::ActivateGalCanvas(); COLORS_DESIGN_SETTINGS& cds = Settings().Colors(); - cds.SetLegacyMode( false ); GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) ); auto view = GetGalCanvas()->GetView(); view->GetPainter()->GetSettings()->ImportLegacyColors( &cds ); diff --git a/pcbnew/ratsnest.cpp b/pcbnew/ratsnest.cpp index 1420f1ed29..1204b211c2 100644 --- a/pcbnew/ratsnest.cpp +++ b/pcbnew/ratsnest.cpp @@ -44,7 +44,6 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus ) { GetBoard()->GetConnectivity()->RecalculateRatsnest(); - GetBoard()->m_Status_Pcb = 0; // we want a full ratsnest computation, from the scratch ClearMsgPanel(); @@ -64,77 +63,3 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus ) } -/** - * function DrawGeneralRatsnest - * Only ratsnest items with the status bit CH_VISIBLE set are displayed - * @param aDC = the current device context (can be NULL) - * @param aNetcode: if > 0, Display only the ratsnest relative to the - * corresponding net_code - */ -void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode ) -{ - // JEY TODO: probalby obsolete (we don't really have DCs anymore) - if( ( m_Pcb->m_Status_Pcb & DO_NOT_SHOW_GENERAL_RASTNEST ) ) - { - return; - } - - if( aDC == NULL ) - return; - - auto connectivity = m_Pcb->GetConnectivity(); - - std::unique_lock<std::mutex> lock( connectivity->GetLock(), std::try_to_lock ); - - if( !lock ) - return; - - COLOR4D color = Settings().Colors().GetItemColor( LAYER_RATSNEST ); - - auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions(); - - const bool curved_ratsnest = displ_opts->m_DisplayRatsnestLinesCurved; - - for( int i = 1 /* skip "No Net" at [0] */; i < connectivity->GetNetCount(); ++i ) - { - RN_NET* net = connectivity->GetRatsnestForNet( i ); - - if( !net ) - continue; - - if( ( aNetcode <= 0 ) || ( aNetcode == i ) ) - { - for( const auto& edge : net->GetEdges() ) - { - auto s = edge.GetSourcePos(); - auto d = edge.GetTargetPos(); - auto sn = edge.GetSourceNode(); - auto dn = edge.GetTargetNode(); - - if( !sn->Valid() || !dn->Valid() ) - continue; - - bool enable = !sn->GetNoLine() && !dn->GetNoLine(); - bool show = sn->Parent()->GetLocalRatsnestVisible() - || dn->Parent()->GetLocalRatsnestVisible(); - - if( enable && show ) - { - if (curved_ratsnest) - { - auto dx = d.x - s.x; - auto dy = d.y - s.y; - auto cx = s.x + 0.5 * dx + 1.2 * dy; - auto cy = s.y + 0.5 * dy - 1.2 * dx; - GRArc1( nullptr, aDC, s.x, s.y, d.x, d.y, cx, cy, 0, color); - } - else - { - GRLine( nullptr, aDC, s.x, s.y, d.x, d.y, 0, color ); - } - } - } - } - } -} - diff --git a/pcbnew/specctra_import_export/specctra_import.cpp b/pcbnew/specctra_import_export/specctra_import.cpp index 3d548c5167..d7b22593cf 100644 --- a/pcbnew/specctra_import_export/specctra_import.cpp +++ b/pcbnew/specctra_import_export/specctra_import.cpp @@ -120,7 +120,6 @@ bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName ) } OnModify(); - GetBoard()->m_Status_Pcb = 0; GetBoard()->GetConnectivity()->Clear(); GetBoard()->GetConnectivity()->Build( GetBoard() ); diff --git a/pcbnew/swig/pcbnew_action_plugins.cpp b/pcbnew/swig/pcbnew_action_plugins.cpp index 6522554d66..2a4ee7e3b1 100644 --- a/pcbnew/swig/pcbnew_action_plugins.cpp +++ b/pcbnew/swig/pcbnew_action_plugins.cpp @@ -258,8 +258,6 @@ void PCB_EDIT_FRAME::RunActionPlugin( ACTION_PLUGIN* aActionPlugin ) aActionPlugin->Run(); ACTION_PLUGINS::SetActionRunning( false ); - currentPcb->m_Status_Pcb = 0; - // Get back the undo buffer to fix some modifications PICKED_ITEMS_LIST* oldBuffer = NULL; diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index cad1f552f1..712dcfbaaa 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -769,8 +769,8 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) if( !m_frame->GetModel() ) return 0; - // Note: PlaceImportedGraphics() will convert PCB_LINE_T and PCB_TEXT_T to module graphic items - // if needed + // Note: PlaceImportedGraphics() will convert PCB_LINE_T and PCB_TEXT_T to module graphic + // items if needed DIALOG_IMPORT_GFX dlg( m_frame, m_editModules ); int dlgResult = dlg.ShowModal(); @@ -786,7 +786,6 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) return 0; } - m_frame->SetNoToolSelected(); // Add a VIEW_GROUP that serves as a preview for the new item diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 425e8fd7ab..a3c4e24857 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -641,8 +641,7 @@ int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) // Display properties dialog BOARD_ITEM* item = static_cast<BOARD_ITEM*>( selection.Front() ); - // Do not handle undo buffer, it is done by the properties dialogs @todo LEGACY - // Display properties dialog provided by the legacy canvas frame + // Do not handle undo buffer, it is done by the properties dialogs editFrame->OnEditItemRequest( item ); // Notify other tools of the changes