Cleanup. No changes to execution.
This commit is contained in:
parent
83e452390d
commit
6abe68fff0
|
@ -75,13 +75,10 @@ wxDECLARE_EVENT( BOARD_CHANGED, wxCommandEvent );
|
||||||
class PCB_BASE_FRAME : public EDA_DRAW_FRAME
|
class PCB_BASE_FRAME : public EDA_DRAW_FRAME
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
BOARD* m_Pcb;
|
BOARD* m_pcb;
|
||||||
|
PCB_DISPLAY_OPTIONS m_displayOptions;
|
||||||
PCB_DISPLAY_OPTIONS m_DisplayOptions;
|
PCB_ORIGIN_TRANSFORMS m_originTransforms;
|
||||||
|
PCBNEW_SETTINGS* m_settings; // No ownership, just a shortcut
|
||||||
PCB_ORIGIN_TRANSFORMS m_OriginTransforms;
|
|
||||||
|
|
||||||
PCBNEW_SETTINGS* m_Settings; // No ownership, just a shortcut
|
|
||||||
|
|
||||||
virtual void unitsChangeRefresh() override;
|
virtual void unitsChangeRefresh() override;
|
||||||
|
|
||||||
|
@ -155,7 +152,7 @@ public:
|
||||||
* Calling "GetBoardBoundingBox(true)" when edge cuts are turned off will return bbox of
|
* Calling "GetBoardBoundingBox(true)" when edge cuts are turned off will return bbox of
|
||||||
* entire page and border, so we make sure to do "GetBoardBoundingBox(false)" instead.
|
* entire page and border, so we make sure to do "GetBoardBoundingBox(false)" instead.
|
||||||
*/
|
*/
|
||||||
if( aIncludeAllVisible || ( !aIncludeAllVisible && !m_Pcb->IsLayerVisible( Edge_Cuts ) ) )
|
if( aIncludeAllVisible || ( !aIncludeAllVisible && !m_pcb->IsLayerVisible( Edge_Cuts ) ) )
|
||||||
return GetBoardBoundingBox( false );
|
return GetBoardBoundingBox( false );
|
||||||
else
|
else
|
||||||
return GetBoardBoundingBox( true );
|
return GetBoardBoundingBox( true );
|
||||||
|
@ -196,7 +193,7 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
PCBNEW_SETTINGS& Settings() { return *m_Settings; }
|
PCBNEW_SETTINGS& Settings() { return *m_settings; }
|
||||||
|
|
||||||
void SetDrawBgColor( COLOR4D aColor ) override;
|
void SetDrawBgColor( COLOR4D aColor ) override;
|
||||||
|
|
||||||
|
@ -205,7 +202,7 @@ public:
|
||||||
* Display options control the way tracks, vias, outlines and other things are shown
|
* Display options control the way tracks, vias, outlines and other things are shown
|
||||||
* (for instance solid or sketch mode)
|
* (for instance solid or sketch mode)
|
||||||
*/
|
*/
|
||||||
const PCB_DISPLAY_OPTIONS& GetDisplayOptions() const { return m_DisplayOptions; }
|
const PCB_DISPLAY_OPTIONS& GetDisplayOptions() const { return m_displayOptions; }
|
||||||
void SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions );
|
void SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions );
|
||||||
|
|
||||||
const ZONE_SETTINGS& GetZoneSettings() const;
|
const ZONE_SETTINGS& GetZoneSettings() const;
|
||||||
|
@ -229,8 +226,8 @@ public:
|
||||||
|
|
||||||
BOARD* GetBoard() const
|
BOARD* GetBoard() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
wxASSERT( m_pcb );
|
||||||
return m_Pcb;
|
return m_pcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -495,7 +495,7 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aExisting, MODULE* aNew, BOARD_COM
|
||||||
aNew->SetPosition( aExisting->GetPosition() );
|
aNew->SetPosition( aExisting->GetPosition() );
|
||||||
|
|
||||||
if( aNew->GetLayer() != aExisting->GetLayer() )
|
if( aNew->GetLayer() != aExisting->GetLayer() )
|
||||||
aNew->Flip( aNew->GetPosition(), m_Settings->m_FlipLeftRight );
|
aNew->Flip( aNew->GetPosition(), m_settings->m_FlipLeftRight );
|
||||||
|
|
||||||
if( aNew->GetOrientation() != aExisting->GetOrientation() )
|
if( aNew->GetOrientation() != aExisting->GetOrientation() )
|
||||||
aNew->SetOrientation( aExisting->GetOrientation() );
|
aNew->SetOrientation( aExisting->GetOrientation() );
|
||||||
|
|
|
@ -260,7 +260,7 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
|
||||||
GetBoard()->ComputeBoundingBox();
|
GetBoard()->ComputeBoundingBox();
|
||||||
|
|
||||||
// Save the auxiliary origin for the rest of the module
|
// Save the auxiliary origin for the rest of the module
|
||||||
wxPoint auxOrigin = m_Pcb->GetDesignSettings().m_AuxOrigin;
|
wxPoint auxOrigin = m_pcb->GetDesignSettings().m_AuxOrigin;
|
||||||
GencadOffsetX = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.x : 0;
|
GencadOffsetX = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.x : 0;
|
||||||
GencadOffsetY = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.y : 0;
|
GencadOffsetY = optionsDialog.GetOption( USE_AUX_ORIGIN ) ? auxOrigin.y : 0;
|
||||||
|
|
||||||
|
|
|
@ -135,7 +135,6 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
SetCanvas( drawPanel );
|
SetCanvas( drawPanel );
|
||||||
SetBoard( new BOARD() );
|
SetBoard( new BOARD() );
|
||||||
|
|
||||||
|
|
||||||
// In modedit, the default net clearance is not known (it depends on the actual board).
|
// In modedit, the default net clearance is not known (it depends on the actual board).
|
||||||
// So we do not show the default clearance, by setting it to 0.
|
// So we do not show the default clearance, by setting it to 0.
|
||||||
// The footprint or pad specific clearance will be shown.
|
// The footprint or pad specific clearance will be shown.
|
||||||
|
@ -201,23 +200,22 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
m_auimgr.SetFlags( wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE );
|
m_auimgr.SetFlags( wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE );
|
||||||
|
|
||||||
// Horizontal items; layers 4 - 6
|
// Horizontal items; layers 4 - 6
|
||||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
m_auimgr.AddPane( m_infoBar,
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
||||||
|
|
||||||
// Vertical items; layers 1 - 3
|
// Vertical items; layers 1 - 3
|
||||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer( 3 ) );
|
||||||
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(2)
|
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(2)
|
||||||
.Caption( _( "Libraries" ) ).MinSize( 250, 400 )
|
.Caption( _( "Libraries" ) ).MinSize( 250, 400 )
|
||||||
.BestSize( m_defaultLibWidth, -1 ) );
|
.BestSize( m_defaultLibWidth, -1 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_appearancePanel,
|
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
|
||||||
EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
|
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
||||||
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
|
||||||
m_auimgr.AddPane( m_selectionFilterPanel,
|
m_auimgr.AddPane( m_selectionFilterPanel,
|
||||||
EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 )
|
EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 )
|
||||||
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
|
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
|
||||||
|
@ -465,7 +463,7 @@ void FOOTPRINT_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
GetDesignSettings() = cfg->m_DesignSettings;
|
GetDesignSettings() = cfg->m_DesignSettings;
|
||||||
|
|
||||||
m_DisplayOptions = cfg->m_Display;
|
m_displayOptions = cfg->m_Display;
|
||||||
m_defaultLibWidth = cfg->m_LibWidth;
|
m_defaultLibWidth = cfg->m_LibWidth;
|
||||||
m_selectionFilterPanel->SetCheckboxesFromFilter( cfg->m_SelectionFilter );
|
m_selectionFilterPanel->SetCheckboxesFromFilter( cfg->m_SelectionFilter );
|
||||||
}
|
}
|
||||||
|
@ -479,7 +477,7 @@ void FOOTPRINT_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
PCB_BASE_FRAME::SaveSettings( cfg );
|
PCB_BASE_FRAME::SaveSettings( cfg );
|
||||||
|
|
||||||
cfg->m_DesignSettings = GetDesignSettings();
|
cfg->m_DesignSettings = GetDesignSettings();
|
||||||
cfg->m_Display = m_DisplayOptions;
|
cfg->m_Display = m_displayOptions;
|
||||||
cfg->m_LibWidth = m_treePane->GetSize().x;
|
cfg->m_LibWidth = m_treePane->GetSize().x;
|
||||||
cfg->m_SelectionFilter = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
|
cfg->m_SelectionFilter = GetToolManager()->GetTool<SELECTION_TOOL>()->GetFilter();
|
||||||
cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets();
|
cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets();
|
||||||
|
|
|
@ -232,7 +232,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
GetBoard()->Add( loadFootprint( id ) );
|
GetBoard()->Add( loadFootprint( id ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
drawPanel->DisplayBoard( m_Pcb );
|
drawPanel->DisplayBoard( m_pcb );
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ void FOOTPRINT_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
// Fetch display and grid settings from Footprint Editor
|
// Fetch display and grid settings from Footprint Editor
|
||||||
auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
auto fpedit = Pgm().GetSettingsManager().GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>();
|
||||||
m_DisplayOptions = fpedit->m_Display;
|
m_displayOptions = fpedit->m_Display;
|
||||||
GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window );
|
GetGalDisplayOptions().ReadWindowSettings( fpedit->m_Window );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -497,7 +497,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, bool aRecreateRatsnest )
|
||||||
s_ModuleInitialCopy = NULL;
|
s_ModuleInitialCopy = NULL;
|
||||||
|
|
||||||
if( aRecreateRatsnest )
|
if( aRecreateRatsnest )
|
||||||
m_Pcb->GetConnectivity()->Update( aModule );
|
m_pcb->GetConnectivity()->Update( aModule );
|
||||||
|
|
||||||
if( aRecreateRatsnest )
|
if( aRecreateRatsnest )
|
||||||
Compile_Ratsnest( true );
|
Compile_Ratsnest( true );
|
||||||
|
|
|
@ -160,9 +160,9 @@ void PCB_EDIT_FRAME::LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter )
|
||||||
// Check if component footprint is already on BOARD and only load the footprint from
|
// Check if component footprint is already on BOARD and only load the footprint from
|
||||||
// the library if it's needed. Nickname can be blank.
|
// the library if it's needed. Nickname can be blank.
|
||||||
if( aNetlist.IsFindByTimeStamp() )
|
if( aNetlist.IsFindByTimeStamp() )
|
||||||
fpOnBoard = m_Pcb->FindModuleByPath( aNetlist.GetComponent( ii )->GetPath() );
|
fpOnBoard = m_pcb->FindModuleByPath( aNetlist.GetComponent( ii )->GetPath() );
|
||||||
else
|
else
|
||||||
fpOnBoard = m_Pcb->FindModuleByReference( aNetlist.GetComponent( ii )->GetReference() );
|
fpOnBoard = m_pcb->FindModuleByReference( aNetlist.GetComponent( ii )->GetReference() );
|
||||||
|
|
||||||
bool footprintMisMatch = fpOnBoard && fpOnBoard->GetFPID() != component->GetFPID();
|
bool footprintMisMatch = fpOnBoard && fpOnBoard->GetFPID() != component->GetFPID();
|
||||||
|
|
||||||
|
|
|
@ -122,13 +122,13 @@ void PCB_BASE_EDIT_FRAME::ActivateGalCanvas()
|
||||||
{
|
{
|
||||||
PCB_BASE_FRAME::ActivateGalCanvas();
|
PCB_BASE_FRAME::ActivateGalCanvas();
|
||||||
|
|
||||||
GetCanvas()->SyncLayersVisibility( m_Pcb );
|
GetCanvas()->SyncLayersVisibility( m_pcb );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
||||||
{
|
{
|
||||||
bool new_board = ( aBoard != m_Pcb );
|
bool new_board = ( aBoard != m_pcb );
|
||||||
|
|
||||||
if( new_board )
|
if( new_board )
|
||||||
{
|
{
|
||||||
|
|
|
@ -56,13 +56,13 @@
|
||||||
wxDEFINE_EVENT( BOARD_CHANGED, wxCommandEvent );
|
wxDEFINE_EVENT( BOARD_CHANGED, wxCommandEvent );
|
||||||
|
|
||||||
PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
||||||
long aStyle, const wxString & aFrameName ) :
|
long aStyle, const wxString & aFrameName ) :
|
||||||
EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
|
EDA_DRAW_FRAME( aKiway, aParent, aFrameType, aTitle, aPos, aSize, aStyle, aFrameName ),
|
||||||
m_Pcb( nullptr ),
|
m_pcb( nullptr ),
|
||||||
m_OriginTransforms( *this )
|
m_originTransforms( *this )
|
||||||
{
|
{
|
||||||
m_Settings = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
|
m_settings = static_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME()
|
||||||
// Ensure m_canvasType is up to date, to save it in config
|
// Ensure m_canvasType is up to date, to save it in config
|
||||||
m_canvasType = GetCanvas()->GetBackend();
|
m_canvasType = GetCanvas()->GetBackend();
|
||||||
|
|
||||||
delete m_Pcb;
|
delete m_pcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -144,10 +144,10 @@ FP_LIB_TABLE* PROJECT::PcbFootprintLibs()
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
|
void PCB_BASE_FRAME::SetBoard( BOARD* aBoard )
|
||||||
{
|
{
|
||||||
if( m_Pcb != aBoard )
|
if( m_pcb != aBoard )
|
||||||
{
|
{
|
||||||
delete m_Pcb;
|
delete m_pcb;
|
||||||
m_Pcb = aBoard;
|
m_pcb = aBoard;
|
||||||
|
|
||||||
wxCommandEvent e( BOARD_CHANGED );
|
wxCommandEvent e( BOARD_CHANGED );
|
||||||
ProcessEventLocally( e );
|
ProcessEventLocally( e );
|
||||||
|
@ -167,7 +167,7 @@ void PCB_BASE_FRAME::AddModuleToBoard( MODULE* module )
|
||||||
// Put it on FRONT layer (note that it might be stored flipped if the lib is an archive
|
// Put it on FRONT layer (note that it might be stored flipped if the lib is an archive
|
||||||
// built from a board)
|
// built from a board)
|
||||||
if( module->IsFlipped() )
|
if( module->IsFlipped() )
|
||||||
module->Flip( module->GetPosition(), m_Settings->m_FlipLeftRight );
|
module->Flip( module->GetPosition(), m_settings->m_FlipLeftRight );
|
||||||
|
|
||||||
// Place it in orientation 0 even if it is not saved with orientation 0 in lib (note that
|
// Place it in orientation 0 even if it is not saved with orientation 0 in lib (note that
|
||||||
// it might be stored in another orientation if the lib is an archive built from a board)
|
// it might be stored in another orientation if the lib is an archive built from a board)
|
||||||
|
@ -241,8 +241,7 @@ void PCB_BASE_FRAME::FocusOnItem( BOARD_ITEM* aItem )
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
m_pcb->SetPageSettings( aPageSettings );
|
||||||
m_Pcb->SetPageSettings( aPageSettings );
|
|
||||||
|
|
||||||
if( GetScreen() )
|
if( GetScreen() )
|
||||||
GetScreen()->InitDataPoints( aPageSettings.GetSizeIU() );
|
GetScreen()->InitDataPoints( aPageSettings.GetSizeIU() );
|
||||||
|
@ -251,40 +250,34 @@ void PCB_BASE_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
||||||
|
|
||||||
const PAGE_INFO& PCB_BASE_FRAME::GetPageSettings() const
|
const PAGE_INFO& PCB_BASE_FRAME::GetPageSettings() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetPageSettings();
|
||||||
return m_Pcb->GetPageSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxSize PCB_BASE_FRAME::GetPageSizeIU() const
|
const wxSize PCB_BASE_FRAME::GetPageSizeIU() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
|
||||||
|
|
||||||
// this function is only needed because EDA_DRAW_FRAME is not compiled
|
// this function is only needed because EDA_DRAW_FRAME is not compiled
|
||||||
// with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
|
// with either -DPCBNEW or -DEESCHEMA, so the virtual is used to route
|
||||||
// into an application specific source file.
|
// into an application specific source file.
|
||||||
return m_Pcb->GetPageSettings().GetSizeIU();
|
return m_pcb->GetPageSettings().GetSizeIU();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxPoint& PCB_BASE_FRAME::GetGridOrigin() const
|
const wxPoint& PCB_BASE_FRAME::GetGridOrigin() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetDesignSettings().m_GridOrigin;
|
||||||
return m_Pcb->GetDesignSettings().m_GridOrigin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetGridOrigin( const wxPoint& aPoint )
|
void PCB_BASE_FRAME::SetGridOrigin( const wxPoint& aPoint )
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
m_pcb->GetDesignSettings().m_GridOrigin = aPoint;
|
||||||
m_Pcb->GetDesignSettings().m_GridOrigin = aPoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxPoint& PCB_BASE_FRAME::GetAuxOrigin() const
|
const wxPoint& PCB_BASE_FRAME::GetAuxOrigin() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetDesignSettings().m_AuxOrigin;
|
||||||
return m_Pcb->GetDesignSettings().m_AuxOrigin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -295,18 +288,10 @@ const wxPoint PCB_BASE_FRAME::GetUserOrigin() const
|
||||||
|
|
||||||
switch( displ_opts.m_DisplayOrigin )
|
switch( displ_opts.m_DisplayOrigin )
|
||||||
{
|
{
|
||||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE:
|
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_PAGE: break;
|
||||||
// No-op
|
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX: origin = GetAuxOrigin(); break;
|
||||||
break;
|
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID: origin = GetGridOrigin(); break;
|
||||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_AUX:
|
default: wxASSERT( false ); break;
|
||||||
origin = GetAuxOrigin();
|
|
||||||
break;
|
|
||||||
case PCB_DISPLAY_OPTIONS::PCB_ORIGIN_GRID:
|
|
||||||
origin = GetGridOrigin();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
wxASSERT( false );
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return origin;
|
return origin;
|
||||||
|
@ -314,28 +299,25 @@ const wxPoint PCB_BASE_FRAME::GetUserOrigin() const
|
||||||
|
|
||||||
ORIGIN_TRANSFORMS& PCB_BASE_FRAME::GetOriginTransforms()
|
ORIGIN_TRANSFORMS& PCB_BASE_FRAME::GetOriginTransforms()
|
||||||
{
|
{
|
||||||
return m_OriginTransforms;
|
return m_originTransforms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const TITLE_BLOCK& PCB_BASE_FRAME::GetTitleBlock() const
|
const TITLE_BLOCK& PCB_BASE_FRAME::GetTitleBlock() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetTitleBlock();
|
||||||
return m_Pcb->GetTitleBlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
|
void PCB_BASE_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock )
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
m_pcb->SetTitleBlock( aTitleBlock );
|
||||||
m_Pcb->SetTitleBlock( aTitleBlock );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOARD_DESIGN_SETTINGS& PCB_BASE_FRAME::GetDesignSettings() const
|
BOARD_DESIGN_SETTINGS& PCB_BASE_FRAME::GetDesignSettings() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetDesignSettings();
|
||||||
return m_Pcb->GetDesignSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -348,37 +330,31 @@ void PCB_BASE_FRAME::SetDrawBgColor( COLOR4D aColor )
|
||||||
|
|
||||||
const ZONE_SETTINGS& PCB_BASE_FRAME::GetZoneSettings() const
|
const ZONE_SETTINGS& PCB_BASE_FRAME::GetZoneSettings() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetDesignSettings().GetDefaultZoneSettings();
|
||||||
return m_Pcb->GetDesignSettings().GetDefaultZoneSettings();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings )
|
void PCB_BASE_FRAME::SetZoneSettings( const ZONE_SETTINGS& aSettings )
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
m_pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings );
|
||||||
m_Pcb->GetDesignSettings().SetDefaultZoneSettings( aSettings );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const
|
const PCB_PLOT_PARAMS& PCB_BASE_FRAME::GetPlotSettings() const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
return m_pcb->GetPlotOptions();
|
||||||
return m_Pcb->GetPlotOptions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings )
|
void PCB_BASE_FRAME::SetPlotSettings( const PCB_PLOT_PARAMS& aSettings )
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
m_pcb->SetPlotOptions( aSettings );
|
||||||
m_Pcb->SetPlotOptions( aSettings );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
|
EDA_RECT PCB_BASE_FRAME::GetBoardBoundingBox( bool aBoardEdgesOnly ) const
|
||||||
{
|
{
|
||||||
wxASSERT( m_Pcb );
|
EDA_RECT area = aBoardEdgesOnly ? m_pcb->GetBoardEdgesBoundingBox() : m_pcb->GetBoundingBox();
|
||||||
|
|
||||||
EDA_RECT area = aBoardEdgesOnly ? m_Pcb->GetBoardEdgesBoundingBox() : m_Pcb->GetBoundingBox();
|
|
||||||
|
|
||||||
if( area.GetWidth() == 0 && area.GetHeight() == 0 )
|
if( area.GetWidth() == 0 && area.GetHeight() == 0 )
|
||||||
{
|
{
|
||||||
|
@ -458,7 +434,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
|
||||||
{
|
{
|
||||||
// If only one copper layer is enabled, the only such layer that can be selected to
|
// If only one copper layer is enabled, the only such layer that can be selected to
|
||||||
// is the "Copper" layer (so the selection of any other copper layer is disregarded).
|
// is the "Copper" layer (so the selection of any other copper layer is disregarded).
|
||||||
if( m_Pcb->GetCopperLayerCount() < 2 )
|
if( m_pcb->GetCopperLayerCount() < 2 )
|
||||||
{
|
{
|
||||||
if( layer != B_Cu )
|
if( layer != B_Cu )
|
||||||
return;
|
return;
|
||||||
|
@ -469,7 +445,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
|
||||||
// layers are also capable of being selected.
|
// layers are also capable of being selected.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( layer != B_Cu && layer != F_Cu && layer >= ( m_Pcb->GetCopperLayerCount() - 1 ) )
|
if( layer != B_Cu && layer != F_Cu && layer >= ( m_pcb->GetCopperLayerCount() - 1 ) )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -487,24 +463,24 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
|
||||||
|
|
||||||
GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
|
GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
|
||||||
{
|
{
|
||||||
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->GetVisibleLayers(), GetActiveLayer(),
|
GENERAL_COLLECTORS_GUIDE guide( m_pcb->GetVisibleLayers(), GetActiveLayer(),
|
||||||
GetCanvas()->GetView() );
|
GetCanvas()->GetView() );
|
||||||
|
|
||||||
// account for the globals
|
// account for the globals
|
||||||
guide.SetIgnoreMTextsMarkedNoShow( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
|
guide.SetIgnoreMTextsMarkedNoShow( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
|
||||||
guide.SetIgnoreMTextsOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
|
guide.SetIgnoreMTextsOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_BK ) );
|
||||||
guide.SetIgnoreMTextsOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
|
guide.SetIgnoreMTextsOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_TEXT_FR ) );
|
||||||
guide.SetIgnoreModulesOnBack( ! m_Pcb->IsElementVisible( LAYER_MOD_BK ) );
|
guide.SetIgnoreModulesOnBack( ! m_pcb->IsElementVisible( LAYER_MOD_BK ) );
|
||||||
guide.SetIgnoreModulesOnFront( ! m_Pcb->IsElementVisible( LAYER_MOD_FR ) );
|
guide.SetIgnoreModulesOnFront( ! m_pcb->IsElementVisible( LAYER_MOD_FR ) );
|
||||||
guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( LAYER_PAD_BK ) );
|
guide.SetIgnorePadsOnBack( ! m_pcb->IsElementVisible( LAYER_PAD_BK ) );
|
||||||
guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( LAYER_PAD_FR ) );
|
guide.SetIgnorePadsOnFront( ! m_pcb->IsElementVisible( LAYER_PAD_FR ) );
|
||||||
guide.SetIgnoreThroughHolePads( ! m_Pcb->IsElementVisible( LAYER_PADS_TH ) );
|
guide.SetIgnoreThroughHolePads( ! m_pcb->IsElementVisible( LAYER_PADS_TH ) );
|
||||||
guide.SetIgnoreModulesVals( ! m_Pcb->IsElementVisible( LAYER_MOD_VALUES ) );
|
guide.SetIgnoreModulesVals( ! m_pcb->IsElementVisible( LAYER_MOD_VALUES ) );
|
||||||
guide.SetIgnoreModulesRefs( ! m_Pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
guide.SetIgnoreModulesRefs( ! m_pcb->IsElementVisible( LAYER_MOD_REFERENCES ) );
|
||||||
guide.SetIgnoreThroughVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
guide.SetIgnoreThroughVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreBlindBuriedVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
guide.SetIgnoreBlindBuriedVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreMicroVias( ! m_Pcb->IsElementVisible( LAYER_VIAS ) );
|
guide.SetIgnoreMicroVias( ! m_pcb->IsElementVisible( LAYER_VIAS ) );
|
||||||
guide.SetIgnoreTracks( ! m_Pcb->IsElementVisible( LAYER_TRACKS ) );
|
guide.SetIgnoreTracks( ! m_pcb->IsElementVisible( LAYER_TRACKS ) );
|
||||||
|
|
||||||
return guide;
|
return guide;
|
||||||
}
|
}
|
||||||
|
@ -576,8 +552,8 @@ void PCB_BASE_FRAME::UpdateStatusBar()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform absolute coordinates for user origin preferences
|
// Transform absolute coordinates for user origin preferences
|
||||||
double userXpos = m_OriginTransforms.ToDisplayAbsX( static_cast<double>( cursorPos.x ) );
|
double userXpos = m_originTransforms.ToDisplayAbsX( static_cast<double>( cursorPos.x ) );
|
||||||
double userYpos = m_OriginTransforms.ToDisplayAbsY( static_cast<double>( cursorPos.y ) );
|
double userYpos = m_originTransforms.ToDisplayAbsY( static_cast<double>( cursorPos.y ) );
|
||||||
|
|
||||||
// Display absolute coordinates:
|
// Display absolute coordinates:
|
||||||
double dXpos = To_User_Unit( GetUserUnits(), userXpos );
|
double dXpos = To_User_Unit( GetUserUnits(), userXpos );
|
||||||
|
@ -619,8 +595,8 @@ void PCB_BASE_FRAME::UpdateStatusBar()
|
||||||
double relYpos = cursorPos.y - screen->m_LocalOrigin.y;
|
double relYpos = cursorPos.y - screen->m_LocalOrigin.y;
|
||||||
|
|
||||||
// Transform relative coordinates for user origin preferences
|
// Transform relative coordinates for user origin preferences
|
||||||
userXpos = m_OriginTransforms.ToDisplayRelX( relXpos );
|
userXpos = m_originTransforms.ToDisplayRelX( relXpos );
|
||||||
userYpos = m_OriginTransforms.ToDisplayRelY( relYpos );
|
userYpos = m_originTransforms.ToDisplayRelY( relYpos );
|
||||||
|
|
||||||
// Display relative coordinates:
|
// Display relative coordinates:
|
||||||
dXpos = To_User_Unit( GetUserUnits(), userXpos );
|
dXpos = To_User_Unit( GetUserUnits(), userXpos );
|
||||||
|
@ -710,7 +686,7 @@ void PCB_BASE_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
if( cfg )
|
if( cfg )
|
||||||
{
|
{
|
||||||
m_DisplayOptions = cfg->m_Display;
|
m_displayOptions = cfg->m_Display;
|
||||||
m_PolarCoords = cfg->m_PolarCoords;
|
m_PolarCoords = cfg->m_PolarCoords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -750,7 +726,7 @@ void PCB_BASE_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
|
||||||
|
|
||||||
if( cfg )
|
if( cfg )
|
||||||
{
|
{
|
||||||
cfg->m_Display = m_DisplayOptions;
|
cfg->m_Display = m_displayOptions;
|
||||||
cfg->m_PolarCoords = m_PolarCoords;
|
cfg->m_PolarCoords = m_PolarCoords;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -769,8 +745,8 @@ FOOTPRINT_EDITOR_SETTINGS* PCB_BASE_FRAME::GetFootprintEditorSettings()
|
||||||
|
|
||||||
MAGNETIC_SETTINGS* PCB_BASE_FRAME::GetMagneticItemsSettings()
|
MAGNETIC_SETTINGS* PCB_BASE_FRAME::GetMagneticItemsSettings()
|
||||||
{
|
{
|
||||||
wxCHECK( m_Settings, nullptr );
|
wxCHECK( m_settings, nullptr );
|
||||||
return &m_Settings->m_MagneticItems;
|
return &m_settings->m_MagneticItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -814,7 +790,7 @@ void PCB_BASE_FRAME::ActivateGalCanvas()
|
||||||
|
|
||||||
if( m_toolManager )
|
if( m_toolManager )
|
||||||
{
|
{
|
||||||
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
|
m_toolManager->SetEnvironment( m_pcb, GetCanvas()->GetView(),
|
||||||
GetCanvas()->GetViewControls(), config(), this );
|
GetCanvas()->GetViewControls(), config(), this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,7 +812,7 @@ void PCB_BASE_FRAME::ActivateGalCanvas()
|
||||||
|
|
||||||
void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions )
|
void PCB_BASE_FRAME::SetDisplayOptions( const PCB_DISPLAY_OPTIONS& aOptions )
|
||||||
{
|
{
|
||||||
m_DisplayOptions = aOptions;
|
m_displayOptions = aOptions;
|
||||||
|
|
||||||
EDA_DRAW_PANEL_GAL* canvas = GetCanvas();
|
EDA_DRAW_PANEL_GAL* canvas = GetCanvas();
|
||||||
KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( canvas->GetView() );
|
KIGFX::PCB_VIEW* view = static_cast<KIGFX::PCB_VIEW*>( canvas->GetView() );
|
||||||
|
|
|
@ -410,8 +410,8 @@ PCB_EDIT_FRAME::~PCB_EDIT_FRAME()
|
||||||
|
|
||||||
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
||||||
{
|
{
|
||||||
if( m_Pcb )
|
if( m_pcb )
|
||||||
m_Pcb->ClearProject();
|
m_pcb->ClearProject();
|
||||||
|
|
||||||
PCB_BASE_EDIT_FRAME::SetBoard( aBoard );
|
PCB_BASE_EDIT_FRAME::SetBoard( aBoard );
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ void PCB_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
||||||
|
|
||||||
BOARD_ITEM_CONTAINER* PCB_EDIT_FRAME::GetModel() const
|
BOARD_ITEM_CONTAINER* PCB_EDIT_FRAME::GetModel() const
|
||||||
{
|
{
|
||||||
return m_Pcb;
|
return m_pcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -435,8 +435,8 @@ void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
||||||
|
|
||||||
// Prepare worksheet template
|
// Prepare worksheet template
|
||||||
KIGFX::WS_PROXY_VIEW_ITEM* worksheet;
|
KIGFX::WS_PROXY_VIEW_ITEM* worksheet;
|
||||||
worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( IU_PER_MILS ,&m_Pcb->GetPageSettings(),
|
worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( IU_PER_MILS, &m_pcb->GetPageSettings(),
|
||||||
m_Pcb->GetProject(), &m_Pcb->GetTitleBlock() );
|
m_pcb->GetProject(), &m_pcb->GetTitleBlock() );
|
||||||
worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
|
worksheet->SetSheetName( std::string( GetScreenDesc().mb_str() ) );
|
||||||
|
|
||||||
BASE_SCREEN* screen = GetScreen();
|
BASE_SCREEN* screen = GetScreen();
|
||||||
|
@ -480,7 +480,7 @@ void PCB_EDIT_FRAME::setupTools()
|
||||||
{
|
{
|
||||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||||
m_toolManager = new TOOL_MANAGER;
|
m_toolManager = new TOOL_MANAGER;
|
||||||
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
|
m_toolManager->SetEnvironment( m_pcb, GetCanvas()->GetView(),
|
||||||
GetCanvas()->GetViewControls(), config(), this );
|
GetCanvas()->GetViewControls(), config(), this );
|
||||||
m_actions = new PCB_ACTIONS();
|
m_actions = new PCB_ACTIONS();
|
||||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
||||||
|
@ -1036,7 +1036,7 @@ void PCB_EDIT_FRAME::onBoardLoaded()
|
||||||
ReCreateLayerBox();
|
ReCreateLayerBox();
|
||||||
|
|
||||||
// Sync layer and item visibility
|
// Sync layer and item visibility
|
||||||
GetCanvas()->SyncLayersVisibility( m_Pcb );
|
GetCanvas()->SyncLayersVisibility( m_pcb );
|
||||||
|
|
||||||
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );
|
SetElementVisibility( LAYER_RATSNEST, GetDisplayOptions().m_ShowGlobalRatsnest );
|
||||||
|
|
||||||
|
|
|
@ -137,14 +137,6 @@ bool PCB_LAYER_WIDGET::isAllowedInFpMode( int aId )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PCB_LAYER_WIDGET::isLayerAllowedInFpMode( PCB_LAYER_ID aLayer )
|
|
||||||
{
|
|
||||||
static LSET allowed = LSET::AllTechMask();
|
|
||||||
allowed.set( F_Cu ).set( B_Cu );
|
|
||||||
return allowed.test( aLayer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PCB_LAYER_WIDGET::AddRightClickMenuItems( wxMenu& menu )
|
void PCB_LAYER_WIDGET::AddRightClickMenuItems( wxMenu& menu )
|
||||||
{
|
{
|
||||||
AddMenuItem( &menu, ID_SHOW_ALL_COPPER_LAYERS,
|
AddMenuItem( &menu, ID_SHOW_ALL_COPPER_LAYERS,
|
||||||
|
|
|
@ -154,18 +154,6 @@ protected:
|
||||||
*/
|
*/
|
||||||
bool isAllowedInFpMode( int aId );
|
bool isAllowedInFpMode( int aId );
|
||||||
|
|
||||||
/**
|
|
||||||
* Function isLayerAllowedInFpMode
|
|
||||||
*
|
|
||||||
* User layers, which are not paired, are not shown in layers manager. However a not
|
|
||||||
* listed layer can be reachable in the graphic item properties dialog.
|
|
||||||
*
|
|
||||||
* @param aLayer is the layer id to test
|
|
||||||
* @return true if PCB_LAYER_ID aLayer has meaning in footprint editor mode.
|
|
||||||
* and therefore is shown in render panel
|
|
||||||
*/
|
|
||||||
bool isLayerAllowedInFpMode( PCB_LAYER_ID aLayer );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function OnRightDownLayers
|
* Function OnRightDownLayers
|
||||||
* puts up a popup menu for the layer panel.
|
* puts up a popup menu for the layer panel.
|
||||||
|
@ -173,10 +161,6 @@ protected:
|
||||||
void onRightDownLayers( wxMouseEvent& event );
|
void onRightDownLayers( wxMouseEvent& event );
|
||||||
|
|
||||||
void onPopupSelection( wxCommandEvent& event );
|
void onPopupSelection( wxCommandEvent& event );
|
||||||
|
|
||||||
/// this is for the popup menu, the right click handler has to be installed
|
|
||||||
/// on every child control within the layer panel.
|
|
||||||
void installRightLayerClickHandler();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PCB_LAYER_WIDGET_H
|
#endif // PCB_LAYER_WIDGET_H
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2019-2020 Reece R. Pollack <reece@his.com>
|
* Copyright (C) 2019-2020 Reece R. Pollack <reece@his.com>
|
||||||
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -36,23 +36,18 @@ public:
|
||||||
|
|
||||||
virtual ~PCB_ORIGIN_TRANSFORMS() override;
|
virtual ~PCB_ORIGIN_TRANSFORMS() override;
|
||||||
|
|
||||||
|
|
||||||
using ORIGIN_TRANSFORMS::ToDisplay;
|
using ORIGIN_TRANSFORMS::ToDisplay;
|
||||||
|
|
||||||
virtual long long int ToDisplay( long long int aValue,
|
virtual long long int ToDisplay( long long int aValue, COORD_TYPES_T aCoordType ) override;
|
||||||
COORD_TYPES_T aCoordType ) override;
|
|
||||||
|
|
||||||
virtual double ToDisplay( double aValue,
|
virtual double ToDisplay( double aValue, COORD_TYPES_T aCoordType ) override;
|
||||||
COORD_TYPES_T aCoordType ) override;
|
|
||||||
|
|
||||||
|
|
||||||
using ORIGIN_TRANSFORMS::FromDisplay;
|
using ORIGIN_TRANSFORMS::FromDisplay;
|
||||||
|
|
||||||
virtual long long int FromDisplay( long long int aValue,
|
virtual long long int FromDisplay( long long int aValue, COORD_TYPES_T aCoordType ) override;
|
||||||
COORD_TYPES_T aCoordType ) override;
|
|
||||||
|
|
||||||
virtual double FromDisplay( double aValue,
|
virtual double FromDisplay( double aValue, COORD_TYPES_T aCoordType ) override;
|
||||||
COORD_TYPES_T aCoordType ) override;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -161,7 +156,6 @@ public:
|
||||||
return displayValue;
|
return displayValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T FromDisplayAbs( T aDisplayValue ) const
|
T FromDisplayAbs( T aDisplayValue ) const
|
||||||
{
|
{
|
||||||
|
@ -173,7 +167,6 @@ public:
|
||||||
return internalValue;
|
return internalValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T ToDisplayRel( T aInternalValue ) const
|
T ToDisplayRel( T aInternalValue ) const
|
||||||
{
|
{
|
||||||
|
@ -185,7 +178,6 @@ public:
|
||||||
return displayValue;
|
return displayValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T FromDisplayRel( T aDisplayValue ) const
|
T FromDisplayRel( T aDisplayValue ) const
|
||||||
{
|
{
|
||||||
|
@ -197,15 +189,14 @@ public:
|
||||||
return internalValue;
|
return internalValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int GetUserXOrigin() const;
|
||||||
|
int GetUserYOrigin() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const PCB_BASE_FRAME& m_pcbBaseFrame;
|
const PCB_BASE_FRAME& m_pcbBaseFrame;
|
||||||
const bool& m_invertXAxis;
|
const bool& m_invertXAxis;
|
||||||
const bool& m_invertYAxis;
|
const bool& m_invertYAxis;
|
||||||
|
|
||||||
int GetUserXOrigin() const;
|
|
||||||
int GetUserYOrigin() const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PCB_ORIGIN_TRANSFORMS_H_
|
#endif // PCB_ORIGIN_TRANSFORMS_H_
|
||||||
|
|
|
@ -48,7 +48,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus )
|
||||||
|
|
||||||
if( aDisplayStatus )
|
if( aDisplayStatus )
|
||||||
{
|
{
|
||||||
std::shared_ptr<CONNECTIVITY_DATA> conn = m_Pcb->GetConnectivity();
|
std::shared_ptr<CONNECTIVITY_DATA> conn = m_pcb->GetConnectivity();
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
||||||
msg.Printf( wxT( " %d" ), conn->GetPadCount() );
|
msg.Printf( wxT( " %d" ), conn->GetPadCount() );
|
||||||
|
@ -57,7 +57,7 @@ void PCB_BASE_FRAME::Compile_Ratsnest( bool aDisplayStatus )
|
||||||
msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ );
|
msg.Printf( wxT( " %d" ), conn->GetNetCount() - 1 /* Don't include "No Net" in count */ );
|
||||||
AppendMsgPanel( _( "Nets" ), msg, CYAN );
|
AppendMsgPanel( _( "Nets" ), msg, CYAN );
|
||||||
|
|
||||||
SetMsgPanel( m_Pcb );
|
SetMsgPanel( m_pcb );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,11 +88,9 @@ private:
|
||||||
*/
|
*/
|
||||||
static SHAPE_POLY_SET makePolysFromRects( const std::deque<EDA_ITEM*>& aItems );
|
static SHAPE_POLY_SET makePolysFromRects( const std::deque<EDA_ITEM*>& aItems );
|
||||||
|
|
||||||
SELECTION_TOOL* m_selectionTool;
|
SELECTION_TOOL* m_selectionTool;
|
||||||
|
|
||||||
CONDITIONAL_MENU* m_menu;
|
CONDITIONAL_MENU* m_menu;
|
||||||
|
PCB_BASE_FRAME* m_frame;
|
||||||
PCB_BASE_FRAME* m_frame;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -224,17 +224,17 @@ private:
|
||||||
///> Returns the appropriate width for a segment depending on the settings.
|
///> Returns the appropriate width for a segment depending on the settings.
|
||||||
int getSegmentWidth( PCB_LAYER_ID aLayer ) const;
|
int getSegmentWidth( PCB_LAYER_ID aLayer ) const;
|
||||||
|
|
||||||
KIGFX::VIEW* m_view;
|
KIGFX::VIEW* m_view;
|
||||||
KIGFX::VIEW_CONTROLS* m_controls;
|
KIGFX::VIEW_CONTROLS* m_controls;
|
||||||
BOARD* m_board;
|
BOARD* m_board;
|
||||||
PCB_BASE_EDIT_FRAME* m_frame;
|
PCB_BASE_EDIT_FRAME* m_frame;
|
||||||
MODE m_mode;
|
MODE m_mode;
|
||||||
|
|
||||||
unsigned int m_lineWidth; // Current line width for multi-segment drawing
|
unsigned int m_lineWidth; // Current line width for multi-segment drawing
|
||||||
static const unsigned int WIDTH_STEP; // Amount of width change with one -/+ key press
|
static const unsigned int WIDTH_STEP; // Amount of width change for one -/+ key press
|
||||||
|
|
||||||
// give internal access to drawing helper classes
|
|
||||||
friend class ZONE_CREATE_HELPER;
|
friend class ZONE_CREATE_HELPER; // give internal access to helper classes
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __DRAWING_TOOL_H */
|
#endif /* __DRAWING_TOOL_H */
|
||||||
|
|
|
@ -57,11 +57,8 @@ public:
|
||||||
void setTransitions() override;
|
void setTransitions() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DIALOG_GROUP_PROPERTIES* m_propertiesDialog;
|
DIALOG_GROUP_PROPERTIES* m_propertiesDialog;
|
||||||
|
SELECTION_TOOL* m_selectionTool;
|
||||||
///> Selection tool used for obtaining selected items
|
|
||||||
SELECTION_TOOL* m_selectionTool;
|
|
||||||
|
|
||||||
std::unique_ptr<BOARD_COMMIT> m_commit;
|
std::unique_ptr<BOARD_COMMIT> m_commit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -58,13 +58,6 @@ public:
|
||||||
*/
|
*/
|
||||||
int PlacePad( const TOOL_EVENT& aEvent );
|
int PlacePad( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
/**
|
|
||||||
* Function CreatePadFromShapes()
|
|
||||||
*
|
|
||||||
* Creates a custom-shaped pad from a set of selected graphical shapes
|
|
||||||
*/
|
|
||||||
int CreatePadFromShapes( const TOOL_EVENT& aEvent );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enters/exits WYSIWYG pad shape editing
|
* Enters/exits WYSIWYG pad shape editing
|
||||||
*/
|
*/
|
||||||
|
@ -77,9 +70,6 @@ private:
|
||||||
///> Bind handlers to corresponding TOOL_ACTIONs
|
///> Bind handlers to corresponding TOOL_ACTIONs
|
||||||
void setTransitions() override;
|
void setTransitions() override;
|
||||||
|
|
||||||
///> Determine if there are any footprints on the board
|
|
||||||
bool haveFootprints();
|
|
||||||
|
|
||||||
///> Apply pad settings from board design settings to a pad
|
///> Apply pad settings from board design settings to a pad
|
||||||
int pastePadProperties( const TOOL_EVENT& aEvent );
|
int pastePadProperties( const TOOL_EVENT& aEvent );
|
||||||
|
|
||||||
|
|
|
@ -554,7 +554,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
|
||||||
case UNDO_REDO::FLIPPED:
|
case UNDO_REDO::FLIPPED:
|
||||||
{
|
{
|
||||||
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
||||||
item->Flip( aList->m_TransformPoint, m_Settings->m_FlipLeftRight );
|
item->Flip( aList->m_TransformPoint, m_settings->m_FlipLeftRight );
|
||||||
view->Update( item, KIGFX::LAYERS );
|
view->Update( item, KIGFX::LAYERS );
|
||||||
connectivity->Update( item );
|
connectivity->Update( item );
|
||||||
item->GetBoard()->OnItemChanged( item );
|
item->GetBoard()->OnItemChanged( item );
|
||||||
|
|
Loading…
Reference in New Issue