Clean up some dangling legacy odds and ends.
This commit is contained in:
parent
c71c1d4d1a
commit
7553cc2651
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
||||
|
|
|
@ -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: */
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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_
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue