Grid rid of GetCanvas/GetGalCanvas distinction now that there's only gal.
This commit is contained in:
parent
1edeba7fb4
commit
8f84c3ec4f
|
@ -200,9 +200,9 @@ bool SaveCanvasImageToFile( EDA_DRAW_FRAME* aFrame, const wxString& aFileName,
|
|||
bool retv = true;
|
||||
|
||||
// Make a screen copy of the canvas:
|
||||
wxSize image_size = aFrame->GetGalCanvas()->GetClientSize();
|
||||
wxSize image_size = aFrame->GetCanvas()->GetClientSize();
|
||||
|
||||
wxClientDC dc( aFrame->GetGalCanvas() );
|
||||
wxClientDC dc( aFrame->GetCanvas() );
|
||||
wxBitmap bitmap( image_size.x, image_size.y );
|
||||
wxMemoryDC memdc;
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
m_zoomSelectBox = NULL;
|
||||
|
||||
m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
m_galCanvas = NULL;
|
||||
m_canvas = NULL;
|
||||
m_toolDispatcher = NULL;
|
||||
m_messagePanel = NULL;
|
||||
m_currentScreen = NULL;
|
||||
|
@ -175,7 +175,7 @@ EDA_DRAW_FRAME::~EDA_DRAW_FRAME()
|
|||
delete m_actions;
|
||||
delete m_toolManager;
|
||||
delete m_toolDispatcher;
|
||||
delete m_galCanvas;
|
||||
delete m_canvas;
|
||||
|
||||
delete m_currentScreen;
|
||||
m_currentScreen = NULL;
|
||||
|
@ -212,7 +212,7 @@ void EDA_DRAW_FRAME::CommonSettingsChanged()
|
|||
EDA_BASE_FRAME::CommonSettingsChanged();
|
||||
|
||||
wxConfigBase* settings = Pgm().CommonSettings();
|
||||
KIGFX::VIEW_CONTROLS* viewControls = GetGalCanvas()->GetViewControls();
|
||||
KIGFX::VIEW_CONTROLS* viewControls = GetCanvas()->GetViewControls();
|
||||
|
||||
int autosaveInterval;
|
||||
settings->Read( AUTOSAVE_INTERVAL_KEY, &autosaveInterval );
|
||||
|
@ -304,7 +304,7 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
UpdateStatusBar();
|
||||
m_galCanvas->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -322,7 +322,7 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
|
|||
|
||||
m_toolManager->RunAction( "common.Control.zoomPreset", true, id );
|
||||
UpdateStatusBar();
|
||||
m_galCanvas->Refresh();
|
||||
m_canvas->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -425,7 +425,7 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
|||
|
||||
// Change GAL canvas cursor if requested.
|
||||
if( aCursor >= 0 )
|
||||
GetGalCanvas()->SetCurrentCursor( aCursor );
|
||||
GetCanvas()->SetCurrentCursor( aCursor );
|
||||
|
||||
DisplayToolMsg( aToolMsg );
|
||||
|
||||
|
@ -442,13 +442,7 @@ void EDA_DRAW_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
|||
void EDA_DRAW_FRAME::SetNoToolSelected()
|
||||
{
|
||||
// Select the ID_NO_TOOL_SELECTED id tool (Idle tool)
|
||||
|
||||
int defaultCursor = wxCURSOR_DEFAULT;
|
||||
|
||||
// Change GAL canvas cursor if requested.
|
||||
defaultCursor = GetGalCanvas()->GetDefaultCursor();
|
||||
|
||||
SetToolID( ID_NO_TOOL_SELECTED, defaultCursor, wxEmptyString );
|
||||
SetToolID( ID_NO_TOOL_SELECTED, GetCanvas()->GetDefaultCursor(), wxEmptyString );
|
||||
}
|
||||
|
||||
|
||||
|
@ -468,7 +462,7 @@ const wxString EDA_DRAW_FRAME::GetZoomLevelIndicator() const
|
|||
{
|
||||
// returns a human readable value which can be displayed as zoom
|
||||
// level indicator in dialogs.
|
||||
return wxString::Format( wxT( "Z %.2f" ), m_galCanvas->GetGAL()->GetZoomFactor() );
|
||||
return wxString::Format( wxT( "Z %.2f" ), m_canvas->GetGAL()->GetZoomFactor() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -570,10 +564,8 @@ void EDA_DRAW_FRAME::UpdateMsgPanel()
|
|||
|
||||
void EDA_DRAW_FRAME::ActivateGalCanvas()
|
||||
{
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();
|
||||
|
||||
galCanvas->SetEvtHandlerEnabled( true );
|
||||
galCanvas->StartDrawing();
|
||||
GetCanvas()->SetEvtHandlerEnabled( true );
|
||||
GetCanvas()->StartDrawing();
|
||||
|
||||
// Reset current tool on switch();
|
||||
SetNoToolSelected();
|
||||
|
@ -582,8 +574,8 @@ void EDA_DRAW_FRAME::ActivateGalCanvas()
|
|||
|
||||
void EDA_DRAW_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
||||
{
|
||||
GetGalCanvas()->SwitchBackend( aCanvasType );
|
||||
m_canvasType = GetGalCanvas()->GetBackend();
|
||||
GetCanvas()->SwitchBackend( aCanvasType );
|
||||
m_canvasType = GetCanvas()->GetBackend();
|
||||
|
||||
ActivateGalCanvas();
|
||||
}
|
||||
|
@ -712,7 +704,7 @@ wxWindow* findDialog( wxWindowList& aList )
|
|||
}
|
||||
|
||||
|
||||
void EDA_DRAW_FRAME::FocusOnLocation( const wxPoint& aPos, bool aWarpCursor, bool aCenterView )
|
||||
void EDA_DRAW_FRAME::FocusOnLocation( const wxPoint& aPos, bool aCenterView )
|
||||
{
|
||||
if( aCenterView )
|
||||
{
|
||||
|
@ -721,18 +713,15 @@ void EDA_DRAW_FRAME::FocusOnLocation( const wxPoint& aPos, bool aWarpCursor, boo
|
|||
// If a dialog partly obscures the window, then center on the uncovered area.
|
||||
if( dialog )
|
||||
{
|
||||
wxRect dialogRect( GetGalCanvas()->ScreenToClient( dialog->GetScreenPosition() ),
|
||||
wxRect dialogRect( GetCanvas()->ScreenToClient( dialog->GetScreenPosition() ),
|
||||
dialog->GetSize() );
|
||||
GetGalCanvas()->GetView()->SetCenter( aPos, dialogRect );
|
||||
GetCanvas()->GetView()->SetCenter( aPos, dialogRect );
|
||||
}
|
||||
else
|
||||
GetGalCanvas()->GetView()->SetCenter( aPos );
|
||||
GetCanvas()->GetView()->SetCenter( aPos );
|
||||
}
|
||||
|
||||
if( aWarpCursor )
|
||||
GetGalCanvas()->GetViewControls()->SetCursorPosition( aPos );
|
||||
else
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( aPos );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( aPos );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ void STATUS_POPUP::onCharHook( wxKeyEvent& aEvent )
|
|||
EDA_DRAW_FRAME* frame = dynamic_cast<EDA_DRAW_FRAME*>( GetParent() );
|
||||
|
||||
if( frame )
|
||||
frame->GetGalCanvas()->OnEvent( aEvent );
|
||||
frame->GetCanvas()->OnEvent( aEvent );
|
||||
else
|
||||
GetParent()->GetEventHandler()->ProcessEvent( aEvent );
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ int COMMON_TOOLS::ZoomInOutCenter( const TOOL_EVENT& aEvent )
|
|||
|
||||
int COMMON_TOOLS::doZoomInOut( bool aDirection, bool aCenterOnCursor )
|
||||
{
|
||||
double zoom = m_frame->GetGalCanvas()->GetLegacyZoom();
|
||||
double zoom = m_frame->GetCanvas()->GetLegacyZoom();
|
||||
|
||||
// Step must be AT LEAST 1.3
|
||||
if( aDirection )
|
||||
|
@ -218,14 +218,14 @@ int COMMON_TOOLS::ZoomCenter( const TOOL_EVENT& aEvent )
|
|||
|
||||
int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
KIGFX::VIEW* view = getView();
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas();
|
||||
EDA_DRAW_FRAME* frame = getEditFrame<EDA_DRAW_FRAME>();
|
||||
KIGFX::VIEW* view = getView();
|
||||
EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
|
||||
EDA_DRAW_FRAME* frame = getEditFrame<EDA_DRAW_FRAME>();
|
||||
|
||||
BOX2I bBox = frame->GetDocumentExtents();
|
||||
BOX2I defaultBox = galCanvas->GetDefaultViewBBox();
|
||||
VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
|
||||
VECTOR2D screenSize = view->ToWorld( galCanvas->GetClientSize(), false );
|
||||
BOX2I bBox = frame->GetDocumentExtents();
|
||||
BOX2I defaultBox = canvas->GetDefaultViewBBox();
|
||||
VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
|
||||
VECTOR2D screenSize = view->ToWorld( canvas->GetClientSize(), false );
|
||||
|
||||
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
||||
bBox = defaultBox;
|
||||
|
@ -258,16 +258,16 @@ int COMMON_TOOLS::ZoomFitScreen( const TOOL_EVENT& aEvent )
|
|||
|
||||
int COMMON_TOOLS::CenterContents( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = m_frame->GetGalCanvas();
|
||||
EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
|
||||
BOX2I bBox = getModel<EDA_ITEM>()->ViewBBox();
|
||||
|
||||
if( bBox.GetWidth() == 0 || bBox.GetHeight() == 0 )
|
||||
bBox = galCanvas->GetDefaultViewBBox();
|
||||
bBox = canvas->GetDefaultViewBBox();
|
||||
|
||||
getView()->SetCenter( bBox.Centre() );
|
||||
|
||||
// Take scrollbars into account
|
||||
VECTOR2D scrollbarSize = VECTOR2D( galCanvas->GetSize() - galCanvas->GetClientSize() );
|
||||
VECTOR2D scrollbarSize = VECTOR2D( canvas->GetSize() - canvas->GetClientSize() );
|
||||
VECTOR2D worldScrollbarSize = getView()->ToWorld( scrollbarSize, false );
|
||||
getView()->SetCenter( getView()->GetCenter() + worldScrollbarSize / 2.0 );
|
||||
|
||||
|
@ -286,7 +286,7 @@ int COMMON_TOOLS::ZoomPreset( const TOOL_EVENT& aEvent )
|
|||
int COMMON_TOOLS::doZoomToPreset( int idx, bool aCenterOnCursor )
|
||||
{
|
||||
std::vector<double>& zoomList = m_frame->GetScreen()->m_ZoomList;
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
|
||||
if( idx == 0 ) // Zoom Auto
|
||||
{
|
||||
|
@ -406,9 +406,9 @@ int COMMON_TOOLS::ToggleGrid( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
m_frame->SetGridVisibility( !m_frame->IsGridVisible() );
|
||||
|
||||
m_frame->GetGalCanvas()->GetGAL()->SetGridVisibility( m_frame->IsGridVisible() );
|
||||
m_frame->GetCanvas()->GetGAL()->SetGridVisibility( m_frame->IsGridVisible() );
|
||||
getView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -363,7 +363,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
|
|||
// TODO That's a big ugly workaround, somehow DRAWPANEL_GAL loses focus
|
||||
// after second LMB click and currently I have no means to do better debugging
|
||||
if( type == wxEVT_LEFT_UP )
|
||||
static_cast<EDA_DRAW_FRAME*>( m_toolMgr->GetEditFrame() )->GetGalCanvas()->SetFocus();
|
||||
static_cast<EDA_DRAW_FRAME*>( m_toolMgr->GetEditFrame() )->GetCanvas()->SetFocus();
|
||||
#endif /* __APPLE__ */
|
||||
}
|
||||
else if( type == wxEVT_CHAR_HOOK || type == wxEVT_CHAR )
|
||||
|
|
|
@ -71,9 +71,10 @@ int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
|
|||
|
||||
bool ZOOM_TOOL::selectRegion()
|
||||
{
|
||||
bool cancelled = false;
|
||||
auto view = getView();
|
||||
auto canvas = m_frame->GetGalCanvas();
|
||||
bool cancelled = false;
|
||||
KIGFX::VIEW* view = getView();
|
||||
EDA_DRAW_PANEL_GAL* canvas = m_frame->GetCanvas();
|
||||
|
||||
getViewControls()->SetAutoPan( true );
|
||||
|
||||
KIGFX::PREVIEW::SELECTION_AREA area;
|
||||
|
|
|
@ -104,7 +104,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
|||
#endif
|
||||
auto* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), backend );
|
||||
SetGalCanvas( gal_drawPanel );
|
||||
SetCanvas( gal_drawPanel );
|
||||
|
||||
// Now all panels are created, set the window size to the latest saved in config:
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
@ -135,19 +135,19 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
|||
|
||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
||||
m_auimgr.Update();
|
||||
|
||||
auto& galOpts = GetGalDisplayOptions();
|
||||
galOpts.m_axesEnabled = true;
|
||||
|
||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
|
||||
ActivateGalCanvas();
|
||||
|
||||
// Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.)
|
||||
GetGalCanvas()->GetView()->SetScale( m_lastZoom );
|
||||
GetCanvas()->GetView()->SetScale( m_lastZoom );
|
||||
|
||||
updateView();
|
||||
|
||||
|
@ -157,10 +157,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
|||
|
||||
DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
|
||||
{
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->StopDrawing();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
// Be sure any event cannot be fired after frame deletion:
|
||||
GetGalCanvas()->SetEvtHandlerEnabled( false );
|
||||
GetCanvas()->SetEvtHandlerEnabled( false );
|
||||
|
||||
// Be sure a active tool (if exists) is desactivated:
|
||||
if( m_toolManager )
|
||||
|
@ -282,18 +282,18 @@ void DISPLAY_FOOTPRINTS_FRAME::SaveSettings( wxConfigBase* aCfg )
|
|||
PCB_BASE_FRAME::SaveSettings( aCfg );
|
||||
|
||||
aCfg->Write( ConfigBaseName() + AUTO_ZOOM_KEY, m_autoZoom );
|
||||
aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetGalCanvas()->GetView()->GetScale() );
|
||||
aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetCanvas()->GetView()->GetScale() );
|
||||
}
|
||||
|
||||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::ApplyDisplaySettingsToGAL()
|
||||
{
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() );
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
settings->LoadDisplayOptions( &m_DisplayOptions, false );
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
||||
|
||||
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetGalCanvas()->Refresh();
|
||||
painter->GetSettings()->LoadDisplayOptions( &m_DisplayOptions, false );
|
||||
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -376,7 +376,7 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
|||
const FOOTPRINT_INFO* module_info = nullptr;
|
||||
|
||||
GetBoard()->DeleteAllModules();
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
wxString footprintName = parentframe->GetSelectedFootprint();
|
||||
|
||||
|
@ -409,14 +409,14 @@ void DISPLAY_FOOTPRINTS_FRAME::InitDisplay()
|
|||
|
||||
UpdateStatusBar();
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
Update3DView( true );
|
||||
}
|
||||
|
||||
|
||||
void DISPLAY_FOOTPRINTS_FRAME::updateView()
|
||||
{
|
||||
PCB_DRAW_PANEL_GAL* dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
PCB_DRAW_PANEL_GAL* dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ wxPanel* DIALOG_CHOOSE_COMPONENT::ConstructRightPanel( wxWindow* aParent )
|
|||
auto sizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
m_symbol_preview = new SYMBOL_PREVIEW_WIDGET( panel, Kiway(),
|
||||
m_parent->GetGalCanvas()->GetBackend() );
|
||||
m_parent->GetCanvas()->GetBackend() );
|
||||
m_symbol_preview->SetLayoutDirection( wxLayout_LeftToRight );
|
||||
|
||||
if( m_show_footprints )
|
||||
|
|
|
@ -290,7 +290,7 @@ void DIALOG_ERC::OnLeftClickMarkersList( wxHtmlLinkEvent& event )
|
|||
}
|
||||
|
||||
m_lastMarkerFound = marker;
|
||||
m_parent->FocusOnLocation( marker->m_Pos, false, true );
|
||||
m_parent->FocusOnLocation( marker->m_Pos, true );
|
||||
RedrawDrawPanel();
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ void DIALOG_ERC::OnLeftDblClickMarkersList( wxMouseEvent& event )
|
|||
// was initialized (NULL if not found).
|
||||
if( m_lastMarkerFound )
|
||||
{
|
||||
m_parent->FocusOnLocation( m_lastMarkerFound->m_Pos, false, true );
|
||||
m_parent->FocusOnLocation( m_lastMarkerFound->m_Pos, true );
|
||||
RedrawDrawPanel();
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ void DIALOG_MIGRATE_BUSES::onItemSelected( wxListEvent& aEvent )
|
|||
|
||||
auto pos = driver->GetPosition();
|
||||
|
||||
m_frame->GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( pos, false );
|
||||
m_frame->GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( pos, false );
|
||||
m_frame->RedrawScreen( pos, false );
|
||||
|
||||
m_cb_new_name->Clear();
|
||||
|
|
|
@ -87,8 +87,7 @@ void DIALOG_SYMBOL_REMAP::OnRemapSymbols( wxCommandEvent& aEvent )
|
|||
// Ignore the never show rescue setting for one last rescue of legacy symbol
|
||||
// libraries before remapping to the symbol library table. This ensures the
|
||||
// best remapping results.
|
||||
LEGACY_RESCUER rescuer( Prj(), &parent->GetCurrentSheet(),
|
||||
parent->GetGalCanvas()->GetBackend() );
|
||||
LEGACY_RESCUER rescuer( Prj(), &parent->GetCurrentSheet(), parent->GetCanvas()->GetBackend() );
|
||||
|
||||
if( RESCUER::RescueProject( this, rescuer, false ) )
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <lib_edit_frame.h>
|
||||
#include <view/view.h>
|
||||
#include <sch_view.h>
|
||||
#include <widgets/gal_options_panel.h>
|
||||
#include <widgets/paged_dialog.h>
|
||||
|
||||
|
@ -57,7 +57,7 @@ bool PANEL_LIBEDIT_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|||
m_galOptsPanel->TransferDataFromWindow();
|
||||
|
||||
// refresh view
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::SCH_VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
view->RecacheAllItems();
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
|
|
@ -45,7 +45,7 @@ static bool lastTextItalic = false;
|
|||
|
||||
SCH_TEXT* SCH_EDIT_FRAME::CreateNewText( int aType )
|
||||
{
|
||||
wxPoint cursorPos = (wxPoint) GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
wxPoint cursorPos = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
SCH_TEXT* textItem = nullptr;
|
||||
|
||||
switch( aType )
|
||||
|
|
|
@ -137,7 +137,7 @@ SCH_ITEM* SCH_EDIT_FRAME::FindComponentAndItem( const wxString& aReference,
|
|||
delta = Component->GetTransform().TransformCoordinate( pos );
|
||||
pos = delta + Component->GetPosition();
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( pos, false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( pos, false );
|
||||
CenterScreen( pos, false );
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
GetScreen()->m_Center = true;
|
||||
GetScreen()->SetMaxUndoItems( m_UndoRedoCountMax );
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
||||
setupTools();
|
||||
|
@ -176,7 +176,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
.BestSize( m_defaultLibWidth, -1 ).Resizable() );
|
||||
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
|
||||
m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
|
||||
|
||||
m_auimgr.Update();
|
||||
|
||||
|
@ -188,10 +188,10 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, false );
|
||||
|
||||
SyncView();
|
||||
GetGalCanvas()->GetViewControls()->SetSnapping( true );
|
||||
GetGalCanvas()->GetView()->UseDrawPriority( true );
|
||||
GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetViewControls()->SetSnapping( true );
|
||||
GetCanvas()->GetView()->UseDrawPriority( true );
|
||||
GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
|
||||
// Set the working/draw area size to display a symbol to a reasonable value:
|
||||
// A 600mm x 600mm with a origin at the area center looks like a large working area
|
||||
|
@ -261,7 +261,7 @@ double LIB_EDIT_FRAME::BestZoom()
|
|||
|
||||
if( !part )
|
||||
{
|
||||
GetGalCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
GetCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
return defaultLibraryZoom;
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ void LIB_EDIT_FRAME::SetCurPart( LIB_PART* aPart )
|
|||
void LIB_EDIT_FRAME::OnImportBody( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_toolManager->DeactivateTool();
|
||||
SetToolID( ID_LIBEDIT_IMPORT_BODY_BUTT, GetGalCanvas()->GetDefaultCursor(), _( "Import" ) );
|
||||
SetToolID( ID_LIBEDIT_IMPORT_BODY_BUTT, GetCanvas()->GetDefaultCursor(), _( "Import" ) );
|
||||
LoadOneSymbol();
|
||||
SetNoToolSelected();
|
||||
}
|
||||
|
@ -457,7 +457,7 @@ void LIB_EDIT_FRAME::OnImportBody( wxCommandEvent& aEvent )
|
|||
void LIB_EDIT_FRAME::OnExportBody( wxCommandEvent& aEvent )
|
||||
{
|
||||
m_toolManager->DeactivateTool();
|
||||
SetToolID( ID_LIBEDIT_EXPORT_BODY_BUTT, GetGalCanvas()->GetDefaultCursor(), _( "Export" ) );
|
||||
SetToolID( ID_LIBEDIT_EXPORT_BODY_BUTT, GetCanvas()->GetDefaultCursor(), _( "Export" ) );
|
||||
SaveOneSymbol();
|
||||
SetNoToolSelected();
|
||||
}
|
||||
|
@ -871,7 +871,7 @@ void LIB_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
|||
SCH_BASE_FRAME::SwitchCanvas( aCanvasType );
|
||||
|
||||
// Set options specific to symbol editor (axies are always enabled):
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -201,10 +201,10 @@ void LIB_EDIT_FRAME::ReCreateMenuBar()
|
|||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
};
|
||||
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
};
|
||||
|
||||
prefsMenu->AddItem( ACTIONS::configurePaths, EE_CONDITIONS::ShowAlways );
|
||||
|
|
|
@ -300,10 +300,10 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
|||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
};
|
||||
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
};
|
||||
|
||||
prefsMenu->AddItem( ACTIONS::configurePaths, EE_CONDITIONS::ShowAlways );
|
||||
|
|
|
@ -511,7 +511,7 @@ void RESCUER::UndoRescues()
|
|||
|
||||
bool SCH_EDIT_FRAME::RescueLegacyProject( bool aRunningOnDemand )
|
||||
{
|
||||
LEGACY_RESCUER rescuer( Prj(), &GetCurrentSheet(), GetGalCanvas()->GetBackend() );
|
||||
LEGACY_RESCUER rescuer( Prj(), &GetCurrentSheet(), GetCanvas()->GetBackend() );
|
||||
|
||||
return rescueProject( rescuer, aRunningOnDemand );
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ bool SCH_EDIT_FRAME::RescueLegacyProject( bool aRunningOnDemand )
|
|||
|
||||
bool SCH_EDIT_FRAME::RescueSymbolLibTableProject( bool aRunningOnDemand )
|
||||
{
|
||||
SYMBOL_LIB_TABLE_RESCUER rescuer( Prj(), &GetCurrentSheet(), GetGalCanvas()->GetBackend() );
|
||||
SYMBOL_LIB_TABLE_RESCUER rescuer( Prj(), &GetCurrentSheet(), GetCanvas()->GetBackend() );
|
||||
|
||||
return rescueProject( rescuer, aRunningOnDemand );
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ void SCH_BASE_FRAME::UpdateStatusBar()
|
|||
EDA_DRAW_FRAME::UpdateStatusBar();
|
||||
|
||||
// Display absolute coordinates:
|
||||
VECTOR2D cursorPos = GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
double dXpos = To_User_Unit( GetUserUnits(), cursorPos.x );
|
||||
double dYpos = To_User_Unit( GetUserUnits(), cursorPos.y );
|
||||
|
||||
|
@ -333,26 +333,26 @@ void SCH_BASE_FRAME::CenterScreen( const wxPoint& aCenterPoint, bool aWarpPointe
|
|||
if( aWarpPointer )
|
||||
GetCanvas()->GetViewControls()->WarpCursor( aCenterPoint, true );
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void SCH_BASE_FRAME::HardRedraw()
|
||||
{
|
||||
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
SCH_DRAW_PANEL* SCH_BASE_FRAME::GetCanvas() const
|
||||
{
|
||||
return static_cast<SCH_DRAW_PANEL*>( GetGalCanvas() );
|
||||
return static_cast<SCH_DRAW_PANEL*>( EDA_DRAW_FRAME::GetCanvas() );
|
||||
}
|
||||
|
||||
|
||||
KIGFX::SCH_RENDER_SETTINGS* SCH_BASE_FRAME::GetRenderSettings()
|
||||
{
|
||||
KIGFX::PAINTER* painter = GetGalCanvas()->GetView()->GetPainter();
|
||||
KIGFX::PAINTER* painter = GetCanvas()->GetView()->GetPainter();
|
||||
return static_cast<KIGFX::SCH_RENDER_SETTINGS*>( painter->GetSettings() );
|
||||
}
|
||||
|
||||
|
@ -368,8 +368,8 @@ void SCH_BASE_FRAME::createCanvas()
|
|||
m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
}
|
||||
|
||||
SetGalCanvas( new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), m_canvasType ) );
|
||||
SetCanvas( new SCH_DRAW_PANEL( this, wxID_ANY, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), m_canvasType ));
|
||||
ActivateGalCanvas();
|
||||
}
|
||||
|
||||
|
@ -434,10 +434,7 @@ void SCH_BASE_FRAME::RemoveFromScreen( EDA_ITEM* aItem, SCH_SCREEN* aScreen )
|
|||
|
||||
void SCH_BASE_FRAME::SyncView()
|
||||
{
|
||||
auto screen = GetScreen();
|
||||
auto gal = GetGalCanvas()->GetGAL();
|
||||
|
||||
auto gs = screen->GetGridSize();
|
||||
gal->SetGridSize( VECTOR2D( gs.x, gs.y ));
|
||||
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
auto gs = GetScreen()->GetGridSize();
|
||||
GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( gs.x, gs.y ));
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
|
||||
void createCanvas();
|
||||
|
||||
SCH_DRAW_PANEL* GetCanvas() const;
|
||||
SCH_DRAW_PANEL* GetCanvas() const override;
|
||||
SCH_SCREEN* GetScreen() const override;
|
||||
void SetScreen( BASE_SCREEN* aScreen ) override;
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ SCH_DRAW_PANEL::SCH_DRAW_PANEL( wxWindow* aParentWindow, wxWindowID aWindowId,
|
|||
setDefaultLayerOrder();
|
||||
setDefaultLayerDeps();
|
||||
|
||||
view()->UpdateAllLayersOrder();
|
||||
GetView()->UpdateAllLayersOrder();
|
||||
|
||||
// View controls is the first in the event handler chain, so the Tool Framework operates
|
||||
// on updated viewport data.
|
||||
|
@ -93,18 +93,18 @@ SCH_DRAW_PANEL::~SCH_DRAW_PANEL()
|
|||
|
||||
void SCH_DRAW_PANEL::DisplayComponent( const LIB_PART* aComponent )
|
||||
{
|
||||
view()->Clear();
|
||||
view()->DisplayComponent( const_cast<LIB_PART*>(aComponent) );
|
||||
GetView()->Clear();
|
||||
GetView()->DisplayComponent( const_cast<LIB_PART*>(aComponent) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void SCH_DRAW_PANEL::DisplaySheet( const SCH_SCREEN *aScreen )
|
||||
{
|
||||
view()->Clear();
|
||||
GetView()->Clear();
|
||||
|
||||
if( aScreen )
|
||||
view()->DisplaySheet( const_cast<SCH_SCREEN*>( aScreen ) );
|
||||
GetView()->DisplaySheet( const_cast<SCH_SCREEN*>( aScreen ) );
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,7 +163,7 @@ void SCH_DRAW_PANEL::setDefaultLayerDeps()
|
|||
}
|
||||
|
||||
|
||||
KIGFX::SCH_VIEW* SCH_DRAW_PANEL::view() const
|
||||
KIGFX::SCH_VIEW* SCH_DRAW_PANEL::GetView() const
|
||||
{
|
||||
return static_cast<KIGFX::SCH_VIEW*>( m_view );
|
||||
}
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, you may find one here:
|
||||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
||||
* or you may search the http://www.gnu.org website for the version 2 license,
|
||||
* or you may write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#ifndef __SCH_DRAW_PANEL_H
|
||||
#define __SCH_DRAW_PANEL_H
|
||||
|
||||
|
@ -5,17 +28,9 @@
|
|||
#include <base_struct.h>
|
||||
#include <gr_basic.h>
|
||||
#include <eda_rect.h>
|
||||
#include <sch_view.h>
|
||||
|
||||
|
||||
namespace KIGFX
|
||||
{
|
||||
class SCH_VIEW;
|
||||
namespace PREVIEW
|
||||
{
|
||||
class SELECTION_AREA;
|
||||
};
|
||||
};
|
||||
|
||||
class SCH_SHEET;
|
||||
class LIB_PART;
|
||||
class BASE_SCREEN;
|
||||
|
@ -38,16 +53,16 @@ public:
|
|||
|
||||
bool SwitchBackend( GAL_TYPE aGalType ) override;
|
||||
|
||||
KIGFX::SCH_VIEW* GetView() const { return view(); }
|
||||
KIGFX::SCH_VIEW* GetView() const override;
|
||||
|
||||
protected:
|
||||
virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
|
||||
|
||||
KIGFX::SCH_VIEW* view() const;
|
||||
wxWindow* m_parent;
|
||||
|
||||
void setDefaultLayerOrder(); ///> Reassigns layer order to the initial settings.
|
||||
void setDefaultLayerDeps(); ///> Sets rendering targets & dependencies for layers.
|
||||
|
||||
protected:
|
||||
wxWindow* m_parent;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -292,7 +292,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
||||
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(1) );
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
||||
|
||||
m_auimgr.Update();
|
||||
|
@ -300,8 +300,8 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId );
|
||||
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
|
||||
|
||||
if( GetGalCanvas() )
|
||||
GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
if( GetCanvas() )
|
||||
GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
|
||||
// Net list generator
|
||||
DefaultExecFlags();
|
||||
|
@ -477,7 +477,7 @@ void SCH_EDIT_FRAME::SetCurrentSheet( const SCH_SHEET_PATH& aSheet )
|
|||
void SCH_EDIT_FRAME::HardRedraw()
|
||||
{
|
||||
GetCanvas()->DisplaySheet( g_CurrentSheet->LastScreen() );
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -394,7 +394,7 @@ SCH_SHEET_PIN* SCH_EDIT_FRAME::CreateSheetPin( SCH_SHEET* aSheet, SCH_HIERLABEL*
|
|||
m_lastSheetPinType = sheetPin->GetShape();
|
||||
m_lastSheetPinTextSize = sheetPin->GetTextSize();
|
||||
|
||||
sheetPin->SetPosition( (wxPoint) GetGalCanvas()->GetViewControls()->GetCursorPosition() );
|
||||
sheetPin->SetPosition( (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition() );
|
||||
|
||||
return sheetPin;
|
||||
}
|
||||
|
|
|
@ -1149,7 +1149,7 @@ void EE_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem, bool aForce )
|
|||
}
|
||||
|
||||
if( m_frame )
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -778,7 +778,7 @@ int SCH_EDITOR_CONTROL::UpdateNetHighlighting( const TOOL_EVENT& aEvent )
|
|||
for( auto redrawItem : itemsToRedraw )
|
||||
view->Update( (KIGFX::VIEW_ITEM*)redrawItem, KIGFX::VIEW_UPDATE_FLAGS::REPAINT );
|
||||
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -135,9 +135,9 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
// Ensure axis are always drawn (initial default display was not drawn)
|
||||
KIGFX::GAL_DISPLAY_OPTIONS& gal_opts = GetGalDisplayOptions();
|
||||
gal_opts.m_axesEnabled = true;
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetRenderSettings()->m_ShowPinsElectricalType = GetShowElectricalType();
|
||||
GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
GetCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() );
|
||||
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
||||
|
@ -180,7 +180,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
m_auimgr.AddPane( m_cmpList, EDA_PANE().Palette().Name( "Symbols" ).Left().Layer(1)
|
||||
.CaptionVisible( false ).MinSize( 80, -1 ).BestSize( m_cmpListWidth, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
m_auimgr.GetPane( m_libList ).Show( aLibraryName.empty() );
|
||||
|
||||
|
@ -196,7 +196,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
}
|
||||
|
||||
SyncView();
|
||||
GetGalCanvas()->GetViewControls()->SetSnapping( true );
|
||||
GetCanvas()->GetViewControls()->SetSnapping( true );
|
||||
|
||||
// Set the working/draw area size to display a symbol to a reasonable value:
|
||||
// A 450mm x 450mm with a origin at the area center looks like a large working area
|
||||
|
@ -411,7 +411,7 @@ double LIB_VIEW_FRAME::BestZoom()
|
|||
|
||||
if( m_libraryName.IsEmpty() || m_entryName.IsEmpty() )
|
||||
{
|
||||
GetGalCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
GetCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
return defaultLibraryZoom;
|
||||
}
|
||||
|
||||
|
@ -430,7 +430,7 @@ double LIB_VIEW_FRAME::BestZoom()
|
|||
|
||||
if( !part )
|
||||
{
|
||||
GetGalCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
GetCanvas()->GetView()->SetCenter( VECTOR2D( 0, 0 ) );
|
||||
return defaultLibraryZoom;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,12 +47,12 @@ bool GERBVIEW_FRAME::Clear_DrawLayers( bool query )
|
|||
return false;
|
||||
}
|
||||
|
||||
if( auto canvas = GetGalCanvas() )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
if( m_toolManager )
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
canvas->GetView()->Clear();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
// Reinit the worksheet view, cleared by GetView()->Clear():
|
||||
SetPageSettings( GetPageSettings() );
|
||||
|
@ -86,5 +86,5 @@ void GERBVIEW_FRAME::Erase_Current_DrawLayer( bool query )
|
|||
|
||||
ReFillLayerWidget();
|
||||
syncLayerBox();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ private:
|
|||
wxPrintout* createPrintout( const wxString& aTitle ) override
|
||||
{
|
||||
return new GERBVIEW_PRINTOUT( m_parent->GetGerberLayout(), *settings(),
|
||||
m_parent->GetGalCanvas()->GetView(), aTitle );
|
||||
m_parent->GetCanvas()->GetView(), aTitle );
|
||||
}
|
||||
|
||||
GERBVIEW_FRAME* m_parent;
|
||||
|
|
|
@ -90,7 +90,7 @@ bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|||
m_galOptsPanel->TransferDataFromWindow();
|
||||
|
||||
// Apply changes to the GAL
|
||||
auto view = m_Parent->GetGalCanvas()->GetView();
|
||||
auto view = m_Parent->GetCanvas()->GetView();
|
||||
auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
|
||||
auto settings = painter->GetSettings();
|
||||
settings->LoadDisplayOptions( displayOptions );
|
||||
|
@ -99,7 +99,7 @@ bool PANEL_GERBVIEW_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|||
if( needs_repaint )
|
||||
view->UpdateAllItems( KIGFX::REPAINT );
|
||||
|
||||
m_Parent->GetGalCanvas()->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -161,13 +161,13 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
break;
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void GERBVIEW_FRAME::OnSelectHighlightChoice( wxCommandEvent& event )
|
||||
{
|
||||
auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() )->GetSettings();
|
||||
auto settings = static_cast<KIGFX::GERBVIEW_PAINTER*>( GetCanvas()->GetView()->GetPainter() )->GetSettings();
|
||||
|
||||
switch( event.GetId() )
|
||||
{
|
||||
|
@ -185,8 +185,8 @@ void GERBVIEW_FRAME::OnSelectHighlightChoice( wxCommandEvent& event )
|
|||
|
||||
}
|
||||
|
||||
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -201,7 +201,7 @@ void GERBVIEW_FRAME::OnSelectActiveDCode( wxCommandEvent& event )
|
|||
if( tool != gerber_image->m_Selected_Tool )
|
||||
{
|
||||
gerber_image->m_Selected_Tool = tool;
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ void GERBVIEW_FRAME::OnSelectDisplayMode( wxCommandEvent& event )
|
|||
case ID_TB_OPTIONS_SHOW_GBR_MODE_2: SetDisplayMode( 2 ); break;
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -282,19 +282,10 @@ bool GERBVIEW_FRAME::Read_EXCELLON_File( const wxString& aFullFileName )
|
|||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
if( success )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
EDA_DRAW_PANEL_GAL* canvas = GetGalCanvas();
|
||||
|
||||
if( canvas )
|
||||
{
|
||||
KIGFX::VIEW* view = canvas->GetView();
|
||||
|
||||
for( GERBER_DRAW_ITEM* item = drill_layer->GetItemsList(); item; item = item->Next() )
|
||||
{
|
||||
view->Add( (KIGFX::VIEW_ITEM*) item );
|
||||
}
|
||||
}
|
||||
for( GERBER_DRAW_ITEM* item = drill_layer->GetItemsList(); item; item = item->Next() )
|
||||
GetCanvas()->GetView()->Add( (KIGFX::VIEW_ITEM*) item );
|
||||
}
|
||||
|
||||
return success;
|
||||
|
|
|
@ -108,7 +108,7 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
|
|||
case ID_GERBVIEW_ERASE_ALL:
|
||||
Clear_DrawLayers( false );
|
||||
Zoom_Automatique( false );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
ClearMsgPanel();
|
||||
break;
|
||||
|
||||
|
@ -139,7 +139,7 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
|
|||
// Clear all layers
|
||||
Clear_DrawLayers( false );
|
||||
Zoom_Automatique( false );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
ClearMsgPanel();
|
||||
|
||||
// Load the layers from stored paths
|
||||
|
@ -150,17 +150,17 @@ void GERBVIEW_FRAME::Files_io( wxCommandEvent& event )
|
|||
|
||||
case ID_GERBVIEW_LOAD_DRILL_FILE:
|
||||
LoadExcellonFiles( wxEmptyString );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case ID_GERBVIEW_LOAD_ZIP_ARCHIVE_FILE:
|
||||
LoadZipArchiveFile( wxEmptyString );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case ID_GERBVIEW_LOAD_JOB_FILE:
|
||||
LoadGerberJobFile( wxEmptyString );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -375,7 +375,7 @@ bool GERBVIEW_FRAME::loadListOfGerberAndDrillFiles( const wxString& aPath,
|
|||
m_LayersManager->UpdateLayerIcons();
|
||||
syncLayerBox( true );
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
GetGalDisplayOptions(),
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE );
|
||||
|
||||
SetGalCanvas( galCanvas );
|
||||
SetCanvas( galCanvas );
|
||||
|
||||
// GerbView requires draw priority for rendering negative objects
|
||||
galCanvas->GetView()->UseDrawPriority( true );
|
||||
|
@ -118,7 +118,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
SetScreen( new GBR_SCREEN( GetPageSettings().GetSizeIU() ) );
|
||||
|
||||
// Create the PCB_LAYER_WIDGET *after* SetLayout():
|
||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, GetGalCanvas() );
|
||||
m_LayersManager = new GERBER_LAYER_WIDGET( this, GetCanvas() );
|
||||
|
||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||
// initialize parameters in m_LayersManager
|
||||
|
@ -152,7 +152,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
.Caption( _( "Layers Manager" ) ).PaneBorder( false )
|
||||
.MinSize( 80, -1 ).BestSize( m_LayersManager->GetBestSize() ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
ReFillLayerWidget(); // this is near end because contents establish size
|
||||
m_auimgr.Update();
|
||||
|
@ -187,10 +187,8 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
GetToolManager()->RunAction( ACTIONS::acceleratedGraphics, true );
|
||||
|
||||
// Switch back to Cairo if OpenGL is not supported
|
||||
if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
if( GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
GetToolManager()->RunAction( ACTIONS::standardGraphics, true );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -203,7 +201,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
SaveSettings( config() );
|
||||
}
|
||||
|
||||
GetGalCanvas()->SwitchBackend( canvasType );
|
||||
GetCanvas()->SwitchBackend( canvasType );
|
||||
ActivateGalCanvas();
|
||||
|
||||
// Enable the axes to match legacy draw style
|
||||
|
@ -218,7 +216,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
|
||||
GERBVIEW_FRAME::~GERBVIEW_FRAME()
|
||||
{
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
GetGerberLayout()->GetImagesList()->DeleteAllImages();
|
||||
delete m_gerberLayout;
|
||||
|
@ -227,14 +225,14 @@ GERBVIEW_FRAME::~GERBVIEW_FRAME()
|
|||
|
||||
void GERBVIEW_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
||||
{
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->StopDrawing();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
|
||||
if( m_toolManager )
|
||||
m_toolManager->DeactivateTool();
|
||||
|
||||
// Be sure any OpenGL event cannot be fired after frame deletion:
|
||||
GetGalCanvas()->SetEvtHandlerEnabled( false );
|
||||
GetCanvas()->SetEvtHandlerEnabled( false );
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
@ -432,7 +430,7 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
|
|||
{
|
||||
m_DisplayOptions.m_DisplayNegativeObjects = aNewState;
|
||||
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
auto view = GetCanvas()->GetView();
|
||||
|
||||
view->UpdateAllItemsConditionally( KIGFX::REPAINT, []( KIGFX::VIEW_ITEM* aItem )
|
||||
{
|
||||
|
@ -446,7 +444,7 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
|
|||
|
||||
case LAYER_WORKSHEET:
|
||||
m_showBorderAndTitleBlock = aNewState;
|
||||
GetGalCanvas()->GetView()->SetLayerVisible( LAYER_WORKSHEET, aNewState );
|
||||
GetCanvas()->GetView()->SetLayerVisible( LAYER_WORKSHEET, aNewState );
|
||||
break;
|
||||
|
||||
case LAYER_GERBVIEW_GRID:
|
||||
|
@ -459,7 +457,7 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
|
|||
|
||||
if( dcodes_changed )
|
||||
{
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
auto view = GetCanvas()->GetView();
|
||||
|
||||
for( int i = 0; i < GERBER_DRAWLAYERS_COUNT; i++ )
|
||||
{
|
||||
|
@ -476,14 +474,13 @@ void GERBVIEW_FRAME::SetElementVisibility( int aLayerID, bool aNewState )
|
|||
|
||||
void GERBVIEW_FRAME::applyDisplaySettingsToGAL()
|
||||
{
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( view->GetPainter() );
|
||||
auto painter = static_cast<KIGFX::GERBVIEW_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
||||
KIGFX::GERBVIEW_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
settings->LoadDisplayOptions( &m_DisplayOptions );
|
||||
|
||||
settings->ImportLegacyColors( m_colorsSettings );
|
||||
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
}
|
||||
|
||||
|
||||
|
@ -616,8 +613,8 @@ void GERBVIEW_FRAME::SortLayersByX2Attributes()
|
|||
GERBER_DCODE_LAYER( GERBER_DRAW_LAYER( it.second ) );
|
||||
}
|
||||
|
||||
GetGalCanvas()->GetView()->ReorderLayerData( view_remapping );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->GetView()->ReorderLayerData( view_remapping );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -634,7 +631,7 @@ void GERBVIEW_FRAME::UpdateDisplayOptions( const GBR_DISPLAY_OPTIONS& aOptions )
|
|||
|
||||
applyDisplaySettingsToGAL();
|
||||
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
auto view = GetCanvas()->GetView();
|
||||
|
||||
if( update_flashed )
|
||||
{
|
||||
|
@ -685,7 +682,7 @@ void GERBVIEW_FRAME::UpdateDisplayOptions( const GBR_DISPLAY_OPTIONS& aOptions )
|
|||
}
|
||||
|
||||
view->UpdateAllItems( KIGFX::COLOR );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -771,10 +768,10 @@ LSET GERBVIEW_FRAME::GetVisibleLayers() const
|
|||
{
|
||||
LSET visible = LSET::AllLayersMask();
|
||||
|
||||
if( auto canvas = GetGalCanvas() )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
for( int i = 0; i < GERBER_DRAWLAYERS_COUNT; i++ )
|
||||
visible[i] = canvas->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( i ) );
|
||||
visible[i] = GetCanvas()->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( i ) );
|
||||
}
|
||||
|
||||
return visible;
|
||||
|
@ -783,15 +780,15 @@ LSET GERBVIEW_FRAME::GetVisibleLayers() const
|
|||
|
||||
void GERBVIEW_FRAME::SetVisibleLayers( LSET aLayerMask )
|
||||
{
|
||||
if( auto canvas = GetGalCanvas() )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
for( int i = 0; i < GERBER_DRAWLAYERS_COUNT; i++ )
|
||||
{
|
||||
bool v = aLayerMask[i];
|
||||
int layer = GERBER_DRAW_LAYER( i );
|
||||
canvas->GetView()->SetLayerVisible( layer, v );
|
||||
canvas->GetView()->SetLayerVisible( GERBER_DCODE_LAYER( layer ),
|
||||
m_DisplayOptions.m_DisplayDCodes && v );
|
||||
GetCanvas()->GetView()->SetLayerVisible( layer, v );
|
||||
GetCanvas()->GetView()->SetLayerVisible( GERBER_DCODE_LAYER( layer ),
|
||||
m_DisplayOptions.m_DisplayDCodes && v );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -899,11 +896,10 @@ void GERBVIEW_FRAME::SetActiveLayer( int aLayer, bool doLayerWidgetUpdate )
|
|||
UpdateTitleAndInfo();
|
||||
|
||||
m_toolManager->RunAction( GERBVIEW_ACTIONS::layerChanged ); // notify other tools
|
||||
GetGalCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
|
||||
GetCanvas()->SetFocus(); // otherwise hotkeys are stuck somewhere
|
||||
|
||||
GetGalCanvas()->SetHighContrastLayer( GERBER_DRAW_LAYER( aLayer ) );
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->SetHighContrastLayer( GERBER_DRAW_LAYER( aLayer ) );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -915,7 +911,7 @@ void GERBVIEW_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
|||
if( screen )
|
||||
screen->InitDataPoints( aPageSettings.GetSizeIU() );
|
||||
|
||||
auto drawPanel = static_cast<GERBVIEW_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
auto drawPanel = static_cast<GERBVIEW_DRAW_PANEL_GAL*>( GetCanvas() );
|
||||
|
||||
// Prepare worksheet template
|
||||
auto worksheet =
|
||||
|
@ -977,8 +973,7 @@ void GERBVIEW_FRAME::SetAuxOrigin( const wxPoint& aPosition )
|
|||
|
||||
void GERBVIEW_FRAME::SetGridColor( COLOR4D aColor )
|
||||
{
|
||||
GetGalCanvas()->GetGAL()->SetGridColor( aColor );
|
||||
|
||||
GetCanvas()->GetGAL()->SetGridColor( aColor );
|
||||
m_gridColor = aColor;
|
||||
}
|
||||
|
||||
|
@ -1029,7 +1024,7 @@ void GERBVIEW_FRAME::UpdateStatusBar()
|
|||
return;
|
||||
|
||||
wxString line;
|
||||
VECTOR2D cursorPos = GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
|
||||
if( GetShowPolarCoords() ) // display relative polar coordinates
|
||||
{
|
||||
|
@ -1130,12 +1125,12 @@ void GERBVIEW_FRAME::ActivateGalCanvas()
|
|||
{
|
||||
EDA_DRAW_FRAME::ActivateGalCanvas();
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = GetCanvas();
|
||||
|
||||
if( m_toolManager )
|
||||
{
|
||||
m_toolManager->SetEnvironment( m_gerberLayout, GetGalCanvas()->GetView(),
|
||||
GetGalCanvas()->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( m_gerberLayout, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
|
||||
}
|
||||
|
||||
|
@ -1159,8 +1154,8 @@ void GERBVIEW_FRAME::setupTools()
|
|||
{
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( m_gerberLayout, GetGalCanvas()->GetView(),
|
||||
GetGalCanvas()->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( m_gerberLayout, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
m_actions = new GERBVIEW_ACTIONS();
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
||||
|
||||
|
@ -1235,7 +1230,7 @@ void GERBVIEW_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
|
|||
int current = 0; // display Auto if no match found
|
||||
|
||||
// check for a match within 1%
|
||||
double zoom = GetGalCanvas()->GetLegacyZoom();
|
||||
double zoom = GetCanvas()->GetLegacyZoom();
|
||||
|
||||
for( unsigned i = 0; i < GetScreen()->m_ZoomList.size(); i++ )
|
||||
{
|
||||
|
|
|
@ -188,7 +188,7 @@ void GERBER_LAYER_WIDGET::onPopupSelection( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
myframe->SetVisibleLayers( visibleLayers );
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case ID_SORT_GBR_LAYERS:
|
||||
|
@ -223,14 +223,10 @@ void GERBER_LAYER_WIDGET::ReFill()
|
|||
|
||||
bool visible = true;
|
||||
|
||||
if( auto canvas = myframe->GetGalCanvas() )
|
||||
{
|
||||
visible = canvas->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) );
|
||||
}
|
||||
if( myframe->GetCanvas() )
|
||||
visible = myframe->GetCanvas()->GetView()->IsLayerVisible( GERBER_DRAW_LAYER( layer ) );
|
||||
else
|
||||
{
|
||||
visible = myframe->IsLayerVisible( layer );
|
||||
}
|
||||
|
||||
AppendLayerRow( LAYER_WIDGET::ROW( msg, layer,
|
||||
myframe->GetLayerColor( GERBER_DRAW_LAYER( layer ) ),
|
||||
|
@ -257,11 +253,11 @@ void GERBER_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
|
|||
myframe->SetLayerColor( GERBER_DRAW_LAYER( aLayer ), aColor );
|
||||
myframe->m_SelLayerBox->ResyncBitmapOnly();
|
||||
|
||||
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = myframe->GetCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
|
||||
view->UpdateLayerColor( GERBER_DRAW_LAYER( aLayer ) );
|
||||
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -277,7 +273,7 @@ bool GERBER_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
|||
if( layer != myframe->GetActiveLayer() )
|
||||
{
|
||||
if( ! OnLayerSelected() )
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -293,7 +289,7 @@ void GERBER_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFin
|
|||
myframe->SetVisibleLayers( visibleLayers );
|
||||
|
||||
if( isFinal )
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -301,15 +297,14 @@ void GERBER_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
|
|||
{
|
||||
myframe->SetVisibleElementColor( aId, aColor );
|
||||
|
||||
auto galCanvas = myframe->GetGalCanvas();
|
||||
auto view = galCanvas->GetView();
|
||||
auto view = myframe->GetCanvas()->GetView();
|
||||
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( myframe->m_colorsSettings );
|
||||
view->UpdateLayerColor( aId );
|
||||
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
view->UpdateAllItems( KIGFX::COLOR );
|
||||
galCanvas->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -317,20 +312,18 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
|||
{
|
||||
myframe->SetElementVisibility( aId, isEnabled );
|
||||
|
||||
auto galCanvas = myframe->GetGalCanvas();
|
||||
|
||||
if( galCanvas )
|
||||
if( myframe->GetCanvas() )
|
||||
{
|
||||
if( aId == LAYER_GERBVIEW_GRID )
|
||||
{
|
||||
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
||||
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
myframe->GetCanvas()->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
||||
myframe->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
}
|
||||
else
|
||||
galCanvas->GetView()->SetLayerVisible( aId, isEnabled );
|
||||
myframe->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled );
|
||||
}
|
||||
|
||||
galCanvas->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
//-----</LAYER_WIDGET callbacks>------------------------------------------
|
||||
|
|
|
@ -240,10 +240,10 @@ void GERBVIEW_FRAME::ReCreateMenuBar()
|
|||
//-- Preferences menu -----------------------------------------------
|
||||
//
|
||||
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
};
|
||||
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
};
|
||||
|
||||
CONDITIONAL_MENU* preferencesMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
|
|
@ -85,12 +85,8 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
|
|||
wxMessageBox( msg );
|
||||
}
|
||||
|
||||
auto canvas = GetGalCanvas();
|
||||
|
||||
if( canvas )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
auto view = canvas->GetView();
|
||||
|
||||
if( gerber->m_ImageNegative )
|
||||
{
|
||||
// TODO: find a way to handle negative images
|
||||
|
@ -98,9 +94,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName )
|
|||
}
|
||||
|
||||
for( auto item = gerber->GetItemsList(); item; item = item->Next() )
|
||||
{
|
||||
view->Add( (KIGFX::VIEW_ITEM*) item );
|
||||
}
|
||||
GetCanvas()->GetView()->Add( (KIGFX::VIEW_ITEM*) item );
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -153,8 +153,8 @@ int GERBVIEW_CONTROL::HighlightControl( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
m_frame->GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -286,7 +286,7 @@ void GERBVIEW_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem )
|
|||
}
|
||||
}
|
||||
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -579,22 +579,21 @@ void GERBVIEW_SELECTION_TOOL::zoomFitSelection( void )
|
|||
{
|
||||
//Should recalculate the view to zoom in on the selection
|
||||
auto selectionBox = m_selection.ViewBBox();
|
||||
auto canvas = m_frame->GetGalCanvas();
|
||||
auto view = getView();
|
||||
|
||||
VECTOR2D screenSize = view->ToWorld( canvas->GetClientSize(), false );
|
||||
VECTOR2D screenSize = view->ToWorld( m_frame->GetCanvas()->GetClientSize(), false );
|
||||
|
||||
if( !( selectionBox.GetWidth() == 0 ) || !( selectionBox.GetHeight() == 0 ) )
|
||||
{
|
||||
VECTOR2D vsize = selectionBox.GetSize();
|
||||
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
|
||||
fabs( vsize.y / screenSize.y ) );
|
||||
fabs( vsize.y / screenSize.y ) );
|
||||
view->SetScale( scale );
|
||||
view->SetCenter( selectionBox.Centre() );
|
||||
view->Add( &m_selection );
|
||||
}
|
||||
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ public:
|
|||
* Returns a pointer to the VIEW instance used in the panel.
|
||||
* @return The instance of VIEW.
|
||||
*/
|
||||
KIGFX::VIEW* GetView() const { return m_view; }
|
||||
virtual KIGFX::VIEW* GetView() const { return m_view; }
|
||||
|
||||
/**
|
||||
* Function GetViewControls()
|
||||
|
|
|
@ -88,7 +88,7 @@ class EDA_DRAW_FRAME : public KIWAY_PLAYER
|
|||
|
||||
BASE_SCREEN* m_currentScreen; ///< current used SCREEN
|
||||
|
||||
EDA_DRAW_PANEL_GAL* m_galCanvas;
|
||||
EDA_DRAW_PANEL_GAL* m_canvas;
|
||||
|
||||
///< GAL display options - this is the frame's interface to setting GAL display options
|
||||
KIGFX::GAL_DISPLAY_OPTIONS m_galDisplayOptions;
|
||||
|
@ -435,10 +435,9 @@ public:
|
|||
* Move the graphic cursor (crosshair cursor) at a given coordinate and reframes
|
||||
* the drawing if the requested point is out of view or if center on location is requested.
|
||||
* @param aPos is the point to go to.
|
||||
* @param aWarpCursor is true if the pointer should be warped to the new position.
|
||||
* @param aCenterView is true if the new cursor position should be centered on canvas.
|
||||
*/
|
||||
void FocusOnLocation( const wxPoint& aPos, bool aWarpCursor = true, bool aCenterView = false );
|
||||
void FocusOnLocation( const wxPoint& aPos, bool aCenterView = false );
|
||||
|
||||
/**
|
||||
* @return The current zoom level.
|
||||
|
@ -566,8 +565,8 @@ public:
|
|||
*
|
||||
* @return Pointer to GAL-based canvas.
|
||||
*/
|
||||
EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
|
||||
void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
|
||||
virtual EDA_DRAW_PANEL_GAL* GetCanvas() const { return m_canvas; }
|
||||
void SetCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_canvas = aPanel; }
|
||||
|
||||
/**
|
||||
* A way to pass info to draw functions. the base class has no knowledge about
|
||||
|
@ -583,7 +582,7 @@ public:
|
|||
|
||||
void RefreshCanvas() override
|
||||
{
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
virtual const BOX2I GetDocumentExtents() const;
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include <pcb_screen.h>
|
||||
#include <pcb_display_options.h>
|
||||
#include <pcb_general_settings.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <lib_id.h>
|
||||
|
||||
/* Forward declarations of classes. */
|
||||
|
@ -58,7 +59,6 @@ class BOARD_DESIGN_SETTINGS;
|
|||
class ZONE_SETTINGS;
|
||||
class PCB_PLOT_PARAMS;
|
||||
class FP_LIB_TABLE;
|
||||
class PCB_GENERAL_SETTINGS ;
|
||||
|
||||
/**
|
||||
* class PCB_BASE_FRAME
|
||||
|
@ -425,6 +425,8 @@ public:
|
|||
*/
|
||||
void DisplayGridMsg();
|
||||
|
||||
PCB_DRAW_PANEL_GAL* GetCanvas() const override;
|
||||
|
||||
///> @copydoc EDA_DRAW_FRAME::UseGalCanvas
|
||||
virtual void ActivateGalCanvas() override;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
|
||||
auto* drawPanel = new PL_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), m_canvasType );
|
||||
SetGalCanvas( drawPanel );
|
||||
SetCanvas( drawPanel );
|
||||
|
||||
LoadSettings( config() );
|
||||
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
|
||||
|
@ -169,9 +169,9 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
.Caption( _( "Properties" ) ).MinSize( m_propertiesPagelayout->GetMinSize() )
|
||||
.BestSize( m_propertiesFrameWidth, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
ActivateGalCanvas();
|
||||
|
||||
m_auimgr.Update();
|
||||
|
@ -195,12 +195,12 @@ void PL_EDITOR_FRAME::setupTools()
|
|||
{
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( nullptr, GetGalCanvas()->GetView(),
|
||||
GetGalCanvas()->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( nullptr, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
m_actions = new PL_ACTIONS();
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
||||
|
||||
GetGalCanvas()->SetEventDispatcher( m_toolDispatcher );
|
||||
GetCanvas()->SetEventDispatcher( m_toolDispatcher );
|
||||
|
||||
// Register tools
|
||||
m_toolManager->RegisterTool( new COMMON_CONTROL );
|
||||
|
@ -266,10 +266,10 @@ void PL_EDITOR_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
*/
|
||||
void PL_EDITOR_FRAME::OnSelectPage( wxCommandEvent& event )
|
||||
{
|
||||
KIGFX::VIEW* view = GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = GetCanvas()->GetView();
|
||||
view->SetLayerVisible( LAYER_WORKSHEET_PAGE1, m_pageSelectBox->GetSelection() == 0 );
|
||||
view->SetLayerVisible( LAYER_WORKSHEET_PAGEn, m_pageSelectBox->GetSelection() == 1 );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -280,8 +280,8 @@ void PL_EDITOR_FRAME::OnSelectCoordOriginCorner( wxCommandEvent& event )
|
|||
{
|
||||
m_originSelectChoice = m_originSelectBox->GetSelection();
|
||||
UpdateStatusBar(); // Update grid origin
|
||||
static_cast<PL_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayWorksheet();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->DisplayWorksheet();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -574,7 +574,7 @@ void PL_EDITOR_FRAME::UpdateStatusBar()
|
|||
}
|
||||
|
||||
// Display absolute coordinates:
|
||||
VECTOR2D cursorPos = GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
VECTOR2D coord = cursorPos - originCoord;
|
||||
double dXpos = To_User_Unit( GetUserUnits(), coord.x * Xsign );
|
||||
double dYpos = To_User_Unit( GetUserUnits(), coord.y * Ysign );
|
||||
|
@ -630,11 +630,15 @@ void PL_EDITOR_FRAME::PrintPage( wxDC* aDC )
|
|||
}
|
||||
|
||||
|
||||
PL_DRAW_PANEL_GAL* PL_EDITOR_FRAME::GetCanvas() const
|
||||
{
|
||||
return static_cast<PL_DRAW_PANEL_GAL*>( EDA_DRAW_FRAME::GetCanvas() );
|
||||
}
|
||||
|
||||
|
||||
void PL_EDITOR_FRAME::HardRedraw()
|
||||
{
|
||||
PL_DRAW_PANEL_GAL* drawPanel = static_cast<PL_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
|
||||
drawPanel->DisplayWorksheet();
|
||||
GetCanvas()->DisplayWorksheet();
|
||||
|
||||
PL_SELECTION_TOOL* selTool = m_toolManager->GetTool<PL_SELECTION_TOOL>();
|
||||
PL_SELECTION& selection = selTool->GetSelection();
|
||||
|
@ -645,7 +649,7 @@ void PL_EDITOR_FRAME::HardRedraw()
|
|||
|
||||
m_propertiesPagelayout->CopyPrmsFromItemToPanel( item );
|
||||
m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -705,7 +709,7 @@ WS_DATA_ITEM* PL_EDITOR_FRAME::AddPageLayoutItem( int aType )
|
|||
return NULL;
|
||||
|
||||
WS_DATA_MODEL::GetTheInstance().Append( item );
|
||||
item->SyncDrawItems( nullptr, GetGalCanvas()->GetView() );
|
||||
item->SyncDrawItems( nullptr, GetCanvas()->GetView() );
|
||||
|
||||
return item;
|
||||
}
|
||||
|
@ -715,8 +719,7 @@ void PL_EDITOR_FRAME::OnNewPageLayout()
|
|||
{
|
||||
GetScreen()->ClearUndoRedoList();
|
||||
GetScreen()->ClrModify();
|
||||
|
||||
static_cast<PL_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayWorksheet();
|
||||
GetCanvas()->DisplayWorksheet();
|
||||
|
||||
m_propertiesPagelayout->CopyPrmsFromItemToPanel( nullptr );
|
||||
m_propertiesPagelayout->CopyPrmsFromGeneralToPanel();
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <eda_draw_frame.h>
|
||||
#include <pl_editor_screen.h>
|
||||
#include <pl_editor_layout.h>
|
||||
#include <pl_draw_panel_gal.h>
|
||||
|
||||
class PROPERTIES_FRAME;
|
||||
class WS_DATA_ITEM;
|
||||
|
@ -110,6 +111,8 @@ public:
|
|||
*/
|
||||
const wxString GetZoomLevelIndicator() const override;
|
||||
|
||||
PL_DRAW_PANEL_GAL* GetCanvas() const override;
|
||||
|
||||
PL_EDITOR_SCREEN* GetScreen() const override
|
||||
{
|
||||
return (PL_EDITOR_SCREEN*) EDA_DRAW_FRAME::GetScreen();
|
||||
|
|
|
@ -69,7 +69,7 @@ void PL_EDITOR_FRAME::GetLayoutFromRedoList()
|
|||
GetScreen()->PushCommandToUndoList( undoCmd );
|
||||
|
||||
selTool->ClearSelection();
|
||||
redoItem->Restore( this, GetGalCanvas()->GetView() );
|
||||
redoItem->Restore( this, GetCanvas()->GetView() );
|
||||
selTool->RebuildSelection();
|
||||
|
||||
delete redoItem;
|
||||
|
@ -81,7 +81,7 @@ void PL_EDITOR_FRAME::GetLayoutFromRedoList()
|
|||
}
|
||||
else
|
||||
{
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
OnModify();
|
||||
|
@ -109,7 +109,7 @@ void PL_EDITOR_FRAME::GetLayoutFromUndoList()
|
|||
GetScreen()->PushCommandToRedoList( redoCmd );
|
||||
|
||||
selTool->ClearSelection();
|
||||
undoItem->Restore( this, GetGalCanvas()->GetView() );
|
||||
undoItem->Restore( this, GetCanvas()->GetView() );
|
||||
selTool->RebuildSelection();
|
||||
|
||||
delete undoItem;
|
||||
|
@ -120,7 +120,7 @@ void PL_EDITOR_FRAME::GetLayoutFromUndoList()
|
|||
HardRedraw(); // items based off of corners will need re-calculating
|
||||
}
|
||||
else
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
OnModify();
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ void PL_EDITOR_FRAME::RollbackFromUndo()
|
|||
bool pageSettingsAndTitleBlock = undoItem->Type() == WS_PROXY_UNDO_ITEM_PLUS_T;
|
||||
|
||||
selTool->ClearSelection();
|
||||
undoItem->Restore( this, GetGalCanvas()->GetView() );
|
||||
undoItem->Restore( this, GetCanvas()->GetView() );
|
||||
selTool->RebuildSelection();
|
||||
|
||||
delete undoItem;
|
||||
|
@ -152,5 +152,5 @@ void PL_EDITOR_FRAME::RollbackFromUndo()
|
|||
HardRedraw(); // items based off of corners will need re-calculating
|
||||
}
|
||||
else
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
|
|
@ -301,7 +301,7 @@ void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
|
|||
// Be sure what is displayed is what is set for item
|
||||
// (mainly, texts can be modified if they contain "\n")
|
||||
CopyPrmsFromItemToPanel( dataItem );
|
||||
m_parent->GetGalCanvas()->GetView()->Update( drawItem );
|
||||
m_parent->GetCanvas()->GetView()->Update( drawItem );
|
||||
}
|
||||
|
||||
CopyPrmsFromPanelToGeneral();
|
||||
|
@ -312,10 +312,8 @@ void PROPERTIES_FRAME::OnAcceptPrms( wxCommandEvent& event )
|
|||
m_parent->OnModify();
|
||||
|
||||
// Rebuild the draw list with the new parameters
|
||||
PL_DRAW_PANEL_GAL* drawPanel = static_cast<PL_DRAW_PANEL_GAL*>( m_parent->GetGalCanvas() );
|
||||
drawPanel->DisplayWorksheet();
|
||||
|
||||
drawPanel->Refresh();
|
||||
m_parent->GetCanvas()->DisplayWorksheet();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,10 +328,8 @@ void PROPERTIES_FRAME::OnSetDefaultValues( wxCommandEvent& event )
|
|||
CopyPrmsFromGeneralToPanel();
|
||||
|
||||
// Rebuild the draw list with the new parameters
|
||||
PL_DRAW_PANEL_GAL* drawPanel = static_cast<PL_DRAW_PANEL_GAL*>( m_parent->GetGalCanvas() );
|
||||
drawPanel->DisplayWorksheet();
|
||||
|
||||
drawPanel->Refresh();
|
||||
m_parent->GetCanvas()->DisplayWorksheet();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -139,8 +139,8 @@ int PL_EDITOR_CONTROL::ToggleBackgroundColor( const TOOL_EVENT& aEvent )
|
|||
m_frame->SetDrawBgColor( m_frame->GetDrawBgColor() == WHITE ? BLACK : WHITE );
|
||||
getView()->GetPainter()->GetSettings()->SetBackgroundColor( m_frame->GetDrawBgColor() );
|
||||
|
||||
m_frame->GetGalCanvas()->GetView()->UpdateAllLayersColor();
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ int PL_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
|
|||
m_frame->OnModify();
|
||||
|
||||
m_editPoints.reset();
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -586,7 +586,7 @@ bool PL_SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector )
|
|||
}
|
||||
|
||||
getView()->UpdateItems();
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
if( current )
|
||||
|
@ -594,7 +594,7 @@ bool PL_SELECTION_TOOL::doSelectionMenu( COLLECTOR* aCollector )
|
|||
unhighlight( current, BRIGHTENED );
|
||||
|
||||
getView()->UpdateItems();
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
aCollector->Empty();
|
||||
aCollector->Append( current );
|
||||
|
@ -644,7 +644,7 @@ void PL_SELECTION_TOOL::toggleSelection( EDA_ITEM* aItem )
|
|||
}
|
||||
|
||||
if( m_frame )
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -79,12 +79,10 @@ static PCB_BASE_EDIT_FRAME* fparent;
|
|||
static int refreshCallback( MODULE* aModule )
|
||||
{
|
||||
if( aModule )
|
||||
{
|
||||
fparent->GetGalCanvas()->GetView()->Update( aModule );
|
||||
}
|
||||
fparent->GetCanvas()->GetView()->Update( aModule );
|
||||
|
||||
fparent->GetGalCanvas()->GetView()->MarkDirty();
|
||||
fparent->GetGalCanvas()->Refresh();
|
||||
fparent->GetCanvas()->GetView()->MarkDirty();
|
||||
fparent->GetCanvas()->Refresh();
|
||||
wxSafeYield(); // Give a slice of time to refresh the display
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -361,7 +361,7 @@ void PCB_EDIT_FRAME::SpreadFootprints( std::vector<MODULE*>* aFootprints,
|
|||
|
||||
OnModify();
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -255,10 +255,9 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a
|
|||
{
|
||||
size_t num_changes = m_changes.size();
|
||||
|
||||
auto panel = static_cast<PCB_DRAW_PANEL_GAL*>( frame->GetGalCanvas() );
|
||||
connectivity->RecalculateRatsnest( this );
|
||||
connectivity->ClearDynamicRatsnest();
|
||||
panel->RedrawRatsnest();
|
||||
frame->GetCanvas()->RedrawRatsnest();
|
||||
|
||||
if( m_changes.size() > num_changes )
|
||||
{
|
||||
|
|
|
@ -147,7 +147,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
if( netcode > 0 && bbox.GetWidth() > 0 && bbox.GetHeight() > 0 )
|
||||
{
|
||||
auto bbSize = bbox.Inflate( bbox.GetWidth() * 0.2f ).GetSize();
|
||||
auto screenSize = view->ToWorld( GetGalCanvas()->GetClientSize(), false );
|
||||
auto screenSize = view->ToWorld( GetCanvas()->GetClientSize(), false );
|
||||
double ratio = std::max( fabs( bbSize.x / screenSize.x ),
|
||||
fabs( bbSize.y / screenSize.y ) );
|
||||
double scale = view->GetScale() / ratio;
|
||||
|
@ -156,7 +156,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
view->SetCenter( bbox.Centre() );
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -171,7 +171,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
|
|||
pcb->ResetHighLight();
|
||||
SetMsgPanel( pcb );
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
if( text == NULL )
|
||||
|
|
|
@ -146,7 +146,7 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup( bool aDryRun )
|
|||
{
|
||||
// Clear undo and redo lists to avoid inconsistencies between lists
|
||||
commit.Push( _( "Board cleanup" ) );
|
||||
m_parentFrame->GetGalCanvas()->Refresh( true );
|
||||
m_parentFrame->GetCanvas()->Refresh( true );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -162,9 +162,9 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnSelectItem( wxCommandEvent& event )
|
|||
|
||||
if( item )
|
||||
{
|
||||
m_parentFrame->FocusOnLocation( item->GetPointA(), false, true );
|
||||
m_parentFrame->FocusOnLocation( item->GetPointA(), true );
|
||||
WINDOW_THAWER thawer( m_parentFrame );
|
||||
m_parentFrame->GetGalCanvas()->Refresh();
|
||||
m_parentFrame->GetCanvas()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLeftDClickItem( wxMouseEvent& event )
|
|||
const DRC_ITEM* item = m_ItemsListBox->GetItem( selection );
|
||||
if( item )
|
||||
{
|
||||
m_parentFrame->FocusOnLocation( item->GetPointA(), true, true );
|
||||
m_parentFrame->FocusOnLocation( item->GetPointA(), true );
|
||||
|
||||
if( !IsModal() )
|
||||
Show( false );
|
||||
|
@ -213,7 +213,7 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnRightUpItem( wxMouseEvent& event )
|
|||
|
||||
WINDOW_THAWER thawer( m_parentFrame );
|
||||
m_parentFrame->GetToolManager()->RunAction( PCB_ACTIONS::selectionMenu, true, &items );
|
||||
m_parentFrame->GetGalCanvas()->Refresh();
|
||||
m_parentFrame->GetCanvas()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -380,8 +380,8 @@ bool DIALOG_DRC_CONTROL::focusOnItem( const DRC_ITEM* aItem )
|
|||
toolmgr->RunAction( PCB_ACTIONS::selectItem, true, marker );
|
||||
}
|
||||
|
||||
m_brdEditor->FocusOnLocation( pos, false, true );
|
||||
m_brdEditor->GetGalCanvas()->Refresh();
|
||||
m_brdEditor->FocusOnLocation( pos, true );
|
||||
m_brdEditor->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -444,9 +444,9 @@ void DIALOG_DRC_CONTROL::doSelectionMenu( const DRC_ITEM* aItem )
|
|||
BOARD_ITEM* selection = items.GetCount() ? items[0] : nullptr;
|
||||
|
||||
if( selection && ( selection == first || selection == second ) )
|
||||
m_brdEditor->FocusOnLocation( selection->GetPosition(), false, true );
|
||||
m_brdEditor->FocusOnLocation( selection->GetPosition(), true );
|
||||
|
||||
m_brdEditor->GetGalCanvas()->Refresh();
|
||||
m_brdEditor->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -564,7 +564,7 @@ void DIALOG_DRC_CONTROL::RedrawDrawPanel()
|
|||
{
|
||||
WINDOW_THAWER thawer( m_brdEditor );
|
||||
|
||||
m_brdEditor->GetGalCanvas()->Refresh();
|
||||
m_brdEditor->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -619,7 +619,7 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataFromWindow()
|
|||
if( !m_Panel3D->TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
auto view = m_frame->GetGalCanvas()->GetView();
|
||||
auto view = m_frame->GetCanvas()->GetView();
|
||||
BOARD_COMMIT commit( m_frame );
|
||||
commit.Modify( m_footprint );
|
||||
|
||||
|
|
|
@ -564,7 +564,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow()
|
|||
if( !m_Panel3D->TransferDataFromWindow() )
|
||||
return false;
|
||||
|
||||
auto view = m_frame->GetGalCanvas()->GetView();
|
||||
auto view = m_frame->GetCanvas()->GetView();
|
||||
BOARD_COMMIT commit( m_frame );
|
||||
commit.Modify( m_footprint );
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ void DIALOG_EXCHANGE_FOOTPRINTS::OnApplyClicked( wxCommandEvent& event )
|
|||
if( processMatchingModules() )
|
||||
{
|
||||
m_parent->Compile_Ratsnest( true );
|
||||
m_parent->GetGalCanvas()->Refresh();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
m_commit.Push( wxT( "Changed footprint" ) );
|
||||
|
|
|
@ -95,7 +95,7 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
|
|||
|
||||
prevSearchString = searchString;
|
||||
|
||||
parent->GetGalCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
||||
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
@ -133,7 +133,7 @@ void DIALOG_FIND::onButtonFindItemClick( wxCommandEvent& aEvent )
|
|||
if( foundItem )
|
||||
{
|
||||
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
||||
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked(), true );
|
||||
parent->FocusOnLocation( pos, true );
|
||||
msg.Printf( _( "\"%s\" found" ), GetChars( searchString ) );
|
||||
parent->SetStatusText( msg );
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
|
|||
foundItem = NULL;
|
||||
|
||||
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
parent->GetGalCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
||||
parent->GetCanvas()->GetViewStart( &screen->m_StartVisu.x, &screen->m_StartVisu.y );
|
||||
|
||||
MARKER_PCB* marker = parent->GetBoard()->GetMARKER( markerCount++ );
|
||||
|
||||
|
@ -171,7 +171,7 @@ void DIALOG_FIND::onButtonFindMarkerClick( wxCommandEvent& aEvent )
|
|||
if( foundItem )
|
||||
{
|
||||
parent->GetToolManager()->RunAction( PCB_ACTIONS::selectItem, true, foundItem );
|
||||
parent->FocusOnLocation( pos, !m_NoMouseWarpCheckBox->IsChecked() );
|
||||
parent->FocusOnLocation( pos );
|
||||
msg = _( "Marker found" );
|
||||
parent->SetStatusText( msg );
|
||||
}
|
||||
|
|
|
@ -231,5 +231,5 @@ void DIALOG_GLOBAL_DELETION::AcceptPcbDelete()
|
|||
m_Parent->Compile_Ratsnest( true );
|
||||
|
||||
// There is a chance that some of tracks have changed their nets, so rebuild ratsnest from scratch
|
||||
m_Parent->GetGalCanvas()->Refresh();
|
||||
m_Parent->GetCanvas()->Refresh();
|
||||
}
|
||||
|
|
|
@ -402,7 +402,7 @@ bool DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataFromWindow()
|
|||
}
|
||||
|
||||
commit.Push( "Edit text and graphics properties" );
|
||||
m_parent->GetGalCanvas()->Refresh();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -343,7 +343,7 @@ bool DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataFromWindow()
|
|||
m_parent->SaveCopyInUndoList( itemsListPicker, UR_CHANGED );
|
||||
|
||||
for( auto segment : m_brd->Tracks() )
|
||||
m_parent->GetGalCanvas()->GetView()->Update( segment );
|
||||
m_parent->GetCanvas()->GetView()->Update( segment );
|
||||
}
|
||||
|
||||
return !m_failedDRC;
|
||||
|
|
|
@ -237,10 +237,10 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas()
|
|||
m_axisOrigin->SetDrawAtZero( true );
|
||||
|
||||
m_panelShowPadGal->UseColorScheme( &m_parent->Settings().Colors() );
|
||||
m_panelShowPadGal->SwitchBackend( m_parent->GetGalCanvas()->GetBackend() );
|
||||
m_panelShowPadGal->SwitchBackend( m_parent->GetCanvas()->GetBackend() );
|
||||
m_panelShowPadGal->SetStealsFocus( false );
|
||||
|
||||
bool mousewheelPan = m_parent->GetGalCanvas()->GetViewControls()->IsMousewheelPanEnabled();
|
||||
bool mousewheelPan = m_parent->GetCanvas()->GetViewControls()->IsMousewheelPanEnabled();
|
||||
m_panelShowPadGal->GetViewControls()->EnableMousewheelPan( mousewheelPan );
|
||||
|
||||
m_panelShowPadGal->Show();
|
||||
|
@ -1447,7 +1447,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
|
|||
|
||||
// redraw the area where the pad was, without pad (delete pad on screen)
|
||||
m_currentPad->SetFlags( DO_NOT_DRAW );
|
||||
m_parent->GetGalCanvas()->Refresh();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
m_currentPad->ClearFlags( DO_NOT_DRAW );
|
||||
|
||||
// Update values
|
||||
|
@ -1553,7 +1553,7 @@ bool DIALOG_PAD_PROPERTIES::TransferDataFromWindow()
|
|||
m_parent->SetMsgPanel( m_currentPad );
|
||||
|
||||
// redraw the area where the pad was
|
||||
m_parent->GetGalCanvas()->Refresh();
|
||||
m_parent->GetCanvas()->Refresh();
|
||||
|
||||
commit.Push( _( "Modify pad" ) );
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ private:
|
|||
wxPrintout* createPrintout( const wxString& aTitle ) override
|
||||
{
|
||||
return new PCBNEW_PRINTOUT( m_parent->GetBoard(), *settings(),
|
||||
m_parent->GetGalCanvas()->GetView(), aTitle );
|
||||
m_parent->GetCanvas()->GetView(), aTitle );
|
||||
}
|
||||
|
||||
PCB_BASE_EDIT_FRAME* m_parent;
|
||||
|
|
|
@ -220,12 +220,11 @@ void DIALOG_SELECT_NET_FROM_LIST::HighlightNet( const wxString& aNetName )
|
|||
netCode = net->GetNet();
|
||||
}
|
||||
|
||||
auto galCanvas = m_frame->GetGalCanvas();
|
||||
KIGFX::RENDER_SETTINGS* render = galCanvas->GetView()->GetPainter()->GetSettings();
|
||||
KIGFX::RENDER_SETTINGS* render = m_frame->GetCanvas()->GetView()->GetPainter()->GetSettings();
|
||||
render->SetHighlight( netCode >= 0, netCode );
|
||||
|
||||
galCanvas->GetView()->UpdateAllLayersColor();
|
||||
galCanvas->Refresh();
|
||||
m_frame->GetCanvas()->GetView()->UpdateAllLayersColor();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -57,10 +57,9 @@ bool PANEL_MODEDIT_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|||
m_galOptsPanel->TransferDataFromWindow();
|
||||
|
||||
// refresh view
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
view->RecacheAllItems();
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->GetView()->RecacheAllItems();
|
||||
m_frame->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <config_map.h>
|
||||
#include <pcbnew_id.h>
|
||||
#include <panel_pcbnew_display_options.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <pcb_view.h>
|
||||
#include <pcb_painter.h>
|
||||
#include <widgets/paged_dialog.h>
|
||||
|
@ -92,7 +92,7 @@ bool PANEL_PCBNEW_DISPLAY_OPTIONS::TransferDataFromWindow()
|
|||
m_galOptsPanel->TransferDataFromWindow();
|
||||
|
||||
// Apply changes to the GAL
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow()
|
|||
|
||||
// Apply changes to the GAL
|
||||
PCB_DISPLAY_OPTIONS* displ_opts = (PCB_DISPLAY_OPTIONS*) m_Frame->GetDisplayOptions();
|
||||
KIGFX::VIEW* view = m_Frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_Frame->GetCanvas()->GetView();
|
||||
KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view->GetPainter() );
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
|
||||
|
@ -100,7 +100,7 @@ bool PANEL_PCBNEW_SETTINGS::TransferDataFromWindow()
|
|||
view->RecacheAllItems();
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
|
||||
m_Frame->GetGalCanvas()->Refresh();
|
||||
m_Frame->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
SetActiveLayer( ToLAYER_ID( m_SelLayerBox->GetLayerSelection() ) );
|
||||
|
||||
if( displ_opts->m_ContrastModeDisplay )
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case ID_MENU_ARCHIVE_MODULES_IN_LIBRARY:
|
||||
|
@ -147,7 +147,7 @@ void PCB_EDIT_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
|
|||
SetActiveLayer( layer );
|
||||
|
||||
if( displ_opts->m_ContrastModeDisplay )
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -608,7 +608,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
|
|||
* This is more a workaround than a fix.
|
||||
*/
|
||||
SetFocus();
|
||||
GetGalCanvas()->SetFocus();
|
||||
GetCanvas()->SetFocus();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -127,7 +127,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||
|
||||
PCB_DRAW_PANEL_GAL* drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), m_canvasType );
|
||||
SetGalCanvas( drawPanel );
|
||||
SetCanvas( drawPanel );
|
||||
|
||||
SetBoard( new BOARD() );
|
||||
// In modedit, the default net clearance is not known.
|
||||
|
@ -153,7 +153,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||
// no net in footprint editor: make it non visible
|
||||
GetBoard()->SetElementVisibility( LAYER_NO_CONNECTS, false );
|
||||
|
||||
m_Layers = new PCB_LAYER_WIDGET( this, GetGalCanvas(), true );
|
||||
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas(), true );
|
||||
|
||||
// LoadSettings() *after* creating m_LayersManager, because LoadSettings()
|
||||
// initialize parameters in m_LayersManager
|
||||
|
@ -208,11 +208,11 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||
.Caption( _( "Layers Manager" ) ).PaneBorder( false )
|
||||
.MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
ActivateGalCanvas();
|
||||
|
||||
m_auimgr.Update();
|
||||
|
@ -240,8 +240,8 @@ void FOOTPRINT_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasTyp
|
|||
// switches currently used canvas (Cairo / OpenGL).
|
||||
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
|
||||
// The base class method *does not reinit* the layers manager. We must upate the layer
|
||||
// widget to match board visibility states, both layers and render columns, and and some
|
||||
|
@ -253,7 +253,7 @@ void FOOTPRINT_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasTyp
|
|||
void FOOTPRINT_EDIT_FRAME::HardRedraw()
|
||||
{
|
||||
SyncLibraryTree( true );
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -459,8 +459,8 @@ void FOOTPRINT_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
}
|
||||
}
|
||||
|
||||
GetGalCanvas()->SetEventDispatcher( NULL );
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetCanvas()->SetEventDispatcher( NULL );
|
||||
GetCanvas()->StopDrawing();
|
||||
|
||||
// Do not show the layer manager during closing to avoid flicker
|
||||
// on some platforms (Windows) that generate useless redraw of items in
|
||||
|
@ -631,7 +631,7 @@ void FOOTPRINT_EDIT_FRAME::UpdateUserInterface()
|
|||
|
||||
// update the layer widget to match board visibility states.
|
||||
m_Layers->SyncLayerVisibilities();
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
|
||||
GetCanvas()->SyncLayersVisibility( m_Pcb );
|
||||
m_Layers->SelectLayer( GetActiveLayer() );
|
||||
m_Layers->OnLayerSelected();
|
||||
|
||||
|
@ -641,9 +641,8 @@ void FOOTPRINT_EDIT_FRAME::UpdateUserInterface()
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::updateView()
|
||||
{
|
||||
auto dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
GetCanvas()->UseColorScheme( &Settings().Colors() );
|
||||
GetCanvas()->DisplayBoard( GetBoard() );
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
updateTitle();
|
||||
|
@ -738,7 +737,7 @@ bool FOOTPRINT_EDIT_FRAME::IsElementVisible( GAL_LAYER_ID aElement ) const
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState )
|
||||
{
|
||||
GetGalCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
|
||||
GetCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
|
||||
GetBoard()->SetElementVisibility( aElement, aNewState );
|
||||
m_Layers->SetRenderState( aElement, aNewState );
|
||||
}
|
||||
|
@ -765,16 +764,14 @@ void FOOTPRINT_EDIT_FRAME::InstallPreferences( PAGED_DIALOG* aParent,
|
|||
|
||||
void FOOTPRINT_EDIT_FRAME::setupTools()
|
||||
{
|
||||
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( GetBoard(), drawPanel->GetView(),
|
||||
drawPanel->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( GetBoard(), GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
m_actions = new PCB_ACTIONS();
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
||||
|
||||
drawPanel->SetEventDispatcher( m_toolDispatcher );
|
||||
GetCanvas()->SetEventDispatcher( m_toolDispatcher );
|
||||
|
||||
m_toolManager->RegisterTool( new COMMON_CONTROL );
|
||||
m_toolManager->RegisterTool( new COMMON_TOOLS );
|
||||
|
@ -806,7 +803,7 @@ void FOOTPRINT_EDIT_FRAME::ActivateGalCanvas()
|
|||
PCB_BASE_EDIT_FRAME::ActivateGalCanvas();
|
||||
|
||||
// Be sure the axis are enabled:
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
updateView();
|
||||
|
||||
// Ensure the m_Layers settings are using the canvas type:
|
||||
|
|
|
@ -86,7 +86,7 @@ void FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary( LIB_ID aFPID)
|
|||
if( !Clear_Pcb( true ) )
|
||||
return;
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
AddModuleToBoard( module );
|
||||
|
||||
auto fp = GetBoard()->GetFirstModule();
|
||||
|
@ -121,7 +121,7 @@ void FOOTPRINT_EDIT_FRAME::LoadModuleFromLibrary( LIB_ID aFPID)
|
|||
GetScreen()->ClrModify();
|
||||
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
// Update the save items if needed.
|
||||
if( is_last_fp_from_brd )
|
||||
|
@ -167,7 +167,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
if( !Clear_Pcb( true ) )
|
||||
break;
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
AddModuleToBoard( module );
|
||||
|
||||
// Initialize data relative to nets and netclasses (for a new
|
||||
|
@ -193,7 +193,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
Update3DView( true );
|
||||
|
||||
SyncLibraryTree( false );
|
||||
|
@ -229,7 +229,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
|
||||
Clear_Pcb( false );
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
// Add the new object to board
|
||||
AddModuleToBoard( module );
|
||||
|
||||
|
@ -254,7 +254,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
}
|
||||
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
Update3DView( true );
|
||||
|
||||
SyncLibraryTree( false );
|
||||
|
@ -271,7 +271,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
{
|
||||
m_toolManager->GetView()->Update( GetBoard()->GetFirstModule() );
|
||||
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
GetCanvas()->ForceRefresh();
|
||||
GetScreen()->ClrModify();
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
|
|||
m_toolManager->GetView()->Update( footprint );
|
||||
GetScreen()->ClrModify();
|
||||
|
||||
GetGalCanvas()->ForceRefresh();
|
||||
GetCanvas()->ForceRefresh();
|
||||
SyncLibraryTree( true );
|
||||
}
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ void FOOTPRINT_EDIT_FRAME::OnEditItemRequest( BOARD_ITEM* aItem )
|
|||
|
||||
case PCB_MODULE_T:
|
||||
editFootprintProperties( (MODULE*) aItem );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
break;
|
||||
|
||||
case PCB_MODULE_TEXT_T:
|
||||
|
@ -382,8 +382,8 @@ void FOOTPRINT_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
|||
m_Layers->SelectLayer( GetActiveLayer() );
|
||||
m_Layers->OnLayerSelected();
|
||||
|
||||
GetGalCanvas()->SetHighContrastLayer( aLayer );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->SetHighContrastLayer( aLayer );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
|
||||
|
@ -391,7 +391,7 @@ bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileS
|
|||
if( ! Clear_Pcb( true ) )
|
||||
return false; // //this command is aborted
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
Import_Module( aFileSet[0] );
|
||||
|
||||
if( GetBoard()->GetFirstModule() )
|
||||
|
@ -399,7 +399,7 @@ bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileS
|
|||
|
||||
GetScreen()->ClrModify();
|
||||
Zoom_Automatique( false );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -849,7 +849,7 @@ bool FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard( bool aAddNew )
|
|||
}
|
||||
else // This is an insert command
|
||||
{
|
||||
KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetGalCanvas()->GetViewControls();
|
||||
KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetCanvas()->GetViewControls();
|
||||
VECTOR2D cursorPos = viewControls->GetCursorPosition();
|
||||
|
||||
commit.Add( newmodule );
|
||||
|
@ -1017,7 +1017,7 @@ bool FOOTPRINT_EDIT_FRAME::RevertFootprint()
|
|||
GetScreen()->ClrModify();
|
||||
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::New( KIWAY* aKiway, wxWindow*
|
|||
panel->GetGAL()->SetGridSize( VECTOR2D( pcbnew->GetScreen()->GetGridSize() ) );
|
||||
|
||||
// Grid color (among other things):
|
||||
KIGFX::PAINTER* pcbnew_painter = pcbnew->GetGalCanvas()->GetView()->GetPainter();
|
||||
KIGFX::PAINTER* pcbnew_painter = pcbnew->GetCanvas()->GetView()->GetPainter();
|
||||
panel->GetView()->GetPainter()->ApplySettings( pcbnew_painter->GetSettings() );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -71,7 +71,7 @@ void FOOTPRINT_TREE_PANE::onComponentSelected( wxCommandEvent& aEvent )
|
|||
|
||||
void FOOTPRINT_TREE_PANE::onUpdateUI( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
if( m_frame->GetGalCanvas()->HasFocus() )
|
||||
if( m_frame->GetCanvas()->HasFocus() )
|
||||
{
|
||||
// Don't allow a selected item in the tree when the canvas has focus: it's too easy
|
||||
// to confuse the selected-highlighting with the being-edited-on-canvas-highlighting.
|
||||
|
|
|
@ -167,7 +167,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
// Create GAL canvas
|
||||
auto drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), LoadCanvasTypeSetting() );
|
||||
SetGalCanvas( drawPanel );
|
||||
SetCanvas( drawPanel );
|
||||
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
|
@ -215,18 +215,17 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
m_auimgr.AddPane( m_footprintList, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(1)
|
||||
.CaptionVisible( false ).MinSize( 100, -1 ).BestSize( 300, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
// after changing something to the aui manager call Update() to reflect the changes
|
||||
m_auimgr.Update();
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
|
||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->GetGAL()->SetAxesEnabled( true );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
ActivateGalCanvas();
|
||||
|
||||
// Restore last zoom. (If auto-zooming we'll adjust when we load the footprint.)
|
||||
GetGalCanvas()->GetView()->SetScale( m_lastZoom );
|
||||
GetCanvas()->GetView()->SetScale( m_lastZoom );
|
||||
|
||||
updateView();
|
||||
|
||||
|
@ -240,10 +239,10 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
|
||||
FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME()
|
||||
{
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->StopDrawing();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
// Be sure any event cannot be fired after frame deletion:
|
||||
GetGalCanvas()->SetEvtHandlerEnabled( false );
|
||||
GetCanvas()->SetEvtHandlerEnabled( false );
|
||||
}
|
||||
|
||||
|
||||
|
@ -254,7 +253,7 @@ void FOOTPRINT_VIEWER_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
// (usefull on windows only)
|
||||
m_mainToolBar->SetFocus();
|
||||
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetCanvas()->StopDrawing();
|
||||
|
||||
if( IsModal() )
|
||||
{
|
||||
|
@ -305,7 +304,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateLibraryList()
|
|||
|
||||
ReCreateFootprintList();
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -415,7 +414,7 @@ void FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList( wxCommandEvent& event )
|
|||
|
||||
updateView();
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
Update3DView( true );
|
||||
}
|
||||
}
|
||||
|
@ -461,7 +460,7 @@ void FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB( wxCommandEvent& event )
|
|||
newmodule->SetParent( pcbframe->GetBoard() );
|
||||
newmodule->SetLink( 0 );
|
||||
|
||||
KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetGalCanvas()->GetViewControls();
|
||||
KIGFX::VIEW_CONTROLS* viewControls = pcbframe->GetCanvas()->GetViewControls();
|
||||
VECTOR2D cursorPos = viewControls->GetCursorPosition();
|
||||
|
||||
commit.Add( newmodule );
|
||||
|
@ -510,7 +509,7 @@ void FOOTPRINT_VIEWER_FRAME::SaveSettings( wxConfigBase* aCfg )
|
|||
PCB_BASE_FRAME::SaveSettings( aCfg );
|
||||
|
||||
aCfg->Write( ConfigBaseName() + AUTO_ZOOM_KEY, m_autoZoom );
|
||||
aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetGalCanvas()->GetView()->GetScale() );
|
||||
aCfg->Write( ConfigBaseName() + ZOOM_KEY, GetCanvas()->GetView()->GetScale() );
|
||||
}
|
||||
|
||||
|
||||
|
@ -741,26 +740,25 @@ void FOOTPRINT_VIEWER_FRAME::SelectAndViewFootprint( int aMode )
|
|||
|
||||
UpdateTitle();
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_VIEWER_FRAME::ApplyDisplaySettingsToGAL()
|
||||
{
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetGalCanvas()->GetView()->GetPainter() );
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( GetCanvas()->GetView()->GetPainter() );
|
||||
KIGFX::PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
settings->LoadDisplayOptions( &m_DisplayOptions, false );
|
||||
|
||||
GetGalCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_VIEWER_FRAME::updateView()
|
||||
{
|
||||
auto dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
GetCanvas()->UseColorScheme( &Settings().Colors() );
|
||||
GetCanvas()->DisplayBoard( GetBoard() );
|
||||
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
#endif
|
||||
PCB_DRAW_PANEL_GAL* gal_drawPanel = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(), backend );
|
||||
SetGalCanvas( gal_drawPanel );
|
||||
SetCanvas( gal_drawPanel );
|
||||
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
|
@ -202,14 +202,14 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
m_auimgr.AddPane( m_buildMessageBox, EDA_PANE().Palette().Name( "Output" ).Left().Position(1)
|
||||
.CaptionVisible( false ).MinSize( 360, -1 ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
|
||||
m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
|
||||
|
||||
auto& galOpts = GetGalDisplayOptions();
|
||||
galOpts.m_fullscreenCursor = true;
|
||||
galOpts.m_forceDisplayCursor = true;
|
||||
galOpts.m_axesEnabled = true;
|
||||
|
||||
GetGalCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
ActivateGalCanvas();
|
||||
updateView();
|
||||
|
||||
|
@ -230,9 +230,9 @@ FOOTPRINT_WIZARD_FRAME::~FOOTPRINT_WIZARD_FRAME()
|
|||
// Delete the GRID_TRICKS.
|
||||
m_parameterGrid->PopEventHandler( true );
|
||||
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetCanvas()->StopDrawing();
|
||||
// Be sure any event cannot be fired after frame deletion:
|
||||
GetGalCanvas()->SetEvtHandlerEnabled( false );
|
||||
GetCanvas()->SetEvtHandlerEnabled( false );
|
||||
|
||||
// Be sure a active tool (if exists) is desactivated:
|
||||
if( m_toolManager )
|
||||
|
@ -292,9 +292,8 @@ void FOOTPRINT_WIZARD_FRAME::OnSize( wxSizeEvent& SizeEv )
|
|||
|
||||
void FOOTPRINT_WIZARD_FRAME::updateView()
|
||||
{
|
||||
auto dp = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
dp->UseColorScheme( &Settings().Colors() );
|
||||
dp->DisplayBoard( GetBoard() );
|
||||
GetCanvas()->UseColorScheme( &Settings().Colors() );
|
||||
GetCanvas()->DisplayBoard( GetBoard() );
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
m_toolManager->RunAction( ACTIONS::zoomFitScreen, true );
|
||||
UpdateMsgPanel();
|
||||
|
@ -369,7 +368,7 @@ void FOOTPRINT_WIZARD_FRAME::ReCreatePageList()
|
|||
ReCreateParameterList();
|
||||
ReCreateHToolbar();
|
||||
DisplayWizardInfos();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -498,7 +497,7 @@ void FOOTPRINT_WIZARD_FRAME::ClickOnPageList( wxCommandEvent& event )
|
|||
if( m_pageList->GetSelection() > 0 )
|
||||
{
|
||||
ReCreateParameterList();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
DisplayWizardInfos();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ void FOOTPRINT_WIZARD_FRAME::ReloadFootprint()
|
|||
}
|
||||
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
|
|||
// so we force the ORPHANED dummy net info for all pads
|
||||
newModule->ClearAllNets();
|
||||
|
||||
GetGalCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
GetCanvas()->GetViewControls()->SetCrossHairCursorPosition( VECTOR2D( 0, 0 ), false );
|
||||
PlaceModule( newModule );
|
||||
newModule->SetPosition( wxPoint( 0, 0 ) ); // cursor in GAL may not be initialized at the moment
|
||||
|
||||
|
@ -156,7 +156,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
|
|||
|
||||
Update3DView( true );
|
||||
updateView();
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
m_treePane->GetLibTree()->Refresh(); // update any previously-highlighted items
|
||||
|
||||
return true;
|
||||
|
@ -498,7 +498,7 @@ void PCB_BASE_FRAME::PlaceModule( MODULE* aModule, bool aRecreateRatsnest )
|
|||
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
|
||||
aModule->SetPosition( (wxPoint) GetGalCanvas()->GetViewControls()->GetCursorPosition() );
|
||||
aModule->SetPosition( (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition() );
|
||||
aModule->ClearFlags();
|
||||
|
||||
delete s_ModuleInitialCopy;
|
||||
|
|
|
@ -267,10 +267,10 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
|
|||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
};
|
||||
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
};
|
||||
|
||||
prefsMenu->AddItem( ACTIONS::configurePaths, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
|
|
@ -274,7 +274,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
return disp_opt->m_DisplayRatsnestLinesCurved;
|
||||
};
|
||||
auto boardFlippedCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetView()->IsMirroredX();
|
||||
return GetCanvas()->GetView()->IsMirroredX();
|
||||
};
|
||||
auto zonesFilledCondition = [ this, disp_opt ] ( const SELECTION& aSel ) {
|
||||
return disp_opt->m_DisplayZonesMode == 0;
|
||||
|
@ -470,10 +470,10 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
|
|||
CONDITIONAL_MENU* prefsMenu = new CONDITIONAL_MENU( false, selTool );
|
||||
|
||||
auto acceleratedGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL;
|
||||
};
|
||||
auto standardGraphicsCondition = [ this ] ( const SELECTION& aSel ) {
|
||||
return GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
return GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO;
|
||||
};
|
||||
|
||||
prefsMenu->AddItem( ACTIONS::configurePaths, SELECTION_CONDITIONS::ShowAlways );
|
||||
|
|
|
@ -89,24 +89,21 @@ bool PCB_EDIT_FRAME::ReadNetlistFromFile( const wxString &aFilename,
|
|||
}
|
||||
|
||||
|
||||
void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater,
|
||||
bool* aRunDragCommand )
|
||||
void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aRunDragCommand )
|
||||
{
|
||||
BOARD* board = GetBoard();
|
||||
|
||||
SetMsgPanel( board );
|
||||
|
||||
// Update rendered tracks and vias net labels
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
|
||||
// TODO is there a way to extract information about which nets were modified?
|
||||
for( auto track : board->Tracks() )
|
||||
view->Update( track );
|
||||
GetCanvas()->GetView()->Update( track );
|
||||
|
||||
std::vector<MODULE*> newFootprints = aUpdater.GetAddedComponents();
|
||||
|
||||
// Spread new footprints.
|
||||
wxPoint areaPosition = (wxPoint) GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
wxPoint areaPosition = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
EDA_RECT bbox = board->GetBoundingBox();
|
||||
|
||||
GetToolManager()->RunAction( PCB_ACTIONS::selectionClear, true );
|
||||
|
@ -129,7 +126,7 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater,
|
|||
selection.SetReferencePoint( newFootprints[0]->GetPosition() );
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ void PCB_BASE_EDIT_FRAME::ActivateGalCanvas()
|
|||
{
|
||||
PCB_BASE_FRAME::ActivateGalCanvas();
|
||||
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
|
||||
GetCanvas()->SyncLayersVisibility( m_Pcb );
|
||||
}
|
||||
|
||||
|
||||
|
@ -79,22 +79,20 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
|
|||
if( m_toolManager )
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
||||
GetGalCanvas()->GetView()->Clear();
|
||||
GetCanvas()->GetView()->Clear();
|
||||
}
|
||||
|
||||
PCB_BASE_FRAME::SetBoard( aBoard );
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetGridOrigin( VECTOR2D( aBoard->GetGridOrigin() ) );
|
||||
GetCanvas()->GetGAL()->SetGridOrigin( VECTOR2D( aBoard->GetGridOrigin() ) );
|
||||
|
||||
// update the tool manager with the new board and its view.
|
||||
if( m_toolManager )
|
||||
{
|
||||
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
|
||||
drawPanel->DisplayBoard( aBoard );
|
||||
drawPanel->UseColorScheme( &Settings().Colors() );
|
||||
m_toolManager->SetEnvironment( aBoard, drawPanel->GetView(),
|
||||
drawPanel->GetViewControls(), this );
|
||||
GetCanvas()->DisplayBoard( aBoard );
|
||||
GetCanvas()->UseColorScheme( &Settings().Colors() );
|
||||
m_toolManager->SetEnvironment( aBoard, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
|
||||
if( new_board )
|
||||
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||
|
|
|
@ -103,10 +103,7 @@ PCB_BASE_FRAME::PCB_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
PCB_BASE_FRAME::~PCB_BASE_FRAME()
|
||||
{
|
||||
// Ensure m_canvasType is up to date, to save it in config
|
||||
if( !GetGalCanvas() )
|
||||
m_canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||
else
|
||||
m_canvasType = GetGalCanvas()->GetBackend();
|
||||
m_canvasType = GetCanvas()->GetBackend();
|
||||
|
||||
delete m_Pcb;
|
||||
}
|
||||
|
@ -448,7 +445,7 @@ void PCB_BASE_FRAME::SwitchLayer( wxDC* DC, PCB_LAYER_ID layer )
|
|||
GetScreen()->m_Active_Layer = layer;
|
||||
|
||||
if( displ_opts->m_ContrastModeDisplay )
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -457,12 +454,11 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
|
|||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
|
||||
displ_opts->m_DisplayPadFill = !displ_opts->m_DisplayPadFill;
|
||||
EDA_DRAW_PANEL_GAL* gal = GetGalCanvas();
|
||||
|
||||
if( gal )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
// Apply new display options to the GAL canvas
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( gal->GetView() );
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
|
||||
view->UpdateDisplayOptions( displ_opts );
|
||||
|
||||
// Update pads
|
||||
|
@ -474,7 +470,7 @@ void PCB_BASE_FRAME::OnTogglePadDrawMode( wxCommandEvent& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -482,7 +478,7 @@ void PCB_BASE_FRAME::OnToggleGraphicDrawMode( wxCommandEvent& aEvent )
|
|||
{
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
displ_opts->m_DisplayDrawItemsFill = !displ_opts->m_DisplayDrawItemsFill;
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -490,35 +486,33 @@ void PCB_BASE_FRAME::OnToggleEdgeDrawMode( wxCommandEvent& aEvent )
|
|||
{
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
displ_opts->m_DisplayModEdgeFill = !displ_opts->m_DisplayModEdgeFill;
|
||||
EDA_DRAW_PANEL_GAL* gal = GetGalCanvas();
|
||||
|
||||
if( gal )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
// Apply new display options to the GAL canvas
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( gal->GetView() );
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
|
||||
view->UpdateDisplayOptions( displ_opts );
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
void PCB_BASE_FRAME::OnToggleTextDrawMode( wxCommandEvent& aEvent )
|
||||
{
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
|
||||
displ_opts->m_DisplayModTextFill = !displ_opts->m_DisplayModTextFill;
|
||||
EDA_DRAW_PANEL_GAL* gal = GetGalCanvas();
|
||||
|
||||
if( gal )
|
||||
if( GetCanvas() )
|
||||
{
|
||||
// Apply new display options to the GAL canvas
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( gal->GetView() );
|
||||
// Apply new display options to the canvas
|
||||
auto view = static_cast<KIGFX::PCB_VIEW*>( GetCanvas()->GetView() );
|
||||
view->UpdateDisplayOptions( displ_opts );
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
}
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -530,7 +524,7 @@ void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
|
|||
int current = 0; // display Auto if no match found
|
||||
|
||||
// check for a match within 1%
|
||||
double zoom = GetGalCanvas()->GetLegacyZoom();
|
||||
double zoom = GetCanvas()->GetLegacyZoom();
|
||||
|
||||
for( unsigned i = 0; i < GetScreen()->m_ZoomList.size(); i++ )
|
||||
{
|
||||
|
@ -549,7 +543,7 @@ void PCB_BASE_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
|
|||
GENERAL_COLLECTORS_GUIDE PCB_BASE_FRAME::GetCollectorsGuide()
|
||||
{
|
||||
GENERAL_COLLECTORS_GUIDE guide( m_Pcb->GetVisibleLayers(), GetActiveLayer(),
|
||||
GetGalCanvas()->GetView() );
|
||||
GetCanvas()->GetView() );
|
||||
|
||||
// account for the globals
|
||||
guide.SetIgnoreMTextsMarkedNoShow( ! m_Pcb->IsElementVisible( LAYER_MOD_TEXT_INVISIBLE ) );
|
||||
|
@ -592,7 +586,7 @@ void PCB_BASE_FRAME::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
|
|||
// must do this after the tool has been set, otherwise pad::Draw() does
|
||||
// not show proper color when GetDisplayOptions().ContrastModeDisplay is true.
|
||||
if( redraw )
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -645,7 +639,7 @@ void PCB_BASE_FRAME::UpdateStatusBar()
|
|||
return;
|
||||
|
||||
wxString line;
|
||||
VECTOR2D cursorPos = GetGalCanvas()->GetViewControls()->GetCursorPosition();
|
||||
VECTOR2D cursorPos = GetCanvas()->GetViewControls()->GetCursorPosition();
|
||||
|
||||
if( GetShowPolarCoords() ) // display polar coordinates
|
||||
{
|
||||
|
@ -885,16 +879,22 @@ void PCB_BASE_FRAME::SetFastGrid2()
|
|||
}
|
||||
|
||||
|
||||
PCB_DRAW_PANEL_GAL* PCB_BASE_FRAME::GetCanvas() const
|
||||
{
|
||||
return static_cast<PCB_DRAW_PANEL_GAL*>( EDA_DRAW_FRAME::GetCanvas() );
|
||||
}
|
||||
|
||||
|
||||
void PCB_BASE_FRAME::ActivateGalCanvas()
|
||||
{
|
||||
EDA_DRAW_FRAME::ActivateGalCanvas();
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = GetGalCanvas();
|
||||
EDA_DRAW_PANEL_GAL* canvas = GetCanvas();
|
||||
|
||||
if( m_toolManager )
|
||||
{
|
||||
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
|
||||
GetGalCanvas()->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
}
|
||||
|
||||
SetBoard( m_Pcb );
|
||||
|
@ -903,13 +903,13 @@ void PCB_BASE_FRAME::ActivateGalCanvas()
|
|||
m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH );
|
||||
|
||||
// Transfer latest current display options from legacy to GAL canvas:
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( galCanvas->GetView()->GetPainter() );
|
||||
auto painter = static_cast<KIGFX::PCB_PAINTER*>( canvas->GetView()->GetPainter() );
|
||||
auto settings = painter->GetSettings();
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*)GetDisplayOptions();
|
||||
auto displ_opts = (PCB_DISPLAY_OPTIONS*) GetDisplayOptions();
|
||||
settings->LoadDisplayOptions( displ_opts, ShowPageLimits() );
|
||||
|
||||
galCanvas->GetView()->RecacheAllItems();
|
||||
galCanvas->SetEventDispatcher( m_toolDispatcher );
|
||||
galCanvas->StartDrawing();
|
||||
canvas->GetView()->RecacheAllItems();
|
||||
canvas->SetEventDispatcher( m_toolDispatcher );
|
||||
canvas->StartDrawing();
|
||||
}
|
||||
|
||||
|
|
|
@ -493,7 +493,7 @@ void PCB_DRAW_PANEL_GAL::setDefaultLayerDeps()
|
|||
}
|
||||
|
||||
|
||||
KIGFX::PCB_VIEW* PCB_DRAW_PANEL_GAL::view() const
|
||||
KIGFX::PCB_VIEW* PCB_DRAW_PANEL_GAL::GetView() const
|
||||
{
|
||||
return static_cast<KIGFX::PCB_VIEW*>( m_view );
|
||||
}
|
||||
|
|
|
@ -27,13 +27,13 @@
|
|||
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <pcb_view.h>
|
||||
#include <common.h>
|
||||
|
||||
namespace KIGFX
|
||||
{
|
||||
class WS_PROXY_VIEW_ITEM;
|
||||
class RATSNEST_VIEWITEM;
|
||||
class PCB_VIEW;
|
||||
}
|
||||
class COLORS_DESIGN_SETTINGS;
|
||||
|
||||
|
@ -107,9 +107,9 @@ public:
|
|||
///> @copydoc EDA_DRAW_PANEL_GAL::GetDefaultViewBBox()
|
||||
BOX2I GetDefaultViewBBox() const override;
|
||||
|
||||
protected:
|
||||
virtual KIGFX::PCB_VIEW* GetView() const override;
|
||||
|
||||
KIGFX::PCB_VIEW* view() const;
|
||||
protected:
|
||||
|
||||
///> Reassigns layer order to the initial settings.
|
||||
void setDefaultLayerOrder();
|
||||
|
|
|
@ -202,16 +202,16 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_AboutTitle = "Pcbnew";
|
||||
|
||||
// Create GAL canvas
|
||||
auto galCanvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(),
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
|
||||
auto canvas = new PCB_DRAW_PANEL_GAL( this, -1, wxPoint( 0, 0 ), m_FrameSize,
|
||||
GetGalDisplayOptions(),
|
||||
EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO );
|
||||
|
||||
SetGalCanvas( galCanvas );
|
||||
SetCanvas( canvas );
|
||||
|
||||
SetBoard( new BOARD() );
|
||||
|
||||
// Create the PCB_LAYER_WIDGET *after* SetBoard():
|
||||
m_Layers = new PCB_LAYER_WIDGET( this, GetGalCanvas() );
|
||||
m_Layers = new PCB_LAYER_WIDGET( this, GetCanvas() );
|
||||
|
||||
wxIcon icon;
|
||||
icon.CopyFromBitmap( KiBitmap( icon_pcbnew_xpm ) );
|
||||
|
@ -257,7 +257,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
.Caption( _( "Layers Manager" ) ).PaneBorder( false )
|
||||
.MinSize( 80, -1 ).BestSize( m_Layers->GetBestSize() ) );
|
||||
|
||||
m_auimgr.AddPane( GetGalCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
||||
|
||||
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
|
||||
m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
|
||||
|
@ -297,10 +297,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
GetToolManager()->RunAction( ACTIONS::acceleratedGraphics, true );
|
||||
|
||||
// Switch back to Cairo if OpenGL is not supported
|
||||
if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
if( GetCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
GetToolManager()->RunAction( ACTIONS::standardGraphics, true );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -313,9 +311,9 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
SaveSettings( config() );
|
||||
}
|
||||
|
||||
GetGalCanvas()->SwitchBackend( m_canvasType );
|
||||
galCanvas->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
galCanvas->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
GetCanvas()->SwitchBackend( m_canvasType );
|
||||
GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
GetCanvas()->GetView()->SetScale( GetZoomLevelCoeff() / GetScreen()->GetZoom() );
|
||||
ActivateGalCanvas();
|
||||
|
||||
// disable Export STEP item if kicad2step does not exist
|
||||
|
@ -368,8 +366,6 @@ void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
|||
{
|
||||
PCB_BASE_FRAME::SetPageSettings( aPageSettings );
|
||||
|
||||
PCB_DRAW_PANEL_GAL* drawPanel = static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() );
|
||||
|
||||
// Prepare worksheet template
|
||||
KIGFX::WS_PROXY_VIEW_ITEM* worksheet;
|
||||
worksheet = new KIGFX::WS_PROXY_VIEW_ITEM( IU_PER_MILS ,&m_Pcb->GetPageSettings(),
|
||||
|
@ -388,7 +384,7 @@ void PCB_EDIT_FRAME::SetPageSettings( const PAGE_INFO& aPageSettings )
|
|||
worksheet->SetFileName( TO_UTF8( board->GetFileName() ) );
|
||||
|
||||
// PCB_DRAW_PANEL_GAL takes ownership of the worksheet
|
||||
drawPanel->SetWorksheet( worksheet );
|
||||
GetCanvas()->SetWorksheet( worksheet );
|
||||
}
|
||||
|
||||
|
||||
|
@ -405,8 +401,8 @@ void PCB_EDIT_FRAME::setupTools()
|
|||
{
|
||||
// Create the manager and dispatcher & route draw panel events to the dispatcher
|
||||
m_toolManager = new TOOL_MANAGER;
|
||||
m_toolManager->SetEnvironment( m_Pcb, GetGalCanvas()->GetView(),
|
||||
GetGalCanvas()->GetViewControls(), this );
|
||||
m_toolManager->SetEnvironment( m_Pcb, GetCanvas()->GetView(),
|
||||
GetCanvas()->GetViewControls(), this );
|
||||
m_actions = new PCB_ACTIONS();
|
||||
m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions );
|
||||
|
||||
|
@ -483,9 +479,9 @@ void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
// See https://bugs.launchpad.net/kicad/+bug/1655858
|
||||
// I think this is certainly a OpenGL event fired after frame deletion, so this workaround
|
||||
// avoid the crash (JPC)
|
||||
GetGalCanvas()->SetEvtHandlerEnabled( false );
|
||||
GetCanvas()->SetEvtHandlerEnabled( false );
|
||||
|
||||
GetGalCanvas()->StopDrawing();
|
||||
GetCanvas()->StopDrawing();
|
||||
|
||||
// Delete the auto save file if it exists.
|
||||
wxFileName fn = GetBoard()->GetFileName();
|
||||
|
@ -531,10 +527,9 @@ void PCB_EDIT_FRAME::ActivateGalCanvas()
|
|||
PCB_BASE_EDIT_FRAME::ActivateGalCanvas();
|
||||
COLORS_DESIGN_SETTINGS& cds = Settings().Colors();
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &cds );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->GetGAL()->SetGridColor( cds.GetLayerColor( LAYER_GRID ) );
|
||||
GetCanvas()->GetView()->GetPainter()->GetSettings()->ImportLegacyColors( &cds );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -554,9 +549,9 @@ void PCB_EDIT_FRAME::DoShowBoardSetupDialog( const wxString& aInitialPage,
|
|||
ReCreateAuxiliaryToolbar();
|
||||
|
||||
for( auto module : GetBoard()->Modules() )
|
||||
GetGalCanvas()->GetView()->Update( module );
|
||||
GetCanvas()->GetView()->Update( module );
|
||||
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
|
||||
//this event causes the routing tool to reload its design rules information
|
||||
TOOL_EVENT toolEvent( TC_COMMAND, TA_MODEL_CHANGE, AS_ACTIVE );
|
||||
|
@ -626,8 +621,7 @@ void PCB_EDIT_FRAME::SetGridColor( COLOR4D aColor )
|
|||
{
|
||||
|
||||
Settings().Colors().SetItemColor( LAYER_GRID, aColor );
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetGridColor( aColor );
|
||||
GetCanvas()->GetGAL()->SetGridColor( aColor );
|
||||
}
|
||||
|
||||
|
||||
|
@ -638,10 +632,9 @@ void PCB_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
|||
syncLayerWidgetLayer();
|
||||
|
||||
m_toolManager->RunAction( PCB_ACTIONS::layerChanged ); // notify other tools
|
||||
GetGalCanvas()->SetFocus(); // allow capture of hotkeys
|
||||
|
||||
GetGalCanvas()->SetHighContrastLayer( aLayer );
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->SetFocus(); // allow capture of hotkeys
|
||||
GetCanvas()->SetHighContrastLayer( aLayer );
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -689,7 +682,7 @@ void PCB_EDIT_FRAME::syncRenderStates()
|
|||
void PCB_EDIT_FRAME::syncLayerVisibilities()
|
||||
{
|
||||
m_Layers->SyncLayerVisibilities();
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->SyncLayersVisibility( m_Pcb );
|
||||
GetCanvas()->SyncLayersVisibility( m_Pcb );
|
||||
}
|
||||
|
||||
|
||||
|
@ -709,9 +702,9 @@ void PCB_EDIT_FRAME::SetElementVisibility( GAL_LAYER_ID aElement, bool aNewState
|
|||
{
|
||||
// Force the RATSNEST visible
|
||||
if( aElement == LAYER_RATSNEST )
|
||||
GetGalCanvas()->GetView()->SetLayerVisible( aElement, true );
|
||||
GetCanvas()->GetView()->SetLayerVisible( aElement, true );
|
||||
else
|
||||
GetGalCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
|
||||
GetCanvas()->GetView()->SetLayerVisible( aElement , aNewState );
|
||||
|
||||
GetBoard()->SetElementVisibility( aElement, aNewState );
|
||||
m_Layers->SetRenderState( aElement, aNewState );
|
||||
|
@ -872,7 +865,7 @@ void PCB_EDIT_FRAME::SwitchCanvas( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType )
|
|||
// switches currently used canvas (Cairo / OpenGL).
|
||||
PCB_BASE_FRAME::SwitchCanvas( aCanvasType );
|
||||
|
||||
GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
GetCanvas()->GetGAL()->SetGridSize( VECTOR2D( GetScreen()->GetGridSize() ) );
|
||||
|
||||
// The base class method *does not reinit* the layers manager. We must upate the
|
||||
// layer widget to match board visibility states, both layers and render columns.
|
||||
|
@ -1094,7 +1087,7 @@ void PCB_EDIT_FRAME::InstallFootprintPropertiesDialog( MODULE* Module )
|
|||
if( retvalue == DIALOG_FOOTPRINT_BOARD_EDITOR::PRM_EDITOR_EDIT_OK )
|
||||
{
|
||||
// If something edited, push a refresh request
|
||||
GetGalCanvas()->Refresh();
|
||||
GetCanvas()->Refresh();
|
||||
}
|
||||
else if( retvalue == DIALOG_FOOTPRINT_BOARD_EDITOR::PRM_EDITOR_EDIT_BOARD_FOOTPRINT )
|
||||
{
|
||||
|
|
|
@ -24,14 +24,9 @@
|
|||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @file pcb_layer_widget.cpp
|
||||
* @brief Pcbnew specialization of LAYER_WIDGET layers manager
|
||||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <pgm_base.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <pcb_draw_panel_gal.h>
|
||||
#include <view/view.h>
|
||||
#include <painter.h>
|
||||
#include <confirm.h>
|
||||
|
@ -578,14 +573,14 @@ void PCB_LAYER_WIDGET::OnLayerColorChange( int aLayer, COLOR4D aColor )
|
|||
{
|
||||
myframe->Settings().Colors().SetLayerColor( aLayer, aColor );
|
||||
|
||||
KIGFX::VIEW* view = myframe->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = myframe->GetCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
|
||||
view->UpdateLayerColor( aLayer );
|
||||
view->UpdateLayerColor( GetNetnameLayer( aLayer ) );
|
||||
|
||||
myframe->ReCreateHToolbar();
|
||||
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
|
||||
if( aLayer == LAYER_PCB_BACKGROUND )
|
||||
myframe->SetDrawBgColor( aColor );
|
||||
|
@ -607,7 +602,7 @@ bool PCB_LAYER_WIDGET::OnLayerSelect( int aLayer )
|
|||
if( m_alwaysShowActiveCopperLayer )
|
||||
OnLayerSelected();
|
||||
else if( displ_opts->m_ContrastModeDisplay )
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -644,14 +639,12 @@ void PCB_LAYER_WIDGET::OnLayerVisible( int aLayer, bool isVisible, bool isFinal
|
|||
if( !m_fp_editor_mode )
|
||||
myframe->OnModify();
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
|
||||
|
||||
if( galCanvas )
|
||||
galCanvas->GetView()->SetLayerVisible( aLayer, isVisible );
|
||||
if( myframe->GetCanvas() )
|
||||
myframe->GetCanvas()->GetView()->SetLayerVisible( aLayer, isVisible );
|
||||
}
|
||||
|
||||
if( isFinal )
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -667,12 +660,10 @@ void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
|
|||
|
||||
myframe->Settings().Colors().SetItemColor( static_cast<GAL_LAYER_ID>( aId ), aColor );
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
|
||||
|
||||
if( aId == LAYER_GRID )
|
||||
galCanvas->GetGAL()->SetGridColor( aColor );
|
||||
myframe->GetCanvas()->GetGAL()->SetGridColor( aColor );
|
||||
|
||||
KIGFX::VIEW* view = galCanvas->GetView();
|
||||
KIGFX::VIEW* view = myframe->GetCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &myframe->Settings().Colors() );
|
||||
view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); // useful to update rastnest
|
||||
view->UpdateLayerColor( aId );
|
||||
|
@ -681,11 +672,9 @@ void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, COLOR4D aColor )
|
|||
if( aId == LAYER_PCB_BACKGROUND )
|
||||
view->UpdateLayerColor( LAYER_PADS_PLATEDHOLES );
|
||||
|
||||
galCanvas->ForceRefresh();
|
||||
|
||||
myframe->ReCreateHToolbar();
|
||||
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->ForceRefresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -704,31 +693,29 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
|||
|
||||
brd->SetElementVisibility( static_cast<GAL_LAYER_ID>( aId ), isEnabled );
|
||||
|
||||
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
|
||||
|
||||
if( aId == LAYER_GRID )
|
||||
{
|
||||
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
||||
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
myframe->GetCanvas()->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
||||
myframe->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
}
|
||||
else if( aId == LAYER_RATSNEST )
|
||||
{
|
||||
// don't touch the layers. ratsnest is enabled on per-item basis.
|
||||
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
galCanvas->GetView()->SetLayerVisible( aId, true );
|
||||
myframe->GetCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||
myframe->GetCanvas()->GetView()->SetLayerVisible( aId, true );
|
||||
|
||||
if( myframe->IsType( FRAME_PCB ) )
|
||||
{
|
||||
auto opt = static_cast<PCB_DISPLAY_OPTIONS*>( myframe->GetDisplayOptions() );
|
||||
opt->m_ShowGlobalRatsnest = isEnabled;
|
||||
static_cast<KIGFX::PCB_VIEW*>( galCanvas->GetView() )->UpdateDisplayOptions( opt );
|
||||
myframe->GetCanvas()->GetView()->UpdateDisplayOptions( opt );
|
||||
}
|
||||
}
|
||||
else
|
||||
galCanvas->GetView()->SetLayerVisible( aId, isEnabled );
|
||||
myframe->GetCanvas()->GetView()->SetLayerVisible( aId, isEnabled );
|
||||
|
||||
galCanvas->Refresh();
|
||||
myframe->GetGalCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
myframe->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
//-----</LAYER_WIDGET callbacks>------------------------------------------
|
||||
|
|
|
@ -79,18 +79,14 @@ bool PCB_EDIT_FRAME::ImportSpecctraSession( const wxString& fullFileName )
|
|||
GetBoard()->GetConnectivity()->Clear();
|
||||
GetBoard()->GetConnectivity()->Build( GetBoard() );
|
||||
|
||||
if( GetGalCanvas() ) // Update view:
|
||||
if( GetCanvas() ) // Update view:
|
||||
{
|
||||
auto view = GetGalCanvas()->GetView();
|
||||
|
||||
// Update footprint positions
|
||||
view->RecacheAllItems();
|
||||
GetCanvas()->GetView()->RecacheAllItems();
|
||||
|
||||
// add imported tracks (previous tracks are removed, therfore all are new)
|
||||
for( auto track : GetBoard()->Tracks() )
|
||||
{
|
||||
view->Add( track );
|
||||
}
|
||||
GetCanvas()->GetView()->Add( track );
|
||||
}
|
||||
|
||||
SetStatusText( wxString( _( "Session file imported and merged OK." ) ) );
|
||||
|
|
|
@ -154,11 +154,9 @@ void Refresh()
|
|||
auto board = s_PcbEditFrame->GetBoard();
|
||||
board->BuildConnectivity();
|
||||
|
||||
auto gal_canvas = static_cast<PCB_DRAW_PANEL_GAL*>( s_PcbEditFrame->GetGalCanvas() );
|
||||
|
||||
// Reinit everything: this is the easy way to do that
|
||||
// Re-init everything: this is the easy way to do that
|
||||
s_PcbEditFrame->ActivateGalCanvas();
|
||||
gal_canvas->Refresh();
|
||||
s_PcbEditFrame->GetCanvas()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -265,7 +265,7 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
|
|||
while( drawSegment( S_SEGMENT, line, startingPoint ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( line )
|
||||
{
|
||||
|
@ -307,7 +307,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
|
|||
while( drawSegment( S_CIRCLE, circle ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( circle )
|
||||
{
|
||||
|
@ -344,7 +344,7 @@ int DRAWING_TOOL::DrawArc( const TOOL_EVENT& aEvent )
|
|||
while( drawArc( arc ) )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( arc )
|
||||
{
|
||||
|
@ -390,7 +390,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
VECTOR2I cursorPos = m_controls->GetCursorPosition();
|
||||
|
||||
if( reselect && text )
|
||||
|
@ -585,7 +585,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
m_controls->SetSnapping( !evt->Modifier( MD_ALT ) );
|
||||
|
@ -953,7 +953,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
|
||||
if( evt->IsClick( BUT_LEFT ) )
|
||||
{
|
||||
|
@ -1435,7 +1435,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout, ZONE_MODE aMode )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
LSET layers( m_frame->GetActiveLayer() );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
|
@ -1559,7 +1559,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
|||
const LSET lset = aVia->GetLayerSet();
|
||||
std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> items;
|
||||
BOX2I bbox = aVia->GetBoundingBox();
|
||||
auto view = m_frame->GetGalCanvas()->GetView();
|
||||
auto view = m_frame->GetCanvas()->GetView();
|
||||
std::vector<TRACK*> possible_tracks;
|
||||
|
||||
view->Query( bbox, items );
|
||||
|
@ -1605,7 +1605,7 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
|||
int net = 0;
|
||||
int clearance = 0;
|
||||
BOX2I bbox = aVia->GetBoundingBox();
|
||||
auto view = m_frame->GetGalCanvas()->GetView();
|
||||
auto view = m_frame->GetCanvas()->GetView();
|
||||
|
||||
view->Query( bbox, items );
|
||||
|
||||
|
|
|
@ -1228,7 +1228,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
while( auto evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
frame()->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
frame()->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
|
||||
grid.SetUseGrid( !evt->Modifier( MD_ALT ) );
|
||||
controls.SetSnapping( !evt->Modifier( MD_ALT ) );
|
||||
|
|
|
@ -360,7 +360,7 @@ int MODULE_EDITOR_TOOLS::Properties( const TOOL_EVENT& aEvent )
|
|||
if( footprint )
|
||||
{
|
||||
getEditFrame<FOOTPRINT_EDIT_FRAME>()->OnEditItemRequest( footprint );
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ bool GLOBAL_EDIT_TOOL::swapBoardItem( BOARD_ITEM* aItem, PCB_LAYER_ID* new_layer
|
|||
{
|
||||
m_commit->Modify( aItem );
|
||||
aItem->SetLayer( new_layer[ aItem->GetLayer() ] );
|
||||
frame()->GetGalCanvas()->GetView()->Update( aItem, KIGFX::GEOMETRY );
|
||||
frame()->GetCanvas()->GetView()->Update( aItem, KIGFX::GEOMETRY );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ int GLOBAL_EDIT_TOOL::SwapLayers( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
m_commit->Modify( via );
|
||||
via->SetLayerPair( new_layer[top_layer], new_layer[bottom_layer] );
|
||||
frame()->GetGalCanvas()->GetView()->Update( via, KIGFX::GEOMETRY );
|
||||
frame()->GetCanvas()->GetView()->Update( via, KIGFX::GEOMETRY );
|
||||
hasChanges = true;
|
||||
}
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ int GLOBAL_EDIT_TOOL::SwapLayers( const TOOL_EVENT& aEvent )
|
|||
{
|
||||
frame()->OnModify();
|
||||
m_commit->Push( "Layers moved" );
|
||||
frame()->GetGalCanvas()->Refresh();
|
||||
frame()->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -52,7 +52,7 @@ GRID_HELPER::GRID_HELPER( PCB_BASE_FRAME* aFrame ) :
|
|||
m_enableSnap = true;
|
||||
m_enableGrid = true;
|
||||
m_snapSize = 100;
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
|
||||
m_viewAxis.SetSize( 20000 );
|
||||
m_viewAxis.SetStyle( KIGFX::ORIGIN_VIEWITEM::CROSS );
|
||||
|
@ -104,18 +104,16 @@ VECTOR2I GRID_HELPER::GetOrigin() const
|
|||
|
||||
void GRID_HELPER::SetAuxAxes( bool aEnable, const VECTOR2I& aOrigin, bool aEnableDiagonal )
|
||||
{
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
|
||||
if( aEnable )
|
||||
{
|
||||
m_auxAxis = aOrigin;
|
||||
m_viewAxis.SetPosition( aOrigin );
|
||||
view->SetVisible( &m_viewAxis, true );
|
||||
m_frame->GetCanvas()->GetView()->SetVisible( &m_viewAxis, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_auxAxis = OPT<VECTOR2I>();
|
||||
view->SetVisible( &m_viewAxis, false );
|
||||
m_frame->GetCanvas()->GetView()->SetVisible( &m_viewAxis, false );
|
||||
}
|
||||
|
||||
m_diagonalAuxAxesEnable = aEnable;
|
||||
|
@ -189,7 +187,7 @@ VECTOR2I GRID_HELPER::BestDragOrigin( const VECTOR2I &aMousePos, BOARD_ITEM* aIt
|
|||
clearAnchors();
|
||||
computeAnchors( aItem, aMousePos, true );
|
||||
|
||||
double worldScale = m_frame->GetGalCanvas()->GetGAL()->GetWorldScale();
|
||||
double worldScale = m_frame->GetCanvas()->GetGAL()->GetWorldScale();
|
||||
double lineSnapMinCornerDistance = 50.0 / worldScale;
|
||||
|
||||
ANCHOR* nearestOutline = nearestAnchor( aMousePos, OUTLINE, LSET::AllLayersMask() );
|
||||
|
@ -233,7 +231,7 @@ std::set<BOARD_ITEM*> GRID_HELPER::queryVisible( const BOX2I& aArea,
|
|||
std::set<BOARD_ITEM*> items;
|
||||
std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
|
||||
|
||||
auto view = m_frame->GetGalCanvas()->GetView();
|
||||
auto view = m_frame->GetCanvas()->GetView();
|
||||
auto activeLayers = view->GetPainter()->GetSettings()->GetActiveLayers();
|
||||
bool isHighContrast = view->GetPainter()->GetSettings()->GetHighContrast();
|
||||
view->Query( aArea, selectedItems );
|
||||
|
@ -243,8 +241,7 @@ std::set<BOARD_ITEM*> GRID_HELPER::queryVisible( const BOX2I& aArea,
|
|||
BOARD_ITEM* item = static_cast<BOARD_ITEM*>( it.first );
|
||||
|
||||
// The item must be visible and on an active layer
|
||||
if( view->IsVisible( item )
|
||||
&& ( !isHighContrast || activeLayers.count( it.second ) ) )
|
||||
if( view->IsVisible( item ) && ( !isHighContrast || activeLayers.count( it.second ) ) )
|
||||
items.insert ( item );
|
||||
}
|
||||
|
||||
|
@ -276,7 +273,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, BOARD_ITEM* aDrag
|
|||
VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLayers,
|
||||
const std::vector<BOARD_ITEM*> aSkip )
|
||||
{
|
||||
double worldScale = m_frame->GetGalCanvas()->GetGAL()->GetWorldScale();
|
||||
double worldScale = m_frame->GetCanvas()->GetGAL()->GetWorldScale();
|
||||
int snapRange = (int) ( m_snapSize / worldScale );
|
||||
|
||||
BOX2I bb( VECTOR2I( aOrigin.x - snapRange / 2, aOrigin.y - snapRange / 2 ), VECTOR2I( snapRange, snapRange ) );
|
||||
|
@ -284,9 +281,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLaye
|
|||
clearAnchors();
|
||||
|
||||
for( BOARD_ITEM* item : queryVisible( bb, aSkip ) )
|
||||
{
|
||||
computeAnchors( item, aOrigin );
|
||||
}
|
||||
|
||||
ANCHOR* nearest = nearestAnchor( aOrigin, SNAPPABLE, aLayers );
|
||||
VECTOR2I nearestGrid = Align( aOrigin );
|
||||
|
@ -300,10 +295,10 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLaye
|
|||
{
|
||||
m_viewSnapPoint.SetPosition( nearest->pos );
|
||||
|
||||
if( m_frame->GetGalCanvas()->GetView()->IsVisible( &m_viewSnapPoint ) )
|
||||
m_frame->GetGalCanvas()->GetView()->Update( &m_viewSnapPoint, KIGFX::GEOMETRY);
|
||||
if( m_frame->GetCanvas()->GetView()->IsVisible( &m_viewSnapPoint ) )
|
||||
m_frame->GetCanvas()->GetView()->Update( &m_viewSnapPoint, KIGFX::GEOMETRY);
|
||||
else
|
||||
m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true );
|
||||
m_frame->GetCanvas()->GetView()->SetVisible( &m_viewSnapPoint, true );
|
||||
|
||||
m_snapItem = nearest;
|
||||
return nearest->pos;
|
||||
|
@ -311,7 +306,7 @@ VECTOR2I GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, const LSET& aLaye
|
|||
}
|
||||
|
||||
m_snapItem = nullptr;
|
||||
m_frame->GetGalCanvas()->GetView()->SetVisible( &m_viewSnapPoint, false );
|
||||
m_frame->GetCanvas()->GetView()->SetVisible( &m_viewSnapPoint, false );
|
||||
return nearestGrid;
|
||||
}
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent )
|
|||
|
||||
statusPopup.Hide();
|
||||
frame()->SetNoToolSelected();
|
||||
frame()->GetGalCanvas()->SetCursor( wxCURSOR_ARROW );
|
||||
frame()->GetCanvas()->SetCursor( wxCURSOR_ARROW );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -721,7 +721,7 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
|
||||
|
||||
if( reselect && module )
|
||||
|
@ -901,7 +901,7 @@ int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
|
|||
while( OPT_TOOL_EVENT evt = Wait() )
|
||||
{
|
||||
// This can be reset by some actions (e.g. Save Board), so ensure it stays set.
|
||||
m_frame->GetGalCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
m_frame->GetCanvas()->SetCurrentCursor( wxCURSOR_PENCIL );
|
||||
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
|
||||
|
||||
if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) )
|
||||
|
@ -1153,7 +1153,7 @@ int PCB_EDITOR_CONTROL::CrossProbeSchToPcb( const TOOL_EVENT& aEvent )
|
|||
// Ensure the display is refreshed, because in some installs
|
||||
// the refresh is done only when the gal canvas has the focus, and
|
||||
// that is not the case when crossprobing from Eeschema:
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1507,8 +1507,8 @@ void PCB_EDITOR_CONTROL::ratsnestTimer( wxTimerEvent& aEvent )
|
|||
{
|
||||
m_ratsnestTimer.Stop();
|
||||
calculateSelectionRatsnest();
|
||||
static_cast<PCB_DRAW_PANEL_GAL*>( m_frame->GetGalCanvas() )->RedrawRatsnest();
|
||||
m_frame->GetGalCanvas()->Refresh();
|
||||
m_frame->GetCanvas()->RedrawRatsnest();
|
||||
m_frame->GetCanvas()->Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ PCB_DISPLAY_OPTIONS* PCB_TOOL_BASE::displayOptions() const
|
|||
|
||||
PCB_DRAW_PANEL_GAL* PCB_TOOL_BASE::canvas() const
|
||||
{
|
||||
return static_cast<PCB_DRAW_PANEL_GAL*>( frame()->GetGalCanvas() );
|
||||
return static_cast<PCB_DRAW_PANEL_GAL*>( frame()->GetCanvas() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -514,7 +514,7 @@ int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent )
|
|||
currentColor.a += ALPHA_STEP;
|
||||
settings.SetLayerColor( currentLayer, currentColor );
|
||||
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &settings );
|
||||
view->UpdateLayerColor( currentLayer );
|
||||
|
||||
|
@ -540,7 +540,7 @@ int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent )
|
|||
currentColor.a -= ALPHA_STEP;
|
||||
settings.SetLayerColor( currentLayer, currentColor );
|
||||
|
||||
KIGFX::VIEW* view = m_frame->GetGalCanvas()->GetView();
|
||||
KIGFX::VIEW* view = m_frame->GetCanvas()->GetView();
|
||||
view->GetPainter()->GetSettings()->ImportLegacyColors( &settings );
|
||||
view->UpdateLayerColor( currentLayer );
|
||||
|
||||
|
|
|
@ -450,7 +450,7 @@ PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCli
|
|||
for( auto item : new_items )
|
||||
highlight( static_cast<BOARD_ITEM*>( item ), SELECTED, m_selection );
|
||||
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
return m_selection;
|
||||
|
@ -482,7 +482,7 @@ void SELECTION_TOOL::toggleSelection( BOARD_ITEM* aItem, bool aForce )
|
|||
}
|
||||
|
||||
if( m_frame )
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const
|
||||
|
@ -1096,12 +1096,11 @@ void SELECTION_TOOL::zoomFitSelection()
|
|||
{
|
||||
//Should recalculate the view to zoom in on the selection
|
||||
auto selectionBox = m_selection.ViewBBox();
|
||||
auto canvas = m_frame->GetGalCanvas();
|
||||
auto view = getView();
|
||||
|
||||
VECTOR2D screenSize = view->ToWorld( canvas->GetClientSize(), false );
|
||||
VECTOR2D screenSize = view->ToWorld( m_frame->GetCanvas()->GetClientSize(), false );
|
||||
|
||||
if( !( selectionBox.GetWidth() == 0 ) || !( selectionBox.GetHeight() == 0 ) )
|
||||
if( selectionBox.GetWidth() != 0 || selectionBox.GetHeight() != 0 )
|
||||
{
|
||||
VECTOR2D vsize = selectionBox.GetSize();
|
||||
double scale = view->GetScale() / std::max( fabs( vsize.x / screenSize.x ),
|
||||
|
@ -1111,7 +1110,7 @@ void SELECTION_TOOL::zoomFitSelection()
|
|||
view->Add( &m_selection );
|
||||
}
|
||||
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1178,7 +1177,7 @@ void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem )
|
|||
m_toolMgr->ProcessEvent( EVENTS::SelectedEvent );
|
||||
}
|
||||
|
||||
m_frame->GetGalCanvas()->ForceRefresh();
|
||||
m_frame->GetCanvas()->ForceRefresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue