diff --git a/Documentation/development/tool-framework.md b/Documentation/development/tool-framework.md index 370f73463f..83a4538404 100644 --- a/Documentation/development/tool-framework.md +++ b/Documentation/development/tool-framework.md @@ -443,7 +443,7 @@ Below you will find the contents of useless_tool.cpp: { // we will call actions on the selection tool to get the current // selection. The selection tools will handle item disambiguation - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); assert( selectionTool ); // call the actions diff --git a/gerbview/tools/gerbview_control.h b/gerbview/tools/gerbview_control.h index 6a0c26a791..53f73db260 100644 --- a/gerbview/tools/gerbview_control.h +++ b/gerbview/tools/gerbview_control.h @@ -27,7 +27,7 @@ class EDA_DRAW_PANEL_GAL; class GERBVIEW_FRAME; /** - * PCBNEW_CONTROL + * GERBVIEW_CONTROL * * Handles actions that are shared between different frames in pcbnew. */ diff --git a/include/tool/conditional_menu.h b/include/tool/conditional_menu.h index 1b2ec86d7c..1301c981a7 100644 --- a/include/tool/conditional_menu.h +++ b/include/tool/conditional_menu.h @@ -30,7 +30,7 @@ #include #include -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class TOOL_ACTION; class TOOL_INTERACTIVE; diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index 045c5c048f..fe00b67f33 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -323,6 +323,9 @@ set( PCBNEW_CLASS_SRCS ratsnest/ratsnest.cpp + tools/board_editor_control.cpp + tools/board_inspection_tool.cpp + tools/board_reannotate_tool.cpp tools/convert_tool.cpp tools/drawing_tool.cpp tools/drc_tool.cpp @@ -332,18 +335,15 @@ set( PCBNEW_CLASS_SRCS tools/footprint_editor_tools.cpp tools/pad_tool.cpp tools/pcb_bright_box.cpp - tools/pcb_editor_control.cpp - tools/pcb_inspection_tool.cpp - tools/pcb_reannotate_tool.cpp + tools/pcb_control.cpp + tools/pcb_picker_tool.cpp + tools/pcb_selection.cpp tools/pcb_selection_conditions.cpp + tools/pcb_selection_tool.cpp tools/pcb_tool_base.cpp - tools/pcbnew_control.cpp - tools/pcbnew_picker_tool.cpp - tools/pcbnew_selection.cpp tools/placement_tool.cpp tools/point_editor.cpp tools/position_relative_tool.cpp - tools/selection_tool.cpp tools/tool_event_utils.cpp tools/zone_create_helper.cpp tools/zone_filler_tool.cpp diff --git a/pcbnew/array_creator.h b/pcbnew/array_creator.h index 2edc32ddca..8464750987 100644 --- a/pcbnew/array_creator.h +++ b/pcbnew/array_creator.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include /*! * Class that performs array creation by producing a dialog to gather parameters and then @@ -40,7 +40,7 @@ class ARRAY_CREATOR { public: ARRAY_CREATOR( PCB_BASE_FRAME& aParent, bool aIsFootprintEditor, - const PCBNEW_SELECTION& aSelection ) : + const PCB_SELECTION& aSelection ) : m_parent( aParent ), m_isFootprintEditor( aIsFootprintEditor ), m_selection( aSelection ) @@ -54,9 +54,9 @@ public: void Invoke(); private: - PCB_BASE_FRAME& m_parent; - bool m_isFootprintEditor; - const PCBNEW_SELECTION& m_selection; + PCB_BASE_FRAME& m_parent; + bool m_isFootprintEditor; + const PCB_SELECTION& m_selection; }; #endif /* ARRAY_CREATOR_H_ */ diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index f0c7e858ac..530e0a61fe 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -2085,7 +2085,7 @@ wxString BOARD::GroupsSanityCheckInternal( bool repair ) } -BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCBNEW_SELECTION& selection ) const +BOARD::GroupLegalOpsField BOARD::GroupLegalOps( const PCB_SELECTION& selection ) const { GroupLegalOpsField legalOps = { false, false, false, false, false, false }; diff --git a/pcbnew/board.h b/pcbnew/board.h index 784d4ca7e4..3885195f2f 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include class BOARD_COMMIT; class PCB_BASE_FRAME; @@ -1163,6 +1163,6 @@ public: * Check which selection tool group operations are legal given the selection. * @return bit field of legal ops. */ - GroupLegalOpsField GroupLegalOps( const PCBNEW_SELECTION& selection ) const; + GroupLegalOpsField GroupLegalOps( const PCB_SELECTION& selection ) const; }; #endif // CLASS_BOARD_H_ diff --git a/pcbnew/board_commit.cpp b/pcbnew/board_commit.cpp index 2acb964aae..f4f332eadc 100644 --- a/pcbnew/board_commit.cpp +++ b/pcbnew/board_commit.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -93,7 +93,7 @@ void BOARD_COMMIT::Push( const wxString& aMessage, bool aCreateUndoEntry, bool a PCB_BASE_FRAME* frame = (PCB_BASE_FRAME*) m_toolMgr->GetToolHolder(); auto connectivity = board->GetConnectivity(); std::set savedModules; - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); bool itemsDeselected = false; std::vector bulkAddedItems; @@ -489,7 +489,7 @@ void BOARD_COMMIT::Revert() if ( !m_isFootprintEditor ) connectivity->RecalculateRatsnest(); - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); selTool->RebuildSelection(); clear(); diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index 1ae047c4e3..11ee9b385a 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include /* Execute a remote command send by Eeschema via a socket, diff --git a/pcbnew/dialogs/dialog_board_reannotate.cpp b/pcbnew/dialogs/dialog_board_reannotate.cpp index 9104462f62..e40c684298 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.cpp +++ b/pcbnew/dialogs/dialog_board_reannotate.cpp @@ -137,7 +137,7 @@ DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE( PCB_EDIT_FRAME* aParentFrame ) m_sortButtons[m_sortCode]->SetValue( true ); - m_selection = m_frame->GetToolManager()->GetTool()->GetSelection(); + m_selection = m_frame->GetToolManager()->GetTool()->GetSelection(); if( !m_selection.Empty() ) m_annotationChoice = AnnotationChoice::AnnotateSelected; diff --git a/pcbnew/dialogs/dialog_board_reannotate.h b/pcbnew/dialogs/dialog_board_reannotate.h index f3fc563a5b..d632c36141 100644 --- a/pcbnew/dialogs/dialog_board_reannotate.h +++ b/pcbnew/dialogs/dialog_board_reannotate.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #define SORTXFIRST 0b000 //Sort on X #define SORTYFIRST 0b100 //Sort on Y @@ -107,7 +107,7 @@ private: PCB_EDIT_FRAME* m_frame; FOOTPRINTS m_footprints; PCB_SCREEN* m_screen; - PCBNEW_SELECTION m_selection; + PCB_SELECTION m_selection; std::vector m_changeArray; std::vector m_frontFootprints; diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index 37c2927376..5f8fe35bbd 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -45,7 +45,7 @@ #include "3d_cache/dialogs/3d_cache_dialogs.h" #include #include -#include +#include #include @@ -635,7 +635,7 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow() } // Remove text items: - SELECTION_TOOL* selTool = m_frame->GetToolManager()->GetTool(); + PCB_SELECTION_TOOL* selTool = m_frame->GetToolManager()->GetTool(); for( FP_TEXT* item: items_to_remove ) { diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 0effb9ec9b..1aa7f977c1 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ static DRILL_PRECISION precisionListForMetric( 3, 3 ); /* This function displays the dialog frame for drill tools */ -int PCB_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent ) { PCB_EDIT_FRAME* editFrame = getEditFrame(); DIALOG_GENDRILL dlg( editFrame, editFrame ); diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index 12180cea70..4480580849 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "dialog_global_edit_tracks_and_vias_base.h" @@ -220,8 +220,9 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid() bool DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow() { - PCBNEW_SELECTION& selection = m_parent->GetToolManager()->GetTool()->GetSelection(); - auto item = dynamic_cast( selection.Front() ); + PCB_SELECTION_TOOL* selTool = m_parent->GetToolManager()->GetTool(); + PCB_SELECTION& selection = selTool->GetSelection(); + BOARD_CONNECTED_ITEM* item = dynamic_cast( selection.Front() ); m_tracks->SetValue( g_modifyTracks ); m_vias->SetValue( g_modifyVias ); diff --git a/pcbnew/dialogs/dialog_net_inspector.cpp b/pcbnew/dialogs/dialog_net_inspector.cpp index 93e1046e3a..8b7a3418fd 100644 --- a/pcbnew/dialogs/dialog_net_inspector.cpp +++ b/pcbnew/dialogs/dialog_net_inspector.cpp @@ -24,7 +24,7 @@ */ #include -#include +#include #include #include #include diff --git a/pcbnew/dialogs/dialog_print_pcbnew.cpp b/pcbnew/dialogs/dialog_print_pcbnew.cpp index f8496baef8..72431de06e 100644 --- a/pcbnew/dialogs/dialog_print_pcbnew.cpp +++ b/pcbnew/dialogs/dialog_print_pcbnew.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include @@ -435,7 +435,7 @@ void DIALOG_PRINT_PCBNEW::saveSettings() } -int PCBNEW_CONTROL::Print( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::Print( const TOOL_EVENT& aEvent ) { // Selection affects the origin item visibility m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); diff --git a/pcbnew/dialogs/dialog_track_via_properties.cpp b/pcbnew/dialogs/dialog_track_via_properties.cpp index a39e6926a3..a3f55285ca 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.cpp +++ b/pcbnew/dialogs/dialog_track_via_properties.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -34,7 +34,7 @@ #include DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParent, - const PCBNEW_SELECTION& aItems, + const PCB_SELECTION& aItems, COMMIT& aCommit ) : DIALOG_TRACK_VIA_PROPERTIES_BASE( aParent ), m_frame( aParent ), diff --git a/pcbnew/dialogs/dialog_track_via_properties.h b/pcbnew/dialogs/dialog_track_via_properties.h index 31e8882293..071ab2ef5d 100644 --- a/pcbnew/dialogs/dialog_track_via_properties.h +++ b/pcbnew/dialogs/dialog_track_via_properties.h @@ -27,7 +27,7 @@ #include #include -class PCBNEW_SELECTION; +class PCB_SELECTION; class COMMIT; class PCB_BASE_FRAME; class PAD; @@ -35,7 +35,7 @@ class PAD; class DIALOG_TRACK_VIA_PROPERTIES : public DIALOG_TRACK_VIA_PROPERTIES_BASE { public: - DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParent, const PCBNEW_SELECTION& aItems, + DIALOG_TRACK_VIA_PROPERTIES( PCB_BASE_FRAME* aParent, const PCB_SELECTION& aItems, COMMIT& aCommit ); bool TransferDataFromWindow() override; @@ -50,17 +50,17 @@ private: bool confirmPadChange( const std::vector& connectedPads ); - PCB_BASE_FRAME* m_frame; - const PCBNEW_SELECTION& m_items; // List of items to be modified. - COMMIT& m_commit; // An undo record to add any changes to. + PCB_BASE_FRAME* m_frame; + const PCB_SELECTION& m_items; // List of items to be modified. + COMMIT& m_commit; // An undo record to add any changes to. - UNIT_BINDER m_trackStartX, m_trackStartY; - UNIT_BINDER m_trackEndX, m_trackEndY; - UNIT_BINDER m_trackWidth; + UNIT_BINDER m_trackStartX, m_trackStartY; + UNIT_BINDER m_trackEndX, m_trackEndY; + UNIT_BINDER m_trackWidth; - UNIT_BINDER m_viaX, m_viaY; - UNIT_BINDER m_viaDiameter, m_viaDrill; + UNIT_BINDER m_viaX, m_viaY; + UNIT_BINDER m_viaDiameter, m_viaDrill; - bool m_tracks; // True if dialog displays any track properties. - bool m_vias; // True if dialog displays any via properties. + bool m_tracks; // True if dialog displays any track properties. + bool m_vias; // True if dialog displays any via properties. }; diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.cpp b/pcbnew/dialogs/dialog_unused_pad_layers.cpp index c78880b851..78bbc325aa 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.cpp +++ b/pcbnew/dialogs/dialog_unused_pad_layers.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include enum SCOPE : int { @@ -46,7 +46,7 @@ enum PAD_ACTION : int DIALOG_UNUSED_PAD_LAYERS::DIALOG_UNUSED_PAD_LAYERS( PCB_BASE_FRAME* aParent, - const PCBNEW_SELECTION& aItems, + const PCB_SELECTION& aItems, COMMIT& aCommit ) : DIALOG_UNUSED_PAD_LAYERS_BASE( aParent ), m_frame( aParent ), diff --git a/pcbnew/dialogs/dialog_unused_pad_layers.h b/pcbnew/dialogs/dialog_unused_pad_layers.h index 341a8151ff..abcc27763b 100644 --- a/pcbnew/dialogs/dialog_unused_pad_layers.h +++ b/pcbnew/dialogs/dialog_unused_pad_layers.h @@ -30,14 +30,13 @@ class COMMIT; class PCB_BASE_FRAME; -class PCBNEW_SELECTION; +class PCB_SELECTION; class DIALOG_UNUSED_PAD_LAYERS : public DIALOG_UNUSED_PAD_LAYERS_BASE { public: - DIALOG_UNUSED_PAD_LAYERS( PCB_BASE_FRAME* aParent, - const PCBNEW_SELECTION& aItems, - COMMIT& aCommit ); + DIALOG_UNUSED_PAD_LAYERS( PCB_BASE_FRAME* aParent, const PCB_SELECTION& aItems, + COMMIT& aCommit ); private: bool TransferDataFromWindow() override; @@ -47,9 +46,9 @@ private: void syncImages( wxCommandEvent& aEvent ) override; void onScopeChange( wxCommandEvent& aEvent ) override; - PCB_BASE_FRAME* m_frame; - const PCBNEW_SELECTION& m_items; // List of items to be modified. - COMMIT& m_commit; // An undo record to add any changes to. + PCB_BASE_FRAME* m_frame; + const PCB_SELECTION& m_items; // List of items to be modified. + COMMIT& m_commit; // An undo record to add any changes to. }; #endif // __dialog_remove_unused_pads__ diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index 2d255b6516..9f71f7bb41 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include diff --git a/pcbnew/exporters/gen_footprints_placefile.cpp b/pcbnew/exporters/gen_footprints_placefile.cpp index 4ccd7eedee..ee967c09af 100644 --- a/pcbnew/exporters/gen_footprints_placefile.cpp +++ b/pcbnew/exporters/gen_footprints_placefile.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -452,7 +452,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles() } -int PCB_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::GeneratePosFile( const TOOL_EVENT& aEvent ) { PCB_EDIT_FRAME* editFrame = getEditFrame(); DIALOG_GEN_FOOTPRINT_POSITION dlg( editFrame ); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 14e1d9cdcb..8fb38d0a77 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -26,11 +26,11 @@ #include "tools/footprint_editor_tools.h" #include "tools/pad_tool.h" #include "tools/pcb_actions.h" -#include "tools/pcbnew_control.h" -#include "tools/pcbnew_picker_tool.h" +#include "tools/pcb_control.h" +#include "tools/pcb_picker_tool.h" #include "tools/placement_tool.h" #include "tools/point_editor.h" -#include "tools/selection_tool.h" +#include "tools/pcb_selection_tool.h" #include <3d_viewer/eda_3d_viewer.h> #include #include @@ -312,7 +312,7 @@ bool FOOTPRINT_EDIT_FRAME::IsContentModified() SELECTION& FOOTPRINT_EDIT_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } @@ -511,7 +511,7 @@ void FOOTPRINT_EDIT_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) m_displayOptions = cfg->m_Display; m_defaultLibWidth = cfg->m_LibWidth; - GetToolManager()->GetTool()->GetFilter() = cfg->m_SelectionFilter; + GetToolManager()->GetTool()->GetFilter() = cfg->m_SelectionFilter; m_selectionFilterPanel->SetCheckboxesFromFilter( cfg->m_SelectionFilter ); } @@ -526,7 +526,7 @@ void FOOTPRINT_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg ) cfg->m_DesignSettings = GetDesignSettings(); cfg->m_Display = m_displayOptions; cfg->m_LibWidth = m_treePane->GetSize().x; - cfg->m_SelectionFilter = GetToolManager()->GetTool()->GetFilter(); + cfg->m_SelectionFilter = GetToolManager()->GetTool()->GetFilter(); cfg->m_LayerPresets = m_appearancePanel->GetUserLayerPresets(); cfg->m_ActiveLayerPreset = m_appearancePanel->GetActiveLayerPreset(); @@ -901,28 +901,28 @@ void FOOTPRINT_EDIT_FRAME::setupTools() m_toolManager->RegisterTool( new COMMON_CONTROL ); m_toolManager->RegisterTool( new COMMON_TOOLS ); - m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); m_toolManager->RegisterTool( new ZOOM_TOOL ); m_toolManager->RegisterTool( new EDIT_TOOL ); m_toolManager->RegisterTool( new PAD_TOOL ); m_toolManager->RegisterTool( new DRAWING_TOOL ); m_toolManager->RegisterTool( new POINT_EDITOR ); - m_toolManager->RegisterTool( new PCBNEW_CONTROL ); // copy/paste + m_toolManager->RegisterTool( new PCB_CONTROL ); // copy/paste m_toolManager->RegisterTool( new FOOTPRINT_EDITOR_TOOLS ); m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL ); - m_toolManager->RegisterTool( new PCBNEW_PICKER_TOOL ); + m_toolManager->RegisterTool( new PCB_PICKER_TOOL ); m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL ); m_toolManager->RegisterTool( new PCB_VIEWER_TOOLS ); m_toolManager->RegisterTool( new GROUP_TOOL ); m_toolManager->RegisterTool( new CONVERT_TOOL ); - m_toolManager->GetTool()->SetIsFootprintEditor( true ); + m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); - m_toolManager->GetTool()->SetIsFootprintEditor( true ); - m_toolManager->GetTool()->SetIsFootprintEditor( true ); + m_toolManager->GetTool()->SetIsFootprintEditor( true ); + m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); m_toolManager->GetTool()->SetIsFootprintEditor( true ); diff --git a/pcbnew/footprint_edit_frame.h b/pcbnew/footprint_edit_frame.h index 8139a5f228..70f5a1355c 100644 --- a/pcbnew/footprint_edit_frame.h +++ b/pcbnew/footprint_edit_frame.h @@ -31,7 +31,6 @@ class FP_LIB_TABLE; class FOOTPRINT_TREE_PANE; class SYMBOL_LIBRARY_MANAGER; class FOOTPRINT_EDITOR_SETTINGS; -class PCBNEW_SELECTION; namespace PCB { struct IFACE; } // A KIFACE_I coded in pcbnew.c diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 0b87552f0d..10a25ea512 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -52,9 +52,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include @@ -203,11 +203,11 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); drawPanel->SetEventDispatcher( m_toolDispatcher ); - m_toolManager->RegisterTool( new PCBNEW_CONTROL ); - m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new PCB_CONTROL ); + m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); m_toolManager->RegisterTool( new COMMON_TOOLS ); // for std context menus (zoom & grid) m_toolManager->RegisterTool( new COMMON_CONTROL ); - m_toolManager->RegisterTool( new PCBNEW_PICKER_TOOL ); // for setting grid origin + m_toolManager->RegisterTool( new PCB_PICKER_TOOL ); // for setting grid origin m_toolManager->RegisterTool( new ZOOM_TOOL ); m_toolManager->RegisterTool( new PCB_VIEWER_TOOLS ); @@ -293,7 +293,7 @@ FOOTPRINT_VIEWER_FRAME::~FOOTPRINT_VIEWER_FRAME() SELECTION& FOOTPRINT_VIEWER_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index bc992f93e5..50f26cadea 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -48,8 +48,8 @@ #include #include #include -#include "tools/selection_tool.h" -#include "tools/pcbnew_control.h" +#include "tools/pcb_selection_tool.h" +#include "tools/pcb_control.h" #include "tools/pcb_actions.h" @@ -145,8 +145,8 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent m_toolDispatcher = new TOOL_DISPATCHER( m_toolManager, m_actions ); gal_drawPanel->SetEventDispatcher( m_toolDispatcher ); - m_toolManager->RegisterTool( new PCBNEW_CONTROL ); - m_toolManager->RegisterTool( new SELECTION_TOOL ); // for std context menus (zoom & grid) + m_toolManager->RegisterTool( new PCB_CONTROL ); + m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); // for std context menus (zoom & grid) m_toolManager->RegisterTool( new COMMON_TOOLS ); m_toolManager->InitTools(); diff --git a/pcbnew/kicad_clipboard.cpp b/pcbnew/kicad_clipboard.cpp index 3aeb6fbba2..c7788e92cb 100644 --- a/pcbnew/kicad_clipboard.cpp +++ b/pcbnew/kicad_clipboard.cpp @@ -58,7 +58,7 @@ void CLIPBOARD_IO::SetBoard( BOARD* aBoard ) } -void CLIPBOARD_IO::SaveSelection( const PCBNEW_SELECTION& aSelected, bool isFootprintEditor ) +void CLIPBOARD_IO::SaveSelection( const PCB_SELECTION& aSelected, bool isFootprintEditor ) { VECTOR2I refPoint( 0, 0 ); diff --git a/pcbnew/kicad_clipboard.h b/pcbnew/kicad_clipboard.h index 6f454f23c9..7343d15a10 100644 --- a/pcbnew/kicad_clipboard.h +++ b/pcbnew/kicad_clipboard.h @@ -35,7 +35,7 @@ #include #include #include -#include +#include class CLIPBOARD_IO : public PCB_IO @@ -54,7 +54,7 @@ public: * Writes all the settings of the BOARD* set by setBoard() and then adds all the * BOARD_ITEMs found in selection formatted by PCB_IO to clipboard as sexpr text */ - void SaveSelection( const PCBNEW_SELECTION& selected, bool isFootprintEditor ); + void SaveSelection( const PCB_SELECTION& selected, bool isFootprintEditor ); BOARD_ITEM* Parse(); diff --git a/pcbnew/menubar_footprint_editor.cpp b/pcbnew/menubar_footprint_editor.cpp index 7cb8a1c589..89e1bf5191 100644 --- a/pcbnew/menubar_footprint_editor.cpp +++ b/pcbnew/menubar_footprint_editor.cpp @@ -32,13 +32,13 @@ #include #include #include -#include +#include #include void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar() { - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); // wxWidgets handles the Mac Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. wxMenuBar* oldMenuBar = GetMenuBar(); diff --git a/pcbnew/menubar_pcb_editor.cpp b/pcbnew/menubar_pcb_editor.cpp index 57a0274c7b..67166bfe68 100644 --- a/pcbnew/menubar_pcb_editor.cpp +++ b/pcbnew/menubar_pcb_editor.cpp @@ -38,13 +38,13 @@ #include #include #include -#include +#include #include void PCB_EDIT_FRAME::ReCreateMenuBar() { - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); // wxWidgets handles the Mac Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. wxMenuBar* oldMenuBar = GetMenuBar(); diff --git a/pcbnew/microwave/microwave_tool.cpp b/pcbnew/microwave/microwave_tool.cpp index 20e1dc1e9d..f219dcf0fc 100644 --- a/pcbnew/microwave/microwave_tool.cpp +++ b/pcbnew/microwave/microwave_tool.cpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/pcbnew/netlist_reader/netlist.cpp b/pcbnew/netlist_reader/netlist.cpp index 9008df3257..b2edfc68a3 100644 --- a/pcbnew/netlist_reader/netlist.cpp +++ b/pcbnew/netlist_reader/netlist.cpp @@ -44,7 +44,7 @@ using namespace std::placeholders; #include "board_netlist_updater.h" #include #include -#include +#include #include // LAST_PATH_TYPE @@ -120,8 +120,8 @@ void PCB_EDIT_FRAME::OnNetlistChanged( BOARD_NETLIST_UPDATER& aUpdater, bool* aR // Now fix a reference point to move the footprints. // We use the first footprint in list as reference point // The graphic cursor will be on this fp when moving the footprints. - SELECTION_TOOL* selTool = GetToolManager()->GetTool(); - PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + PCB_SELECTION& selection = selTool->GetSelection(); selection.SetReferencePoint( newFootprints[0]->GetPosition() ); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 8570b6fe29..f2b075f2a2 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -57,8 +57,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -66,12 +66,12 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include -#include +#include #include #include #include @@ -430,7 +430,7 @@ bool PCB_EDIT_FRAME::isAutoSaveRequired() const SELECTION& PCB_EDIT_FRAME::GetCurrentSelection() { - return m_toolManager->GetTool()->GetSelection(); + return m_toolManager->GetTool()->GetSelection(); } @@ -446,9 +446,9 @@ void PCB_EDIT_FRAME::setupTools() // Register tools m_toolManager->RegisterTool( new COMMON_CONTROL ); m_toolManager->RegisterTool( new COMMON_TOOLS ); - m_toolManager->RegisterTool( new SELECTION_TOOL ); + m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); m_toolManager->RegisterTool( new ZOOM_TOOL ); - m_toolManager->RegisterTool( new PCBNEW_PICKER_TOOL ); + m_toolManager->RegisterTool( new PCB_PICKER_TOOL ); m_toolManager->RegisterTool( new ROUTER_TOOL ); m_toolManager->RegisterTool( new LENGTH_TUNER_TOOL ); m_toolManager->RegisterTool( new EDIT_TOOL ); @@ -456,10 +456,10 @@ void PCB_EDIT_FRAME::setupTools() m_toolManager->RegisterTool( new PAD_TOOL ); m_toolManager->RegisterTool( new DRAWING_TOOL ); m_toolManager->RegisterTool( new POINT_EDITOR ); - m_toolManager->RegisterTool( new PCBNEW_CONTROL ); - m_toolManager->RegisterTool( new PCB_EDITOR_CONTROL ); - m_toolManager->RegisterTool( new PCB_INSPECTION_TOOL ); - m_toolManager->RegisterTool( new PCB_REANNOTATE_TOOL ); + m_toolManager->RegisterTool( new PCB_CONTROL ); + m_toolManager->RegisterTool( new BOARD_EDITOR_CONTROL ); + m_toolManager->RegisterTool( new BOARD_INSPECTION_TOOL ); + m_toolManager->RegisterTool( new BOARD_REANNOTATE_TOOL ); m_toolManager->RegisterTool( new ALIGN_DISTRIBUTE_TOOL ); m_toolManager->RegisterTool( new MICROWAVE_TOOL ); m_toolManager->RegisterTool( new POSITION_RELATIVE_TOOL ); diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index b6d2ad19f8..779ddd6512 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -117,7 +117,8 @@ bool PCB_EDIT_FRAME::LoadProjectSettings() m_appearancePanel->SetUserLayerPresets( project.m_LayerPresets ); - SELECTION_FILTER_OPTIONS& filterOpts = GetToolManager()->GetTool()->GetFilter(); + PCB_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SELECTION_FILTER_OPTIONS& filterOpts = selTool->GetFilter(); filterOpts = localSettings.m_SelectionFilter; m_selectionFilterPanel->SetCheckboxesFromFilter( filterOpts ); @@ -213,8 +214,10 @@ void PCB_EDIT_FRAME::SaveProjectSettings() pair.second->SetPcbColor( netclassColors.at( pair.first ) ); } - SELECTION_FILTER_OPTIONS& filterOpts = GetToolManager()->GetTool()->GetFilter(); - localSettings.m_SelectionFilter = filterOpts; + PCB_SELECTION_TOOL* selTool = GetToolManager()->GetTool(); + SELECTION_FILTER_OPTIONS& filterOpts = selTool->GetFilter(); + + localSettings.m_SelectionFilter = filterOpts; if( !Prj().IsNullProject() ) GetSettingsManager()->SaveProject(); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 7477ada4b7..6a278237c3 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -39,7 +39,7 @@ using namespace std::placeholders; #include #include #include -#include +#include #include #include "router_tool.h" @@ -1437,7 +1437,7 @@ void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECT bool ROUTER_TOOL::CanInlineDrag() { m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); - const auto& selection = m_toolMgr->GetTool()->GetSelection(); + const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( selection.Size() == 1 ) { @@ -1457,7 +1457,7 @@ bool ROUTER_TOOL::CanInlineDrag() int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) { - const auto& selection = m_toolMgr->GetTool()->GetSelection(); + const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( selection.Empty() ) m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, NeighboringSegmentFilter ); @@ -1652,7 +1652,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent ) int ROUTER_TOOL::InlineBreakTrack( const TOOL_EVENT& aEvent ) { - const SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + const SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( selection.Size() != 1 ) return 0; diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index 60f36d5261..ce984b7c92 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() @@ -200,7 +200,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateOptToolbar() m_optionsToolBar->AddScaledSeparator( this ); m_optionsToolBar->Add( PCB_ACTIONS::toggleFootprintTree, ACTION_TOOLBAR::TOGGLE ); - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); std::unique_ptr gridMenu = std::make_unique( false, selTool ); gridMenu->Add( ACTIONS::gridProperties ); m_optionsToolBar->AddToolContextMenu( ACTIONS::toggleGrid, std::move( gridMenu ) ); diff --git a/pcbnew/toolbars_footprint_viewer.cpp b/pcbnew/toolbars_footprint_viewer.cpp index 0d0686323c..2eebe4c813 100644 --- a/pcbnew/toolbars_footprint_viewer.cpp +++ b/pcbnew/toolbars_footprint_viewer.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "footprint_viewer_frame.h" #include "pcbnew_id.h" @@ -143,7 +143,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateVToolbar() void FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar() { - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); // wxWidgets handles the Mac Application menu behind the scenes, but that means // we always have to start from scratch with a new wxMenuBar. wxMenuBar* oldMenuBar = GetMenuBar(); diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index d35e17f21e..92ef65c5b8 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON) @@ -362,7 +362,7 @@ void PCB_EDIT_FRAME::ReCreateOptToolbar() m_optionsToolBar->AddScaledSeparator( this ); m_optionsToolBar->Add( PCB_ACTIONS::showLayersManager, ACTION_TOOLBAR::TOGGLE ); - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); std::unique_ptr gridMenu = std::make_unique( false, selTool ); gridMenu->Add( ACTIONS::gridProperties ); m_optionsToolBar->AddToolContextMenu( ACTIONS::toggleGrid, std::move( gridMenu ) ); @@ -452,7 +452,7 @@ void PCB_EDIT_FRAME::ReCreateVToolbar() m_drawToolBar->AddGroup( originGroup, ACTION_TOOLBAR::TOGGLE ); m_drawToolBar->Add( ACTIONS::measureTool, ACTION_TOOLBAR::TOGGLE ); - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); std::unique_ptr routeMenu = std::make_unique( false, selTool ); routeMenu->Add( PCB_ACTIONS::routerHighlightMode, ACTION_MENU::CHECK ); diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/board_editor_control.cpp similarity index 85% rename from pcbnew/tools/pcb_editor_control.cpp rename to pcbnew/tools/board_editor_control.cpp index 4b96f572fb..67a89d2c89 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/board_editor_control.cpp @@ -22,11 +22,11 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "pcb_editor_control.h" +#include "board_editor_control.h" #include "drawing_tool.h" #include "pcb_actions.h" -#include "pcbnew_picker_tool.h" -#include "selection_tool.h" +#include "pcb_picker_tool.h" +#include "pcb_selection_tool.h" #include "edit_tool.h" #include "tool/tool_event.h" #include @@ -120,7 +120,7 @@ public: }; -PCB_EDITOR_CONTROL::PCB_EDITOR_CONTROL() : +BOARD_EDITOR_CONTROL::BOARD_EDITOR_CONTROL() : PCB_TOOL_BASE( "pcbnew.EditorControl" ), m_frame( nullptr ) { @@ -129,12 +129,12 @@ PCB_EDITOR_CONTROL::PCB_EDITOR_CONTROL() : } -PCB_EDITOR_CONTROL::~PCB_EDITOR_CONTROL() +BOARD_EDITOR_CONTROL::~BOARD_EDITOR_CONTROL() { } -void PCB_EDITOR_CONTROL::Reset( RESET_REASON aReason ) +void BOARD_EDITOR_CONTROL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); @@ -147,7 +147,7 @@ void PCB_EDITOR_CONTROL::Reset( RESET_REASON aReason ) } -bool PCB_EDITOR_CONTROL::Init() +bool BOARD_EDITOR_CONTROL::Init() { auto activeToolCondition = [ this ] ( const SELECTION& aSel ) @@ -188,7 +188,7 @@ bool PCB_EDITOR_CONTROL::Init() // Add the PCB control menus to relevant other tools - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); if( selTool ) { @@ -233,42 +233,42 @@ bool PCB_EDITOR_CONTROL::Init() } -int PCB_EDITOR_CONTROL::New( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::New( const TOOL_EVENT& aEvent ) { m_frame->Files_io_from_id( ID_NEW_BOARD ); return 0; } -int PCB_EDITOR_CONTROL::Open( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::Open( const TOOL_EVENT& aEvent ) { m_frame->Files_io_from_id( ID_LOAD_FILE ); return 0; } -int PCB_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::Save( const TOOL_EVENT& aEvent ) { m_frame->Files_io_from_id( ID_SAVE_BOARD ); return 0; } -int PCB_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::SaveAs( const TOOL_EVENT& aEvent ) { m_frame->Files_io_from_id( ID_SAVE_BOARD_AS ); return 0; } -int PCB_EDITOR_CONTROL::SaveCopyAs( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::SaveCopyAs( const TOOL_EVENT& aEvent ) { m_frame->Files_io_from_id( ID_COPY_BOARD_AS ); return 0; } -int PCB_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent ) { PICKED_ITEMS_LIST undoCmd; WS_PROXY_UNDO_ITEM* undoItem = new WS_PROXY_UNDO_ITEM( m_frame ); @@ -288,28 +288,28 @@ int PCB_EDITOR_CONTROL::PageSettings( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::Plot( const TOOL_EVENT& aEvent ) { m_frame->ToPlotter( ID_GEN_PLOT ); return 0; } -int PCB_EDITOR_CONTROL::BoardSetup( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::BoardSetup( const TOOL_EVENT& aEvent ) { getEditFrame()->ShowBoardSetupDialog(); return 0; } -int PCB_EDITOR_CONTROL::ImportNetlist( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ImportNetlist( const TOOL_EVENT& aEvent ) { getEditFrame()->InstallNetlistFrame(); return 0; } -int PCB_EDITOR_CONTROL::ImportSpecctraSession( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ImportSpecctraSession( const TOOL_EVENT& aEvent ) { wxString fullFileName = frame()->GetBoard()->GetFileName(); wxString path; @@ -329,7 +329,7 @@ int PCB_EDITOR_CONTROL::ImportSpecctraSession( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent ) { wxString fullFileName = m_frame->GetLastPath( LAST_PATH_SPECCTRADSN ); wxFileName fn; @@ -356,7 +356,7 @@ int PCB_EDITOR_CONTROL::ExportSpecctraDSN( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::GenerateFabFiles( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::GenerateFabFiles( const TOOL_EVENT& aEvent ) { wxCommandEvent dummy; @@ -375,7 +375,7 @@ int PCB_EDITOR_CONTROL::GenerateFabFiles( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent ) { int errors = 0; wxString details; @@ -492,7 +492,7 @@ int PCB_EDITOR_CONTROL::RepairBoard( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent ) { NETLIST netlist; @@ -505,7 +505,7 @@ int PCB_EDITOR_CONTROL::UpdatePCBFromSchematic( const TOOL_EVENT& aEvent ) return 0; } -int PCB_EDITOR_CONTROL::UpdateSchematicFromPCB( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB( const TOOL_EVENT& aEvent ) { if( Kiface().IsSingle() ) { @@ -528,21 +528,21 @@ int PCB_EDITOR_CONTROL::UpdateSchematicFromPCB( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ShowEeschema( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ShowEeschema( const TOOL_EVENT& aEvent ) { m_frame->RunEeschema(); return 0; } -int PCB_EDITOR_CONTROL::ToggleLayersManager( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ToggleLayersManager( const TOOL_EVENT& aEvent ) { getEditFrame()->ToggleLayersManager(); return 0; } -int PCB_EDITOR_CONTROL::TogglePythonConsole( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::TogglePythonConsole( const TOOL_EVENT& aEvent ) { #if defined( KICAD_SCRIPTING_WXPYTHON ) m_frame->ScriptingConsoleEnableDisable(); @@ -552,11 +552,11 @@ int PCB_EDITOR_CONTROL::TogglePythonConsole( const TOOL_EVENT& aEvent ) // Track & via size control -int PCB_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent ) { BOARD_DESIGN_SETTINGS& designSettings = getModel()->GetDesignSettings(); constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, EOT }; - PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( m_frame->ToolStackIsEmpty() && SELECTION_CONDITIONS::OnlyTypes( types )( selection ) ) { @@ -618,11 +618,11 @@ int PCB_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent ) { BOARD_DESIGN_SETTINGS& designSettings = getModel()->GetDesignSettings(); constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, EOT }; - PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( m_frame->ToolStackIsEmpty() && SELECTION_CONDITIONS::OnlyTypes( types )( selection ) ) { @@ -686,11 +686,11 @@ int PCB_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent ) { BOARD_DESIGN_SETTINGS& designSettings = getModel()->GetDesignSettings(); constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, EOT }; - PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( m_frame->ToolStackIsEmpty() && SELECTION_CONDITIONS::OnlyTypes( types )( selection ) ) { @@ -735,11 +735,11 @@ int PCB_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent ) { BOARD_DESIGN_SETTINGS& designSettings = getModel()->GetDesignSettings(); constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, EOT }; - PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); if( m_frame->ToolStackIsEmpty() && SELECTION_CONDITIONS::OnlyTypes( types )( selection ) ) { @@ -792,7 +792,7 @@ int PCB_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) { FOOTPRINT* fp = aEvent.Parameter(); KIGFX::VIEW_CONTROLS* controls = getViewControls(); @@ -956,29 +956,29 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ToggleLockSelected( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ToggleLockSelected( const TOOL_EVENT& aEvent ) { return modifyLockSelected( TOGGLE ); } -int PCB_EDITOR_CONTROL::LockSelected( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::LockSelected( const TOOL_EVENT& aEvent ) { return modifyLockSelected( ON ); } -int PCB_EDITOR_CONTROL::UnlockSelected( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::UnlockSelected( const TOOL_EVENT& aEvent ) { return modifyLockSelected( OFF ); } -int PCB_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode ) +int BOARD_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); - BOARD_COMMIT commit( m_frame ); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + BOARD_COMMIT commit( m_frame ); if( selection.Empty() ) m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); @@ -1031,7 +1031,7 @@ int PCB_EDITOR_CONTROL::modifyLockSelected( MODIFY_MODE aMode ) } -int PCB_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent ) { KIGFX::VIEW* view = getView(); KIGFX::VIEW_CONTROLS* controls = getViewControls(); @@ -1180,11 +1180,11 @@ static bool mergeZones( BOARD_COMMIT& aCommit, std::vector& aOriginZones, } -int PCB_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent ) { - const PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); - BOARD* board = getModel(); - BOARD_COMMIT commit( m_frame ); + const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + BOARD* board = getModel(); + BOARD_COMMIT commit( m_frame ); if( selection.Size() < 2 ) return 0; @@ -1238,10 +1238,10 @@ int PCB_EDITOR_CONTROL::ZoneMerge( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); // because this pops up the zone editor, it would be confusing to handle multiple zones, // so just handle single selections containing exactly one zone @@ -1289,10 +1289,10 @@ int PCB_EDITOR_CONTROL::ZoneDuplicate( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const SELECTION& selection = selTool->RequestSelection( EDIT_TOOL::FootprintFilter ); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->RequestSelection( EDIT_TOOL::FootprintFilter ); if( selection.Empty() ) return 0; @@ -1318,8 +1318,8 @@ int PCB_EDITOR_CONTROL::EditFpInFpEditor( const TOOL_EVENT& aEvent ) } -void PCB_EDITOR_CONTROL::DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame, - EDA_ITEM* originViewItem, const VECTOR2D& aPosition ) +void BOARD_EDITOR_CONTROL::DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame, + EDA_ITEM* originViewItem, const VECTOR2D& aPosition ) { aFrame->GetDesignSettings().m_AuxOrigin = (wxPoint) aPosition; originViewItem->SetPosition( (wxPoint) aPosition ); @@ -1328,10 +1328,10 @@ void PCB_EDITOR_CONTROL::DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* a } -int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) { - std::string tool = aEvent.GetCommandStr().get(); - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); + std::string tool = aEvent.GetCommandStr().get(); + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); // Deactivate other tools; particularly important if another PICKER is currently running Activate(); @@ -1350,7 +1350,7 @@ int PCB_EDITOR_CONTROL::DrillOrigin( const TOOL_EVENT& aEvent ) } -int PCB_EDITOR_CONTROL::FlipPcbView( const TOOL_EVENT& aEvent ) +int BOARD_EDITOR_CONTROL::FlipPcbView( const TOOL_EVENT& aEvent ) { view()->SetMirror( !view()->IsMirroredX(), false ); view()->RecacheAllItems(); @@ -1360,57 +1360,57 @@ int PCB_EDITOR_CONTROL::FlipPcbView( const TOOL_EVENT& aEvent ) } -void PCB_EDITOR_CONTROL::setTransitions() +void BOARD_EDITOR_CONTROL::setTransitions() { - Go( &PCB_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::SaveCopyAs, ACTIONS::saveCopyAs.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::PageSettings, ACTIONS::pageSettings.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::New, ACTIONS::doNew.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::Open, ACTIONS::open.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::Save, ACTIONS::save.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::SaveAs, ACTIONS::saveAs.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::SaveCopyAs, ACTIONS::saveCopyAs.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::PageSettings, ACTIONS::pageSettings.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::Plot, ACTIONS::plot.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::BoardSetup, PCB_ACTIONS::boardSetup.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ImportNetlist, PCB_ACTIONS::importNetlist.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ImportSpecctraSession, PCB_ACTIONS::importSpecctraSession.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ExportSpecctraDSN, PCB_ACTIONS::exportSpecctraDSN.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GenerateDrillFiles, PCB_ACTIONS::generateDrillFiles.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateGerbers.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GeneratePosFile, PCB_ACTIONS::generatePosFile.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateReportFile.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateD356File.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateBOM.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::BoardSetup, PCB_ACTIONS::boardSetup.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ImportNetlist, PCB_ACTIONS::importNetlist.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ImportSpecctraSession, PCB_ACTIONS::importSpecctraSession.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ExportSpecctraDSN, PCB_ACTIONS::exportSpecctraDSN.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateDrillFiles, PCB_ACTIONS::generateDrillFiles.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateGerbers.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GeneratePosFile, PCB_ACTIONS::generatePosFile.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateReportFile.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateD356File.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::GenerateFabFiles, PCB_ACTIONS::generateBOM.MakeEvent() ); // Track & via size control - Go( &PCB_EDITOR_CONTROL::TrackWidthInc, PCB_ACTIONS::trackWidthInc.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::TrackWidthDec, PCB_ACTIONS::trackWidthDec.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ViaSizeInc, PCB_ACTIONS::viaSizeInc.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ViaSizeDec, PCB_ACTIONS::viaSizeDec.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::TrackWidthInc, PCB_ACTIONS::trackWidthInc.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::TrackWidthDec, PCB_ACTIONS::trackWidthDec.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ViaSizeInc, PCB_ACTIONS::viaSizeInc.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ViaSizeDec, PCB_ACTIONS::viaSizeDec.MakeEvent() ); // Zone actions - Go( &PCB_EDITOR_CONTROL::ZoneMerge, PCB_ACTIONS::zoneMerge.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ZoneDuplicate, PCB_ACTIONS::zoneDuplicate.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ZoneMerge, PCB_ACTIONS::zoneMerge.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ZoneDuplicate, PCB_ACTIONS::zoneDuplicate.MakeEvent() ); // Placing tools - Go( &PCB_EDITOR_CONTROL::PlaceTarget, PCB_ACTIONS::placeTarget.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::PlaceModule, PCB_ACTIONS::placeModule.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::PlaceTarget, PCB_ACTIONS::placeTarget.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::PlaceModule, PCB_ACTIONS::placeModule.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::DrillOrigin, PCB_ACTIONS::drillOrigin.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::EditFpInFpEditor, PCB_ACTIONS::editFpInFpEditor.MakeEvent() ); // Other - Go( &PCB_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::LockSelected, PCB_ACTIONS::lock.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::UnlockSelected, PCB_ACTIONS::unlock.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ToggleLockSelected, PCB_ACTIONS::toggleLock.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::LockSelected, PCB_ACTIONS::lock.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::UnlockSelected, PCB_ACTIONS::unlock.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::UpdatePCBFromSchematic, ACTIONS::updatePcbFromSchematic.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::UpdateSchematicFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ShowEeschema, PCB_ACTIONS::showEeschema.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::ToggleLayersManager, PCB_ACTIONS::showLayersManager.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::TogglePythonConsole, PCB_ACTIONS::showPythonConsole.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::FlipPcbView, PCB_ACTIONS::flipBoard.MakeEvent() ); - Go( &PCB_EDITOR_CONTROL::RepairBoard, PCB_ACTIONS::repairBoard.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::UpdatePCBFromSchematic, ACTIONS::updatePcbFromSchematic.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB, ACTIONS::updateSchematicFromPcb.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ShowEeschema, PCB_ACTIONS::showEeschema.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::ToggleLayersManager, PCB_ACTIONS::showLayersManager.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::TogglePythonConsole, PCB_ACTIONS::showPythonConsole.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::FlipPcbView, PCB_ACTIONS::flipBoard.MakeEvent() ); + Go( &BOARD_EDITOR_CONTROL::RepairBoard, PCB_ACTIONS::repairBoard.MakeEvent() ); } -const int PCB_EDITOR_CONTROL::WIDTH_STEP = 100000; +const int BOARD_EDITOR_CONTROL::WIDTH_STEP = 100000; diff --git a/pcbnew/tools/pcb_editor_control.h b/pcbnew/tools/board_editor_control.h similarity index 95% rename from pcbnew/tools/pcb_editor_control.h rename to pcbnew/tools/board_editor_control.h index 26f4c08741..fe7451b74d 100644 --- a/pcbnew/tools/pcb_editor_control.h +++ b/pcbnew/tools/board_editor_control.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef PCB_EDITOR_CONTROL_H -#define PCB_EDITOR_CONTROL_H +#ifndef BOARD_EDITOR_CONTROL_H +#define BOARD_EDITOR_CONTROL_H #include #include @@ -35,15 +35,15 @@ namespace KIGFX { class PCB_EDIT_FRAME; /** - * PCB_EDITOR_CONTROL + * BOARD_EDITOR_CONTROL * * Handles actions specific to the board editor in pcbnew. */ -class PCB_EDITOR_CONTROL : public PCB_TOOL_BASE +class BOARD_EDITOR_CONTROL : public PCB_TOOL_BASE { public: - PCB_EDITOR_CONTROL(); - ~PCB_EDITOR_CONTROL(); + BOARD_EDITOR_CONTROL(); + ~BOARD_EDITOR_CONTROL(); /// @copydoc TOOL_INTERACTIVE::Reset() void Reset( RESET_REASON aReason ) override; diff --git a/pcbnew/tools/pcb_inspection_tool.cpp b/pcbnew/tools/board_inspection_tool.cpp similarity index 84% rename from pcbnew/tools/pcb_inspection_tool.cpp rename to pcbnew/tools/board_inspection_tool.cpp index d3f375cc40..49a9858ca8 100644 --- a/pcbnew/tools/pcb_inspection_tool.cpp +++ b/pcbnew/tools/board_inspection_tool.cpp @@ -24,8 +24,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -35,7 +35,7 @@ #include #include #include -#include "pcb_inspection_tool.h" +#include "board_inspection_tool.h" void DIALOG_INSPECTION_REPORTER::OnErrorLinkClicked( wxHtmlLinkEvent& event ) @@ -47,7 +47,7 @@ void DIALOG_INSPECTION_REPORTER::OnErrorLinkClicked( wxHtmlLinkEvent& event ) } -PCB_INSPECTION_TOOL::PCB_INSPECTION_TOOL() : +BOARD_INSPECTION_TOOL::BOARD_INSPECTION_TOOL() : PCB_TOOL_BASE( "pcbnew.InspectionTool" ), m_frame( nullptr ) { @@ -78,9 +78,9 @@ private: }; -bool PCB_INSPECTION_TOOL::Init() +bool BOARD_INSPECTION_TOOL::Init() { - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); auto netSubMenu = std::make_shared(); netSubMenu->SetTool( this ); @@ -99,13 +99,13 @@ bool PCB_INSPECTION_TOOL::Init() } -void PCB_INSPECTION_TOOL::Reset( RESET_REASON aReason ) +void BOARD_INSPECTION_TOOL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); } -int PCB_INSPECTION_TOOL::ShowStatisticsDialog( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::ShowStatisticsDialog( const TOOL_EVENT& aEvent ) { DIALOG_BOARD_STATISTICS dialog( m_frame ); dialog.ShowModal(); @@ -113,7 +113,7 @@ int PCB_INSPECTION_TOOL::ShowStatisticsDialog( const TOOL_EVENT& aEvent ) } -wxString PCB_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem ) +wxString BOARD_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem ) { wxString s = aItem->GetSelectMenuText( m_frame->GetUserUnits() ); @@ -128,7 +128,7 @@ wxString PCB_INSPECTION_TOOL::getItemDescription( BOARD_ITEM* aItem ) }; -void PCB_INSPECTION_TOOL::reportZoneConnection( ZONE* aZone, PAD* aPad, REPORTER* r ) +void BOARD_INSPECTION_TOOL::reportZoneConnection( ZONE* aZone, PAD* aPad, REPORTER* r ) { ENUM_MAP connectionEnum = ENUM_MAP::Instance(); wxString source; @@ -208,9 +208,9 @@ void PCB_INSPECTION_TOOL::reportZoneConnection( ZONE* aZone, PAD* aPad, REPORTER } -void PCB_INSPECTION_TOOL::reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, - PCB_LAYER_ID aLayer, BOARD_ITEM* aA, BOARD_ITEM* aB, - REPORTER* r ) +void BOARD_INSPECTION_TOOL::reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, + PCB_LAYER_ID aLayer, BOARD_ITEM* aA, BOARD_ITEM* aB, + REPORTER* r ) { r->Report( "" ); @@ -265,11 +265,11 @@ void PCB_INSPECTION_TOOL::reportClearance( DRC_CONSTRAINT_TYPE_T aClearanceType, } -int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); - PCB_LAYER_ID layer = m_frame->GetActiveLayer(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + PCB_LAYER_ID layer = m_frame->GetActiveLayer(); if( selection.Size() != 2 ) { @@ -283,7 +283,7 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) m_inspectClearanceDialog->SetTitle( _( "Clearance Report" ) ); m_inspectClearanceDialog->Connect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed ), + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onInspectClearanceDialogClosed ), nullptr, this ); } @@ -420,10 +420,10 @@ int PCB_INSPECTION_TOOL::InspectClearance( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); if( selection.Size() != 1 ) { @@ -437,7 +437,7 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) m_inspectConstraintsDialog->SetTitle( _( "Constraints Report" ) ); m_inspectConstraintsDialog->Connect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), nullptr, this ); } @@ -654,14 +654,14 @@ int PCB_INSPECTION_TOOL::InspectConstraints( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent ) { // Don't get in an infinite loop PCB -> SCH -> PCB -> SCH -> ... if( m_probingSchToPcb ) return 0; - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); if( selection.Size() == 1 ) m_frame->SendMessageToEESCHEMA( static_cast( selection.Front() ) ); @@ -674,7 +674,7 @@ int PCB_INSPECTION_TOOL::CrossProbePcbToSch( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) { BOARD_ITEM* item = aEvent.Parameter(); @@ -706,18 +706,18 @@ int PCB_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) * @param aPosition is the point where an item is expected (world coordinates). * @param aUseSelection is true if we should use the current selection to pick the netcode */ - bool PCB_INSPECTION_TOOL::highlightNet( const VECTOR2D& aPosition, bool aUseSelection ) + bool BOARD_INSPECTION_TOOL::highlightNet( const VECTOR2D& aPosition, bool aUseSelection ) { BOARD* board = static_cast( m_toolMgr->GetModel() ); KIGFX::RENDER_SETTINGS* settings = getView()->GetPainter()->GetSettings(); - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); int net = -1; bool enableHighlight = false; if( aUseSelection ) { - const PCBNEW_SELECTION& selection = selectionTool->GetSelection(); + const PCB_SELECTION& selection = selectionTool->GetSelection(); for( auto item : selection ) { @@ -828,7 +828,7 @@ int PCB_INSPECTION_TOOL::HighlightItem( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::HighlightNet( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::HighlightNet( const TOOL_EVENT& aEvent ) { int netcode = aEvent.Parameter(); KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings(); @@ -856,7 +856,7 @@ int PCB_INSPECTION_TOOL::HighlightNet( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::ClearHighlight( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::ClearHighlight( const TOOL_EVENT& aEvent ) { BOARD* board = static_cast( m_toolMgr->GetModel() ); KIGFX::RENDER_SETTINGS* settings = m_toolMgr->GetView()->GetPainter()->GetSettings(); @@ -870,10 +870,10 @@ int PCB_INSPECTION_TOOL::ClearHighlight( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::HighlightNetTool( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::HighlightNetTool( const TOOL_EVENT& aEvent ) { - std::string tool = aEvent.GetCommandStr().get(); - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); + std::string tool = aEvent.GetCommandStr().get(); + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); // Deactivate other tools; particularly important if another PICKER is currently running Activate(); @@ -902,12 +902,12 @@ int PCB_INSPECTION_TOOL::HighlightNetTool( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) { - std::string tool = aEvent.GetCommandStr().get(); - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); - BOARD* board = getModel(); - auto& opt = displayOptions(); + std::string tool = aEvent.GetCommandStr().get(); + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); + BOARD* board = getModel(); + auto& opt = displayOptions(); // Deactivate other tools; particularly important if another PICKER is currently running Activate(); @@ -915,11 +915,11 @@ int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) picker->SetClickHandler( [this, board, opt]( const VECTOR2D& pt ) -> bool { - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true, EDIT_TOOL::PadFilter ); - PCBNEW_SELECTION& selection = selectionTool->GetSelection(); + PCB_SELECTION& selection = selectionTool->GetSelection(); if( selection.Empty() ) { @@ -966,7 +966,7 @@ int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) picker->SetFinalizeHandler( [board, opt] ( int aCondition ) { - if( aCondition != PCBNEW_PICKER_TOOL::END_ACTIVATE ) + if( aCondition != PCB_PICKER_TOOL::END_ACTIVATE ) { for( FOOTPRINT* fp : board->Footprints() ) { @@ -982,7 +982,7 @@ int PCB_INSPECTION_TOOL::LocalRatsnestTool( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ) { VECTOR2I delta; @@ -999,7 +999,7 @@ int PCB_INSPECTION_TOOL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ) m_dynamicData = nullptr; } - auto selectionTool = m_toolMgr->GetTool(); + auto selectionTool = m_toolMgr->GetTool(); auto& selection = selectionTool->GetSelection(); auto connectivity = getModel()->GetConnectivity(); @@ -1018,7 +1018,7 @@ int PCB_INSPECTION_TOOL::UpdateSelectionRatsnest( const TOOL_EVENT& aEvent ) } -int PCB_INSPECTION_TOOL::HideDynamicRatsnest( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::HideDynamicRatsnest( const TOOL_EVENT& aEvent ) { getModel()->GetConnectivity()->ClearDynamicRatsnest(); delete m_dynamicData; @@ -1028,13 +1028,13 @@ int PCB_INSPECTION_TOOL::HideDynamicRatsnest( const TOOL_EVENT& aEvent ) } -void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) +void BOARD_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) { - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - SELECTION& selection = selectionTool->GetSelection(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SELECTION& selection = selectionTool->GetSelection(); std::shared_ptr connectivity = board()->GetConnectivity(); std::vector items; - std::deque queued_items( selection.begin(), selection.end() ); + std::deque queued_items( selection.begin(), selection.end() ); for( std::size_t i = 0; i < queued_items.size(); ++i ) { @@ -1091,7 +1091,7 @@ void PCB_INSPECTION_TOOL::calculateSelectionRatsnest( const VECTOR2I& aDelta ) } -int PCB_INSPECTION_TOOL::ListNets( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::ListNets( const TOOL_EVENT& aEvent ) { if( m_listNetsDialog == nullptr ) { @@ -1099,11 +1099,11 @@ int PCB_INSPECTION_TOOL::ListNets( const TOOL_EVENT& aEvent ) std::make_unique( m_frame, m_listNetsDialogSettings ); m_listNetsDialog->Connect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); m_listNetsDialog->Connect( wxEVT_BUTTON, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); } @@ -1113,62 +1113,62 @@ int PCB_INSPECTION_TOOL::ListNets( const TOOL_EVENT& aEvent ) } -void PCB_INSPECTION_TOOL::onListNetsDialogClosed( wxCommandEvent& event ) +void BOARD_INSPECTION_TOOL::onListNetsDialogClosed( wxCommandEvent& event ) { m_listNetsDialogSettings = m_listNetsDialog->Settings(); m_listNetsDialog->Disconnect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); m_listNetsDialog->Disconnect( wxEVT_BUTTON, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onListNetsDialogClosed ), nullptr, this ); m_listNetsDialog->Destroy(); m_listNetsDialog.release(); } -void PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed( wxCommandEvent& event ) +void BOARD_INSPECTION_TOOL::onInspectClearanceDialogClosed( wxCommandEvent& event ) { m_inspectClearanceDialog->Disconnect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectClearanceDialogClosed ), nullptr, this ); + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onInspectClearanceDialogClosed ), nullptr, this ); m_inspectClearanceDialog->Destroy(); m_inspectClearanceDialog.release(); } -void PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed( wxCommandEvent& event ) +void BOARD_INSPECTION_TOOL::onInspectConstraintsDialogClosed( wxCommandEvent& event ) { m_inspectConstraintsDialog->Disconnect( wxEVT_CLOSE_WINDOW, - wxCommandEventHandler( PCB_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), nullptr, this ); + wxCommandEventHandler( BOARD_INSPECTION_TOOL::onInspectConstraintsDialogClosed ), nullptr, this ); m_inspectConstraintsDialog->Destroy(); m_inspectConstraintsDialog.release(); } -int PCB_INSPECTION_TOOL::HideNet( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::HideNet( const TOOL_EVENT& aEvent ) { doHideNet( aEvent.Parameter(), true ); return 0; } -int PCB_INSPECTION_TOOL::ShowNet( const TOOL_EVENT& aEvent ) +int BOARD_INSPECTION_TOOL::ShowNet( const TOOL_EVENT& aEvent ) { doHideNet( aEvent.Parameter(), false ); return 0; } -void PCB_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide ) +void BOARD_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide ) { KIGFX::PCB_RENDER_SETTINGS* rs = static_cast( m_toolMgr->GetView()->GetPainter()->GetSettings() ); - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - SELECTION& selection = selectionTool->GetSelection(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + SELECTION& selection = selectionTool->GetSelection(); if( aNetCode <= 0 && !selection.Empty() ) { @@ -1194,29 +1194,29 @@ void PCB_INSPECTION_TOOL::doHideNet( int aNetCode, bool aHide ) } -void PCB_INSPECTION_TOOL::setTransitions() +void BOARD_INSPECTION_TOOL::setTransitions() { - Go( &PCB_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::SelectedEvent ); - Go( &PCB_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::UnselectedEvent ); - Go( &PCB_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::ClearedEvent ); + Go( &BOARD_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::SelectedEvent ); + Go( &BOARD_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::UnselectedEvent ); + Go( &BOARD_INSPECTION_TOOL::CrossProbePcbToSch, EVENTS::ClearedEvent ); - Go( &PCB_INSPECTION_TOOL::LocalRatsnestTool, PCB_ACTIONS::localRatsnestTool.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HideDynamicRatsnest, PCB_ACTIONS::hideDynamicRatsnest.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::UpdateSelectionRatsnest,PCB_ACTIONS::updateLocalRatsnest.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::LocalRatsnestTool, PCB_ACTIONS::localRatsnestTool.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HideDynamicRatsnest, PCB_ACTIONS::hideDynamicRatsnest.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest,PCB_ACTIONS::updateLocalRatsnest.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::ListNets, PCB_ACTIONS::listNets.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::ShowStatisticsDialog, PCB_ACTIONS::boardStatistics.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::InspectClearance, PCB_ACTIONS::inspectClearance.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::InspectConstraints, PCB_ACTIONS::inspectConstraints.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::ListNets, PCB_ACTIONS::listNets.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::ShowStatisticsDialog, PCB_ACTIONS::boardStatistics.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::InspectClearance, PCB_ACTIONS::inspectClearance.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::InspectConstraints, PCB_ACTIONS::inspectConstraints.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNet.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNetSelection.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::toggleLastNetHighlight.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::ClearHighlight, PCB_ACTIONS::clearHighlight.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HighlightNetTool, PCB_ACTIONS::highlightNetTool.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::ClearHighlight, ACTIONS::cancelInteractive.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HighlightItem, PCB_ACTIONS::highlightItem.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNet.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::highlightNetSelection.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HighlightNet, PCB_ACTIONS::toggleLastNetHighlight.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::ClearHighlight, PCB_ACTIONS::clearHighlight.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HighlightNetTool, PCB_ACTIONS::highlightNetTool.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::ClearHighlight, ACTIONS::cancelInteractive.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HighlightItem, PCB_ACTIONS::highlightItem.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::HideNet, PCB_ACTIONS::hideNet.MakeEvent() ); - Go( &PCB_INSPECTION_TOOL::ShowNet, PCB_ACTIONS::showNet.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::HideNet, PCB_ACTIONS::hideNet.MakeEvent() ); + Go( &BOARD_INSPECTION_TOOL::ShowNet, PCB_ACTIONS::showNet.MakeEvent() ); } diff --git a/pcbnew/tools/pcb_inspection_tool.h b/pcbnew/tools/board_inspection_tool.h similarity index 95% rename from pcbnew/tools/pcb_inspection_tool.h rename to pcbnew/tools/board_inspection_tool.h index 7f4bc97a1f..3ca8b2fd52 100644 --- a/pcbnew/tools/pcb_inspection_tool.h +++ b/pcbnew/tools/board_inspection_tool.h @@ -21,8 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __BOARD_STATISTICS_TOOL_H -#define __BOARD_STATISTICS_TOOL_H +#ifndef BOARD_INSPECTION_TOOL_H +#define BOARD_INSPECTION_TOOL_H #include #include @@ -51,14 +51,14 @@ protected: /** - * PCB_INSPECTION_TOOL + * BOARD_INSPECTION_TOOL * * Tool for pcb inspection. */ -class PCB_INSPECTION_TOOL : public wxEvtHandler, public PCB_TOOL_BASE +class BOARD_INSPECTION_TOOL : public wxEvtHandler, public PCB_TOOL_BASE { public: - PCB_INSPECTION_TOOL(); + BOARD_INSPECTION_TOOL(); /// @copydoc TOOL_INTERACTIVE::Init() bool Init() override; @@ -152,4 +152,4 @@ private: std::unique_ptr m_inspectConstraintsDialog; }; -#endif //__BOARD_STATISTICS_TOOL_H +#endif //BOARD_INSPECTION_TOOL_H diff --git a/pcbnew/tools/pcb_reannotate_tool.cpp b/pcbnew/tools/board_reannotate_tool.cpp similarity index 78% rename from pcbnew/tools/pcb_reannotate_tool.cpp rename to pcbnew/tools/board_reannotate_tool.cpp index 10e402a8eb..6bc3568000 100644 --- a/pcbnew/tools/pcb_reannotate_tool.cpp +++ b/pcbnew/tools/board_reannotate_tool.cpp @@ -26,29 +26,29 @@ #include #include #include -#include +#include -PCB_REANNOTATE_TOOL::PCB_REANNOTATE_TOOL() : +BOARD_REANNOTATE_TOOL::BOARD_REANNOTATE_TOOL() : PCB_TOOL_BASE( "pcbnew.ReannotateTool" ), m_frame( nullptr ) { } -bool PCB_REANNOTATE_TOOL::Init() +bool BOARD_REANNOTATE_TOOL::Init() { return true; } -void PCB_REANNOTATE_TOOL::Reset( RESET_REASON aReason ) +void BOARD_REANNOTATE_TOOL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); } -int PCB_REANNOTATE_TOOL::ShowReannotateDialog( const TOOL_EVENT& aEvent ) +int BOARD_REANNOTATE_TOOL::ShowReannotateDialog( const TOOL_EVENT& aEvent ) { DIALOG_BOARD_REANNOTATE dialog( m_frame ); dialog.ShowModal(); @@ -56,7 +56,7 @@ int PCB_REANNOTATE_TOOL::ShowReannotateDialog( const TOOL_EVENT& aEvent ) } -void PCB_REANNOTATE_TOOL::setTransitions() +void BOARD_REANNOTATE_TOOL::setTransitions() { - Go( &PCB_REANNOTATE_TOOL::ShowReannotateDialog, PCB_ACTIONS::boardReannotate.MakeEvent() ); + Go( &BOARD_REANNOTATE_TOOL::ShowReannotateDialog, PCB_ACTIONS::boardReannotate.MakeEvent() ); } diff --git a/pcbnew/tools/pcb_reannotate_tool.h b/pcbnew/tools/board_reannotate_tool.h similarity index 94% rename from pcbnew/tools/pcb_reannotate_tool.h rename to pcbnew/tools/board_reannotate_tool.h index 8baae6c53a..cba9a8ef79 100644 --- a/pcbnew/tools/pcb_reannotate_tool.h +++ b/pcbnew/tools/board_reannotate_tool.h @@ -32,10 +32,10 @@ #include -class PCB_REANNOTATE_TOOL : public wxEvtHandler, public PCB_TOOL_BASE +class BOARD_REANNOTATE_TOOL : public wxEvtHandler, public PCB_TOOL_BASE { public: - PCB_REANNOTATE_TOOL(); + BOARD_REANNOTATE_TOOL(); bool Init() override; void Reset( RESET_REASON aReason ) override; diff --git a/pcbnew/tools/convert_tool.cpp b/pcbnew/tools/convert_tool.cpp index ef23586a07..62e26ee7b4 100644 --- a/pcbnew/tools/convert_tool.cpp +++ b/pcbnew/tools/convert_tool.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include "convert_tool.h" @@ -63,7 +63,7 @@ using P_S_C = PCB_SELECTION_CONDITIONS; bool CONVERT_TOOL::Init() { - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); m_frame = getEditFrame(); // Create a context menu and make it available through selection tool @@ -121,7 +121,7 @@ int CONVERT_TOOL::LinesToPoly( const TOOL_EVENT& aEvent ) FOOTPRINT* parentFootprint = nullptr; auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { for( int i = aCollector.GetCount() - 1; i >= 0; --i ) { @@ -362,7 +362,7 @@ SHAPE_POLY_SET CONVERT_TOOL::makePolysFromRects( const std::deque& aI int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) { auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { for( int i = aCollector.GetCount() - 1; i >= 0; --i ) { @@ -557,7 +557,7 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent ) int CONVERT_TOOL::SegmentToArc( const TOOL_EVENT& aEvent ) { auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { for( int i = aCollector.GetCount() - 1; i >= 0; --i ) { diff --git a/pcbnew/tools/convert_tool.h b/pcbnew/tools/convert_tool.h index c22434ccc0..266ddcf1b3 100644 --- a/pcbnew/tools/convert_tool.h +++ b/pcbnew/tools/convert_tool.h @@ -29,7 +29,7 @@ #include class CONDITIONAL_MENU; -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class PCB_BASE_FRAME; @@ -89,9 +89,9 @@ private: */ static SHAPE_POLY_SET makePolysFromRects( const std::deque& aItems ); - SELECTION_TOOL* m_selectionTool; - CONDITIONAL_MENU* m_menu; - PCB_BASE_FRAME* m_frame; + PCB_SELECTION_TOOL* m_selectionTool; + CONDITIONAL_MENU* m_menu; + PCB_BASE_FRAME* m_frame; }; #endif diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 3e8a069b88..99b53f09e4 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -648,7 +648,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) const BOARD_DESIGN_SETTINGS& boardSettings = m_board->GetDesignSettings(); // Add a VIEW_GROUP that serves as a preview for the new item - PCBNEW_SELECTION preview; + PCB_SELECTION preview; m_view->Add( &preview ); @@ -1020,7 +1020,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) std::vector newItems; // all new items, including group std::vector selectedItems; // the group, or newItems if no group - PCBNEW_SELECTION preview; + PCB_SELECTION preview; BOARD_COMMIT commit( m_frame ); PCB_GROUP* group = nullptr; @@ -1262,7 +1262,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic, KIGFX::PREVIEW::TWO_POINT_ASSISTANT twoPointAsst( twoPointManager, userUnits, geomShape ); // Add a VIEW_GROUP that serves as a preview for the new item - PCBNEW_SELECTION preview; + PCB_SELECTION preview; m_view->Add( &preview ); m_view->Add( &twoPointAsst ); @@ -1556,7 +1556,7 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool KIGFX::PREVIEW::ARC_ASSISTANT arcAsst( arcManager, m_frame->GetUserUnits() ); // Add a VIEW_GROUP that serves as a preview for the new item - PCBNEW_SELECTION preview; + PCB_SELECTION preview; m_view->Add( &preview ); m_view->Add( &arcAsst ); GRID_HELPER grid( m_toolMgr, m_frame->GetMagneticItemsSettings() ); @@ -1776,8 +1776,8 @@ bool DRAWING_TOOL::getSourceZoneForAction( ZONE_MODE aMode, ZONE** aZone ) if( aMode == ZONE_MODE::ADD || aMode == ZONE_MODE::GRAPHIC_POLYGON ) return true; - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); if( selection.Empty() ) { diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index aa71a6eeb7..4bce3cb905 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -38,9 +38,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -99,7 +99,7 @@ SPECIAL_TOOLS_CONTEXT_MENU::SPECIAL_TOOLS_CONTEXT_MENU( TOOL_INTERACTIVE* aTool bool EDIT_TOOL::Init() { // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); auto inFootprintEditor = [ this ]( const SELECTION& aSelection ) @@ -175,8 +175,8 @@ bool EDIT_TOOL::Init() int EDIT_TOOL::GetAndPlace( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - FOOTPRINT* fp = getEditFrame()->GetFootprintFromBoardByReference(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + FOOTPRINT* fp = getEditFrame()->GetFootprintFromBoardByReference(); if( fp ) { @@ -242,8 +242,8 @@ int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) if( aEvent.IsAction( &PCB_ACTIONS::dragFreeAngle ) ) mode |= PNS::DM_FREE_ANGLE; - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -307,8 +307,8 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) // Be sure that there is at least one item that we can modify. If nothing was selected before, // try looking for the stuff under mouse cursor (i.e. Kicad old-style hover selection) - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -331,7 +331,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) // Now filter out locked and grouped items. We cannot do this in the first RequestSelection() // as we need the item_layers when a pad is the selection front. selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -627,8 +627,8 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) int EDIT_TOOL::ChangeTrackWidth( const TOOL_EVENT& aEvent ) { - const auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + const PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -700,8 +700,8 @@ int EDIT_TOOL::FilletTracks( const TOOL_EVENT& aEvent ) // Store last used fillet radius to allow pressing "enter" if repeat fillet is required static long long filletRadiusIU = 0; - auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -900,9 +900,9 @@ int EDIT_TOOL::FilletTracks( const TOOL_EVENT& aEvent ) int EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { - PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); - const PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); + const PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { } ); @@ -954,8 +954,8 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) PCB_BASE_EDIT_FRAME* editFrame = getEditFrame(); - auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { }, !m_dragging /* prompt user regarding locked items */ ); @@ -1054,8 +1054,8 @@ int EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) return 0; } - auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { }, !m_dragging /* prompt user regarding locked items */ ); @@ -1151,8 +1151,8 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent ) return 0; } - auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -1240,7 +1240,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) Activate(); // get a copy instead of reference (as we're going to clear the selection before removing items) - PCBNEW_SELECTION selectionCopy; + PCB_SELECTION selectionCopy; bool isCut = aEvent.Parameter() == PCB_ACTIONS::REMOVE_FLAGS::CUT; bool isAlt = aEvent.Parameter() == PCB_ACTIONS::REMOVE_FLAGS::ALT; @@ -1254,7 +1254,7 @@ int EDIT_TOOL::Remove( const TOOL_EVENT& aEvent ) else { selectionCopy = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { }, true /* prompt user regarding locked items */ ); @@ -1435,8 +1435,8 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent ) return 0; } - const auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + const PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -1544,11 +1544,11 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) // Be sure that there is at least one item that we can modify const auto& selection = m_isFootprintEditor ? m_selectionTool->RequestSelection( - []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { } ) /*is board editor*/ : m_selectionTool->RequestSelection( - []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) @@ -1649,7 +1649,7 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent ) }); } - // Clear the selection flag here, otherwise the SELECTION_TOOL + // Clear the selection flag here, otherwise the PCB_SELECTION_TOOL // will not properly select it later on dupe_item->ClearSelected(); @@ -1696,11 +1696,11 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent ) const auto& selection = m_isFootprintEditor ? m_selectionTool->RequestSelection( - []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { } ) /*is board editor*/ : m_selectionTool->RequestSelection( - []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) @@ -1732,7 +1732,8 @@ int EDIT_TOOL::CreateArray( const TOOL_EVENT& aEvent ) } -void EDIT_TOOL::PadFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) +void EDIT_TOOL::PadFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* sTool ) { for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) { @@ -1745,7 +1746,7 @@ void EDIT_TOOL::PadFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELEC void EDIT_TOOL::FootprintFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, - SELECTION_TOOL* sTool ) + PCB_SELECTION_TOOL* sTool ) { for( int i = aCollector.GetCount() - 1; i >= 0; i-- ) { @@ -1757,7 +1758,7 @@ void EDIT_TOOL::FootprintFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, } -bool EDIT_TOOL::updateModificationPoint( PCBNEW_SELECTION& aSelection ) +bool EDIT_TOOL::updateModificationPoint( PCB_SELECTION& aSelection ) { if( m_dragging && aSelection.HasReferencePoint() ) return false; @@ -1783,9 +1784,9 @@ bool EDIT_TOOL::updateModificationPoint( PCBNEW_SELECTION& aSelection ) bool EDIT_TOOL::pickReferencePoint( const wxString& aTooltip, const wxString& aSuccessMessage, const wxString& aCanceledMessage, VECTOR2I& aReferencePoint ) { - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); - OPT pickedPoint; - bool done = false; + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); + OPT pickedPoint; + bool done = false; m_statusPopup->SetText( aTooltip ); @@ -1867,8 +1868,8 @@ int EDIT_TOOL::copyToClipboard( const TOOL_EVENT& aEvent ) frame()->PushTool( tool ); Activate(); - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { }, aEvent.IsAction( &ACTIONS::cut ) /* prompt user regarding locked items */ ); diff --git a/pcbnew/tools/edit_tool.h b/pcbnew/tools/edit_tool.h index 8064a37ef9..9509f346a7 100644 --- a/pcbnew/tools/edit_tool.h +++ b/pcbnew/tools/edit_tool.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include @@ -152,13 +152,14 @@ public: * A selection filter which prunes the selection to contain only items of type PCB_MODULE_T */ static void FootprintFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, - SELECTION_TOOL* sTool ); + PCB_SELECTION_TOOL* sTool ); /** * Function PadFilter() * A selection filter which prunes the selection to contain only items of type PCB_PAD_T */ - static void PadFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ); + static void PadFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* sTool ); BOARD_COMMIT* GetCurrentCommit() const { return m_commit.get(); } @@ -182,7 +183,7 @@ private: ///> Returns the right modification point (e.g. for rotation), depending on the number of ///> selected items. - bool updateModificationPoint( PCBNEW_SELECTION& aSelection ); + bool updateModificationPoint( PCB_SELECTION& aSelection ); bool invokeInlineRouter( int aDragMode ); bool isInteractiveDragEnabled() const; @@ -194,7 +195,7 @@ private: const wxString& aCanceledMessage, VECTOR2I& aReferencePoint ); private: - SELECTION_TOOL* m_selectionTool; + PCB_SELECTION_TOOL* m_selectionTool; std::unique_ptr m_commit; bool m_dragging; // Indicates objects are currently being dragged VECTOR2I m_cursor; // Last cursor position (so getModificationPoint() diff --git a/pcbnew/tools/global_edit_tool.cpp b/pcbnew/tools/global_edit_tool.cpp index f43bfd348b..f6b0d366e6 100644 --- a/pcbnew/tools/global_edit_tool.cpp +++ b/pcbnew/tools/global_edit_tool.cpp @@ -50,7 +50,7 @@ void GLOBAL_EDIT_TOOL::Reset( RESET_REASON aReason ) bool GLOBAL_EDIT_TOOL::Init() { // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); return true; } @@ -58,10 +58,10 @@ bool GLOBAL_EDIT_TOOL::Init() int GLOBAL_EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent ) { - PCBNEW_SELECTION& selection = m_selectionTool->GetSelection(); - FOOTPRINT* footprint = nullptr; - bool updateMode = false; - bool currentMode = false; + PCB_SELECTION& selection = m_selectionTool->GetSelection(); + FOOTPRINT* footprint = nullptr; + bool updateMode = false; + bool currentMode = false; if( aEvent.HasPosition() ) selection = m_selectionTool->RequestSelection( EDIT_TOOL::FootprintFilter ); @@ -199,8 +199,8 @@ int GLOBAL_EDIT_TOOL::CleanupGraphics( const TOOL_EVENT& aEvent ) int GLOBAL_EDIT_TOOL::RemoveUnusedPads( const TOOL_EVENT& aEvent ) { PCB_EDIT_FRAME* editFrame = getEditFrame(); - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { sTool->FilterCollectorForGroups( aCollector ); } ); diff --git a/pcbnew/tools/global_edit_tool.h b/pcbnew/tools/global_edit_tool.h index 4a9e2805ee..5ede94f0f2 100644 --- a/pcbnew/tools/global_edit_tool.h +++ b/pcbnew/tools/global_edit_tool.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include @@ -70,7 +70,7 @@ private: void setTransitions() override; private: - SELECTION_TOOL* m_selectionTool; + PCB_SELECTION_TOOL* m_selectionTool; std::unique_ptr m_commit; }; diff --git a/pcbnew/tools/group_tool.cpp b/pcbnew/tools/group_tool.cpp index 8acc7d7118..79c7c3543a 100644 --- a/pcbnew/tools/group_tool.cpp +++ b/pcbnew/tools/group_tool.cpp @@ -23,9 +23,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include @@ -188,8 +188,8 @@ public: private: void update() override { - SELECTION_TOOL* selTool = getToolManager()->GetTool(); - BOARD* board = selTool->GetBoard(); + PCB_SELECTION_TOOL* selTool = getToolManager()->GetTool(); + BOARD* board = selTool->GetBoard(); const auto& selection = selTool->GetSelection(); @@ -229,7 +229,7 @@ bool GROUP_TOOL::Init() m_frame = getEditFrame(); // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); auto groupMenu = std::make_shared(); groupMenu->SetTool( this ); @@ -267,10 +267,10 @@ int GROUP_TOOL::GroupProperties( const TOOL_EVENT& aEvent ) int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) { - std::string tool = "pcbnew.EditGroups.selectNewMember"; - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); - STATUS_TEXT_POPUP statusPopup( frame() ); - bool done = false; + std::string tool = "pcbnew.EditGroups.selectNewMember"; + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); + STATUS_TEXT_POPUP statusPopup( frame() ); + bool done = false; if( m_propertiesDialog ) m_propertiesDialog->Show( false ); @@ -284,8 +284,9 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - const PCBNEW_SELECTION& sel = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + const PCB_SELECTION& sel = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* sTool ) { } ); @@ -344,10 +345,10 @@ int GROUP_TOOL::PickNewMember( const TOOL_EVENT& aEvent ) int GROUP_TOOL::Group( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); - BOARD* board = getModel(); - PCB_GROUP* group = nullptr; + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + BOARD* board = getModel(); + PCB_GROUP* group = nullptr; if( selection.Empty() ) m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); @@ -394,14 +395,14 @@ int GROUP_TOOL::Group( const TOOL_EVENT& aEvent ) int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) { - const PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + const PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); BOARD* board = getModel(); std::vector members; if( selection.Empty() ) m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); - PCBNEW_SELECTION selCopy = selection; + PCB_SELECTION selCopy = selection; m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); for( EDA_ITEM* item : selCopy ) @@ -452,9 +453,9 @@ int GROUP_TOOL::Ungroup( const TOOL_EVENT& aEvent ) int GROUP_TOOL::RemoveFromGroup( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); - BOARD_COMMIT commit( m_frame ); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + BOARD_COMMIT commit( m_frame ); if( selection.Empty() ) m_toolMgr->RunAction( PCB_ACTIONS::selectionCursor, true ); @@ -489,8 +490,8 @@ int GROUP_TOOL::RemoveFromGroup( const TOOL_EVENT& aEvent ) int GROUP_TOOL::EnterGroup( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); if( selection.GetSize() == 1 && selection[0]->Type() == PCB_GROUP_T ) selTool->EnterGroup(); @@ -501,7 +502,7 @@ int GROUP_TOOL::EnterGroup( const TOOL_EVENT& aEvent ) int GROUP_TOOL::LeaveGroup( const TOOL_EVENT& aEvent ) { - m_toolMgr->GetTool()->ExitGroup( true /* Select the group */ ); + m_toolMgr->GetTool()->ExitGroup( true /* Select the group */ ); return 0; } diff --git a/pcbnew/tools/group_tool.h b/pcbnew/tools/group_tool.h index 0815634f1e..4d61b1bfe6 100644 --- a/pcbnew/tools/group_tool.h +++ b/pcbnew/tools/group_tool.h @@ -26,12 +26,12 @@ #include #include -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "dialogs/dialog_group_properties_base.h" class BOARD_COMMIT; class BOARD_ITEM; -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class DIALOG_GROUP_PROPERTIES; class GROUP_TOOL : public PCB_TOOL_BASE @@ -75,7 +75,7 @@ private: private: PCB_BASE_EDIT_FRAME* m_frame; DIALOG_GROUP_PROPERTIES* m_propertiesDialog; - SELECTION_TOOL* m_selectionTool; + PCB_SELECTION_TOOL* m_selectionTool; std::unique_ptr m_commit; }; diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index 13a5941c65..f1719c69bc 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ void PAD_TOOL::Reset( RESET_REASON aReason ) bool PAD_TOOL::Init() { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); if( selTool ) { @@ -107,9 +107,9 @@ bool PAD_TOOL::Init() int PAD_TOOL::pastePadProperties( const TOOL_EVENT& aEvent ) { - auto& selTool = *m_toolMgr->GetTool(); - const auto& selection = selTool.GetSelection(); - const PAD& masterPad = frame()->GetDesignSettings().m_Pad_Master; + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + const PAD& masterPad = frame()->GetDesignSettings().m_Pad_Master; BOARD_COMMIT commit( frame() ); @@ -134,10 +134,9 @@ int PAD_TOOL::pastePadProperties( const TOOL_EVENT& aEvent ) int PAD_TOOL::copyPadSettings( const TOOL_EVENT& aEvent ) { - auto& selTool = *m_toolMgr->GetTool(); - const auto& selection = selTool.GetSelection(); - - PAD& masterPad = frame()->GetDesignSettings().m_Pad_Master; + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + PAD& masterPad = frame()->GetDesignSettings().m_Pad_Master; // can only copy from a single pad if( selection.Size() == 1 ) @@ -209,9 +208,9 @@ static void doPushPadProperties( BOARD& board, const PAD& aSrcPad, BOARD_COMMIT& int PAD_TOOL::pushPadSettings( const TOOL_EVENT& aEvent ) { - auto& selTool = *m_toolMgr->GetTool(); - const auto& selection = selTool.GetSelection(); - PAD* srcPad; + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + const PCB_SELECTION& selection = selTool->GetSelection(); + PAD* srcPad; if( selection.Size() == 1 && selection[0]->Type() == PCB_PAD_T ) srcPad = static_cast( selection[0] ); @@ -510,7 +509,7 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent ) { PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions(); WX_INFOBAR* infoBar = frame()->GetInfoBar(); - PCBNEW_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); + PCB_SELECTION& selection = m_toolMgr->GetTool()->GetSelection(); wxString msg; if( m_editPad != niluuid ) diff --git a/pcbnew/tools/pcb_actions.cpp b/pcbnew/tools/pcb_actions.cpp index 127cb13fa6..93bd42e2cf 100644 --- a/pcbnew/tools/pcb_actions.cpp +++ b/pcbnew/tools/pcb_actions.cpp @@ -530,7 +530,7 @@ TOOL_ACTION PCB_ACTIONS::defaultPadProperties( "pcbnew.PadTool.defaultPadPropert options_pad_xpm ); -// PCB_EDITOR_CONTROL +// BOARD_EDITOR_CONTROL // TOOL_ACTION PCB_ACTIONS::boardSetup( "pcbnew.EditorControl.boardSetup", AS_GLOBAL, 0, "", @@ -722,7 +722,7 @@ TOOL_ACTION PCB_ACTIONS::showEeschema( "pcbnew.EditorControl.showEeschema", eeschema_xpm ); -// PCBNEW_CONTROL +// PCB_CONTROL // TOOL_ACTION PCB_ACTIONS::localRatsnestTool( "pcbnew.Control.localRatsnestTool", @@ -1139,7 +1139,7 @@ TOOL_ACTION PCB_ACTIONS::selectpositionRelativeItem( "pcbnew.PositionRelative.se AS_GLOBAL ); -// SELECTION_TOOL +// PCB_SELECTION_TOOL // TOOL_ACTION PCB_ACTIONS::selectionActivate( "pcbnew.InteractiveSelection", AS_GLOBAL, 0, "", "", "", nullptr, AF_ACTIVATE ); // No description, not shown anywhere diff --git a/pcbnew/tools/pcbnew_control.cpp b/pcbnew/tools/pcb_control.cpp similarity index 76% rename from pcbnew/tools/pcbnew_control.cpp rename to pcbnew/tools/pcb_control.cpp index da8e08ac8b..c77b15b5e5 100644 --- a/pcbnew/tools/pcbnew_control.cpp +++ b/pcbnew/tools/pcb_control.cpp @@ -25,9 +25,9 @@ #include "edit_tool.h" #include "pcb_actions.h" -#include "pcbnew_control.h" -#include "pcbnew_picker_tool.h" -#include "selection_tool.h" +#include "pcb_control.h" +#include "pcb_picker_tool.h" +#include "pcb_selection_tool.h" #include <3d_viewer/eda_3d_viewer.h> #include #include @@ -61,7 +61,7 @@ extern bool AskLoadBoardFileName( wxWindow* aParent, int* aCtl, wxString* aFileN extern IO_MGR::PCB_FILE_T plugin_type( const wxString& aFileName, int aCtl ); -PCBNEW_CONTROL::PCBNEW_CONTROL() : +PCB_CONTROL::PCB_CONTROL() : PCB_TOOL_BASE( "pcbnew.Control" ), m_frame( nullptr ), m_pickerItem( nullptr ) @@ -70,12 +70,12 @@ PCBNEW_CONTROL::PCBNEW_CONTROL() : } -PCBNEW_CONTROL::~PCBNEW_CONTROL() +PCB_CONTROL::~PCB_CONTROL() { } -void PCBNEW_CONTROL::Reset( RESET_REASON aReason ) +void PCB_CONTROL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); @@ -89,7 +89,7 @@ void PCBNEW_CONTROL::Reset( RESET_REASON aReason ) } -int PCBNEW_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) { if( m_frame->IsType( FRAME_FOOTPRINT_EDITOR ) || m_frame->IsType( FRAME_PCB_EDITOR ) ) { @@ -103,7 +103,7 @@ int PCBNEW_CONTROL::AddLibrary( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::Quit( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::Quit( const TOOL_EVENT& aEvent ) { m_frame->Close( false ); return 0; @@ -116,7 +116,7 @@ template void Flip( T& aValue ) } -int PCBNEW_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -135,7 +135,7 @@ int PCBNEW_CONTROL::TrackDisplayMode( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::ToggleRatsnest( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::ToggleRatsnest( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -161,7 +161,7 @@ int PCBNEW_CONTROL::ToggleRatsnest( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -180,7 +180,7 @@ int PCBNEW_CONTROL::ViaDisplayMode( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -210,7 +210,7 @@ int PCBNEW_CONTROL::ZoneDisplayMode( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -225,7 +225,7 @@ int PCBNEW_CONTROL::HighContrastMode( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent ) { auto opts = displayOptions(); @@ -251,7 +251,7 @@ int PCBNEW_CONTROL::HighContrastModeCycle( const TOOL_EVENT& aEvent ) // Layer control -int PCBNEW_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent ) { m_frame->SwitchLayer( NULL, aEvent.Parameter() ); @@ -259,11 +259,11 @@ int PCBNEW_CONTROL::LayerSwitch( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::LayerNext( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerNext( const TOOL_EVENT& aEvent ) { - PCB_BASE_FRAME* editFrame = m_frame; + PCB_BASE_FRAME* editFrame = m_frame; BOARD* brd = board(); - LAYER_NUM layer = editFrame->GetActiveLayer(); + LAYER_NUM layer = editFrame->GetActiveLayer(); LAYER_NUM startLayer = layer; if( layer < F_Cu || layer > B_Cu ) @@ -285,11 +285,11 @@ int PCBNEW_CONTROL::LayerNext( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::LayerPrev( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerPrev( const TOOL_EVENT& aEvent ) { - PCB_BASE_FRAME* editFrame = m_frame; + PCB_BASE_FRAME* editFrame = m_frame; BOARD* brd = board(); - LAYER_NUM layer = editFrame->GetActiveLayer(); + LAYER_NUM layer = editFrame->GetActiveLayer(); LAYER_NUM startLayer = layer; if( layer < F_Cu || layer > B_Cu ) @@ -313,7 +313,7 @@ int PCBNEW_CONTROL::LayerPrev( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::LayerToggle( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerToggle( const TOOL_EVENT& aEvent ) { LAYER_NUM currentLayer = m_frame->GetActiveLayer(); PCB_SCREEN* screen = m_frame->GetScreen(); @@ -333,7 +333,7 @@ int PCBNEW_CONTROL::LayerToggle( const TOOL_EVENT& aEvent ) #define ALPHA_MAX 1.00 #define ALPHA_STEP 0.05 -int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) { auto settings = m_frame->GetColorSettings(); @@ -359,7 +359,7 @@ int PCBNEW_CONTROL::LayerAlphaInc( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent ) { auto settings = m_frame->GetColorSettings(); @@ -386,8 +386,8 @@ int PCBNEW_CONTROL::LayerAlphaDec( const TOOL_EVENT& aEvent ) // Grid control -void PCBNEW_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame, - EDA_ITEM* originViewItem, const VECTOR2D& aPoint ) +void PCB_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame, + EDA_ITEM* originViewItem, const VECTOR2D& aPoint ) { aFrame->GetDesignSettings().m_GridOrigin = (wxPoint) aPoint; aView->GetGAL()->SetGridOrigin( aPoint ); @@ -397,7 +397,7 @@ void PCBNEW_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame } -int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) { VECTOR2D* origin = aEvent.Parameter(); @@ -412,8 +412,8 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) if( m_isFootprintEditor && !getEditFrame()->GetModel() ) return 0; - std::string tool = aEvent.GetCommandStr().get(); - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); + std::string tool = aEvent.GetCommandStr().get(); + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); // Deactivate other tools; particularly important if another PICKER is currently running Activate(); @@ -433,7 +433,7 @@ int PCBNEW_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent ) { m_frame->SaveCopyInUndoList( m_gridOrigin.get(), UNDO_REDO::GRIDORIGIN ); DoSetGridOrigin( getView(), m_frame, m_gridOrigin.get(), VECTOR2D( 0, 0 ) ); @@ -444,13 +444,13 @@ int PCBNEW_CONTROL::GridResetOrigin( const TOOL_EVENT& aEvent ) #define HITTEST_THRESHOLD_PIXELS 5 -int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) { if( m_isFootprintEditor && !m_frame->GetBoard()->GetFirstFootprint() ) return 0; - std::string tool = aEvent.GetCommandStr().get(); - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); + std::string tool = aEvent.GetCommandStr().get(); + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); m_pickerItem = nullptr; m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); @@ -474,7 +474,7 @@ int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) return true; } - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); selectionTool->UnbrightenItem( m_pickerItem ); selectionTool->AddItemToSel( m_pickerItem, true /*quiet mode*/ ); m_toolMgr->RunAction( ACTIONS::doDelete, true ); @@ -487,10 +487,10 @@ int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) picker->SetMotionHandler( [this] ( const VECTOR2D& aPos ) { - BOARD* board = m_frame->GetBoard(); - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + BOARD* board = m_frame->GetBoard(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); GENERAL_COLLECTORS_GUIDE guide = m_frame->GetCollectorsGuide(); - GENERAL_COLLECTOR collector; + GENERAL_COLLECTOR collector; collector.m_Threshold = KiROUND( getView()->ToWorld( HITTEST_THRESHOLD_PIXELS ) ); if( m_isFootprintEditor ) @@ -527,7 +527,7 @@ int PCBNEW_CONTROL::DeleteItemCursor( const TOOL_EVENT& aEvent ) [this] ( const int& aFinalState ) { if( m_pickerItem ) - m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); + m_toolMgr->GetTool()->UnbrightenItem( m_pickerItem ); // Wake the selection tool after exiting to ensure the cursor gets updated m_toolMgr->RunAction( PCB_ACTIONS::selectionActivate, false ); @@ -596,7 +596,7 @@ static void pasteFootprintItemsToFootprintEditor( FOOTPRINT* aClipFootprint, BOA } -int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::Paste( const TOOL_EVENT& aEvent ) { CLIPBOARD_IO pi; BOARD_ITEM* clipItem = pi.Parse(); @@ -716,7 +716,7 @@ int PCBNEW_CONTROL::Paste( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::AppendBoardFromFile( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::AppendBoardFromFile( const TOOL_EVENT& aEvent ) { int open_ctl; wxString fileName; @@ -737,7 +737,7 @@ int PCBNEW_CONTROL::AppendBoardFromFile( const TOOL_EVENT& aEvent ) } -// Helper function for PCBNEW_CONTROL::placeBoardItems() +// Helper function for PCB_CONTROL::placeBoardItems() template static void moveUnflaggedItems( std::deque& aList, std::vector& aTarget, bool aIsNew ) @@ -796,7 +796,7 @@ static void moveUnflaggedItems( ZONES& aList, std::vector& aTarget, -int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin ) +int PCB_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin ) { // items are new if the current board is not the board source bool isNew = board() != aBoard; @@ -808,8 +808,8 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin ) moveUnflaggedItems( aBoard->Zones(), items, isNew ); // Subtlety: When selecting a group via the mouse, - // SELECTION_TOOL::highlightInternal runs, which does a SetSelected() on all - // descendants. In PCBNEW_CONTROL::placeBoardItems, below, we skip that and + // PCB_SELECTION_TOOL::highlightInternal runs, which does a SetSelected() on all + // descendants. In PCB_CONTROL::placeBoardItems, below, we skip that and // mark items non-recursively. That works because the saving of the // selection created aBoard that has the group and all descendents in it. moveUnflaggedItems( aBoard->Groups(), items, isNew ); @@ -818,15 +818,14 @@ int PCBNEW_CONTROL::placeBoardItems( BOARD* aBoard, bool aAnchorAtOrigin ) } -int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsNew, - bool aAnchorAtOrigin ) +int PCB_CONTROL::placeBoardItems( std::vector& aItems, bool aIsNew, + bool aAnchorAtOrigin ) { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); - EDIT_TOOL* editTool = m_toolMgr->GetTool(); - - PCBNEW_SELECTION& selection = selectionTool->GetSelection(); + PCB_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool(); + EDIT_TOOL* editTool = m_toolMgr->GetTool(); + PCB_SELECTION& selection = selectionTool->GetSelection(); for( BOARD_ITEM* item : aItems ) { @@ -873,7 +872,7 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsN else editTool->GetCurrentCommit()->Added( item ); - // Matching the logic of SELECTION_TOOL::select for PCB_GROUP_T, there + // Matching the logic of PCB_SELECTION_TOOL::select for PCB_GROUP_T, there // is a distinction between which items are SetSelected and which are in // the selection object. Top-level groups or items not in groups are // added to the selection object (via selection.Add(), below), but all @@ -909,7 +908,7 @@ int PCBNEW_CONTROL::placeBoardItems( std::vector& aItems, bool aIsN } -int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) +int PCB_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) { PCB_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); @@ -999,7 +998,7 @@ int PCBNEW_CONTROL::AppendBoard( PLUGIN& pi, wxString& fileName ) } -int PCBNEW_CONTROL::Undo( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::Undo( const TOOL_EVENT& aEvent ) { PCB_BASE_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); wxCommandEvent dummy; @@ -1011,7 +1010,7 @@ int PCBNEW_CONTROL::Undo( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::Redo( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::Redo( const TOOL_EVENT& aEvent ) { PCB_BASE_EDIT_FRAME* editFrame = dynamic_cast( m_frame ); wxCommandEvent dummy; @@ -1023,10 +1022,10 @@ int PCBNEW_CONTROL::Redo( const TOOL_EVENT& aEvent ) } -int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) +int PCB_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - PCBNEW_SELECTION& selection = selTool->GetSelection(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION& selection = selTool->GetSelection(); if( selection.GetSize() == 1 ) { @@ -1089,81 +1088,81 @@ int PCBNEW_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent ) } -void PCBNEW_CONTROL::setTransitions() +void PCB_CONTROL::setTransitions() { - Go( &PCBNEW_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() ); - Go( &PCBNEW_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() ); - Go( &PCBNEW_CONTROL::Print, ACTIONS::print.MakeEvent() ); - Go( &PCBNEW_CONTROL::Quit, ACTIONS::quit.MakeEvent() ); + Go( &PCB_CONTROL::AddLibrary, ACTIONS::newLibrary.MakeEvent() ); + Go( &PCB_CONTROL::AddLibrary, ACTIONS::addLibrary.MakeEvent() ); + Go( &PCB_CONTROL::Print, ACTIONS::print.MakeEvent() ); + Go( &PCB_CONTROL::Quit, ACTIONS::quit.MakeEvent() ); // Display modes - Go( &PCBNEW_CONTROL::TrackDisplayMode, PCB_ACTIONS::trackDisplayMode.MakeEvent() ); - Go( &PCBNEW_CONTROL::ToggleRatsnest, PCB_ACTIONS::showRatsnest.MakeEvent() ); - Go( &PCBNEW_CONTROL::ToggleRatsnest, PCB_ACTIONS::ratsnestLineMode.MakeEvent() ); - Go( &PCBNEW_CONTROL::ViaDisplayMode, PCB_ACTIONS::viaDisplayMode.MakeEvent() ); - Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() ); - Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() ); - Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() ); - Go( &PCBNEW_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() ); - Go( &PCBNEW_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() ); - Go( &PCBNEW_CONTROL::HighContrastModeCycle, ACTIONS::highContrastModeCycle.MakeEvent() ); + Go( &PCB_CONTROL::TrackDisplayMode, PCB_ACTIONS::trackDisplayMode.MakeEvent() ); + Go( &PCB_CONTROL::ToggleRatsnest, PCB_ACTIONS::showRatsnest.MakeEvent() ); + Go( &PCB_CONTROL::ToggleRatsnest, PCB_ACTIONS::ratsnestLineMode.MakeEvent() ); + Go( &PCB_CONTROL::ViaDisplayMode, PCB_ACTIONS::viaDisplayMode.MakeEvent() ); + Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayEnable.MakeEvent() ); + Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayDisable.MakeEvent() ); + Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayOutlines.MakeEvent() ); + Go( &PCB_CONTROL::ZoneDisplayMode, PCB_ACTIONS::zoneDisplayToggle.MakeEvent() ); + Go( &PCB_CONTROL::HighContrastMode, ACTIONS::highContrastMode.MakeEvent() ); + Go( &PCB_CONTROL::HighContrastModeCycle, ACTIONS::highContrastModeCycle.MakeEvent() ); // Layer control - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerTop.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner1.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner2.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner3.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner4.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner5.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner6.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner7.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner8.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner9.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner10.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner11.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner12.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner13.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner14.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner15.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner16.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner17.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner18.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner19.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner20.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner21.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner22.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner23.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner24.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner25.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner26.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner27.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner28.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner29.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner30.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerSwitch, PCB_ACTIONS::layerBottom.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerNext, PCB_ACTIONS::layerNext.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerPrev, PCB_ACTIONS::layerPrev.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerToggle, PCB_ACTIONS::layerToggle.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerAlphaInc, PCB_ACTIONS::layerAlphaInc.MakeEvent() ); - Go( &PCBNEW_CONTROL::LayerAlphaDec, PCB_ACTIONS::layerAlphaDec.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerTop.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner1.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner2.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner3.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner4.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner5.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner6.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner7.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner8.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner9.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner10.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner11.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner12.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner13.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner14.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner15.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner16.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner17.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner18.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner19.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner20.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner21.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner22.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner23.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner24.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner25.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner26.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner27.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner28.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner29.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerInner30.MakeEvent() ); + Go( &PCB_CONTROL::LayerSwitch, PCB_ACTIONS::layerBottom.MakeEvent() ); + Go( &PCB_CONTROL::LayerNext, PCB_ACTIONS::layerNext.MakeEvent() ); + Go( &PCB_CONTROL::LayerPrev, PCB_ACTIONS::layerPrev.MakeEvent() ); + Go( &PCB_CONTROL::LayerToggle, PCB_ACTIONS::layerToggle.MakeEvent() ); + Go( &PCB_CONTROL::LayerAlphaInc, PCB_ACTIONS::layerAlphaInc.MakeEvent() ); + Go( &PCB_CONTROL::LayerAlphaDec, PCB_ACTIONS::layerAlphaDec.MakeEvent() ); // Grid control - Go( &PCBNEW_CONTROL::GridSetOrigin, ACTIONS::gridSetOrigin.MakeEvent() ); - Go( &PCBNEW_CONTROL::GridResetOrigin, ACTIONS::gridResetOrigin.MakeEvent() ); + Go( &PCB_CONTROL::GridSetOrigin, ACTIONS::gridSetOrigin.MakeEvent() ); + Go( &PCB_CONTROL::GridResetOrigin, ACTIONS::gridResetOrigin.MakeEvent() ); - Go( &PCBNEW_CONTROL::Undo, ACTIONS::undo.MakeEvent() ); - Go( &PCBNEW_CONTROL::Redo, ACTIONS::redo.MakeEvent() ); + Go( &PCB_CONTROL::Undo, ACTIONS::undo.MakeEvent() ); + Go( &PCB_CONTROL::Redo, ACTIONS::redo.MakeEvent() ); // Miscellaneous - Go( &PCBNEW_CONTROL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); + Go( &PCB_CONTROL::DeleteItemCursor, ACTIONS::deleteTool.MakeEvent() ); // Append control - Go( &PCBNEW_CONTROL::AppendBoardFromFile, PCB_ACTIONS::appendBoard.MakeEvent() ); + Go( &PCB_CONTROL::AppendBoardFromFile, PCB_ACTIONS::appendBoard.MakeEvent() ); - Go( &PCBNEW_CONTROL::Paste, ACTIONS::paste.MakeEvent() ); + Go( &PCB_CONTROL::Paste, ACTIONS::paste.MakeEvent() ); - Go( &PCBNEW_CONTROL::UpdateMessagePanel, EVENTS::SelectedEvent ); - Go( &PCBNEW_CONTROL::UpdateMessagePanel, EVENTS::UnselectedEvent ); - Go( &PCBNEW_CONTROL::UpdateMessagePanel, EVENTS::ClearedEvent ); - Go( &PCBNEW_CONTROL::UpdateMessagePanel, EVENTS::SelectedItemsModified ); + Go( &PCB_CONTROL::UpdateMessagePanel, EVENTS::SelectedEvent ); + Go( &PCB_CONTROL::UpdateMessagePanel, EVENTS::UnselectedEvent ); + Go( &PCB_CONTROL::UpdateMessagePanel, EVENTS::ClearedEvent ); + Go( &PCB_CONTROL::UpdateMessagePanel, EVENTS::SelectedItemsModified ); } diff --git a/pcbnew/tools/pcbnew_control.h b/pcbnew/tools/pcb_control.h similarity index 96% rename from pcbnew/tools/pcbnew_control.h rename to pcbnew/tools/pcb_control.h index 1f75bb7163..e61ddfbea5 100644 --- a/pcbnew/tools/pcbnew_control.h +++ b/pcbnew/tools/pcb_control.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef PCBNEW_CONTROL_H -#define PCBNEW_CONTROL_H +#ifndef PCB_CONTROL_H +#define PCB_CONTROL_H #include #include @@ -36,16 +36,16 @@ namespace KIGFX { class PCB_BASE_FRAME; class BOARD_ITEM; /** - * PCBNEW_CONTROL + * PCB_CONTROL * * Handles actions that are shared between different frames in pcbnew. */ -class PCBNEW_CONTROL : public PCB_TOOL_BASE +class PCB_CONTROL : public PCB_TOOL_BASE { public: - PCBNEW_CONTROL(); - ~PCBNEW_CONTROL(); + PCB_CONTROL(); + ~PCB_CONTROL(); /// @copydoc TOOL_INTERACTIVE::Reset() void Reset( RESET_REASON aReason ) override; diff --git a/pcbnew/tools/pcbnew_picker_tool.cpp b/pcbnew/tools/pcb_picker_tool.cpp similarity index 92% rename from pcbnew/tools/pcbnew_picker_tool.cpp rename to pcbnew/tools/pcb_picker_tool.cpp index 0966cf0d24..01b33fdbc2 100644 --- a/pcbnew/tools/pcbnew_picker_tool.cpp +++ b/pcbnew/tools/pcb_picker_tool.cpp @@ -23,22 +23,22 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "pcbnew_picker_tool.h" +#include "pcb_picker_tool.h" #include "pcb_actions.h" #include "grid_helper.h" #include #include -#include "selection_tool.h" +#include "pcb_selection_tool.h" -PCBNEW_PICKER_TOOL::PCBNEW_PICKER_TOOL() +PCB_PICKER_TOOL::PCB_PICKER_TOOL() : PCB_TOOL_BASE( "pcbnew.InteractivePicker" ) { reset(); } -int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) +int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) { KIGFX::VIEW_CONTROLS* controls = getViewControls(); PCB_BASE_FRAME* frame = getEditFrame(); @@ -142,7 +142,7 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) else if( evt->IsClick( BUT_RIGHT ) ) { - PCBNEW_SELECTION dummy; + PCB_SELECTION dummy; m_menu.ShowContextMenu( dummy ); } @@ -171,13 +171,13 @@ int PCBNEW_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) } -void PCBNEW_PICKER_TOOL::setTransitions() +void PCB_PICKER_TOOL::setTransitions() { - Go( &PCBNEW_PICKER_TOOL::Main, ACTIONS::pickerTool.MakeEvent() ); + Go( &PCB_PICKER_TOOL::Main, ACTIONS::pickerTool.MakeEvent() ); } -void PCBNEW_PICKER_TOOL::reset() +void PCB_PICKER_TOOL::reset() { m_layerMask = LSET::AllLayersMask(); m_cursor = KICURSOR::ARROW; @@ -190,7 +190,7 @@ void PCBNEW_PICKER_TOOL::reset() } -void PCBNEW_PICKER_TOOL::setControls() +void PCB_PICKER_TOOL::setControls() { KIGFX::VIEW_CONTROLS* controls = getViewControls(); diff --git a/pcbnew/tools/pcbnew_picker_tool.h b/pcbnew/tools/pcb_picker_tool.h similarity index 94% rename from pcbnew/tools/pcbnew_picker_tool.h rename to pcbnew/tools/pcb_picker_tool.h index 5f9aa53b42..e40235975f 100644 --- a/pcbnew/tools/pcbnew_picker_tool.h +++ b/pcbnew/tools/pcb_picker_tool.h @@ -22,20 +22,20 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef PICKER_TOOL_H -#define PICKER_TOOL_H +#ifndef PCB_PICKER_TOOL_H +#define PCB_PICKER_TOOL_H #include #include /** - * @brief Generic tool for picking a point. + * @brief Generic tool for picking an item. */ -class PCBNEW_PICKER_TOOL : public PCB_TOOL_BASE +class PCB_PICKER_TOOL : public PCB_TOOL_BASE { public: - PCBNEW_PICKER_TOOL(); - ~PCBNEW_PICKER_TOOL() override { } + PCB_PICKER_TOOL(); + ~PCB_PICKER_TOOL() override { } ///> Event handler types. typedef std::function CLICK_HANDLER; @@ -130,4 +130,4 @@ private: OPT m_picked; }; -#endif /* PICKER_TOOL_H */ +#endif /* PCB_PICKER_TOOL_H */ diff --git a/pcbnew/tools/pcbnew_selection.cpp b/pcbnew/tools/pcb_selection.cpp similarity index 93% rename from pcbnew/tools/pcbnew_selection.cpp rename to pcbnew/tools/pcb_selection.cpp index 28f127e051..7b448e7ef6 100644 --- a/pcbnew/tools/pcbnew_selection.cpp +++ b/pcbnew/tools/pcb_selection.cpp @@ -37,22 +37,20 @@ using namespace std::placeholders; #include #include #include -#include #include #include #include #include -#include +#include #include -#include "selection_tool.h" -#include "pcb_bright_box.h" +#include "pcb_selection_tool.h" #include "pcb_actions.h" #include "plugins/kicad/kicad_plugin.h" -EDA_ITEM* PCBNEW_SELECTION::GetTopLeftItem( bool aFootprintsOnly ) const +EDA_ITEM* PCB_SELECTION::GetTopLeftItem( bool aFootprintsOnly ) const { EDA_ITEM* topLeftItem = nullptr; @@ -86,7 +84,7 @@ EDA_ITEM* PCBNEW_SELECTION::GetTopLeftItem( bool aFootprintsOnly ) const } -const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const +const KIGFX::VIEW_GROUP::ITEMS PCB_SELECTION::updateDrawList() const { std::vector items; @@ -143,7 +141,7 @@ const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const } -const LSET PCBNEW_SELECTION::GetSelectionLayers() +const LSET PCB_SELECTION::GetSelectionLayers() { LSET retval; diff --git a/pcbnew/tools/pcbnew_selection.h b/pcbnew/tools/pcb_selection.h similarity index 91% rename from pcbnew/tools/pcbnew_selection.h rename to pcbnew/tools/pcb_selection.h index 833736b1e3..439c223d1b 100644 --- a/pcbnew/tools/pcbnew_selection.h +++ b/pcbnew/tools/pcb_selection.h @@ -21,14 +21,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef PCBNEW_SELECTION_H -#define PCBNEW_SELECTION_H +#ifndef PCB_SELECTION_H +#define PCB_SELECTION_H #include #include -class PCBNEW_SELECTION : public SELECTION +class PCB_SELECTION : public SELECTION { public: EDA_ITEM* GetTopLeftItem( bool aFootprintsOnly = false ) const override; @@ -38,4 +38,4 @@ public: const LSET GetSelectionLayers(); }; -#endif // PCBNEW_SELECTION_H +#endif // PCB_SELECTION_H diff --git a/pcbnew/tools/pcb_selection_conditions.cpp b/pcbnew/tools/pcb_selection_conditions.cpp index 7fece6e3d7..5bade875ee 100644 --- a/pcbnew/tools/pcb_selection_conditions.cpp +++ b/pcbnew/tools/pcb_selection_conditions.cpp @@ -23,7 +23,7 @@ */ #include "pcb_selection_conditions.h" -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include #include diff --git a/pcbnew/tools/selection_tool.cpp b/pcbnew/tools/pcb_selection_tool.cpp similarity index 91% rename from pcbnew/tools/selection_tool.cpp rename to pcbnew/tools/pcb_selection_tool.cpp index 97f98a410c..93f3473717 100644 --- a/pcbnew/tools/selection_tool.cpp +++ b/pcbnew/tools/pcb_selection_tool.cpp @@ -37,7 +37,6 @@ using namespace std::placeholders; #include #include #include -#include #include #include #include @@ -53,7 +52,7 @@ using namespace std::placeholders; #include #include #include "tool_event_utils.h" -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "pcb_bright_box.h" #include "pcb_actions.h" @@ -89,14 +88,14 @@ private: /** * Private implementation of firewalled private data */ -class SELECTION_TOOL::PRIV +class PCB_SELECTION_TOOL::PRIV { public: DIALOG_FILTER_SELECTION::OPTIONS m_filterOpts; }; -SELECTION_TOOL::SELECTION_TOOL() : +PCB_SELECTION_TOOL::PCB_SELECTION_TOOL() : PCB_TOOL_BASE( "pcbnew.InteractiveSelection" ), m_frame( NULL ), m_additive( false ), @@ -121,14 +120,14 @@ SELECTION_TOOL::SELECTION_TOOL() : } -SELECTION_TOOL::~SELECTION_TOOL() +PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL() { getView()->Remove( &m_selection ); getView()->Remove( &m_enteredGroupOverlay ); } -bool SELECTION_TOOL::Init() +bool PCB_SELECTION_TOOL::Init() { auto frame = getEditFrame(); @@ -172,7 +171,7 @@ bool SELECTION_TOOL::Init() } -void SELECTION_TOOL::Reset( RESET_REASON aReason ) +void PCB_SELECTION_TOOL::Reset( RESET_REASON aReason ) { m_frame = getEditFrame(); @@ -204,7 +203,7 @@ void SELECTION_TOOL::Reset( RESET_REASON aReason ) } -int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { // Main loop: keep receiving events while( TOOL_EVENT* evt = Wait() ) @@ -419,7 +418,7 @@ int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::EnterGroup() +void PCB_SELECTION_TOOL::EnterGroup() { wxCHECK_RET( m_selection.GetSize() == 1 && m_selection[0]->Type() == PCB_GROUP_T, "EnterGroup called when selection is not a single group" ); @@ -439,7 +438,7 @@ void SELECTION_TOOL::EnterGroup() } -void SELECTION_TOOL::ExitGroup( bool aSelectGroup ) +void PCB_SELECTION_TOOL::ExitGroup( bool aSelectGroup ) { // Only continue if there is a group entered if( m_enteredGroup == nullptr ) @@ -455,14 +454,14 @@ void SELECTION_TOOL::ExitGroup( bool aSelectGroup ) } -PCBNEW_SELECTION& SELECTION_TOOL::GetSelection() +PCB_SELECTION& PCB_SELECTION_TOOL::GetSelection() { return m_selection; } -PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - bool aConfirmLockedItems ) +PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, + bool aConfirmLockedItems ) { bool selectionEmpty = m_selection.Empty(); m_selection.SetIsHover( selectionEmpty ); @@ -571,7 +570,7 @@ PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aCli } -const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const +const GENERAL_COLLECTORS_GUIDE PCB_SELECTION_TOOL::getCollectorsGuide() const { GENERAL_COLLECTORS_GUIDE guide( board()->GetVisibleLayers(), (PCB_LAYER_ID) view()->GetTopLayer(), view() ); @@ -598,9 +597,9 @@ const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const } -bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, - bool* aSelectionCancelledFlag, - CLIENT_SELECTION_FILTER aClientFilter ) +bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, + bool* aSelectionCancelledFlag, + CLIENT_SELECTION_FILTER aClientFilter ) { GENERAL_COLLECTORS_GUIDE guide = getCollectorsGuide(); GENERAL_COLLECTOR collector; @@ -700,7 +699,7 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, } -bool SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aClientFilter ) +bool PCB_SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aClientFilter ) { if( aForceSelect || m_selection.Empty() ) { @@ -712,7 +711,7 @@ bool SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aC } -bool SELECTION_TOOL::selectMultiple() +bool PCB_SELECTION_TOOL::selectMultiple() { bool cancelled = false; // Was the tool cancelled while it was running? m_multiple = true; // Multiple selection mode is active @@ -845,7 +844,7 @@ bool SELECTION_TOOL::selectMultiple() } -int SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent ) { CLIENT_SELECTION_FILTER aClientFilter = aEvent.Parameter(); @@ -855,7 +854,7 @@ int SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) { ClearSelection(); @@ -863,7 +862,7 @@ int SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent ) { std::vector* items = aEvent.Parameter*>(); @@ -880,14 +879,14 @@ int SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent ) { AddItemToSel( aEvent.Parameter() ); return 0; } -int SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) { KIGFX::VIEW* view = getView(); @@ -916,7 +915,7 @@ int SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode ) +void PCB_SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode ) { if( aItem ) { @@ -929,7 +928,7 @@ void SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode ) } -int SELECTION_TOOL::UnselectItems( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UnselectItems( const TOOL_EVENT& aEvent ) { std::vector* items = aEvent.Parameter*>(); @@ -946,14 +945,14 @@ int SELECTION_TOOL::UnselectItems( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent ) { RemoveItemFromSel( aEvent.Parameter() ); return 0; } -void SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode ) +void PCB_SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode ) { if( aItem ) { @@ -965,19 +964,20 @@ void SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode ) } -void SELECTION_TOOL::BrightenItem( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::BrightenItem( BOARD_ITEM* aItem ) { highlight( aItem, BRIGHTENED ); } -void SELECTION_TOOL::UnbrightenItem( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::UnbrightenItem( BOARD_ITEM* aItem ) { unhighlight( aItem, BRIGHTENED ); } -void connectedItemFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) +void connectedItemFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* sTool ) { // Narrow the collection down to a single BOARD_CONNECTED_ITEM for each represented net. // All other items types are removed. @@ -996,7 +996,7 @@ void connectedItemFilter( const VECTOR2I&, GENERAL_COLLECTOR& aCollector, SELECT } -int SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent ) { unsigned initialCount = 0; @@ -1038,8 +1038,8 @@ int SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem, - STOP_CONDITION aStopCondition ) +void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem, + STOP_CONDITION aStopCondition ) { constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, PCB_PAD_T, EOT }; @@ -1156,7 +1156,7 @@ void SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem, } -void SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect ) +void PCB_SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect ) { constexpr KICAD_T types[] = { PCB_TRACE_T, PCB_ARC_T, PCB_VIA_T, EOT }; auto connectivity = board()->GetConnectivity(); @@ -1167,7 +1167,7 @@ void SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect ) } -int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) { bool select = aEvent.IsAction( &PCB_ACTIONS::selectNet ); @@ -1202,7 +1202,7 @@ int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) +void PCB_SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) { std::list footprintList; @@ -1295,7 +1295,7 @@ void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) } -void SELECTION_TOOL::zoomFitSelection() +void PCB_SELECTION_TOOL::zoomFitSelection() { //Should recalculate the view to zoom in on the selection auto selectionBox = m_selection.GetBoundingBox(); @@ -1319,7 +1319,7 @@ void SELECTION_TOOL::zoomFitSelection() } -int SELECTION_TOOL::selectSheetContents( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectSheetContents( const TOOL_EVENT& aEvent ) { ClearSelection( true /*quiet mode*/ ); wxString sheetPath = *aEvent.Parameter(); @@ -1335,7 +1335,7 @@ int SELECTION_TOOL::selectSheetContents( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent ) { if( !selectCursor( true ) ) return 0; @@ -1373,7 +1373,7 @@ int SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) { bool cleared = false; @@ -1402,10 +1402,10 @@ void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) } -int SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) { DIALOG_FIND dlg( m_frame ); - dlg.SetCallback( std::bind( &SELECTION_TOOL::findCallback, this, _1 ) ); + dlg.SetCallback( std::bind( &PCB_SELECTION_TOOL::findCallback, this, _1 ) ); dlg.ShowModal(); return 0; @@ -1480,7 +1480,7 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard } -int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) { const BOARD& board = *getModel(); DIALOG_FILTER_SELECTION::OPTIONS& opts = m_priv->m_filterOpts; @@ -1512,7 +1512,7 @@ int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::FilterCollectedItems( GENERAL_COLLECTOR& aCollector ) +void PCB_SELECTION_TOOL::FilterCollectedItems( GENERAL_COLLECTOR& aCollector ) { if( aCollector.GetCount() == 0 ) return; @@ -1532,7 +1532,7 @@ void SELECTION_TOOL::FilterCollectedItems( GENERAL_COLLECTOR& aCollector ) } -bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) +bool PCB_SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) { if( aItem->IsLocked() && !m_filter.lockedItems ) return false; @@ -1608,7 +1608,7 @@ bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) } -void SELECTION_TOOL::ClearSelection( bool aQuietMode ) +void PCB_SELECTION_TOOL::ClearSelection( bool aQuietMode ) { if( m_selection.Empty() ) return; @@ -1630,7 +1630,7 @@ void SELECTION_TOOL::ClearSelection( bool aQuietMode ) } -void SELECTION_TOOL::RebuildSelection() +void PCB_SELECTION_TOOL::RebuildSelection() { m_selection.Clear(); @@ -1668,7 +1668,7 @@ void SELECTION_TOOL::RebuildSelection() } -int SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) { GENERAL_COLLECTOR* collector = aEvent.Parameter(); @@ -1678,12 +1678,12 @@ int SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) } -bool SELECTION_TOOL::doSelectionMenu( GENERAL_COLLECTOR* aCollector, const wxString& aTitle ) +bool PCB_SELECTION_TOOL::doSelectionMenu( GENERAL_COLLECTOR* aCollector, const wxString& aTitle ) { - BOARD_ITEM* current = nullptr; - PCBNEW_SELECTION highlightGroup; - bool selectAll = false; - bool expandSelection = false; + BOARD_ITEM* current = nullptr; + PCB_SELECTION highlightGroup; + bool selectAll = false; + bool expandSelection = false; highlightGroup.SetLayer( LAYER_SELECT_OVERLAY ); getView()->Add( &highlightGroup ); @@ -1817,7 +1817,7 @@ bool SELECTION_TOOL::doSelectionMenu( GENERAL_COLLECTOR* aCollector, const wxStr } -BOARD_ITEM* SELECTION_TOOL::pickSmallestComponent( GENERAL_COLLECTOR* aCollector ) +BOARD_ITEM* PCB_SELECTION_TOOL::pickSmallestComponent( GENERAL_COLLECTOR* aCollector ) { int count = aCollector->GetPrimaryCount(); // try to use preferred layer @@ -1854,7 +1854,7 @@ BOARD_ITEM* SELECTION_TOOL::pickSmallestComponent( GENERAL_COLLECTOR* aCollector } -bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOnly ) const +bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOnly ) const { const RENDER_SETTINGS* settings = getView()->GetPainter()->GetSettings(); @@ -2045,7 +2045,7 @@ bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOn } -void SELECTION_TOOL::select( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::select( BOARD_ITEM* aItem ) { if( aItem->IsSelected() ) { @@ -2064,13 +2064,13 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem ) } -void SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) { unhighlight( aItem, SELECTED, &m_selection ); } -void SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup ) +void PCB_SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { highlightInternal( aItem, aMode, aGroup, false ); @@ -2083,8 +2083,8 @@ void SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* } -void SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, - PCBNEW_SELECTION* aSelectionViewGroup, bool isChild ) +void PCB_SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, + PCB_SELECTION* aSelectionViewGroup, bool isChild ) { if( aMode == SELECTED ) aItem->SetSelected(); @@ -2121,7 +2121,7 @@ void SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, } -void SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup ) +void PCB_SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { unhighlightInternal( aItem, aMode, aGroup, false ); @@ -2134,8 +2134,8 @@ void SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION } -void SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, - PCBNEW_SELECTION* aSelectionViewGroup, bool isChild ) +void PCB_SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, + PCB_SELECTION* aSelectionViewGroup, bool isChild ) { if( aMode == SELECTED ) aItem->ClearSelected(); @@ -2176,7 +2176,7 @@ void SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, } -bool SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const +bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const { const unsigned GRIP_MARGIN = 20; VECTOR2I margin = getView()->ToWorld( VECTOR2I( GRIP_MARGIN, GRIP_MARGIN ), false ); @@ -2195,8 +2195,8 @@ bool SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const } -int SELECTION_TOOL::hitTestDistance( const wxPoint& aWhere, BOARD_ITEM* aItem, - int aMaxDistance ) const +int PCB_SELECTION_TOOL::hitTestDistance( const wxPoint& aWhere, BOARD_ITEM* aItem, + int aMaxDistance ) const { BOX2D viewportD = getView()->GetViewport(); BOX2I viewport( VECTOR2I( viewportD.GetPosition() ), VECTOR2I( viewportD.GetSize() ) ); @@ -2288,8 +2288,8 @@ int SELECTION_TOOL::hitTestDistance( const wxPoint& aWhere, BOARD_ITEM* aItem, // We currently check for pads and text mostly covering a footprint, but we don't check for // smaller footprints mostly covering a larger footprint. // -void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, - const VECTOR2I& aWhere ) const +void PCB_SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, + const VECTOR2I& aWhere ) const { std::set preferred; std::set rejected; @@ -2419,7 +2419,7 @@ void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, } -void SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const +void PCB_SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const { std::unordered_set toAdd; @@ -2456,7 +2456,7 @@ void SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) c } -int SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) { getView()->Update( &m_selection ); getView()->Update( &m_enteredGroupOverlay ); @@ -2465,7 +2465,7 @@ int SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) } -int SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent ) { ACTION_MENU* actionMenu = aEvent.Parameter(); CONDITIONAL_MENU* conditionalMenu = dynamic_cast( actionMenu ); @@ -2480,30 +2480,30 @@ int SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::setTransitions() +void PCB_SELECTION_TOOL::setTransitions() { - Go( &SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::UpdateMenu, ACTIONS::updateMenu.MakeEvent() ); - Go( &SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() ); - Go( &SELECTION_TOOL::CursorSelection, PCB_ACTIONS::selectionCursor.MakeEvent() ); - Go( &SELECTION_TOOL::ClearSelection, PCB_ACTIONS::selectionClear.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::Main, PCB_ACTIONS::selectionActivate.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::CursorSelection, PCB_ACTIONS::selectionCursor.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::ClearSelection, PCB_ACTIONS::selectionClear.MakeEvent() ); - Go( &SELECTION_TOOL::SelectItem, PCB_ACTIONS::selectItem.MakeEvent() ); - Go( &SELECTION_TOOL::SelectItems, PCB_ACTIONS::selectItems.MakeEvent() ); - Go( &SELECTION_TOOL::UnselectItem, PCB_ACTIONS::unselectItem.MakeEvent() ); - Go( &SELECTION_TOOL::UnselectItems, PCB_ACTIONS::unselectItems.MakeEvent() ); - Go( &SELECTION_TOOL::SelectionMenu, PCB_ACTIONS::selectionMenu.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::SelectItem, PCB_ACTIONS::selectItem.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::SelectItems, PCB_ACTIONS::selectItems.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::UnselectItem, PCB_ACTIONS::unselectItem.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::UnselectItems, PCB_ACTIONS::unselectItems.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::SelectionMenu, PCB_ACTIONS::selectionMenu.MakeEvent() ); - Go( &SELECTION_TOOL::find, ACTIONS::find.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::find, ACTIONS::find.MakeEvent() ); - Go( &SELECTION_TOOL::filterSelection, PCB_ACTIONS::filterSelection.MakeEvent() ); - Go( &SELECTION_TOOL::expandConnection, PCB_ACTIONS::selectConnection.MakeEvent() ); - Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() ); - Go( &SELECTION_TOOL::selectNet, PCB_ACTIONS::deselectNet.MakeEvent() ); - Go( &SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() ); - Go( &SELECTION_TOOL::selectSheetContents, PCB_ACTIONS::selectOnSheetFromEeschema.MakeEvent() ); - Go( &SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsModified ); - Go( &SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsMoved ); + Go( &PCB_SELECTION_TOOL::filterSelection, PCB_ACTIONS::filterSelection.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::expandConnection, PCB_ACTIONS::selectConnection.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::selectNet, PCB_ACTIONS::selectNet.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::selectNet, PCB_ACTIONS::deselectNet.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::selectSameSheet, PCB_ACTIONS::selectSameSheet.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::selectSheetContents, PCB_ACTIONS::selectOnSheetFromEeschema.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsModified ); + Go( &PCB_SELECTION_TOOL::updateSelection, EVENTS::SelectedItemsMoved ); - Go( &SELECTION_TOOL::SelectAll, ACTIONS::selectAll.MakeEvent() ); + Go( &PCB_SELECTION_TOOL::SelectAll, ACTIONS::selectAll.MakeEvent() ); } diff --git a/pcbnew/tools/selection_tool.h b/pcbnew/tools/pcb_selection_tool.h similarity index 94% rename from pcbnew/tools/selection_tool.h rename to pcbnew/tools/pcb_selection_tool.h index 12f76f9221..5f71b63d92 100644 --- a/pcbnew/tools/selection_tool.h +++ b/pcbnew/tools/pcb_selection_tool.h @@ -24,8 +24,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __SELECTION_TOOL_H -#define __SELECTION_TOOL_H +#ifndef PCB_SELECTION_TOOL_H +#define PCB_SELECTION_TOOL_H #include @@ -35,7 +35,7 @@ #include #include #include -#include +#include class PCB_BASE_FRAME; class BOARD_ITEM; @@ -47,11 +47,11 @@ namespace KIGFX } -typedef void (*CLIENT_SELECTION_FILTER)( const VECTOR2I&, GENERAL_COLLECTOR&, SELECTION_TOOL* ); +typedef void (*CLIENT_SELECTION_FILTER)( const VECTOR2I&, GENERAL_COLLECTOR&, PCB_SELECTION_TOOL* ); /** - * SELECTION_TOOL + * PCB_SELECTION_TOOL * * Our sample selection tool: currently supports: * - pick single objects (click LMB) @@ -61,11 +61,11 @@ typedef void (*CLIENT_SELECTION_FILTER)( const VECTOR2I&, GENERAL_COLLECTOR&, SE * - takes into account high-contrast & layer visibility settings * - invokes InteractiveEdit tool when user starts to drag selected items */ -class SELECTION_TOOL : public PCB_TOOL_BASE +class PCB_SELECTION_TOOL : public PCB_TOOL_BASE { public: - SELECTION_TOOL(); - ~SELECTION_TOOL(); + PCB_SELECTION_TOOL(); + ~PCB_SELECTION_TOOL(); /// @copydoc TOOL_BASE::Init() bool Init() override; @@ -85,7 +85,7 @@ public: * * Returns the set of currently selected items. */ - PCBNEW_SELECTION& GetSelection(); + PCB_SELECTION& GetSelection(); /** * Function RequestSelection() @@ -96,8 +96,8 @@ public: * @param aConfirmLockedItems if true the user will be prompted if they want to drop locked * items from the selection or override the locks */ - PCBNEW_SELECTION& RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - bool aConfirmLockedItems = false ); + PCB_SELECTION& RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, + bool aConfirmLockedItems = false ); ///> Select a single item under cursor event handler. int CursorSelection( const TOOL_EVENT& aEvent ); @@ -334,7 +334,7 @@ private: * @param aHighlightMode should be either SELECTED or BRIGHTENED * @param aGroup is the group to add the item to in the BRIGHTENED mode. */ - void highlight( BOARD_ITEM* aItem, int aHighlightMode, PCBNEW_SELECTION* aGroup = nullptr ); + void highlight( BOARD_ITEM* aItem, int aHighlightMode, PCB_SELECTION* aGroup = nullptr ); /** * Function unhighlight() @@ -343,7 +343,7 @@ private: * @param aHighlightMode should be either SELECTED or BRIGHTENED * @param aGroup is the group to remove the item from. */ - void unhighlight( BOARD_ITEM* aItem, int aHighlightMode, PCBNEW_SELECTION* aGroup = nullptr ); + void unhighlight( BOARD_ITEM* aItem, int aHighlightMode, PCB_SELECTION* aGroup = nullptr ); /** * Function selectionContains() @@ -366,14 +366,14 @@ private: const GENERAL_COLLECTORS_GUIDE getCollectorsGuide() const; private: - void highlightInternal( BOARD_ITEM* aItem, int aHighlightMode, PCBNEW_SELECTION* aSelectionViewGroup, - bool isChild); + void highlightInternal( BOARD_ITEM* aItem, int aHighlightMode, + PCB_SELECTION* aSelectionViewGroup, bool isChild); - void unhighlightInternal( BOARD_ITEM* aItem, int aHighlightMode, PCBNEW_SELECTION* aSelectionViewGroup, - bool isChild); + void unhighlightInternal( BOARD_ITEM* aItem, int aHighlightMode, + PCB_SELECTION* aSelectionViewGroup, bool isChild); PCB_BASE_FRAME* m_frame; // Pointer to the parent frame - PCBNEW_SELECTION m_selection; // Current state of selection + PCB_SELECTION m_selection; // Current state of selection SELECTION_FILTER_OPTIONS m_filter; @@ -393,4 +393,4 @@ private: std::unique_ptr m_priv; }; -#endif /* __SELECTION_TOOL_H */ +#endif /* PCB_SELECTION_TOOL_H */ diff --git a/pcbnew/tools/pcb_tool_base.cpp b/pcbnew/tools/pcb_tool_base.cpp index 267c6e3641..a3beaaf7f4 100644 --- a/pcbnew/tools/pcb_tool_base.cpp +++ b/pcbnew/tools/pcb_tool_base.cpp @@ -29,7 +29,7 @@ #include #include #include -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "pcb_actions.h" #include "tool_event_utils.h" @@ -51,7 +51,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, controls()->ShowCursor( true ); // Add a VIEW_GROUP that serves as a preview for the new item - PCBNEW_SELECTION preview; + PCB_SELECTION preview; view()->Add( &preview ); aPlacer->m_board = board(); @@ -292,17 +292,17 @@ PCB_DRAW_PANEL_GAL* PCB_TOOL_BASE::canvas() const } -const PCBNEW_SELECTION& PCB_TOOL_BASE::selection() const +const PCB_SELECTION& PCB_TOOL_BASE::selection() const { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); return selTool->GetSelection(); } -PCBNEW_SELECTION& PCB_TOOL_BASE::selection() +PCB_SELECTION& PCB_TOOL_BASE::selection() { - SELECTION_TOOL* selTool = m_toolMgr->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); return selTool->GetSelection(); } diff --git a/pcbnew/tools/pcb_tool_base.h b/pcbnew/tools/pcb_tool_base.h index a74f886d7e..3176b279b1 100644 --- a/pcbnew/tools/pcb_tool_base.h +++ b/pcbnew/tools/pcb_tool_base.h @@ -48,7 +48,7 @@ class PCB_TOOL_BASE; class PCB_EDIT_FRAME; class PCB_DISPLAY_OPTIONS; -class PCBNEW_SELECTION; +class PCB_SELECTION; struct INTERACTIVE_PLACER_BASE { @@ -168,9 +168,9 @@ protected: PCB_DRAW_PANEL_GAL* canvas() const; - const PCBNEW_SELECTION& selection() const; + const PCB_SELECTION& selection() const; - PCBNEW_SELECTION& selection(); + PCB_SELECTION& selection(); protected: bool m_isFootprintEditor; diff --git a/pcbnew/tools/placement_tool.cpp b/pcbnew/tools/placement_tool.cpp index f43977ed42..5a36b3e480 100644 --- a/pcbnew/tools/placement_tool.cpp +++ b/pcbnew/tools/placement_tool.cpp @@ -24,7 +24,7 @@ #include "tool/selection.h" #include "placement_tool.h" #include "pcb_actions.h" -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "edit_tool.h" #include @@ -54,7 +54,7 @@ ALIGN_DISTRIBUTE_TOOL::~ALIGN_DISTRIBUTE_TOOL() bool ALIGN_DISTRIBUTE_TOOL::Init() { // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); wxASSERT_MSG( m_selectionTool, "pcbnew.InteractiveSelection tool is not available" ); @@ -142,8 +142,8 @@ template< typename T > size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItems, ALIGNMENT_RECTS& aLocked, T aCompare ) { - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -166,7 +166,7 @@ size_t ALIGN_DISTRIBUTE_TOOL::GetSelections( ALIGNMENT_RECTS& aItems, ALIGNMENT_ } selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -466,8 +466,8 @@ int ALIGN_DISTRIBUTE_TOOL::AlignCenterY( const TOOL_EVENT& aEvent ) int ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally( const TOOL_EVENT& aEvent ) { - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -585,8 +585,8 @@ void ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally( ALIGNMENT_RECTS &it int ALIGN_DISTRIBUTE_TOOL::DistributeVertically( const TOOL_EVENT& aEvent ) { - PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + PCB_SELECTION& selection = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) diff --git a/pcbnew/tools/placement_tool.h b/pcbnew/tools/placement_tool.h index 6ada487f3b..3c8307041f 100644 --- a/pcbnew/tools/placement_tool.h +++ b/pcbnew/tools/placement_tool.h @@ -26,14 +26,14 @@ #define ALIGN_DISTRIBUTE_TOOL_H_ #include -#include +#include #include #include using ALIGNMENT_RECT = std::pair; using ALIGNMENT_RECTS = std::vector; -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class ALIGN_DISTRIBUTE_TOOL : public TOOL_INTERACTIVE { @@ -101,7 +101,6 @@ public: void setTransitions() override; private: - /** * Function GetSelections() * Populates two vectors with the sorted selection and sorted locked items @@ -129,12 +128,6 @@ private: */ int doAlignRight(); - SELECTION_TOOL* m_selectionTool; - - ACTION_MENU* m_placementMenu; - - PCB_BASE_FRAME* m_frame; - /** * Check a selection to ensure locks are valid for alignment. * @@ -143,7 +136,7 @@ private: * We also check the lock of a pad's parent as we will not move pads independently of * the parent footprint */ - int checkLockedStatus( const PCBNEW_SELECTION &selection ) const; + int checkLockedStatus( const PCB_SELECTION &selection ) const; /** * Distributes selected items using an even spacing between the centers of their bounding boxes @@ -180,6 +173,11 @@ private: void doDistributeGapsVertically( ALIGNMENT_RECTS &itemsToDistribute, const BOARD_ITEM *lastItem, int totalGap ) const; + +private: + PCB_SELECTION_TOOL* m_selectionTool; + ACTION_MENU* m_placementMenu; + PCB_BASE_FRAME* m_frame; }; #endif /* ALIGN_DISTRIBUTE_TOOL_H_ */ diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index 111f99cd11..35788bed33 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -32,7 +32,7 @@ using namespace std::placeholders; #include #include #include "pcb_actions.h" -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "point_editor.h" #include "grid_helper.h" #include @@ -338,7 +338,7 @@ void POINT_EDITOR::Reset( RESET_REASON aReason ) bool POINT_EDITOR::Init() { // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); wxASSERT_MSG( m_selectionTool, "pcbnew.InteractiveSelection tool is not available" ); @@ -397,7 +397,7 @@ int POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) if( !m_selectionTool || aEvent.Matches( EVENTS::InhibitSelectionEditing ) ) return 0; - const PCBNEW_SELECTION& selection = m_selectionTool->GetSelection(); + const PCB_SELECTION& selection = m_selectionTool->GetSelection(); if( selection.Size() != 1 || selection.Front()->GetEditFlags() ) return 0; diff --git a/pcbnew/tools/point_editor.h b/pcbnew/tools/point_editor.h index 974d84f111..055041bbe7 100644 --- a/pcbnew/tools/point_editor.h +++ b/pcbnew/tools/point_editor.h @@ -32,7 +32,7 @@ #include -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class SHAPE_POLY_SET; /** @@ -69,7 +69,7 @@ public: private: ///> Selection tool used for obtaining selected items - SELECTION_TOOL* m_selectionTool; + PCB_SELECTION_TOOL* m_selectionTool; ///> Currently edited point, NULL if there is none. EDIT_POINT* m_editedPoint; diff --git a/pcbnew/tools/position_relative_tool.cpp b/pcbnew/tools/position_relative_tool.cpp index 7cebd28e63..e4c07b6775 100644 --- a/pcbnew/tools/position_relative_tool.cpp +++ b/pcbnew/tools/position_relative_tool.cpp @@ -27,9 +27,9 @@ using namespace std::placeholders; #include "position_relative_tool.h" #include "pcb_actions.h" -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "edit_tool.h" -#include "pcbnew_picker_tool.h" +#include "pcb_picker_tool.h" #include #include #include @@ -56,7 +56,7 @@ void POSITION_RELATIVE_TOOL::Reset( RESET_REASON aReason ) bool POSITION_RELATIVE_TOOL::Init() { // Find the selection tool, so they can cooperate - m_selectionTool = m_toolMgr->GetTool(); + m_selectionTool = m_toolMgr->GetTool(); return m_selectionTool != nullptr; } @@ -67,7 +67,7 @@ int POSITION_RELATIVE_TOOL::PositionRelative( const TOOL_EVENT& aEvent ) PCB_BASE_FRAME* editFrame = getEditFrame(); const auto& selection = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, PCB_SELECTION_TOOL* sTool ) { // Iterate from the back so we don't have to worry about removals. for( int i = aCollector.GetCount() - 1; i >= 0; --i ) @@ -136,10 +136,10 @@ int POSITION_RELATIVE_TOOL::RelativeItemSelectionMove( wxPoint aPosAnchor, wxPoi int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent ) { - std::string tool = "pcbnew.PositionRelative.selectReferenceItem"; - PCBNEW_PICKER_TOOL* picker = m_toolMgr->GetTool(); - STATUS_TEXT_POPUP statusPopup( frame() ); - bool done = false; + std::string tool = "pcbnew.PositionRelative.selectReferenceItem"; + PCB_PICKER_TOOL* picker = m_toolMgr->GetTool(); + STATUS_TEXT_POPUP statusPopup( frame() ); + bool done = false; Activate(); @@ -149,8 +149,9 @@ int POSITION_RELATIVE_TOOL::SelectPositionRelativeItem( const TOOL_EVENT& aEvent [&]( const VECTOR2D& aPoint ) -> bool { m_toolMgr->RunAction( PCB_ACTIONS::selectionClear, true ); - const PCBNEW_SELECTION& sel = m_selectionTool->RequestSelection( - []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, SELECTION_TOOL* sTool ) + const PCB_SELECTION& sel = m_selectionTool->RequestSelection( + []( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector, + PCB_SELECTION_TOOL* sTool ) { } ); diff --git a/pcbnew/tools/position_relative_tool.h b/pcbnew/tools/position_relative_tool.h index 3b60686a09..322be8a1ff 100644 --- a/pcbnew/tools/position_relative_tool.h +++ b/pcbnew/tools/position_relative_tool.h @@ -26,13 +26,13 @@ #include #include -#include "selection_tool.h" +#include "pcb_selection_tool.h" #include "dialogs/dialog_position_relative.h" #include "dialogs/dialog_position_relative_base.h" class BOARD_COMMIT; class BOARD_ITEM; -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; class DIALOG_POSITION_RELATIVE; /** @@ -87,18 +87,17 @@ public: void setTransitions() override; private: - DIALOG_POSITION_RELATIVE* m_dialog; + DIALOG_POSITION_RELATIVE* m_dialog; - ///> Selection tool used for obtaining selected items - SELECTION_TOOL* m_selectionTool; - PCBNEW_SELECTION m_selection; + PCB_SELECTION_TOOL* m_selectionTool; + PCB_SELECTION m_selection; std::unique_ptr m_commit; - EDA_ITEM* m_anchor_item; - wxPoint m_anchor; + EDA_ITEM* m_anchor_item; + wxPoint m_anchor; - wxPoint m_translation; + wxPoint m_translation; }; #endif diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 8c45e5b1ca..23521bfb59 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include ZONE_CREATE_HELPER::ZONE_CREATE_HELPER( DRAWING_TOOL& aTool, PARAMS& aParams ): @@ -65,7 +65,7 @@ std::unique_ptr ZONE_CREATE_HELPER::createNewZone( bool aKeepout ) zoneInfo.m_Zone_45_Only = ( m_params.m_leaderMode == POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 ); // If we don't have a net from highlighing, maybe we can get one from the selection - SELECTION_TOOL* selectionTool = m_tool.GetManager()->GetTool(); + PCB_SELECTION_TOOL* selectionTool = m_tool.GetManager()->GetTool(); if( selectionTool && !selectionTool->GetSelection().Empty() && zoneInfo.m_NetcodeSelection == -1 ) diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 4a5fa4077d..393724d44f 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -39,9 +39,9 @@ using namespace std::placeholders; #include #include #include -#include -#include -#include +#include +#include +#include #include /* Functions to undo and redo edit commands. @@ -559,9 +559,9 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool image->SetPosition( eda_item->GetPosition() ); if( aList->GetPickedItemStatus( ii ) == UNDO_REDO::DRILLORIGIN ) - PCB_EDITOR_CONTROL::DoSetDrillOrigin( view, this, item, origin ); + BOARD_EDITOR_CONTROL::DoSetDrillOrigin( view, this, item, origin ); else - PCBNEW_CONTROL::DoSetGridOrigin( view, this, item, origin ); + PCB_CONTROL::DoSetGridOrigin( view, this, item, origin ); } break; @@ -592,7 +592,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool Compile_Ratsnest( false ); } - SELECTION_TOOL* selTool = m_toolManager->GetTool(); + PCB_SELECTION_TOOL* selTool = m_toolManager->GetTool(); selTool->RebuildSelection(); GetBoard()->SanitizeNetcodes(); diff --git a/pcbnew/widgets/appearance_controls.h b/pcbnew/widgets/appearance_controls.h index 3639a24d9b..9c5c404552 100644 --- a/pcbnew/widgets/appearance_controls.h +++ b/pcbnew/widgets/appearance_controls.h @@ -314,7 +314,7 @@ private: std::map m_netclassSettingsMap; - // TODO(JE) Move preset storage to the PCBNEW_CONTROL tool + // TODO(JE) Move preset storage to the PCB_CONTROL tool // Storage for all layer presets std::map m_layerPresets; diff --git a/pcbnew/widgets/panel_selection_filter.cpp b/pcbnew/widgets/panel_selection_filter.cpp index 73c172af38..3264e186f9 100644 --- a/pcbnew/widgets/panel_selection_filter.cpp +++ b/pcbnew/widgets/panel_selection_filter.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include @@ -30,7 +30,7 @@ PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER( wxWindow* aParent ) : m_onlyCheckbox( nullptr ) { wxASSERT( m_frame ); - m_tool = m_frame->GetToolManager()->GetTool(); + m_tool = m_frame->GetToolManager()->GetTool(); wxASSERT( m_tool ); SELECTION_FILTER_OPTIONS& opts = m_tool->GetFilter(); diff --git a/pcbnew/widgets/panel_selection_filter.h b/pcbnew/widgets/panel_selection_filter.h index b08f685530..f09bb07ff3 100644 --- a/pcbnew/widgets/panel_selection_filter.h +++ b/pcbnew/widgets/panel_selection_filter.h @@ -24,7 +24,7 @@ #include -class SELECTION_TOOL; +class PCB_SELECTION_TOOL; struct SELECTION_FILTER_OPTIONS; @@ -47,11 +47,10 @@ private: void onPopupSelection( wxCommandEvent& aEvent ); +private: PCB_BASE_EDIT_FRAME* m_frame; - - SELECTION_TOOL* m_tool; - - wxCheckBox* m_onlyCheckbox; + PCB_SELECTION_TOOL* m_tool; + wxCheckBox* m_onlyCheckbox; }; diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index efec67cc8c..93f04b86cc 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -454,20 +454,20 @@ bool EDA_3D_VIEWER::Set3DSolderPasteColorFromUser() { return false; } void EDA_3D_VIEWER::loadCommonSettings() { } void EDA_3D_VIEWER::Install3DViewOptionDialog( wxCommandEvent& event ) { }; -#include +#include /** * Private implementation of firewalled private data */ -class SELECTION_TOOL::PRIV +class PCB_SELECTION_TOOL::PRIV { public: DIALOG_FILTER_SELECTION::OPTIONS m_filterOpts; }; -SELECTION_TOOL::SELECTION_TOOL() : +PCB_SELECTION_TOOL::PCB_SELECTION_TOOL() : PCB_TOOL_BASE( "pcbnew.InteractiveSelection" ), m_frame( NULL ), m_additive( false ), @@ -482,66 +482,66 @@ SELECTION_TOOL::SELECTION_TOOL() : } -SELECTION_TOOL::~SELECTION_TOOL() +PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL() { } -bool SELECTION_TOOL::Init() +bool PCB_SELECTION_TOOL::Init() { return true; } -void SELECTION_TOOL::Reset( RESET_REASON aReason ) +void PCB_SELECTION_TOOL::Reset( RESET_REASON aReason ) { } -int SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::EnterGroup() +void PCB_SELECTION_TOOL::EnterGroup() { } -void SELECTION_TOOL::ExitGroup( bool aSelectGroup ) +void PCB_SELECTION_TOOL::ExitGroup( bool aSelectGroup ) { } -PCBNEW_SELECTION& SELECTION_TOOL::GetSelection() +PCB_SELECTION& PCB_SELECTION_TOOL::GetSelection() { return m_selection; } -PCBNEW_SELECTION& SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, - bool aConfirmLockedItems ) +PCB_SELECTION& PCB_SELECTION_TOOL::RequestSelection( CLIENT_SELECTION_FILTER aClientFilter, + bool aConfirmLockedItems ) { return m_selection; } -const GENERAL_COLLECTORS_GUIDE SELECTION_TOOL::getCollectorsGuide() const +const GENERAL_COLLECTORS_GUIDE PCB_SELECTION_TOOL::getCollectorsGuide() const { return GENERAL_COLLECTORS_GUIDE( LSET(), PCB_LAYER_ID::UNDEFINED_LAYER, nullptr ); } -bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, - bool* aSelectionCancelledFlag, - CLIENT_SELECTION_FILTER aClientFilter ) +bool PCB_SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, + bool* aSelectionCancelledFlag, + CLIENT_SELECTION_FILTER aClientFilter ) { @@ -549,48 +549,48 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag, } -bool SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aClientFilter ) +bool PCB_SELECTION_TOOL::selectCursor( bool aForceSelect, CLIENT_SELECTION_FILTER aClientFilter ) { return false; } -bool SELECTION_TOOL::selectMultiple() +bool PCB_SELECTION_TOOL::selectMultiple() { return false; } -int SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::CursorSelection( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectItems( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectItem( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) { @@ -598,103 +598,103 @@ int SELECTION_TOOL::SelectAll( const TOOL_EVENT& aEvent ) } -void SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode ) +void PCB_SELECTION_TOOL::AddItemToSel( BOARD_ITEM* aItem, bool aQuietMode ) { } -int SELECTION_TOOL::UnselectItems( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UnselectItems( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UnselectItem( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode ) +void PCB_SELECTION_TOOL::RemoveItemFromSel( BOARD_ITEM* aItem, bool aQuietMode ) { } -void SELECTION_TOOL::BrightenItem( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::BrightenItem( BOARD_ITEM* aItem ) { } -void SELECTION_TOOL::UnbrightenItem( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::UnbrightenItem( BOARD_ITEM* aItem ) { } -int SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::expandConnection( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem, - STOP_CONDITION aStopCondition ) +void PCB_SELECTION_TOOL::selectConnectedTracks( BOARD_CONNECTED_ITEM& aStartItem, + STOP_CONDITION aStopCondition ) { } -void SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect ) +void PCB_SELECTION_TOOL::selectAllItemsOnNet( int aNetCode, bool aSelect ) { } -int SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectNet( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) +void PCB_SELECTION_TOOL::selectAllItemsOnSheet( wxString& aSheetPath ) { } -void SELECTION_TOOL::zoomFitSelection() +void PCB_SELECTION_TOOL::zoomFitSelection() { } -int SELECTION_TOOL::selectSheetContents( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectSheetContents( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::selectSameSheet( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::findCallback( BOARD_ITEM* aItem ) { } -int SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::find( const TOOL_EVENT& aEvent ) { return 0; @@ -717,20 +717,20 @@ static bool itemIsIncludedByFilter( const BOARD_ITEM& aItem, const BOARD& aBoard } -int SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::filterSelection( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::FilterCollectedItems( GENERAL_COLLECTOR& aCollector ) +void PCB_SELECTION_TOOL::FilterCollectedItems( GENERAL_COLLECTOR& aCollector ) { } -bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) +bool PCB_SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) { @@ -738,112 +738,112 @@ bool SELECTION_TOOL::itemPassesFilter( BOARD_ITEM* aItem ) } -void SELECTION_TOOL::ClearSelection( bool aQuietMode ) +void PCB_SELECTION_TOOL::ClearSelection( bool aQuietMode ) { } -void SELECTION_TOOL::RebuildSelection() +void PCB_SELECTION_TOOL::RebuildSelection() { } -int SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) { return 0; } -bool SELECTION_TOOL::doSelectionMenu( GENERAL_COLLECTOR* aCollector, const wxString& aTitle ) +bool PCB_SELECTION_TOOL::doSelectionMenu( GENERAL_COLLECTOR* aCollector, const wxString& aTitle ) { return false; } -BOARD_ITEM* SELECTION_TOOL::pickSmallestComponent( GENERAL_COLLECTOR* aCollector ) +BOARD_ITEM* PCB_SELECTION_TOOL::pickSmallestComponent( GENERAL_COLLECTOR* aCollector ) { return nullptr; } -bool SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOnly ) const +bool PCB_SELECTION_TOOL::Selectable( const BOARD_ITEM* aItem, bool checkVisibilityOnly ) const { return false; } -void SELECTION_TOOL::select( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::select( BOARD_ITEM* aItem ) { } -void SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) +void PCB_SELECTION_TOOL::unselect( BOARD_ITEM* aItem ) { } -void SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup ) +void PCB_SELECTION_TOOL::highlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { } -void SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup, bool isChild ) +void PCB_SELECTION_TOOL::highlightInternal( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup, bool isChild ) { } -void SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup ) +void PCB_SELECTION_TOOL::unhighlight( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup ) { } -void SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, PCBNEW_SELECTION* aGroup, bool isChild ) +void PCB_SELECTION_TOOL::unhighlightInternal( BOARD_ITEM* aItem, int aMode, PCB_SELECTION* aGroup, bool isChild ) { } -bool SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const +bool PCB_SELECTION_TOOL::selectionContains( const VECTOR2I& aPoint ) const { return false; } -void SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, - const VECTOR2I& aWhere ) const +void PCB_SELECTION_TOOL::GuessSelectionCandidates( GENERAL_COLLECTOR& aCollector, + const VECTOR2I& aWhere ) const { } -void SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const +void PCB_SELECTION_TOOL::FilterCollectorForGroups( GENERAL_COLLECTOR& aCollector ) const { } -int SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::updateSelection( const TOOL_EVENT& aEvent ) { return 0; } -int SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent ) +int PCB_SELECTION_TOOL::UpdateMenu( const TOOL_EVENT& aEvent ) { return 0; } -void SELECTION_TOOL::setTransitions() +void PCB_SELECTION_TOOL::setTransitions() {} void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, @@ -882,29 +882,29 @@ PCB_DRAW_PANEL_GAL* PCB_TOOL_BASE::canvas() const } -const PCBNEW_SELECTION& PCB_TOOL_BASE::selection() const +const PCB_SELECTION& PCB_TOOL_BASE::selection() const { - static PCBNEW_SELECTION sel; + static PCB_SELECTION sel; return sel; } -PCBNEW_SELECTION& PCB_TOOL_BASE::selection() +PCB_SELECTION& PCB_TOOL_BASE::selection() { - static PCBNEW_SELECTION sel; + static PCB_SELECTION sel; return sel; } -EDA_ITEM* PCBNEW_SELECTION::GetTopLeftItem( bool onlyModules ) const +EDA_ITEM* PCB_SELECTION::GetTopLeftItem( bool onlyModules ) const { return nullptr; } -const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const +const KIGFX::VIEW_GROUP::ITEMS PCB_SELECTION::updateDrawList() const { std::vector items; @@ -912,7 +912,7 @@ const KIGFX::VIEW_GROUP::ITEMS PCBNEW_SELECTION::updateDrawList() const } -const LSET PCBNEW_SELECTION::GetSelectionLayers() +const LSET PCB_SELECTION::GetSelectionLayers() { return LSET(); } diff --git a/qa/qa_utils/pcb_test_frame.cpp b/qa/qa_utils/pcb_test_frame.cpp index a589caa46b..5bfae48371 100644 --- a/qa/qa_utils/pcb_test_frame.cpp +++ b/qa/qa_utils/pcb_test_frame.cpp @@ -155,7 +155,7 @@ void PCB_TEST_FRAME_BASE::createView( wxWindow *aParent, PCB_DRAW_PANEL_GAL::GAL m_pcbActions = std::make_unique( ); m_toolDispatcher = std::make_unique( m_toolManager.get(), m_pcbActions.get() ); - //m_toolManager->RegisterTool( new SELECTION_TOOL ); + //m_toolManager->RegisterTool( new PCB_SELECTION_TOOL ); createUserTools(); m_toolManager->InitTools();