From 0c2ba94b16ca3ae66e424772f1ad2392613bdb93 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 10 May 2019 20:22:26 +0100 Subject: [PATCH] More sharing between SchEdit and LibEdit. --- Documentation/changelogs/CHANGELOG-2011.txt | 2 +- eeschema/CMakeLists.txt | 2 +- .../{sch_collectors.cpp => ee_collectors.cpp} | 30 +++++++++---------- .../{sch_collectors.h => ee_collectors.h} | 23 +++++++------- eeschema/files-io.cpp | 8 ++--- eeschema/libedit/lib_edit_frame.h | 3 +- eeschema/sch_component.cpp | 4 +-- eeschema/sch_component.h | 6 ++-- eeschema/sch_edit_frame.h | 2 +- eeschema/sch_screen.cpp | 4 +-- eeschema/tools/ee_inspection_tool.cpp | 2 +- eeschema/tools/ee_selection_tool.cpp | 17 +++++------ eeschema/tools/ee_selection_tool.h | 12 ++++---- eeschema/tools/sch_drawing_tools.cpp | 2 +- eeschema/tools/sch_edit_tool.cpp | 12 ++++---- eeschema/tools/sch_editor_control.cpp | 4 +-- 16 files changed, 64 insertions(+), 69 deletions(-) rename eeschema/{sch_collectors.cpp => ee_collectors.cpp} (93%) rename eeschema/{sch_collectors.h => ee_collectors.h} (95%) diff --git a/Documentation/changelogs/CHANGELOG-2011.txt b/Documentation/changelogs/CHANGELOG-2011.txt index fc3e1e6d0a..8752fc7808 100644 --- a/Documentation/changelogs/CHANGELOG-2011.txt +++ b/Documentation/changelogs/CHANGELOG-2011.txt @@ -194,7 +194,7 @@ jp charras: * Add item clarification context menu to EESchema when multiple unresolved items are found at the current cross hair position. - * Add collector class SCH_COLLECTOR for supporting multiple item hit testing. + * Add collector class EE_COLLECTOR for supporting multiple item hit testing. * Removed bit wise masked filtering from schematic item hit testing. * Removed all old hit testing functions and methods scattered about the EESchema source code. diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index dd624e5b68..d93607bcbf 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -186,7 +186,7 @@ set( EESCHEMA_SRCS sch_base_frame.cpp sch_bitmap.cpp sch_bus_entry.cpp - sch_collectors.cpp + ee_collectors.cpp sch_component.cpp sch_connection.cpp sch_eagle_plugin.cpp diff --git a/eeschema/sch_collectors.cpp b/eeschema/ee_collectors.cpp similarity index 93% rename from eeschema/sch_collectors.cpp rename to eeschema/ee_collectors.cpp index 319b472758..afce29cc54 100644 --- a/eeschema/sch_collectors.cpp +++ b/eeschema/ee_collectors.cpp @@ -27,19 +27,19 @@ #include #include -#include +#include #include #include #include -const KICAD_T SCH_COLLECTOR::AllItems[] = { +const KICAD_T EE_COLLECTOR::AllItems[] = { SCH_LOCATE_ANY_T, EOT }; -const KICAD_T SCH_COLLECTOR::EditableItems[] = { +const KICAD_T EE_COLLECTOR::EditableItems[] = { SCH_TEXT_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, @@ -53,7 +53,7 @@ const KICAD_T SCH_COLLECTOR::EditableItems[] = { EOT }; -const KICAD_T SCH_COLLECTOR::RotatableItems[] = { +const KICAD_T EE_COLLECTOR::RotatableItems[] = { SCH_TEXT_T, SCH_LABEL_T, SCH_GLOBAL_LABEL_T, @@ -70,26 +70,26 @@ const KICAD_T SCH_COLLECTOR::RotatableItems[] = { }; -const KICAD_T SCH_COLLECTOR::ComponentsOnly[] = { +const KICAD_T EE_COLLECTOR::ComponentsOnly[] = { SCH_COMPONENT_T, EOT }; -const KICAD_T SCH_COLLECTOR::SheetsOnly[] = { +const KICAD_T EE_COLLECTOR::SheetsOnly[] = { SCH_SHEET_T, EOT }; -const KICAD_T SCH_COLLECTOR::SheetsAndSheetLabels[] = { +const KICAD_T EE_COLLECTOR::SheetsAndSheetLabels[] = { SCH_SHEET_PIN_T, SCH_SHEET_T, EOT }; -SEARCH_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) +SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) { if( aItem->Type() == LIB_PIN_T ) { @@ -115,8 +115,8 @@ SEARCH_RESULT SCH_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData ) } -void SCH_COLLECTOR::Collect( EDA_ITEM* aItem, const KICAD_T aFilterList[], const wxPoint& aPos, - int aUnit, int aConvert ) +void EE_COLLECTOR::Collect( EDA_ITEM* aItem, const KICAD_T aFilterList[], const wxPoint& aPos, + int aUnit, int aConvert ) { Empty(); // empty the collection just in case @@ -134,7 +134,7 @@ void SCH_COLLECTOR::Collect( EDA_ITEM* aItem, const KICAD_T aFilterList[], const } -bool SCH_COLLECTOR::IsCorner() const +bool EE_COLLECTOR::IsCorner() const { if( GetCount() != 2 ) return false; @@ -155,7 +155,7 @@ bool SCH_COLLECTOR::IsCorner() const } -bool SCH_COLLECTOR::IsDraggableJunction() const +bool EE_COLLECTOR::IsDraggableJunction() const { for( size_t i = 0; i < m_List.size(); i++ ) if( ( (SCH_ITEM*) m_List[ i ] )->Type() == SCH_JUNCTION_T ) @@ -230,7 +230,7 @@ SCH_ITEM* SCH_FIND_COLLECTOR::GetItem( int ndx ) const for( unsigned i = 0; i < m_sheetPaths.size(); i++ ) { EDA_ITEM::IterateForward( m_sheetPaths[ i ].LastDrawList(), - inspector, nullptr, SCH_COLLECTOR::AllItems ); + inspector, nullptr, EE_COLLECTOR::AllItems ); } return item; @@ -453,7 +453,7 @@ void SCH_FIND_COLLECTOR::Collect( SCH_FIND_REPLACE_DATA& aFindReplaceData, } -SEARCH_RESULT SCH_TYPE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* testData ) +SEARCH_RESULT EE_TYPE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* testData ) { // The Vist() function only visits the testItem if its type was in the // the scanList, so therefore we can collect anything given to us here. @@ -463,7 +463,7 @@ SEARCH_RESULT SCH_TYPE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* testData ) } -void SCH_TYPE_COLLECTOR::Collect( SCH_ITEM* aItem, const KICAD_T aFilterList[] ) +void EE_TYPE_COLLECTOR::Collect( SCH_ITEM* aItem, const KICAD_T aFilterList[] ) { Empty(); // empty the collection diff --git a/eeschema/sch_collectors.h b/eeschema/ee_collectors.h similarity index 95% rename from eeschema/sch_collectors.h rename to eeschema/ee_collectors.h index 5c5ed68404..e4bbd845f9 100644 --- a/eeschema/sch_collectors.h +++ b/eeschema/ee_collectors.h @@ -22,8 +22,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _SCH_COLLECTORS_H_ -#define _SCH_COLLECTORS_H_ +#ifndef EE_COLLECTORS_H +#define EE_COLLECTORS_H #include @@ -33,9 +33,9 @@ /** - * Class SCH_COLLECTOR + * Class EE_COLLECTOR */ -class SCH_COLLECTOR : public COLLECTOR +class EE_COLLECTOR : public COLLECTOR { public: static const KICAD_T AllItems[]; @@ -45,10 +45,7 @@ public: static const KICAD_T SheetsOnly[]; static const KICAD_T SheetsAndSheetLabels[]; - /** - * Constructor SCH_COLLECTOR - */ - SCH_COLLECTOR( const KICAD_T* aScanTypes = SCH_COLLECTOR::AllItems ) : + EE_COLLECTOR( const KICAD_T* aScanTypes = EE_COLLECTOR::AllItems ) : m_MenuCancelled( false ) { SetScanTypes( aScanTypes ); @@ -191,7 +188,7 @@ public: /** * Constructor SCH_FIND_COLLECTOR */ - SCH_FIND_COLLECTOR( const KICAD_T* aScanTypes = SCH_COLLECTOR::AllItems ) + SCH_FIND_COLLECTOR( const KICAD_T* aScanTypes = EE_COLLECTOR::AllItems ) { SetScanTypes( aScanTypes ); m_foundIndex = 0; @@ -313,13 +310,13 @@ public: /** - * Class TYPE_COLLECTOR + * Class EE_TYPE_COLLECTOR * merely gathers up all SCH_ITEMs of a given set of KICAD_T type(s). It does * no hit-testing. * * @see class COLLECTOR */ -class SCH_TYPE_COLLECTOR : public SCH_COLLECTOR +class EE_TYPE_COLLECTOR : public EE_COLLECTOR { public: /** @@ -339,8 +336,8 @@ public: * @param aItem The head of a DLIST to scan. * @param aScanList The KICAD_Ts to gather up. */ - void Collect( SCH_ITEM* aItem, const KICAD_T aScanList[] ); + void Collect( EDA_ITEM* aItem, const KICAD_T aScanList[] ); }; -#endif // _SCH_COLLECTORS_H_ +#endif // EE_COLLECTORS_H diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 273eb6f6a8..1e9d47039d 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -606,9 +606,9 @@ bool SCH_EDIT_FRAME::AppendSchematic() // Check for duplicate sheet names in the current page. wxArrayString duplicateSheetNames; - SCH_TYPE_COLLECTOR sheets; + EE_TYPE_COLLECTOR sheets; - sheets.Collect( screen->GetDrawItems(), SCH_COLLECTOR::SheetsOnly ); + sheets.Collect( screen->GetDrawItems(), EE_COLLECTOR::SheetsOnly ); for( int i = 0; i < sheets.GetCount(); ++i ) { @@ -853,12 +853,12 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) GetScreen()->m_Initialized = true; - SCH_TYPE_COLLECTOR components; + EE_TYPE_COLLECTOR components; SCH_SCREENS allScreens; for( SCH_SCREEN* screen = allScreens.GetFirst(); screen; screen = allScreens.GetNext() ) { - components.Collect( screen->GetDrawItems(), SCH_COLLECTOR::ComponentsOnly ); + components.Collect( screen->GetDrawItems(), EE_COLLECTOR::ComponentsOnly ); for( int cmpIdx = 0; cmpIdx < components.GetCount(); ++cmpIdx ) { diff --git a/eeschema/libedit/lib_edit_frame.h b/eeschema/libedit/lib_edit_frame.h index 37e8a4f609..4c178802c3 100644 --- a/eeschema/libedit/lib_edit_frame.h +++ b/eeschema/libedit/lib_edit_frame.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include class SCH_EDIT_FRAME; @@ -51,7 +51,6 @@ class LIB_MANAGER; class LIB_EDIT_FRAME : public SCH_BASE_FRAME { LIB_PART* m_my_part; ///< a part I own, it is not in any library, but a copy could be. - SCH_COLLECTOR m_collectedItems; ///< Used for hit testing. wxComboBox* m_partSelectBox; ///< a Box to select a part to edit (if any) SYMBOL_TREE_PANE* m_treePane; ///< component search tree widget LIB_MANAGER* m_libMgr; ///< manager taking care of temporary modificatoins diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 4e82593ea5..4e05326813 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -388,7 +388,7 @@ static bool sort_by_libid( const SCH_COMPONENT* ref, SCH_COMPONENT* cmp ) } -void SCH_COMPONENT::ResolveAll( const SCH_COLLECTOR& aComponents, SYMBOL_LIB_TABLE& aLibTable, +void SCH_COMPONENT::ResolveAll( const EE_COLLECTOR& aComponents, SYMBOL_LIB_TABLE& aLibTable, PART_LIB* aCacheLib ) { std::vector cmp_list; @@ -432,7 +432,7 @@ void SCH_COMPONENT::ResolveAll( const SCH_COLLECTOR& aComponents, SYMBOL_LIB_TAB } -void SCH_COMPONENT::UpdatePins( const SCH_COLLECTOR& aComponents ) +void SCH_COMPONENT::UpdatePins( const EE_COLLECTOR& aComponents ) { for( int i = 0; i < aComponents.GetCount(); ++i ) { diff --git a/eeschema/sch_component.h b/eeschema/sch_component.h index 9b7b19dfec..a57a5a8d16 100644 --- a/eeschema/sch_component.h +++ b/eeschema/sch_component.h @@ -46,7 +46,7 @@ class LIB_PART; class NETLIST_OBJECT_LIST; class PART_LIB; class PART_LIBS; -class SCH_COLLECTOR; +class EE_COLLECTOR; class SCH_SCREEN; class SYMBOL_LIB_TABLE; @@ -199,7 +199,7 @@ public: bool Resolve( SYMBOL_LIB_TABLE& aLibTable, PART_LIB* aCacheLib = NULL ); - static void ResolveAll( const SCH_COLLECTOR& aComponents, SYMBOL_LIB_TABLE& aLibTable, + static void ResolveAll( const EE_COLLECTOR& aComponents, SYMBOL_LIB_TABLE& aLibTable, PART_LIB* aCacheLib = NULL ); int GetUnit() const { return m_unit; } @@ -209,7 +209,7 @@ public: * * @param aComponents collector of components in screen */ - static void UpdatePins( const SCH_COLLECTOR& aComponents ); + static void UpdatePins( const EE_COLLECTOR& aComponents ); /** * Updates the local cache of SCH_PIN_CONNECTION objects for each pin diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 25d530e2cc..cc4ab86cff 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index 4f09656a88..8b0e16cb40 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -508,9 +508,9 @@ void SCH_SCREEN::UpdateSymbolLinks( bool aForce ) { SYMBOL_LIB_TABLE* libs = Prj().SchSymbolLibTable(); int mod_hash = libs->GetModifyHash(); - SCH_TYPE_COLLECTOR c; + EE_TYPE_COLLECTOR c; - c.Collect( GetDrawItems(), SCH_COLLECTOR::ComponentsOnly ); + c.Collect( GetDrawItems(), EE_COLLECTOR::ComponentsOnly ); // Must we resolve? if( (m_modification_sync != mod_hash) || aForce ) diff --git a/eeschema/tools/ee_inspection_tool.cpp b/eeschema/tools/ee_inspection_tool.cpp index 81c186eda8..d1dfba25f8 100644 --- a/eeschema/tools/ee_inspection_tool.cpp +++ b/eeschema/tools/ee_inspection_tool.cpp @@ -90,7 +90,7 @@ void EE_INSPECTION_TOOL::Reset( RESET_REASON aReason ) int EE_INSPECTION_TOOL::ShowDatasheet( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); if( selection.Empty() ) return 0; diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index cec0625fd5..52b9b0db9e 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -314,7 +314,7 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) if( m_selection.Empty() ) { - SelectPoint( evt->Position(), SCH_COLLECTOR::AllItems, &selectionCancelled ); + SelectPoint( evt->Position(), EE_COLLECTOR::AllItems, &selectionCancelled ); m_selection.SetIsHover( true ); } @@ -413,8 +413,8 @@ SELECTION& EE_SELECTION_TOOL::GetSelection() EDA_ITEM* EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T* aFilterList, bool* aSelectionCancelledFlag, bool aCheckLocked ) { - EDA_ITEM* start; - SCH_COLLECTOR collector; + EDA_ITEM* start; + EE_COLLECTOR collector; if( m_isLibEdit ) start = static_cast( m_frame )->GetCurPart(); @@ -478,8 +478,7 @@ EDA_ITEM* EE_SELECTION_TOOL::SelectPoint( const VECTOR2I& aWhere, const KICAD_T* } -void EE_SELECTION_TOOL::guessSelectionCandidates( SCH_COLLECTOR& collector, - const VECTOR2I& aWhere ) +void EE_SELECTION_TOOL::guessSelectionCandidates( EE_COLLECTOR& collector, const VECTOR2I& aPos ) { // There are certain parent/child and enclosure combinations that can be handled // automatically. Since schematics are meant to be human-readable we don't have @@ -647,7 +646,7 @@ static KICAD_T nodeTypes[] = EDA_ITEM* EE_SELECTION_TOOL::GetNode( VECTOR2I aPosition ) { - SCH_COLLECTOR collector; + EE_COLLECTOR collector; collector.Collect( m_frame->GetScreen()->GetDrawItems(), nodeTypes, (wxPoint) aPosition ); @@ -785,7 +784,7 @@ int EE_SELECTION_TOOL::ClearSelection( const TOOL_EVENT& aEvent ) int EE_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) { - SCH_COLLECTOR* collector = aEvent.Parameter(); + EE_COLLECTOR* collector = aEvent.Parameter(); if( !doSelectionMenu( collector ) ) collector->m_MenuCancelled = true; @@ -794,7 +793,7 @@ int EE_SELECTION_TOOL::SelectionMenu( const TOOL_EVENT& aEvent ) } -bool EE_SELECTION_TOOL::doSelectionMenu( SCH_COLLECTOR* aCollector ) +bool EE_SELECTION_TOOL::doSelectionMenu( EE_COLLECTOR* aCollector ) { EDA_ITEM* current = nullptr; CONTEXT_MENU menu; diff --git a/eeschema/tools/ee_selection_tool.h b/eeschema/tools/ee_selection_tool.h index 6c06fb5b6c..f9b26687dc 100644 --- a/eeschema/tools/ee_selection_tool.h +++ b/eeschema/tools/ee_selection_tool.h @@ -28,12 +28,12 @@ #include #include #include -#include +#include #include class SCH_BASE_FRAME; class SCH_ITEM; -class SCH_COLLECTOR; +class EE_COLLECTOR; namespace KIGFX { @@ -88,7 +88,7 @@ public: * Returns either an existing selection (filtered), or the selection at the current * cursor if the existing selection is empty. */ - SELECTION& RequestSelection( const KICAD_T* aFilterList = SCH_COLLECTOR::AllItems ); + SELECTION& RequestSelection( const KICAD_T* aFilterList = EE_COLLECTOR::AllItems ); /** * Function selectPoint() @@ -101,7 +101,7 @@ public: * @param aCheckLocked indicates if locked items should be excluded */ EDA_ITEM* SelectPoint( const VECTOR2I& aWhere, - const KICAD_T* aFilterList = SCH_COLLECTOR::AllItems, + const KICAD_T* aFilterList = EE_COLLECTOR::AllItems, bool* aSelectionCancelledFlag = NULL, bool aCheckLocked = false ); int AddItemToSel( const TOOL_EVENT& aEvent ); @@ -149,7 +149,7 @@ private: * Apply heuristics to try and determine a single object when multiple are found under the * cursor. */ - void guessSelectionCandidates( SCH_COLLECTOR& collector, const VECTOR2I& aWhere ); + void guessSelectionCandidates( EE_COLLECTOR& collector, const VECTOR2I& aWhere ); /** * Allows the selection of a single item from a list via pop-up menu. The items are @@ -157,7 +157,7 @@ private: * the picked item. * @return true if an item was picked */ - bool doSelectionMenu( SCH_COLLECTOR* aItems ); + bool doSelectionMenu( EE_COLLECTOR* aItems ); /** * Function clearSelection() diff --git a/eeschema/tools/sch_drawing_tools.cpp b/eeschema/tools/sch_drawing_tools.cpp index e051fa9c01..a6705851f1 100644 --- a/eeschema/tools/sch_drawing_tools.cpp +++ b/eeschema/tools/sch_drawing_tools.cpp @@ -681,7 +681,7 @@ int SCH_DRAWING_TOOLS::doTwoClickPlace( KICAD_T aType ) item = m_frame->CreateNewText( LAYER_NOTES ); break; case SCH_SHEET_PIN_T: - item = m_selectionTool->SelectPoint( cursorPos, SCH_COLLECTOR::SheetsAndSheetLabels ); + item = m_selectionTool->SelectPoint( cursorPos, EE_COLLECTOR::SheetsAndSheetLabels ); if( item ) { diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index e06dc332f5..b5a9ec93a1 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -466,7 +466,7 @@ void SCH_EDIT_TOOL::Reset( RESET_REASON aReason ) int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::RotatableItems ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::RotatableItems ); if( selection.GetSize() == 0 ) return 0; @@ -606,7 +606,7 @@ int SCH_EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::Mirror( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::RotatableItems ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::RotatableItems ); if( selection.GetSize() == 0 ) return 0; @@ -1056,7 +1056,7 @@ int SCH_EDIT_TOOL::EditField( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); if( selection.Empty() ) return 0; @@ -1077,7 +1077,7 @@ int SCH_EDIT_TOOL::AutoplaceFields( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::ConvertDeMorgan( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); if( selection.Empty() ) return 0; @@ -1097,7 +1097,7 @@ int SCH_EDIT_TOOL::ConvertDeMorgan( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::EditableItems ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::EditableItems ); if( selection.Empty() ) return 0; @@ -1264,7 +1264,7 @@ int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent ) int SCH_EDIT_TOOL::CleanupSheetPins( const TOOL_EVENT& aEvent ) { - SELECTION& selection = m_selectionTool->RequestSelection( SCH_COLLECTOR::SheetsOnly ); + SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::SheetsOnly ); SCH_SHEET* sheet = (SCH_SHEET*) selection.Front(); if( !sheet ) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 9e41528aed..21edd01b6d 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -665,7 +665,7 @@ int SCH_EDITOR_CONTROL::Paste( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) { EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::ComponentsOnly ); + SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); SCH_COMPONENT* comp = nullptr; if( selection.GetSize() >= 1 ) @@ -692,7 +692,7 @@ int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::EnterSheet( const TOOL_EVENT& aEvent ) { EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); - const SELECTION& selection = selTool->RequestSelection( SCH_COLLECTOR::SheetsOnly ); + const SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::SheetsOnly ); if( selection.GetSize() == 1 ) {