KiCad PCB EDA Suite
|
The selection tool: currently supports: More...
#include <pcb_selection_tool.h>
Classes | |
class | PRIV |
Private implementation of firewalled private data. More... | |
Public Types | |
enum | RESET_REASON { RUN , MODEL_RELOAD , GAL_SWITCH , REDRAW } |
Determine the reason of reset for a tool. More... | |
Public Member Functions | |
PCB_SELECTION_TOOL () | |
~PCB_SELECTION_TOOL () | |
bool | Init () override |
Init() is called once upon a registration of the tool. More... | |
void | Reset (RESET_REASON aReason) override |
Bring the tool to a known, initial state. More... | |
void | OnIdle (wxIdleEvent &aEvent) |
bool | IsFootprintEditor () |
int | Main (const TOOL_EVENT &aEvent) |
The main loop. More... | |
PCB_SELECTION & | GetSelection () |
PCB_SELECTION & | RequestSelection (CLIENT_SELECTION_FILTER aClientFilter, bool aConfirmLockedItems=false) |
Return the current selection, filtered according to aClientFilter. More... | |
int | CursorSelection (const TOOL_EVENT &aEvent) |
Clear current selection event handler. More... | |
int | ClearSelection (const TOOL_EVENT &aEvent) |
void | ClearSelection (bool aQuietMode=false) |
Select all items on the board. More... | |
int | SelectAll (const TOOL_EVENT &aEvent) |
void | FindItem (BOARD_ITEM *aItem) |
Take necessary actions to mark an item as found. More... | |
void | select (EDA_ITEM *aItem) override |
Take necessary action mark an item as selected. More... | |
bool | Selectable (const BOARD_ITEM *aItem, bool checkVisibilityOnly=false) const |
void | SelectAllItemsOnNet (int aNetCode, bool aSelect=true) |
Select all items with the given net code. More... | |
void | GuessSelectionCandidates (GENERAL_COLLECTOR &aCollector, const VECTOR2I &aWhere) const |
Try to guess best selection candidates in case multiple items are clicked, by doing some brain-dead heuristics. More... | |
void | RebuildSelection () |
Rebuild the selection from the EDA_ITEMs' selection flags. More... | |
SELECTION_FILTER_OPTIONS & | GetFilter () |
Set up handlers for various events. More... | |
void | setTransitions () override |
Zoom the screen to center and fit the current selection. More... | |
void | zoomFitSelection () |
Zoom the screen to fit the bounding box for cross probing/selection sync. More... | |
void | ZoomFitCrossProbeBBox (const BOX2I &bbox) |
void | EnterGroup () |
Enter the group at the head of the current selection. More... | |
void | ExitGroup (bool aSelectGroup=false) |
Leave the currently-entered group. More... | |
PCB_GROUP * | GetEnteredGroup () |
PCB_LAYER_ID | GetActiveLayer () |
void | FilterCollectorForHierarchy (GENERAL_COLLECTOR &aCollector, bool aMultiselect) const |
In general we don't want to select both a parent and any of it's children. More... | |
void | FilterCollectorForFreePads (GENERAL_COLLECTOR &aCollector) const |
Check the "allow free pads" setting and if disabled, replace any pads in the collector with their parent footprints. More... | |
void | FilterCollectorForMarkers (GENERAL_COLLECTOR &aCollector) const |
Drop any PCB_MARKERs from the collector. More... | |
void | FilterCollectedItems (GENERAL_COLLECTOR &aCollector, bool aMultiSelect) |
Apply the SELECTION_FITLER_OPTIONS to the collector. More... | |
int | UpdateMenu (const TOOL_EVENT &aEvent) |
Update a menu's state based on the current selection. More... | |
int | AddItemToSel (const TOOL_EVENT &aEvent) |
void | AddItemToSel (EDA_ITEM *aItem, bool aQuietMode=false) |
int | AddItemsToSel (const TOOL_EVENT &aEvent) |
void | AddItemsToSel (EDA_ITEMS *aList, bool aQuietMode=false) |
int | RemoveItemFromSel (const TOOL_EVENT &aEvent) |
void | RemoveItemFromSel (EDA_ITEM *aItem, bool aQuietMode=false) |
int | RemoveItemsFromSel (const TOOL_EVENT &aEvent) |
void | RemoveItemsFromSel (EDA_ITEMS *aList, bool aQuietMode=false) |
void | RemoveItemsFromSel (std::vector< KIID > *aList, bool aQuietMode=false) |
A safer version of RemoveItemsFromSel( EDA_ITEMS ) which doesn't require the items to still exist. More... | |
void | BrightenItem (EDA_ITEM *aItem) |
void | UnbrightenItem (EDA_ITEM *aItem) |
int | SelectionMenu (const TOOL_EVENT &aEvent) |
Show a popup menu to trim the COLLECTOR passed as aEvent's parameter down to a single item. More... | |
void | Activate () |
Run the tool. More... | |
TOOL_MENU & | GetToolMenu () |
void | SetContextMenu (ACTION_MENU *aMenu, CONTEXT_MENU_TRIGGER aTrigger=CMENU_BUTTON) |
Assign a context menu and tells when it should be activated. More... | |
void | RunMainStack (std::function< void()> aFunc) |
Call a function using the main stack. More... | |
template<class T > | |
void | Go (int(T::*aStateFunc)(const TOOL_EVENT &), const TOOL_EVENT_LIST &aConditions=TOOL_EVENT(TC_ANY, TA_ANY)) |
Define which state (aStateFunc) to go when a certain event arrives (aConditions). More... | |
TOOL_EVENT * | Wait (const TOOL_EVENT_LIST &aEventList=TOOL_EVENT(TC_ANY, TA_ANY)) |
Suspend execution of the tool until an event specified in aEventList arrives. More... | |
TOOL_TYPE | GetType () const |
Return the type of the tool. More... | |
TOOL_ID | GetId () const |
Return the unique identifier of the tool. More... | |
const std::string & | GetName () const |
Return the name of the tool. More... | |
TOOL_MANAGER * | GetManager () const |
Return the instance of TOOL_MANAGER that takes care of the tool. More... | |
bool | IsToolActive () const |
Protected Member Functions | |
KIGFX::PCB_VIEW * | view () const |
KIGFX::VIEW_CONTROLS * | controls () const |
PCB_BASE_EDIT_FRAME * | frame () const |
BOARD * | board () const |
PCB_DRAW_PANEL_GAL * | canvas () const |
virtual bool | ctrlClickHighlights () override |
Determines if ctrl-click is highlight net or XOR selection. More... | |
SELECTION & | selection () override |
Return a reference to the selection. More... | |
void | onDisambiguationExpire (wxTimerEvent &aEvent) |
Start the process to show our disambiguation menu once the user has kept the mouse down for the minimum time. More... | |
void | setModifiersState (bool aShiftState, bool aCtrlState, bool aAltState) |
Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state of modifier keys SHIFT, CTRL, ALT and depending on the OS. More... | |
bool | hasModifier () |
True if a selection modifier is enabled, false otherwise. More... | |
bool | doSelectionMenu (COLLECTOR *aCollector) |
void | attachManager (TOOL_MANAGER *aManager) |
Set the TOOL_MANAGER the tool will belong to. More... | |
KIGFX::VIEW * | getView () const |
Returns the instance of #VIEW object used in the application. More... | |
KIGFX::VIEW_CONTROLS * | getViewControls () const |
Return the instance of VIEW_CONTROLS object used in the application. More... | |
template<typename T > | |
T * | getEditFrame () const |
Return the application window object, casted to requested user type. More... | |
template<typename T > | |
T * | getModel () const |
Return the model object if it matches the requested type. More... | |
Protected Attributes | |
bool | m_additive |
bool | m_subtractive |
bool | m_exclusive_or |
bool | m_multiple |
bool | m_skip_heuristics |
bool | m_highlight_modifier |
bool | m_drag_additive |
bool | m_drag_subtractive |
bool | m_canceledMenu |
wxTimer | m_disambiguateTimer |
VECTOR2I | m_originalCursor |
TOOL_MENU | m_menu |
The functions below are not yet implemented - their interface may change. More... | |
TOOL_TYPE | m_type |
Unique identifier for the tool, assigned by a TOOL_MANAGER instance. More... | |
TOOL_ID | m_toolId |
Name of the tool. More... | |
std::string | m_toolName |
TOOL_MANAGER * | m_toolMgr |
Private Types | |
enum | STOP_CONDITION { STOP_AT_JUNCTION , STOP_AT_PAD , STOP_NEVER } |
Private Member Functions | |
bool | selectPoint (const VECTOR2I &aWhere, bool aOnDrag=false, bool *aSelectionCancelledFlag=nullptr, CLIENT_SELECTION_FILTER aClientFilter=nullptr) |
Select an item pointed by the parameter aWhere. More... | |
bool | selectCursor (bool aForceSelect=false, CLIENT_SELECTION_FILTER aClientFilter=nullptr) |
Select an item under the cursor unless there is something already selected. More... | |
bool | selectMultiple () |
Handle drawing a selection box that allows one to select many items at the same time. More... | |
int | disambiguateCursor (const TOOL_EVENT &aEvent) |
Handle disambiguation actions including displaying the menu. More... | |
int | expandConnection (const TOOL_EVENT &aEvent) |
Expand the current connected-item selection to the next boundary (junctions, pads, or all) More... | |
int | unrouteSelected (const TOOL_EVENT &aEvent) |
Unroute the selected board connected items. More... | |
int | selectNet (const TOOL_EVENT &aEvent) |
Select all copper connections belonging to the same net(s) as the items in the selection. More... | |
int | selectUnconnected (const TOOL_EVENT &aEvent) |
Select nearest unconnected footprints on same net as selected items. More... | |
int | grabUnconnected (const TOOL_EVENT &aEvent) |
Select and move other nearest footprint unconnected on same net as selected items. More... | |
void | selectAllConnectedTracks (const std::vector< BOARD_CONNECTED_ITEM * > &aStartItems, STOP_CONDITION aStopCondition) |
Select connected tracks and vias. More... | |
void | selectConnections (const std::vector< BOARD_ITEM * > &aItems) |
void | selectAllItemsOnSheet (wxString &aSheetPath) |
Select all items with the given sheet timestamp/UUID name (the sheet path). More... | |
int | selectSheetContents (const TOOL_EVENT &aEvent) |
Select all footprints belonging to same hierarchical sheet as the selected footprint (same sheet path). More... | |
int | selectSameSheet (const TOOL_EVENT &aEvent) |
Set selection to items passed by parameter and connected nets (optionally). More... | |
int | syncSelection (const TOOL_EVENT &aEvent) |
int | syncSelectionWithNets (const TOOL_EVENT &aEvent) |
void | doSyncSelection (const std::vector< BOARD_ITEM * > &aItems, bool aWithNets) |
Invoke filter dialog and modify current selection. More... | |
int | filterSelection (const TOOL_EVENT &aEvent) |
Return true if the given item passes the current SELECTION_FILTER_OPTIONS. More... | |
bool | itemPassesFilter (BOARD_ITEM *aItem, bool aMultiSelect) |
void | unselect (EDA_ITEM *aItem) override |
Take necessary action mark an item as unselected. More... | |
void | highlight (EDA_ITEM *aItem, int aHighlightMode, SELECTION *aGroup=nullptr) override |
Highlight the item visually. More... | |
void | unhighlight (EDA_ITEM *aItem, int aHighlightMode, SELECTION *aGroup=nullptr) override |
Unhighlight the item visually. More... | |
bool | selectionContains (const VECTOR2I &aPoint) const |
int | hitTestDistance (const VECTOR2I &aWhere, BOARD_ITEM *aItem, int aMaxDistance) const |
int | updateSelection (const TOOL_EVENT &aEvent) |
Event handler to update the selection VIEW_ITEM. More... | |
const GENERAL_COLLECTORS_GUIDE | getCollectorsGuide () const |
void | highlightInternal (EDA_ITEM *aItem, int aHighlightMode, bool aUsingOverlay) |
void | unhighlightInternal (EDA_ITEM *aItem, int aHighlightMode, bool aUsingOverlay) |
void | resetTransitions () |
Clear the current transition map and restores the default one created by setTransitions(). More... | |
void | goInternal (TOOL_STATE_FUNC &aState, const TOOL_EVENT_LIST &aConditions) |
EDA_ITEM * | getModelInt () const |
TOOLS_HOLDER * | getToolHolderInt () const |
Private Attributes | |
PCB_BASE_FRAME * | m_frame |
bool | m_isFootprintEditor |
PCB_SELECTION | m_selection |
SELECTION_FILTER_OPTIONS | m_filter |
KICURSOR | m_nonModifiedCursor |
PCB_GROUP * | m_enteredGroup |
KIGFX::VIEW_GROUP | m_enteredGroupOverlay |
std::unique_ptr< PRIV > | m_priv |
The selection tool: currently supports:
Definition at line 64 of file pcb_selection_tool.h.
|
inherited |
Determine the reason of reset for a tool.
Enumerator | |
---|---|
RUN | Tool is invoked after being inactive. |
MODEL_RELOAD | Model changes (required full reload) |
GAL_SWITCH | Rendering engine changes. |
REDRAW | Full drawing refresh. |
Definition at line 77 of file tool_base.h.
|
private |
Definition at line 311 of file pcb_selection_tool.h.
PCB_SELECTION_TOOL::PCB_SELECTION_TOOL | ( | ) |
Definition at line 115 of file pcb_selection_tool.cpp.
References ARROW, SELECTION_FILTER_OPTIONS::dimensions, SELECTION_FILTER_OPTIONS::footprints, SELECTION_FILTER_OPTIONS::graphics, SELECTION_FILTER_OPTIONS::keepouts, SELECTION_FILTER_OPTIONS::lockedItems, m_filter, SELECTION_FILTER_OPTIONS::otherItems, SELECTION_FILTER_OPTIONS::pads, SELECTION_FILTER_OPTIONS::text, SELECTION_FILTER_OPTIONS::tracks, SELECTION_FILTER_OPTIONS::vias, and SELECTION_FILTER_OPTIONS::zones.
PCB_SELECTION_TOOL::~PCB_SELECTION_TOOL | ( | ) |
Definition at line 137 of file pcb_selection_tool.cpp.
References TOOL_BASE::getView(), m_enteredGroupOverlay, m_selection, SELECTION_TOOL::onDisambiguationExpire(), and KIGFX::VIEW::Remove().
|
inherited |
Run the tool.
After activation, the tool starts receiving events until it is finished.
Definition at line 51 of file tool_interactive.cpp.
References TOOL_MANAGER::InvokeTool(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.
Referenced by AUTOPLACE_TOOL::autoplace(), EDIT_TOOL::copyToClipboard(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawArc(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), PAD_TOOL::EnumeratePads(), PCB_CONTROL::GridSetOrigin(), SCH_EDITOR_CONTROL::HighlightNetCursor(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), ROUTER_TOOL::RouteSelected(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().
|
inherited |
Definition at line 128 of file selection_tool.cpp.
References SELECTION_TOOL::AddItemsToSel(), TOOL_EVENT::Parameter(), SELECTION_TOOL::selection(), and SELECTION::SetIsHover().
Referenced by SELECTION_TOOL::AddItemsToSel(), PCB_EDIT_FRAME::RebuildAndRefresh(), EE_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), and setTransitions().
|
inherited |
Definition at line 136 of file selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), SELECTION_TOOL::select(), and EVENTS::SelectedEvent.
|
inherited |
Definition at line 107 of file selection_tool.cpp.
References SELECTION_TOOL::AddItemToSel(), TOOL_EVENT::Parameter(), SELECTION_TOOL::selection(), and SELECTION::SetIsHover().
Referenced by SELECTION_TOOL::AddItemToSel(), SCH_EDIT_TOOL::BreakWire(), SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), EDIT_TOOL::FilletTracks(), SCH_FIND_REPLACE_TOOL::FindNext(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), DIALOG_INSPECTOR::onCellClicked(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), EE_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), setTransitions(), SCH_LINE_WIRE_BUS_TOOL::startSegments(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace().
|
inherited |
Definition at line 115 of file selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), SELECTION_TOOL::select(), and EVENTS::SelectedEvent.
|
protectedinherited |
Set the TOOL_MANAGER the tool will belong to.
Called by TOOL_MANAGER::RegisterTool()
Definition at line 60 of file tool_base.cpp.
References TOOL_BASE::m_toolMgr.
Referenced by TOOL_MANAGER::RegisterTool().
|
inlineprotected |
Definition at line 230 of file pcb_selection_tool.h.
Referenced by filterSelection(), getCollectorsGuide(), grabUnconnected(), RebuildSelection(), Selectable(), selectAllConnectedTracks(), SelectAllItemsOnNet(), selectAllItemsOnSheet(), selectConnections(), selectMultiple(), selectPoint(), and selectUnconnected().
|
inherited |
Definition at line 207 of file selection_tool.cpp.
References BRIGHTENED, and SELECTION_TOOL::highlight().
Referenced by SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_EDIT_FRAME::DisplayCurrentSheet(), SCH_FIND_REPLACE_TOOL::FindNext(), and SCH_FIND_REPLACE_TOOL::UpdateFind().
|
inlineprotected |
Definition at line 235 of file pcb_selection_tool.h.
References frame(), and PCB_BASE_FRAME::GetCanvas().
Referenced by FindItem().
void PCB_SELECTION_TOOL::ClearSelection | ( | bool | aQuietMode = false | ) |
Select all items on the board.
Definition at line 2307 of file pcb_selection_tool.cpp.
References EVENTS::ClearedEvent, SELECTION::ClearReferencePoint(), SELECTION::Empty(), SELECTION::Front(), SELECTION::GetSize(), PCB_ACTIONS::hideLocalRatsnest, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), TOOL_MANAGER::RunAction(), SELECTED, SELECTION::SetIsHover(), unhighlight(), KIGFX::PCB_VIEW::Update(), and view().
int PCB_SELECTION_TOOL::ClearSelection | ( | const TOOL_EVENT & | aEvent | ) |
Definition at line 1071 of file pcb_selection_tool.cpp.
References ClearSelection().
Referenced by BOARD_EDITOR_CONTROL::AssignNetclass(), ClearSelection(), EDIT_TOOL::copyToClipboard(), CONVERT_TOOL::CreatePolys(), EDIT_TOOL::doMoveSelection(), doSyncSelection(), EnterGroup(), ExitGroup(), filterSelection(), FindItem(), grabUnconnected(), GROUP_TOOL::Group(), Main(), RequestSelection(), Reset(), selectCursor(), selectMultiple(), selectPoint(), selectSameSheet(), selectSheetContents(), setTransitions(), and unrouteSelected().
|
inlineprotected |
Definition at line 220 of file pcb_selection_tool.h.
References TOOL_BASE::getViewControls().
|
overrideprotectedvirtual |
Determines if ctrl-click is highlight net or XOR selection.
Reimplemented from SELECTION_TOOL.
Definition at line 706 of file pcb_selection_tool.cpp.
References PCB_BASE_FRAME::GetPcbNewSettings(), PCBNEW_SETTINGS::m_CtrlClickHighlight, m_frame, and m_isFootprintEditor.
int PCB_SELECTION_TOOL::CursorSelection | ( | const TOOL_EVENT & | aEvent | ) |
Clear current selection event handler.
Definition at line 1061 of file pcb_selection_tool.cpp.
References TOOL_EVENT::Parameter(), and selectCursor().
Referenced by setTransitions().
|
private |
Handle disambiguation actions including displaying the menu.
Definition at line 1045 of file pcb_selection_tool.cpp.
References SELECTION_TOOL::m_canceledMenu, SELECTION_TOOL::m_originalCursor, SELECTION_TOOL::m_skip_heuristics, selectPoint(), and SELECTION_TOOL::setModifiersState().
Referenced by setTransitions().
|
protectedinherited |
The user has requested the full, non-limited list of selection items
Definition at line 245 of file selection_tool.cpp.
References _, ACTION_MENU::Add(), KIGFX::VIEW::Add(), COLLECTOR::Append(), BRIGHTENED, CMENU_NOW, COLLECTOR::Combine(), ACTION_MENU::DisplayTitle(), COLLECTOR::Empty(), Format(), COLLECTOR::GetCount(), EDA_ITEM::GetItemDescription(), EDA_ITEM::GetMenuImage(), TOOL_BASE::getView(), COLLECTOR::HasAdditionalItems(), SELECTION_TOOL::highlight(), info, INVALID_BITMAP, LAYER_SELECT_OVERLAY, COLLECTOR::m_MenuTitle, KIGFX::VIEW::Remove(), TOOL_INTERACTIVE::SetContextMenu(), ACTION_MENU::SetIcon(), KIGFX::VIEW_GROUP::SetLayer(), ACTION_MENU::SetTitle(), TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_CLOSED, TA_CHOICE_MENU_UPDATE, SELECTION_TOOL::unhighlight(), KIGFX::VIEW::UpdateItems(), and TOOL_INTERACTIVE::Wait().
Referenced by SELECTION_TOOL::SelectionMenu(), GERBVIEW_SELECTION_TOOL::selectPoint(), PL_SELECTION_TOOL::SelectPoint(), selectPoint(), and EE_SELECTION_TOOL::selectPoint().
|
private |
Invoke filter dialog and modify current selection.
Definition at line 1752 of file pcb_selection_tool.cpp.
References CROSS_PROBING_SETTINGS::center_on_items, BOX2< Vec >::Centre(), ClearSelection(), EDA_DRAW_FRAME::FocusOnLocation(), EDA_DRAW_PANEL_GAL::ForceRefresh(), SELECTION::GetBoundingBox(), PCB_BASE_FRAME::GetCanvas(), BOX2< Vec >::GetHeight(), PCB_BASE_FRAME::GetPcbNewSettings(), BOX2< Vec >::GetWidth(), APP_SETTINGS_BASE::m_CrossProbing, m_frame, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), selectConnections(), EVENTS::SelectedEvent, SELECTION::Size(), KIGFX::VIEW::UpdateAllLayersColor(), view(), CROSS_PROBING_SETTINGS::zoom_to_fit, and ZoomFitCrossProbeBBox().
Referenced by syncSelection(), and syncSelectionWithNets().
void PCB_SELECTION_TOOL::EnterGroup | ( | ) |
Enter the group at the head of the current selection.
Definition at line 502 of file pcb_selection_tool.cpp.
References KIGFX::VIEW_GROUP::Add(), ClearSelection(), ENTERED, ExitGroup(), SELECTION::GetSize(), KIGFX::VIEW::Hide(), m_enteredGroup, m_enteredGroupOverlay, m_selection, TOOL_BASE::m_toolMgr, PCB_GROUP_T, TOOL_MANAGER::ProcessEvent(), PCB_GROUP::RunOnChildren(), select(), EVENTS::SelectedEvent, EDA_ITEM::SetFlags(), KIGFX::PCB_VIEW::Update(), and view().
Referenced by GROUP_TOOL::EnterGroup(), and Main().
void PCB_SELECTION_TOOL::ExitGroup | ( | bool | aSelectGroup = false | ) |
Leave the currently-entered group.
aSelectGroup | [optional] Select the group after leaving. |
Definition at line 527 of file pcb_selection_tool.cpp.
References KIGFX::VIEW_GROUP::Clear(), EDA_ITEM::ClearFlags(), ClearSelection(), ENTERED, KIGFX::VIEW::Hide(), m_enteredGroup, m_enteredGroupOverlay, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), EVENTS::SelectedEvent, KIGFX::PCB_VIEW::Update(), and view().
Referenced by EDIT_TOOL::DeleteItems(), EnterGroup(), Main(), Reset(), select(), and selectPoint().
|
private |
Expand the current connected-item selection to the next boundary (junctions, pads, or all)
Definition at line 1177 of file pcb_selection_tool.cpp.
References _, BOARD_CONNECTED_ITEM::ClassOf(), connectedItemFilter(), SELECTION::GetItems(), m_frame, m_selection, TOOL_BASE::m_toolMgr, pad, FOOTPRINT::Pads(), PCB_FOOTPRINT_T, TOOL_MANAGER::ProcessEvent(), selectAllConnectedTracks(), selectCursor(), EVENTS::SelectedEvent, STOP_AT_JUNCTION, STOP_AT_PAD, and STOP_NEVER.
Referenced by setTransitions().
void PCB_SELECTION_TOOL::FilterCollectedItems | ( | GENERAL_COLLECTOR & | aCollector, |
bool | aMultiSelect | ||
) |
Apply the SELECTION_FITLER_OPTIONS to the collector.
Definition at line 2173 of file pcb_selection_tool.cpp.
References COLLECTOR::GetCount(), itemPassesFilter(), and COLLECTOR::Remove().
Referenced by BOARD_INSPECTION_TOOL::highlightNet(), selectMultiple(), and selectPoint().
void PCB_SELECTION_TOOL::FilterCollectorForFreePads | ( | GENERAL_COLLECTOR & | aCollector | ) | const |
Check the "allow free pads" setting and if disabled, replace any pads in the collector with their parent footprints.
Definition at line 3160 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), frame(), COLLECTOR::GetCount(), BOARD_ITEM::GetParent(), COLLECTOR::HasItem(), m_isFootprintEditor, PCB_PAD_T, COLLECTOR::Remove(), and EDA_ITEM::Type().
Referenced by EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::Flip(), EDIT_TOOL::Mirror(), EDIT_TOOL::PackAndMoveFootprints(), EDIT_TOOL::Remove(), EDIT_TOOL::Rotate(), and EDIT_TOOL::Swap().
void PCB_SELECTION_TOOL::FilterCollectorForHierarchy | ( | GENERAL_COLLECTOR & | aCollector, |
bool | aMultiselect | ||
) | const |
In general we don't want to select both a parent and any of it's children.
This includes both footprints and their items, and groups and their members.
Definition at line 3092 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), CANDIDATE, COLLECTOR::GetCount(), EDA_ITEM::GetFlags(), BOARD_ITEM::GetParent(), COLLECTOR::HasItem(), m_enteredGroup, m_isFootprintEditor, PCB_FOOTPRINT_T, COLLECTOR::Remove(), PCB_GROUP::TopLevelGroup(), EDA_ITEM::Type(), and PCB_GROUP::WithinScope().
Referenced by EDIT_TOOL::CreateArray(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::Duplicate(), EDIT_TOOL::Flip(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), EDIT_TOOL::PackAndMoveFootprints(), POSITION_RELATIVE_TOOL::PositionRelative(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), SelectAll(), selectMultiple(), selectPoint(), and EDIT_TOOL::Swap().
void PCB_SELECTION_TOOL::FilterCollectorForMarkers | ( | GENERAL_COLLECTOR & | aCollector | ) | const |
Drop any PCB_MARKERs from the collector.
Definition at line 3184 of file pcb_selection_tool.cpp.
References COLLECTOR::GetCount(), PCB_MARKER_T, COLLECTOR::Remove(), and EDA_ITEM::Type().
Referenced by EDIT_TOOL::CreateArray(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Duplicate(), EDIT_TOOL::Flip(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), EDIT_TOOL::PackAndMoveFootprints(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Rotate(), and EDIT_TOOL::Swap().
|
private |
Return true if the given item passes the current SELECTION_FILTER_OPTIONS.
Definition at line 2141 of file pcb_selection_tool.cpp.
References board(), ClearSelection(), SELECTION::GetItems(), itemIsIncludedByFilter(), m_frame, m_priv, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), EVENTS::SelectedEvent, and selection().
Referenced by setTransitions().
void PCB_SELECTION_TOOL::FindItem | ( | BOARD_ITEM * | aItem | ) |
Take necessary actions to mark an item as found.
aItem | The item that was found and needs to be highlighted/focused/etc. |
Definition at line 1990 of file pcb_selection_tool.cpp.
References canvas(), EVENTS::ClearedEvent, ClearSelection(), BOX2< Vec >::Contains(), EDA_DRAW_FRAME::FocusOnLocation(), EDA_DRAW_PANEL_GAL::ForceRefresh(), EDA_ITEM::GetBoundingBox(), PCB_BASE_FRAME::GetCanvas(), BOARD_ITEM::GetCenter(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetOrigin(), EDA_ITEM::GetPosition(), KIGFX::VIEW::GetScale(), BOX2< Vec >::GetSize(), SELECTION::GetSize(), PCB_DRAW_PANEL_GAL::GetView(), KIGFX::VIEW::GetViewport(), BOX2< Vec >::GetWidth(), m_frame, m_selection, TOOL_BASE::m_toolMgr, PCB_NETINFO_T, TOOL_MANAGER::ProcessEvent(), scale, select(), SelectAllItemsOnNet(), EVENTS::SelectedEvent, KIGFX::VIEW::SetScale(), EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_EDIT_FRAME::ShowFindDialog().
|
inlineprotected |
Definition at line 225 of file pcb_selection_tool.h.
Referenced by canvas(), FilterCollectorForFreePads(), Init(), Main(), and RequestSelection().
|
inline |
Definition at line 190 of file pcb_selection_tool.h.
References PCB_BASE_FRAME::GetActiveLayer(), and m_frame.
|
private |
Definition at line 679 of file pcb_selection_tool.cpp.
References board(), BOARD::IsElementVisible(), LAYER_MOD_BK, LAYER_MOD_FR, LAYER_MOD_REFERENCES, LAYER_MOD_TEXT, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS, LAYER_PADS_TH, LAYER_TRACKS, LAYER_VIAS, GENERAL_COLLECTORS_GUIDE::SetIgnoreBlindBuriedVias(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMicroVias(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesOnBack(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesOnFront(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesRefs(), GENERAL_COLLECTORS_GUIDE::SetIgnoreModulesVals(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsMarkedNoShow(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsOnBack(), GENERAL_COLLECTORS_GUIDE::SetIgnoreMTextsOnFront(), GENERAL_COLLECTORS_GUIDE::SetIgnorePadsOnBack(), GENERAL_COLLECTORS_GUIDE::SetIgnorePadsOnFront(), GENERAL_COLLECTORS_GUIDE::SetIgnoreThroughHolePads(), GENERAL_COLLECTORS_GUIDE::SetIgnoreThroughVias(), GENERAL_COLLECTORS_GUIDE::SetIgnoreTracks(), and view().
Referenced by RequestSelection(), and selectPoint().
|
inlineprotectedinherited |
Return the application window object, casted to requested user type.
Definition at line 185 of file tool_base.h.
References TOOL_BASE::getToolHolderInt().
Referenced by ZONE_CREATE_HELPER::createNewZone(), and ZONE_CREATE_HELPER::setUniquePriority().
|
inline |
Definition at line 188 of file pcb_selection_tool.h.
References m_enteredGroup.
Referenced by EDIT_TOOL::DeleteItems(), PCB_CONTROL::placeBoardItems(), and BOARD_COMMIT::Push().
|
inline |
Set up handlers for various events.
Definition at line 159 of file pcb_selection_tool.h.
References m_filter.
Referenced by EDIT_TOOL::doMoveSelection(), BOARD_INSPECTION_TOOL::highlightNet(), PCB_EDIT_FRAME::LoadProjectSettings(), PANEL_SELECTION_FILTER::OnFilterChanged(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), and PCB_EDIT_FRAME::saveProjectSettings().
|
inlineinherited |
Return the unique identifier of the tool.
The identifier is set by an instance of TOOL_MANAGER.
Definition at line 121 of file tool_base.h.
References TOOL_BASE::m_toolId.
Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::isActive(), TOOL_MANAGER::RegisterTool(), ACTION_MANAGER::RunHotKey(), TOOL_MANAGER::runTool(), TOOL_MANAGER::saveViewControls(), and TOOL_MANAGER::ShutdownTool().
|
inlineinherited |
Return the instance of TOOL_MANAGER that takes care of the tool.
Definition at line 144 of file tool_base.h.
References TOOL_BASE::m_toolMgr.
Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PNS_KICAD_IFACE::DisplayItem(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), PNS_KICAD_IFACE::GetUnits(), ZONE_CREATE_HELPER::OnFirstPoint(), ACTION_MENU::OnMenuEvent(), and ZONE_CREATE_HELPER::performZoneCutout().
|
inlineprotectedinherited |
Return the model object if it matches the requested type.
Store the type of the tool.
Definition at line 197 of file tool_base.h.
References TOOL_BASE::getModelInt().
Referenced by ZONE_CREATE_HELPER::commitZone(), and ZONE_CREATE_HELPER::createZoneFromExisting().
|
privateinherited |
Definition at line 54 of file tool_base.cpp.
References TOOL_MANAGER::GetModel(), and TOOL_BASE::m_toolMgr.
Referenced by TOOL_BASE::getModel().
|
inlineinherited |
Return the name of the tool.
Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).
Definition at line 134 of file tool_base.h.
References TOOL_BASE::m_toolName.
Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), TOOL_MANAGER::RegisterTool(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().
PCB_SELECTION & PCB_SELECTION_TOOL::GetSelection | ( | ) |
Definition at line 549 of file pcb_selection_tool.cpp.
References m_selection.
Referenced by PCB_PROPERTIES_PANEL::AfterCommit(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PAD_TOOL::copyPadSettings(), ZONE_CREATE_HELPER::createNewZone(), DRC_TOOL::CrossProbe(), BOARD_EDITOR_CONTROL::doCrossProbePcbToSch(), BOARD_INSPECTION_TOOL::doHideRatsnestNet(), EDIT_TOOL::DragArcTrack(), GROUP_TOOL::EnterGroup(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::GetAndPlace(), PCB_PROPERTIES_PANEL::getPropertyFromEvent(), DRAWING_TOOL::getSourceZoneForAction(), BOARD_INSPECTION_TOOL::highlightNet(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), Main(), BOARD_EDITOR_CONTROL::modifyLockSelected(), PCB_POINT_EDITOR::OnSelectionChange(), PAD_TOOL::pastePadProperties(), PCB_CONTROL::placeBoardItems(), DRAWING_TOOL::PlaceImage(), PAD_TOOL::pushPadSettings(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), EDIT_TOOL::Remove(), GROUP_TOOL::RemoveFromGroup(), PCB_TOOL_BASE::selection(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), GROUP_CONTEXT_MENU::update(), PCB_PROPERTIES_PANEL::UpdateData(), PCB_CONTROL::UpdateMessagePanel(), PCB_PROPERTIES_PANEL::valueChanged(), PCB_PROPERTIES_PANEL::valueChanging(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().
|
privateinherited |
Definition at line 48 of file tool_base.cpp.
References TOOL_MANAGER::GetToolHolder(), and TOOL_BASE::m_toolMgr.
Referenced by TOOL_BASE::getEditFrame().
|
inlineinherited |
Definition at line 77 of file tool_interactive.h.
References TOOL_INTERACTIVE::m_menu.
Referenced by EE_INSPECTION_TOOL::Init(), EE_POINT_EDITOR::Init(), SCH_EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SCH_MOVE_TOOL::Init(), SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_MOVE_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), PL_EDIT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), BOARD_INSPECTION_TOOL::Init(), CONVERT_TOOL::Init(), EDIT_TOOL::Init(), GROUP_TOOL::Init(), PAD_TOOL::Init(), PCB_POINT_EDITOR::Init(), and ALIGN_DISTRIBUTE_TOOL::Init().
|
inlineinherited |
Return the type of the tool.
Definition at line 109 of file tool_base.h.
References TOOL_BASE::m_type.
Referenced by TOOL_MANAGER::finishTool(), TOOL_MANAGER::InvokeTool(), TOOL_MANAGER::ResetTools(), TOOL_MANAGER::runTool(), and TOOL_MANAGER::ShutdownTool().
|
protectedinherited |
Returns the instance of #VIEW object used in the application.
It allows tools to draw.
Definition at line 36 of file tool_base.cpp.
References TOOL_MANAGER::GetView(), and TOOL_BASE::m_toolMgr.
Referenced by EE_POINT_EDITOR::addCornerCondition(), ALIGN_DISTRIBUTE_TOOL::AlignLeft(), ALIGN_DISTRIBUTE_TOOL::AlignRight(), COMMON_TOOLS::CenterContents(), SCH_EDIT_TOOL::ChangeTextType(), EE_INSPECTION_TOOL::CheckSymbol(), GERBVIEW_CONTROL::ClearAllLayers(), PL_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::ClearSelection(), EE_SELECTION_TOOL::CollectHits(), SCH_LINE_WIRE_BUS_TOOL::computeBreakPoint(), COMMON_TOOLS::CursorControl(), SCH_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::DeleteItems(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), SELECTION_TOOL::doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), EE_SELECTION_TOOL::GuessSelectionCandidates(), GuessSelectionCandidates(), ROUTER_TOOL::handleCommonEvents(), EE_SELECTION_TOOL::highlight(), PL_SELECTION_TOOL::highlight(), highlight(), GERBVIEW_CONTROL::HighlightControl(), BOARD_INSPECTION_TOOL::highlightNet(), PNS::TOOL_BASE::highlightNets(), hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), EE_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EE_SELECTION_TOOL::Reset(), EE_TOOL_BASE< T >::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), PNS::TOOL_BASE::Reset(), BOARD_EDITOR_CONTROL::Reset(), DRAWING_TOOL::Reset(), PCB_CONTROL::Reset(), Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), Selectable(), EE_SELECTION_TOOL::SelectAll(), SelectAll(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectionContains(), selectionContains(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), EE_SELECTION_TOOL::selectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleERCErrors(), SCH_EDITOR_CONTROL::ToggleERCExclusions(), SCH_EDITOR_CONTROL::ToggleERCWarnings(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SCH_EDITOR_CONTROL::ToggleOPCurrents(), SCH_EDITOR_CONTROL::ToggleOPVoltages(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_SELECTION_TOOL::unhighlight(), PL_SELECTION_TOOL::unhighlight(), unhighlight(), GERBVIEW_SELECTION_TOOL::unselect(), GERBVIEW_SELECTION_TOOL::unselectVisually(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), SCH_FIND_REPLACE_TOOL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< T >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), updateSelection(), PNS::TOOL_BASE::updateStartItem(), view(), PCB_TOOL_BASE::view(), PCB_VIEWER_TOOLS::view(), EE_SELECTION_TOOL::ZoomFitCrossProbeBBox(), ZoomFitCrossProbeBBox(), zoomFitSelection(), EE_SELECTION_TOOL::~EE_SELECTION_TOOL(), GERBVIEW_SELECTION_TOOL::~GERBVIEW_SELECTION_TOOL(), and ~PCB_SELECTION_TOOL().
|
protectedinherited |
Return the instance of VIEW_CONTROLS object used in the application.
It allows tools to read & modify user input and its settings (eg. show cursor, enable snapping to grid, etc.).
Definition at line 42 of file tool_base.cpp.
References TOOL_MANAGER::GetViewControls(), and TOOL_BASE::m_toolMgr.
Referenced by EE_POINT_EDITOR::addCorner(), PCB_POINT_EDITOR::addCorner(), EE_POINT_EDITOR::addCornerCondition(), EE_SELECTION_TOOL::autostartEvent(), SCH_EDIT_TOOL::BreakWire(), controls(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), COMMON_TOOLS::CursorControl(), EDIT_TOOL::DeleteItems(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::doMoveSelection(), SCH_LINE_WIRE_BUS_TOOL::doUnfoldBus(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::DrawCircle(), DRAWING_TOOL::DrawLine(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawRectangle(), SCH_DRAWING_TOOLS::DrawShape(), SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape(), PL_DRAWING_TOOLS::DrawShape(), SCH_DRAWING_TOOLS::DrawSheet(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_LINE_WIRE_BUS_TOOL::finishSegments(), SCH_EDITOR_CONTROL::HighlightNet(), BOARD_INSPECTION_TOOL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), EE_POINT_EDITOR::Main(), EE_SELECTION_TOOL::Main(), SCH_MOVE_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), PL_POINT_EDITOR::Main(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), SCH_EDITOR_CONTROL::Paste(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), ROUTER_TOOL::performDragging(), LENGTH_TUNER_TOOL::performTuning(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImage(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), DRAWING_TOOL::Reset(), PCB_POINT_EDITOR::Reset(), COMMON_TOOLS::ResetLocalCoords(), ROUTER_TOOL::RouteSelected(), selectCursor(), EE_SELECTION_TOOL::selectMultiple(), PL_SELECTION_TOOL::selectMultiple(), selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PICKER_TOOL::setControls(), PCB_PICKER_TOOL::setControls(), EE_POINT_EDITOR::setEditedPoint(), PL_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), EE_POINT_EDITOR::updateEditedPoint(), PL_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateEditedPoint(), PCB_POINT_EDITOR::updateItem(), PL_EDIT_TOOL::updateModificationPoint(), and COMMON_TOOLS::ZoomCenter().
|
inherited |
Define which state (aStateFunc) to go when a certain event arrives (aConditions).
No conditions means any event.
Definition at line 147 of file tool_interactive.h.
References TOOL_INTERACTIVE::goInternal().
Referenced by EDA_3D_CONTROLLER::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), EE_POINT_EDITOR::setTransitions(), EE_SELECTION_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), SCH_EDIT_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), SCH_FIND_REPLACE_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SIMULATOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), GERBVIEW_CONTROL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), COMMON_TOOLS::setTransitions(), PICKER_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), PL_EDIT_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), PL_POINT_EDITOR::setTransitions(), PL_SELECTION_TOOL::setTransitions(), AUTOPLACE_TOOL::setTransitions(), MICROWAVE_TOOL::setTransitions(), SCRIPTING_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), ROUTER_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), CONVERT_TOOL::setTransitions(), DRAWING_TOOL::setTransitions(), DRC_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PAD_TOOL::setTransitions(), PCB_CONTROL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), PROPERTIES_TOOL::setTransitions(), and ZONE_FILLER_TOOL::setTransitions().
|
privateinherited |
Definition at line 70 of file tool_interactive.cpp.
References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ScheduleNextState().
Referenced by TOOL_INTERACTIVE::Go().
|
private |
Select and move other nearest footprint unconnected on same net as selected items.
Definition at line 1495 of file pcb_selection_tool.cpp.
References board(), ClearSelection(), BOARD::GetConnectivity(), SELECTION::GetItems(), m_selection, TOOL_BASE::m_toolMgr, PCB_ACTIONS::moveIndividually, pad, CN_ANCHOR::Parent(), PCB_FOOTPRINT_T, PCB_PAD_T, TOOL_MANAGER::RunAction(), select(), and EDA_ITEM::Type().
Referenced by setTransitions().
void PCB_SELECTION_TOOL::GuessSelectionCandidates | ( | GENERAL_COLLECTOR & | aCollector, |
const VECTOR2I & | aWhere | ||
) | const |
Try to guess best selection candidates in case multiple items are clicked, by doing some brain-dead heuristics.
aCollector | [in, out] The collector that has a list of items to be narrowed. |
aWhere | The selection point to consider. |
Definition at line 2909 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), B_CrtYd, B_SilkS, COLLECTOR::Empty(), F_CrtYd, F_SilkS, PCB_BASE_FRAME::GetActiveLayer(), COLLECTOR::GetCount(), FOOTPRINT::GetCoverageArea(), PCB_VIA::GetDrill(), GENERAL_COLLECTOR::GetGuide(), KIGFX::RENDER_SETTINGS::GetHighContrast(), BOARD_ITEM::GetLayer(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_BASE::getView(), hitTestDistance(), ZONE::HitTestForEdge(), KiROUND(), m_frame, COLLECTORS_GUIDE::OnePixelInIU(), PCB_BITMAP_T, PCB_FOOTPRINT_T, PCB_FP_ZONE_T, PCB_SHAPE_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_VIA_T, PCB_ZONE_T, SEG::Square(), COLLECTOR::Transfer(), EDA_ITEM::Type(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::Drag(), and selectPoint().
|
protectedinherited |
True if a selection modifier is enabled, false otherwise.
Definition at line 86 of file selection_tool.cpp.
References SELECTION_TOOL::m_additive, SELECTION_TOOL::m_exclusive_or, and SELECTION_TOOL::m_subtractive.
Referenced by EE_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), Main(), and SELECTION_TOOL::onDisambiguationExpire().
|
overrideprivatevirtual |
Highlight the item visually.
aItem | The item to be highlighted. |
aHighlightMode | Either SELECTED or BRIGHTENED |
aGroup | [optional A group to add the item to. |
Implements SELECTION_TOOL.
Definition at line 2658 of file pcb_selection_tool.cpp.
References SELECTION::Add(), BRIGHTENED, TOOL_BASE::getView(), highlightInternal(), KIGFX::VIEW::MarkTargetDirty(), KIGFX::REPAINT, KIGFX::TARGET_OVERLAY, KIGFX::PCB_VIEW::Update(), and view().
Referenced by RebuildSelection(), RequestSelection(), and select().
|
private |
Definition at line 2673 of file pcb_selection_tool.cpp.
References BRIGHTENED, KIGFX::VIEW::Hide(), highlightInternal(), PCB_FOOTPRINT_T, PCB_GROUP_T, SELECTED, EDA_ITEM::SetBrightened(), EDA_ITEM::SetSelected(), EDA_ITEM::Type(), and view().
Referenced by highlight(), and highlightInternal().
|
private |
Definition at line 2790 of file pcb_selection_tool.cpp.
References SHAPE_POLY_SET::Collide(), SHAPE_LINE_CHAIN::Collide(), distance(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), BOARD_ITEM::GetEffectiveShape(), EDA_TEXT::GetEffectiveTextShape(), BOX2< Vec >::GetHeight(), MARKER_BASE::GetPos(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), TOOL_BASE::getView(), KIGFX::VIEW::GetViewport(), BOX2< Vec >::GetWidth(), group, hitTestDistance(), ZONE::HitTestForEdge(), SHAPE_LINE_CHAIN::Move(), PCB_FOOTPRINT_T, PCB_FP_TEXT_T, PCB_FP_TEXTBOX_T, PCB_GROUP_T, PCB_MARKER_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_ZONE_T, MARKER_BASE::ShapeToPolygon(), text, and EDA_ITEM::Type().
Referenced by GuessSelectionCandidates(), and hitTestDistance().
|
overridevirtual |
Init() is called once upon a registration of the tool.
Reimplemented from TOOL_BASE.
Definition at line 146 of file pcb_selection_tool.cpp.
References PCB_GROUP::AddItem(), EDA_DRAW_FRAME::AddStandardSubMenus(), ACTIONS::cancelInteractive, PCB_ACTIONS::clearHighlight, SELECTION_CONDITIONS::Count(), frame(), FRAME_FOOTPRINT_VIEWER, FRAME_FOOTPRINT_VIEWER_MODAL, FRAME_PCB_EDITOR, KIGFX::RENDER_SETTINGS::GetHighlightNetCodes(), TOOL_MENU::GetMenu(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_MANAGER::GetView(), PCB_ACTIONS::groupEnter, PCB_ACTIONS::groupLeave, SELECTION_CONDITIONS::HasType(), EDA_BASE_FRAME::IsType(), SELECTION_TOOL::m_disambiguateTimer, m_enteredGroup, TOOL_INTERACTIVE::m_menu, TOOL_BASE::m_toolMgr, SELECTION_CONDITIONS::NotEmpty(), SELECTION_TOOL::onDisambiguationExpire(), PCB_GROUP_T, TOOL_MENU::RegisterSubMenu(), and TOOLS_HOLDER::ToolStackIsEmpty().
|
inline |
Definition at line 78 of file pcb_selection_tool.h.
References m_isFootprintEditor.
|
inherited |
Definition at line 31 of file tool_base.cpp.
References TOOL_MANAGER::IsToolActive(), TOOL_BASE::m_toolId, and TOOL_BASE::m_toolMgr.
Referenced by EDIT_TOOL::Drag(), ROUTER_TOOL::handleLayerSwitch(), Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().
|
private |
Definition at line 2193 of file pcb_selection_tool.cpp.
References SELECTION_FILTER_OPTIONS::dimensions, SELECTION_FILTER_OPTIONS::footprints, ZONE::GetIsRuleArea(), BOARD_ITEM::GetParent(), SELECTION_FILTER_OPTIONS::graphics, BOARD_ITEM::IsLocked(), SELECTION_FILTER_OPTIONS::keepouts, SELECTION_FILTER_OPTIONS::lockedItems, m_filter, m_isFootprintEditor, SELECTION_FILTER_OPTIONS::otherItems, SELECTION_FILTER_OPTIONS::pads, PCB_ARC_T, PCB_BITMAP_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_DIM_RADIAL_T, PCB_FOOTPRINT_T, PCB_FP_DIM_ALIGNED_T, PCB_FP_DIM_CENTER_T, PCB_FP_DIM_LEADER_T, PCB_FP_DIM_ORTHOGONAL_T, PCB_FP_DIM_RADIAL_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_TEXTBOX_T, PCB_FP_ZONE_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, SELECTION_FILTER_OPTIONS::text, SELECTION_FILTER_OPTIONS::tracks, EDA_ITEM::Type(), SELECTION_FILTER_OPTIONS::vias, and SELECTION_FILTER_OPTIONS::zones.
Referenced by FilterCollectedItems(), SelectAll(), and SelectAllItemsOnNet().
int PCB_SELECTION_TOOL::Main | ( | const TOOL_EVENT & | aEvent | ) |
The main loop.
Definition at line 264 of file pcb_selection_tool.cpp.
References ARROW, BUT_LEFT, BUT_MIDDLE, BUT_RIGHT, SELECTION::Clear(), BOARD_INSPECTION_TOOL::ClearHighlight(), ClearSelection(), DRAG, PCB_ACTIONS::drag45Degree, DRAG_ANY, DRAG_FREE_ANGLE, DRAG_SELECTED, PCB_ACTIONS::dragFreeAngle, SELECTION::Empty(), EnterGroup(), ExitGroup(), PCB_BASE_FRAME::FocusOnItem(), frame(), FRAME_PCB_EDITOR, TOOLS_HOLDER::GetDragAction(), SELECTION::GetItem(), TOOL_MANAGER::GetMousePosition(), PCB_BASE_FRAME::GetPcbNewSettings(), GetSelection(), SELECTION::GetSize(), TOOL_MANAGER::GetTool(), SELECTION_TOOL::hasModifier(), PCB_POINT_EDITOR::HasPoint(), PCB_ACTIONS::highlightNet, ZONE::HitTestForCorner(), ZONE::HitTestForEdge(), EVENTS::InhibitSelectionEditing, IS_MOVING, IS_NEW, TOOL_BASE::IsToolActive(), EDA_BASE_FRAME::IsType(), KiROUND(), SELECTION_TOOL::m_canceledMenu, SELECTION_TOOL::m_disambiguateTimer, m_enteredGroup, PCBNEW_SETTINGS::m_ESCClearsNetHighlight, m_frame, SELECTION_TOOL::m_highlight_modifier, TOOL_INTERACTIVE::m_menu, m_nonModifiedCursor, SELECTION_TOOL::m_originalCursor, m_selection, TOOL_BASE::m_toolMgr, PCBNEW_SETTINGS::m_TrackDragAction, MD_ALT, MD_CTRL, MD_SHIFT, PCB_ACTIONS::move, MOVING, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_ZONE_T, TOOL_MANAGER::ProcessEvent(), PCB_ACTIONS::properties, ROUTER_TOOL::RoutingInProgress(), TOOL_MANAGER::RunAction(), SELECT, selectionContains(), selectMultiple(), selectPoint(), SELECTION::SetIsHover(), SELECTION_TOOL::setModifiersState(), TOOL_MENU::ShowContextMenu(), TOOLS_HOLDER::ToolStackIsEmpty(), TOOL_INTERACTIVE::Wait(), ACTIONS::zoomFitObjects, and ACTIONS::zoomFitScreen.
Referenced by setTransitions().
|
protectedinherited |
Start the process to show our disambiguation menu once the user has kept the mouse down for the minimum time.
aEvent |
Definition at line 219 of file selection_tool.cpp.
References EVENTS::DisambiguatePoint, SELECTION_TOOL::hasModifier(), TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), and SELECTION_TOOL::selection().
Referenced by EE_SELECTION_TOOL::Init(), PL_SELECTION_TOOL::Init(), Init(), and ~PCB_SELECTION_TOOL().
void PCB_SELECTION_TOOL::OnIdle | ( | wxIdleEvent & | aEvent | ) |
Definition at line 243 of file pcb_selection_tool.cpp.
References ADD, PCB_BASE_FRAME::GetCanvas(), SELECTION_TOOL::m_additive, SELECTION_TOOL::m_exclusive_or, m_frame, SELECTION_TOOL::m_multiple, m_nonModifiedCursor, SELECTION_TOOL::m_subtractive, EDA_DRAW_PANEL_GAL::SetCurrentCursor(), SELECTION_TOOL::setModifiersState(), SUBTRACT, TOOLS_HOLDER::ToolStackIsEmpty(), and XOR.
Referenced by PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME().
void PCB_SELECTION_TOOL::RebuildSelection | ( | ) |
Rebuild the selection from the EDA_ITEMs' selection flags.
Commonly called after rolling back an undo state to make sure there aren't any stale pointers.
Definition at line 2329 of file pcb_selection_tool.cpp.
References GENERAL_COLLECTOR::AllBoardItems, board(), KIGFX::VIEW_GROUP::Clear(), SELECTION::Clear(), EDA_ITEM::ClearFlags(), CONTINUE, ENTERED, GENERAL_COLLECTOR::FootprintItems, EDA_ITEM::GetParent(), highlight(), EDA_ITEM::IsSelected(), m_enteredGroup, m_enteredGroupOverlay, m_isFootprintEditor, m_selection, SELECTED, EDA_ITEM::SetFlags(), and BOARD::Visit().
Referenced by EDIT_TOOL::doMoveSelection(), PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), and BOARD_COMMIT::Revert().
|
inherited |
Definition at line 150 of file selection_tool.cpp.
References TOOL_EVENT::Parameter(), SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::selection(), and SELECTION::SetIsHover().
Referenced by PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), SELECTION_TOOL::RemoveItemFromSel(), EE_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), setTransitions(), and DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow().
|
inherited |
Definition at line 158 of file selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), SELECTION_TOOL::unselect(), and EVENTS::UnselectedEvent.
|
inherited |
Definition at line 171 of file selection_tool.cpp.
References TOOL_EVENT::Parameter(), SELECTION_TOOL::RemoveItemsFromSel(), SELECTION_TOOL::selection(), and SELECTION::SetIsHover().
Referenced by SCH_MOVE_TOOL::Main(), PCB_EDIT_FRAME::RebuildAndRefresh(), SELECTION_TOOL::RemoveItemsFromSel(), EE_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), and setTransitions().
|
inherited |
Definition at line 179 of file selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), SELECTION_TOOL::unselect(), and EVENTS::UnselectedEvent.
|
inherited |
A safer version of RemoveItemsFromSel( EDA_ITEMS ) which doesn't require the items to still exist.
Definition at line 193 of file selection_tool.cpp.
References alg::contains(), SELECTION_TOOL::RemoveItemsFromSel(), and SELECTION_TOOL::selection().
PCB_SELECTION & PCB_SELECTION_TOOL::RequestSelection | ( | CLIENT_SELECTION_FILTER | aClientFilter, |
bool | aConfirmLockedItems = false |
||
) |
Return the current selection, filtered according to aClientFilter.
If the set is empty, performs the legacy-style hover selection.
aClientFilter | A callback to allow tool- or action-specific filtering. |
aConfirmLockedItems | [optional] Signals that the user shall be asked if they want to drop locked items from the selection or override the locks. Select a single item under cursor event handler. |
Definition at line 555 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), SELECTION::ClearReferencePoint(), ClearSelection(), SELECTION::Empty(), EDA_DRAW_PANEL_GAL::ForceRefresh(), frame(), PCB_BASE_FRAME::GetCanvas(), getCollectorsGuide(), group, highlight(), BOARD_ITEM::IsLocked(), m_frame, m_selection, TOOL_BASE::m_toolMgr, PCB_GROUP_T, TOOL_MANAGER::RunAction(), SELECTED, PCB_ACTIONS::selectionCursor, GENERAL_COLLECTOR::SetGuide(), SELECTION::SetIsHover(), DIALOG_LOCKED_ITEMS_QUERY::ShowModal(), EDA_ITEM::Type(), unhighlight(), and unselect().
Referenced by BOARD_EDITOR_CONTROL::AssignNetclass(), EDIT_TOOL::ChangeTrackWidth(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), CONVERT_TOOL::CreateLines(), CONVERT_TOOL::CreatePolys(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::Duplicate(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::FilletLines(), EDIT_TOOL::FilletTracks(), EDIT_TOOL::Flip(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), GROUP_TOOL::Group(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), EDIT_TOOL::PackAndMoveFootprints(), GROUP_TOOL::PickNewMember(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), CONVERT_TOOL::SegmentToArc(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), and EDIT_TOOL::Swap().
|
overridevirtual |
Bring the tool to a known, initial state.
If the tool claimed anything from the model or the view, it must release it when its reset.
aReason | contains information about the reason of tool reset. |
Implements TOOL_BASE.
Definition at line 210 of file pcb_selection_tool.cpp.
References KIGFX::PCB_VIEW::Add(), ClearSelection(), ExitGroup(), FRAME_FOOTPRINT_EDITOR, KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_BASE::getView(), EDA_BASE_FRAME::IsType(), m_enteredGroup, m_enteredGroupOverlay, m_frame, m_isFootprintEditor, m_selection, TOOL_BASE::MODEL_RELOAD, TOOL_BASE::REDRAW, KIGFX::PCB_VIEW::Remove(), KIGFX::RENDER_SETTINGS::SetHighlight(), and view().
|
privateinherited |
Clear the current transition map and restores the default one created by setTransitions().
Definition at line 63 of file tool_interactive.cpp.
References TOOL_MANAGER::ClearTransitions(), TOOL_BASE::m_toolMgr, and TOOL_INTERACTIVE::setTransitions().
|
inherited |
Call a function using the main stack.
aFunc | is the function to be calls. |
Definition at line 87 of file tool_interactive.cpp.
References TOOL_BASE::m_toolMgr, and TOOL_MANAGER::RunMainStack().
Referenced by DRAWING_TOOL::PlaceText().
|
overridevirtual |
Take necessary action mark an item as selected.
aItem | The item to be selected. |
Implements SELECTION_TOOL.
Definition at line 2628 of file pcb_selection_tool.cpp.
References SELECTION::Contains(), ExitGroup(), EDA_ITEM::GetParent(), highlight(), EDA_ITEM::IsSelected(), m_enteredGroup, m_isFootprintEditor, m_selection, PCB_PAD_T, SELECTED, EDA_ITEM::Type(), and PCB_GROUP::WithinScope().
Referenced by doSyncSelection(), EnterGroup(), ExitGroup(), filterSelection(), FindItem(), grabUnconnected(), GROUP_TOOL::Group(), SelectAll(), selectAllConnectedTracks(), SelectAllItemsOnNet(), selectAllItemsOnSheet(), selectConnections(), selectMultiple(), selectNet(), selectPoint(), selectUnconnected(), and unrouteSelected().
bool PCB_SELECTION_TOOL::Selectable | ( | const BOARD_ITEM * | aItem, |
bool | checkVisibilityOnly = false |
||
) | const |
Definition at line 2373 of file pcb_selection_tool.cpp.
References LSET::AllLayersMask(), B_Cu, LSET::BackMask(), board(), F_Cu, LSET::FrontMask(), KIGFX::RENDER_SETTINGS::GetHighContrast(), KIGFX::RENDER_SETTINGS::GetHighContrastLayers(), BOARD_ITEM::GetLayer(), ZONE::GetLayerSet(), KIGFX::VIEW::GetPainter(), BOARD_ITEM::GetParent(), KIGFX::PAINTER::GetSettings(), FP_TEXT::GetType(), TOOL_BASE::getView(), BOARD::GetVisibleLayers(), FOOTPRINT::GraphicalItems(), group, BOARD::IsElementVisible(), FOOTPRINT::IsFlipped(), KIGFX::VIEW::IsLayerVisible(), BOARD::IsLayerVisible(), KIGFX::VIEW::IsVisible(), LAYER_MOD_REFERENCES, LAYER_MOD_TEXT, LAYER_MOD_TEXT_INVISIBLE, LAYER_MOD_VALUES, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_TH, LAYER_TRACKS, LAYER_VIAS, LAYER_ZONES, m_isFootprintEditor, SELECTION_TOOL::m_skip_heuristics, NOT_USED, NPTH, pad, FOOTPRINT::Pads(), PCB_ARC_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_TEXTBOX_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_NETINFO_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, LSET::PhysicalLayersMask(), PTH, Selectable(), LSET::Seq(), text, FP_TEXT::TEXT_is_DIVERS, FP_TEXT::TEXT_is_REFERENCE, FP_TEXT::TEXT_is_VALUE, ToLAYER_ID(), EDA_ITEM::Type(), TYPE_NOT_INIT, UNDEFINED_LAYER, via, view(), and FOOTPRINT::Zones().
Referenced by PCB_CONTROL::DeleteItemCursor(), Selectable(), SelectAll(), selectMultiple(), and selectPoint().
int PCB_SELECTION_TOOL::SelectAll | ( | const TOOL_EVENT & | aEvent | ) |
Definition at line 1079 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), FilterCollectorForHierarchy(), EDA_DRAW_PANEL_GAL::ForceRefresh(), PCB_BASE_FRAME::GetCanvas(), TOOL_BASE::getView(), itemPassesFilter(), m_frame, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), KIGFX::VIEW::Query(), select(), Selectable(), EVENTS::SelectedEvent, BOX2< Vec >::SetMaximum(), and view().
Referenced by setTransitions().
|
private |
Select connected tracks and vias.
aStopCondition | Indicates where to stop selecting more items. |
Definition at line 1231 of file pcb_selection_tool.cpp.
References LSET::AllCuMask(), board(), LSET::Contains(), EDA_DRAW_PANEL_GAL::ForceRefresh(), PCB_BASE_FRAME::GetCanvas(), BOARD::GetConnectivity(), PCB_TRACK::GetEnd(), BOARD_ITEM::GetLayerSet(), SELECTION::GetSize(), PCB_TRACK::GetStart(), m_frame, m_selection, PROF_TIMER::msecs(), pad, PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, select(), SELECTION::Size(), SKIP_STRUCT, PROF_TIMER::Start(), STOP_AT_JUNCTION, STOP_AT_PAD, and via.
Referenced by expandConnection(), selectConnections(), and unrouteSelected().
void PCB_SELECTION_TOOL::SelectAllItemsOnNet | ( | int | aNetCode, |
bool | aSelect = true |
||
) |
Select all items with the given net code.
aNetCode | is the target net to select |
aSelect | is true to add the items to the selection, false to remove them (deselect) |
Definition at line 1559 of file pcb_selection_tool.cpp.
References board(), BOARD::GetConnectivity(), itemPassesFilter(), select(), and unselect().
Referenced by BOARD_EDITOR_CONTROL::AssignNetclass(), FindItem(), and selectNet().
|
private |
Select all items with the given sheet timestamp/UUID name (the sheet path).
The path of the root sheet is "/". Select all footprints belonging to same sheet, from Eeschema using cross-probing.
Definition at line 1615 of file pcb_selection_tool.cpp.
References board(), select(), and selectConnections().
Referenced by selectSameSheet(), and selectSheetContents().
|
private |
Definition at line 1644 of file pcb_selection_tool.cpp.
References board(), BOARD::GetConnectivity(), pad, PCB_FOOTPRINT_T, PCB_PAD_T, select(), selectAllConnectedTracks(), and STOP_AT_PAD.
Referenced by doSyncSelection(), and selectAllItemsOnSheet().
|
private |
Select an item under the cursor unless there is something already selected.
aForceSelect | [optional] Forces an item to be selected even if there is already a selection. |
aClientFilter | A callback to allow tool- or action-specific filtering. |
Definition at line 837 of file pcb_selection_tool.cpp.
References ClearSelection(), SELECTION::Empty(), TOOL_BASE::getViewControls(), m_selection, and selectPoint().
Referenced by CursorSelection(), expandConnection(), and selectNet().
|
inlineoverrideprotectedvirtual |
Return a reference to the selection.
Implements SELECTION_TOOL.
Definition at line 242 of file pcb_selection_tool.h.
References m_selection.
Referenced by filterSelection(), and selectNet().
|
private |
Definition at line 2745 of file pcb_selection_tool.cpp.
References BOX2< Vec >::Contains(), TOOL_BASE::getView(), group, EDA_ITEM::HitTest(), BOX2< Vec >::Inflate(), KiROUND(), and m_selection.
Referenced by Main().
|
inherited |
Show a popup menu to trim the COLLECTOR passed as aEvent's parameter down to a single item.
Definition at line 234 of file selection_tool.cpp.
References SELECTION_TOOL::doSelectionMenu(), COLLECTOR::m_MenuCancelled, and TOOL_EVENT::Parameter().
Referenced by EE_SELECTION_TOOL::setTransitions(), PL_SELECTION_TOOL::setTransitions(), and setTransitions().
|
private |
Handle drawing a selection box that allows one to select many items at the same time.
Definition at line 862 of file pcb_selection_tool.cpp.
References KIGFX::PCB_VIEW::Add(), allowedActions, COLLECTOR::Append(), board(), BUT_LEFT, SELECTION::ClearReferencePoint(), ClearSelection(), BOX2< Vec >::Contains(), FilterCollectedItems(), FilterCollectorForHierarchy(), PCB_BASE_FRAME::GetCanvas(), COLLECTOR::GetCount(), KIGFX::PREVIEW::SELECTION_AREA::GetEnd(), KIGFX::PREVIEW::SELECTION_AREA::GetOrigin(), SELECTION::GetSize(), TOOL_BASE::getView(), TOOL_BASE::getViewControls(), group, EDA_ITEM::HitTest(), KIGFX::VIEW::IsMirroredX(), EDA_ITEM::IsSelected(), SELECTION_TOOL::m_drag_additive, SELECTION_TOOL::m_drag_subtractive, m_enteredGroup, SELECTION_TOOL::m_exclusive_or, m_frame, m_isFootprintEditor, SELECTION_TOOL::m_multiple, m_selection, SELECTION_TOOL::m_subtractive, TOOL_BASE::m_toolMgr, BOX2< Vec >::Normalize(), PCB_PAD_T, TOOL_MANAGER::ProcessEvent(), KIGFX::VIEW::Query(), KIGFX::PCB_VIEW::Remove(), select(), SELECT_LASSO, SELECT_WINDOW, Selectable(), EVENTS::SelectedEvent, KIGFX::PREVIEW::SELECTION_AREA::SetAdditive(), KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), KIGFX::PREVIEW::SELECTION_AREA::SetEnd(), KIGFX::PREVIEW::SELECTION_AREA::SetExclusiveOr(), SELECTION::SetIsHover(), KIGFX::PREVIEW::SELECTION_AREA::SetOrigin(), KIGFX::PREVIEW::SELECTION_AREA::SetSubtractive(), KIGFX::VIEW::SetVisible(), EDA_ITEM::Type(), EVENTS::UninhibitSelectionEditing, unselect(), EVENTS::UnselectedEvent, KIGFX::PCB_VIEW::Update(), view(), KIGFX::PREVIEW::SELECTION_AREA::ViewBBox(), TOOL_INTERACTIVE::Wait(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by Main().
|
private |
Select all copper connections belonging to the same net(s) as the items in the selection.
Definition at line 1571 of file pcb_selection_tool.cpp.
References SELECTION::GetItems(), BOARD_CONNECTED_ITEM::GetNetCode(), TOOL_EVENT::IsAction(), m_selection, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), TOOL_MANAGER::ProcessEvent(), select(), SelectAllItemsOnNet(), selectCursor(), EVENTS::SelectedEvent, selection(), PCB_ACTIONS::selectNet, SELECTION::Size(), and EVENTS::UnselectedEvent.
Referenced by setTransitions().
|
private |
Select an item pointed by the parameter aWhere.
If there is more than one item at that place, there is a menu displayed that allows one to choose the item.
aWhere | is the place where the item should be selected. |
aOnDrag | indicates whether a drag operation is being performed. |
aSelectionCancelledFlag | allows the function to inform its caller that a selection was canceled (for instance, by clicking outside of the disambiguation menu). |
aClientFilter | a callback to allow tool- or action-specific filtering. |
Definition at line 712 of file pcb_selection_tool.cpp.
References GENERAL_COLLECTOR::AllBoardItems, board(), BUT_LEFT, SELECTION::ClearReferencePoint(), ClearSelection(), GENERAL_COLLECTOR::Collect(), BOX2< Vec >::Contains(), SELECTION_TOOL::doSelectionMenu(), ExitGroup(), FilterCollectedItems(), FilterCollectorForHierarchy(), GENERAL_COLLECTOR::FootprintItems, PCB_GROUP::GetBoundingBox(), getCollectorsGuide(), COLLECTOR::GetCount(), PCB_BASE_FRAME::GetDisplayOptions(), SELECTION::GetSize(), GuessSelectionCandidates(), SELECTION_TOOL::m_additive, m_enteredGroup, SELECTION_TOOL::m_exclusive_or, m_frame, m_isFootprintEditor, m_selection, SELECTION_TOOL::m_skip_heuristics, SELECTION_TOOL::m_subtractive, TOOL_BASE::m_toolMgr, PCB_DISPLAY_OPTIONS::m_ZoneDisplayMode, EVENTS::PointSelectedEvent, TOOL_MANAGER::ProcessEvent(), COLLECTOR::Remove(), select(), Selectable(), EVENTS::SelectedEvent, GENERAL_COLLECTORS_GUIDE::SetIgnoreZoneFills(), SHOW_FILLED, TA_MOUSE_UP, TC_ANY, unselect(), EVENTS::UnselectedEvent, and TOOL_INTERACTIVE::Wait().
Referenced by disambiguateCursor(), Main(), and selectCursor().
|
private |
Set selection to items passed by parameter and connected nets (optionally).
Zooms to fit, if enabled
Definition at line 1801 of file pcb_selection_tool.cpp.
References KIID_PATH::AsString(), ClearSelection(), SELECTION::Front(), FOOTPRINT::GetPath(), m_selection, TOOL_BASE::m_toolMgr, PCB_FOOTPRINT_T, TOOL_MANAGER::ProcessEvent(), selectAllItemsOnSheet(), EVENTS::SelectedEvent, SELECTION::Size(), and EDA_ITEM::Type().
Referenced by setTransitions().
|
private |
Select all footprints belonging to same hierarchical sheet as the selected footprint (same sheet path).
Definition at line 1785 of file pcb_selection_tool.cpp.
References ClearSelection(), m_selection, TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), TOOL_MANAGER::ProcessEvent(), selectAllItemsOnSheet(), EVENTS::SelectedEvent, SELECTION::Size(), and zoomFitSelection().
Referenced by setTransitions().
|
private |
Select nearest unconnected footprints on same net as selected items.
Definition at line 1450 of file pcb_selection_tool.cpp.
References board(), BOARD::GetConnectivity(), SELECTION::GetItems(), m_selection, pad, PCB_FOOTPRINT_T, PCB_PAD_T, select(), and EDA_ITEM::Type().
Referenced by setTransitions().
|
inherited |
Assign a context menu and tells when it should be activated.
aMenu | is the menu to be assigned. |
aTrigger | determines conditions upon which the context menu is activated. |
Definition at line 76 of file tool_interactive.cpp.
References CMENU_OFF, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ScheduleContextMenu(), and ACTION_MENU::SetTool().
Referenced by SELECTION_TOOL::doSelectionMenu(), TOOL_MENU::ShowContextMenu(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().
|
protectedinherited |
Set the configuration of m_additive, m_subtractive, m_exclusive_or, m_skip_heuristics from the state of modifier keys SHIFT, CTRL, ALT and depending on the OS.
Definition at line 48 of file selection_tool.cpp.
References SELECTION_TOOL::ctrlClickHighlights(), SELECTION_TOOL::m_additive, SELECTION_TOOL::m_drag_additive, SELECTION_TOOL::m_drag_subtractive, SELECTION_TOOL::m_exclusive_or, SELECTION_TOOL::m_highlight_modifier, SELECTION_TOOL::m_skip_heuristics, and SELECTION_TOOL::m_subtractive.
Referenced by EE_SELECTION_TOOL::disambiguateCursor(), PL_SELECTION_TOOL::disambiguateCursor(), disambiguateCursor(), EE_SELECTION_TOOL::Main(), GERBVIEW_SELECTION_TOOL::Main(), PL_SELECTION_TOOL::Main(), Main(), EE_SELECTION_TOOL::OnIdle(), and OnIdle().
|
overridevirtual |
Zoom the screen to center and fit the current selection.
Implements TOOL_INTERACTIVE.
Definition at line 3206 of file pcb_selection_tool.cpp.
References SELECTION_TOOL::AddItemsToSel(), SELECTION_TOOL::AddItemToSel(), ClearSelection(), CursorSelection(), PCB_ACTIONS::deselectNet, disambiguateCursor(), EVENTS::DisambiguatePoint, expandConnection(), PCB_ACTIONS::filterSelection, filterSelection(), TOOL_INTERACTIVE::Go(), PCB_ACTIONS::grabUnconnected, grabUnconnected(), Main(), SELECTION_TOOL::RemoveItemFromSel(), SELECTION_TOOL::RemoveItemsFromSel(), ACTIONS::selectAll, SelectAll(), PCB_ACTIONS::selectConnection, EVENTS::SelectedItemsModified, EVENTS::SelectedItemsMoved, PCB_ACTIONS::selectionActivate, PCB_ACTIONS::selectionClear, PCB_ACTIONS::selectionCursor, SELECTION_TOOL::SelectionMenu(), PCB_ACTIONS::selectionMenu, PCB_ACTIONS::selectItem, PCB_ACTIONS::selectItems, PCB_ACTIONS::selectNet, selectNet(), PCB_ACTIONS::selectOnSheetFromEeschema, PCB_ACTIONS::selectSameSheet, selectSameSheet(), selectSheetContents(), PCB_ACTIONS::selectUnconnected, selectUnconnected(), PCB_ACTIONS::syncSelection, syncSelection(), PCB_ACTIONS::syncSelectionWithNets, syncSelectionWithNets(), PCB_ACTIONS::unrouteSelected, unrouteSelected(), PCB_ACTIONS::unselectItem, PCB_ACTIONS::unselectItems, ACTIONS::updateMenu, SELECTION_TOOL::UpdateMenu(), and updateSelection().
|
private |
Definition at line 1730 of file pcb_selection_tool.cpp.
References doSyncSelection(), and TOOL_EVENT::Parameter().
Referenced by setTransitions().
|
private |
Definition at line 1741 of file pcb_selection_tool.cpp.
References doSyncSelection(), and TOOL_EVENT::Parameter().
Referenced by setTransitions().
|
inherited |
Definition at line 213 of file selection_tool.cpp.
References BRIGHTENED, and SELECTION_TOOL::unhighlight().
Referenced by SCH_EDIT_TOOL::DeleteItemCursor(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), SCH_EDIT_FRAME::DisplayCurrentSheet(), and SCH_FIND_REPLACE_TOOL::UpdateFind().
|
overrideprivatevirtual |
Unhighlight the item visually.
aItem | The item to be highlighted. |
aHighlightMode | Either SELECTED or BRIGHTENED |
aGroup | [optional] A group to remove the item from. |
Implements SELECTION_TOOL.