![]() |
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 } |
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) |
int | Main (const TOOL_EVENT &aEvent) |
The main loop. More... | |
PCB_SELECTION & | GetSelection () |
Return the set of currently selected items. More... | |
PCB_SELECTION & | RequestSelection (CLIENT_SELECTION_FILTER aClientFilter, bool aConfirmLockedItems=false) |
Return the current selection set, filtered according to aFlags and 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) |
Item selection event handler. More... | |
int | SelectItem (const TOOL_EVENT &aEvent) |
void | AddItemToSel (BOARD_ITEM *aItem, bool aQuietMode=false) |
Select all items on the board. More... | |
int | SelectAll (const TOOL_EVENT &aEvent) |
Multiple item selection event handler. More... | |
int | SelectItems (const TOOL_EVENT &aEvent) |
Item unselection event handler. More... | |
int | UnselectItem (const TOOL_EVENT &aEvent) |
void | RemoveItemFromSel (BOARD_ITEM *aItem, bool aQuietMode=false) |
Multiple item unselection event handler. More... | |
int | UnselectItems (const TOOL_EVENT &aEvent) |
void | BrightenItem (BOARD_ITEM *aItem) |
void | UnbrightenItem (BOARD_ITEM *aItem) |
void | FindItem (BOARD_ITEM *aItem) |
Handle finding an item. More... | |
void | select (BOARD_ITEM *aItem) |
Take necessary action mark an item as selected. More... | |
bool | Selectable (const BOARD_ITEM *aItem, bool checkVisibilityOnly=false) const |
Check conditions for an item to be selected. 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... | |
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 | 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 () |
BOARD * | GetBoard () const |
void | EnterGroup () |
void | ExitGroup (bool aSelectGroup=false) |
Leave the currently entered group. More... | |
PCB_GROUP * | GetEnteredGroup () |
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, upgrade any pad selection to the selection of its parent footprint. More... | |
void | FilterCollectorForMarkers (GENERAL_COLLECTOR &aCollector) const |
Apply the SELECTION_FILTER_OPTIONS to a collection of items. More... | |
void | FilterCollectedItems (GENERAL_COLLECTOR &aCollector, bool aMultiSelect) |
void | SetIsFootprintEditor (bool aEnabled) |
Function SetIsFootprintEditor() More... | |
bool | IsFootprintEditor () const |
virtual bool | Is45Limited () const |
Should the tool use its 45° mode option? 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 Types | |
enum | INTERACTIVE_PLACEMENT_OPTIONS { IPO_ROTATE = 0x01, IPO_FLIP = 0x02, IPO_SINGLE_CLICK = 0x04, IPO_REPEAT = 0x08 } |
Options for placing items interactively. More... | |
Protected Member Functions | |
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... | |
void | doInteractiveItemPlacement (const std::string &aTool, INTERACTIVE_PLACER_BASE *aPlacer, const wxString &aCommitMessage, int aOptions=IPO_ROTATE|IPO_FLIP|IPO_REPEAT) |
Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc. More... | |
KIGFX::PCB_VIEW * | view () const |
KIGFX::VIEW_CONTROLS * | controls () const |
PCB_BASE_EDIT_FRAME * | frame () const |
BOARD * | board () const |
FOOTPRINT * | footprint () const |
const PCB_DISPLAY_OPTIONS & | displayOptions () const |
PCB_DRAW_PANEL_GAL * | canvas () const |
const PCB_SELECTION & | selection () const |
PCB_SELECTION & | selection () |
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 |
bool | m_isFootprintEditor |
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 or aSelectAlways is true. More... | |
bool | selectMultiple () |
Handle drawing a selection box that allows one to select many items at the same time. More... | |
bool | doSelectionMenu (GENERAL_COLLECTOR *aItems) |
Allow the selection of a single item from a list via pop-up menu. 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... | |
int | disambiguateCursor (const TOOL_EVENT &aEvent) |
Handle disambiguation actions including displaying the menu. More... | |
int | expandConnection (const TOOL_EVENT &aEvent) |
Expand the current track selection to the next boundary (junctions, pads, or all) More... | |
int | selectNet (const TOOL_EVENT &aEvent) |
Select all copper connections belonging to the same net(s) as the items in the selection. More... | |
void | selectConnectedTracks (BOARD_CONNECTED_ITEM &aSourceItem, STOP_CONDITION aStopCondition) |
Select connected tracks and vias. More... | |
void | selectAllItemsOnNet (int aNetCode, bool aSelect=true) |
Select all items with the given net code. More... | |
void | selectAllItemsOnSheet (wxString &aSheetPath) |
Select all items on a sheet and its subsheets, given the full 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) |
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 (BOARD_ITEM *aItem) |
Take necessary action mark an item as unselected. More... | |
void | highlight (BOARD_ITEM *aItem, int aHighlightMode, PCB_SELECTION *aGroup=nullptr) |
Highlight the item visually. More... | |
void | unhighlight (BOARD_ITEM *aItem, int aHighlightMode, PCB_SELECTION *aGroup=nullptr) |
Unhighlight the item visually. More... | |
bool | selectionContains (const VECTOR2I &aPoint) const |
int | hitTestDistance (const wxPoint &aWhere, BOARD_ITEM *aItem, int aMaxDistance) const |
int | updateSelection (const TOOL_EVENT &aEvent) |
Event handler to update the selection VIEW_ITEM. More... | |
int | UpdateMenu (const TOOL_EVENT &aEvent) |
Pass the selection to a conditional menu for updating. More... | |
const GENERAL_COLLECTORS_GUIDE | getCollectorsGuide () const |
void | highlightInternal (BOARD_ITEM *aItem, int aHighlightMode, bool aUsingOverlay) |
void | unhighlightInternal (BOARD_ITEM *aItem, int aHighlightMode, bool aUsingOverlay) |
Private Attributes | |
PCB_BASE_FRAME * | m_frame |
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.
|
protectedinherited |
Options for placing items interactively.
Definition at line 116 of file pcb_tool_base.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. |
Definition at line 77 of file tool_base.h.
|
private |
Definition at line 287 of file pcb_selection_tool.h.
PCB_SELECTION_TOOL::PCB_SELECTION_TOOL | ( | ) |
Definition at line 105 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 126 of file pcb_selection_tool.cpp.
References TOOL_BASE::getView(), m_enteredGroupOverlay, m_selection, 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(), SYMBOL_EDITOR_EDIT_TOOL::DeleteItemCursor(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_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(), 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(), PCB_PICKER_TOOL::Main(), PL_EDIT_TOOL::Main(), EE_POINT_EDITOR::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), LIB_TREE::onContextMenu(), PCB_POINT_EDITOR::OnSelectionChange(), GROUP_TOOL::PickNewMember(), SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor(), BOARD_EDITOR_CONTROL::PlaceFootprint(), SCH_DRAWING_TOOLS::PlaceImage(), DRAWING_TOOL::PlaceImportedGraphics(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), EDIT_TOOL::Remove(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), DRAWING_TOOL::SetAnchor(), DRC_TOOL::ShowDRCDialog(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().
void PCB_SELECTION_TOOL::AddItemToSel | ( | BOARD_ITEM * | aItem, |
bool | aQuietMode = false |
||
) |
Select all items on the board.
Definition at line 1018 of file pcb_selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), and EVENTS::SelectedEvent.
Referenced by PCB_CONTROL::DeleteItemCursor(), EDIT_TOOL::FilletTracks(), and SelectItem().
|
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().
|
inlineprotectedinherited |
Definition at line 165 of file pcb_tool_base.h.
Referenced by PCB_CONTROL::AppendBoard(), AUTOPLACE_TOOL::autoplace(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), EDIT_TOOL::ChangeTrackWidth(), ZONE_FILLER_TOOL::CheckAllZones(), BOARD_INSPECTION_TOOL::ClearHighlight(), EDIT_TOOL::copyToClipboard(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), MICROWAVE_TOOL::createInductorBetween(), ROUTER_TOOL::CustomTrackWidthDialog(), PCB_CONTROL::DeleteItemCursor(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportNetlist(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), filterSelection(), PCB_TOOL_BASE::footprint(), GetBoard(), getCollectorsGuide(), GROUP_TOOL::Group(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::highlightNet(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_CONTROL::LayerNext(), PCB_CONTROL::LayerPrev(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), EDIT_TOOL::MoveExact(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), PCB_CONTROL::Paste(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PAD_TOOL::PlacePad(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), RebuildSelection(), PAD_TOOL::recombinePad(), BOARD_EDITOR_CONTROL::RepairBoard(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), Selectable(), selectAllItemsOnNet(), selectAllItemsOnSheet(), selectConnectedTracks(), selectionContains(), selectPoint(), PCB_CONTROL::TrackDisplayMode(), PCB_CONTROL::unfilledZoneCheck(), GROUP_TOOL::Ungroup(), ROUTER_TOOL::UpdateMessagePanel(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), BOARD_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfillAll().
void PCB_SELECTION_TOOL::BrightenItem | ( | BOARD_ITEM * | aItem | ) |
Definition at line 1070 of file pcb_selection_tool.cpp.
References BRIGHTENED, and highlight().
Referenced by PCB_CONTROL::DeleteItemCursor().
|
protectedinherited |
Definition at line 301 of file pcb_tool_base.cpp.
References PCB_TOOL_BASE::frame().
Referenced by ZONE_FILLER_TOOL::CheckAllZones(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), ZONE_FILLER_TOOL::FillAllZones(), FOOTPRINT_EDITOR_CONTROL::NewFootprint(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), EDIT_TOOL::Remove(), FOOTPRINT_EDITOR_CONTROL::Save(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), ZONE_FILLER_TOOL::singleShotRefocus(), PCB_CONTROL::ToggleRatsnest(), PCB_CONTROL::TrackDisplayMode(), PCB_CONTROL::ViaDisplayMode(), PCB_CONTROL::ZoneDisplayMode(), ZONE_FILLER_TOOL::ZoneFill(), ZONE_FILLER_TOOL::ZoneUnfill(), and ZONE_FILLER_TOOL::ZoneUnfillAll().
int PCB_SELECTION_TOOL::ClearSelection | ( | const TOOL_EVENT & | aEvent | ) |
Definition at line 949 of file pcb_selection_tool.cpp.
Referenced by EnterGroup(), ExitGroup(), filterSelection(), FindItem(), GROUP_TOOL::Group(), Main(), RequestSelection(), Reset(), selectCursor(), selectMultiple(), selectPoint(), selectSameSheet(), selectSheetContents(), and setTransitions().
void PCB_SELECTION_TOOL::ClearSelection | ( | bool | aQuietMode = false | ) |
Item selection event handler.
Definition at line 1765 of file pcb_selection_tool.cpp.
References EVENTS::ClearedEvent, SELECTION::ClearReferencePoint(), SELECTION::Empty(), SELECTION::Front(), SELECTION::GetSize(), PCB_ACTIONS::hideDynamicRatsnest, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), TOOL_MANAGER::RunAction(), SELECTED, SELECTION::SetIsHover(), unhighlight(), KIGFX::PCB_VIEW::Update(), and PCB_TOOL_BASE::view().
|
inlineprotectedinherited |
Definition at line 155 of file pcb_tool_base.h.
References TOOL_BASE::getViewControls().
Referenced by PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::DragArcTrack(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::DrawZone(), ROUTER_TOOL::finishInteractive(), ROUTER_TOOL::handleLayerSwitch(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PCB_PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BOARD_EDITOR_CONTROL::PlaceTarget(), ROUTER_TOOL::prepareInteractive(), PCB_PICKER_TOOL::setControls(), PCB_POINT_EDITOR::setEditedPoint(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
int PCB_SELECTION_TOOL::CursorSelection | ( | const TOOL_EVENT & | aEvent | ) |
Clear current selection event handler.
Definition at line 939 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 923 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 |
Definition at line 296 of file pcb_tool_base.cpp.
References PCB_TOOL_BASE::frame(), and PCB_BASE_FRAME::GetDisplayOptions().
Referenced by BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PCB_CONTROL::HighContrastMode(), PCB_CONTROL::HighContrastModeCycle(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), PCB_CONTROL::NetColorModeCycle(), PNS::TOOL_BASE::pickSingleItem(), PCB_CONTROL::RatsnestModeCycle(), PCB_CONTROL::ToggleRatsnest(), PCB_CONTROL::TrackDisplayMode(), PCB_CONTROL::ViaDisplayMode(), and PCB_CONTROL::ZoneDisplayMode().
|
protectedinherited |
Helper function for performing a common interactive idiom: wait for a left click, place an item there (perhaps with a dialog or other user interaction), then have it move with the mouse and respond to rotate/flip, etc.
More complex interactive processes are not supported here, you should implement a customised event loop for those.
aItemCreator | the callable that will attempt to create the item |
aCommitMessage | the message used on a successful commit |
Definition at line 37 of file pcb_tool_base.cpp.
References TOOL_INTERACTIVE::Activate(), KIGFX::PCB_VIEW::Add(), KIGFX::VIEW_GROUP::Add(), SELECTION::Add(), ARROW, PCB_TOOL_BASE::board(), BUT_LEFT, BUT_RIGHT, KIGFX::VIEW_CONTROLS::CaptureCursor(), SELECTION::Clear(), PCB_TOOL_BASE::controls(), INTERACTIVE_PLACER_BASE::CreateItem(), PCB_ACTIONS::flip, PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), TOOL_EVT_UTILS::GetEventRotationAngle(), TOOL_BASE::GetManager(), PCB_BASE_FRAME::GetModel(), TOOL_BASE::getView(), grid, PCB_TOOL_BASE::IPO_FLIP, PCB_TOOL_BASE::IPO_REPEAT, PCB_TOOL_BASE::IPO_ROTATE, PCB_TOOL_BASE::IPO_SINGLE_CLICK, TOOL_EVT_UTILS::IsRotateToolEvt(), INTERACTIVE_PLACER_BASE::m_board, PCBNEW_SETTINGS::m_FlipLeftRight, INTERACTIVE_PLACER_BASE::m_frame, TOOL_INTERACTIVE::m_menu, INTERACTIVE_PLACER_BASE::m_modifiers, TOOL_BASE::m_toolMgr, PCB_BASE_EDIT_FRAME::OnEditItemRequest(), PCB_FOOTPRINT_T, PENCIL, PLACE, INTERACTIVE_PLACER_BASE::PlaceItem(), TOOLS_HOLDER::PopTool(), TOOL_MANAGER::ProcessEvent(), PCB_ACTIONS::properties, BOARD_COMMIT::Push(), TOOLS_HOLDER::PushTool(), ACTIONS::refreshPreview, KIGFX::PCB_VIEW::Remove(), TOOL_MANAGER::RunAction(), FOOTPRINT::RunOnChildren(), EVENTS::SelectedItemsModified, PCB_TOOL_BASE::selection(), PCB_ACTIONS::selectionClear, KIGFX::VIEW_CONTROLS::SetAutoPan(), EDA_DRAW_PANEL_GAL::SetCurrentCursor(), PCB_BASE_FRAME::Settings(), TOOL_MENU::ShowContextMenu(), KIGFX::VIEW_CONTROLS::ShowCursor(), INTERACTIVE_PLACER_BASE::SnapItem(), TC_COMMAND, PCB_ACTIONS::trackViaSizeChanged, KIGFX::PCB_VIEW::Update(), PCB_TOOL_BASE::view(), and TOOL_INTERACTIVE::Wait().
Referenced by MICROWAVE_TOOL::addMicrowaveFootprint(), DRAWING_TOOL::DrawVia(), and PAD_TOOL::PlacePad().
|
private |
Allow the selection of a single item from a list via pop-up menu.
The items are highlighted on the canvas when hovered in the menu. The collector is trimmed to the picked item.
The user has requested the full, non-limited list of selection items
Definition at line 1841 of file pcb_selection_tool.cpp.
References _, KIGFX::VIEW::Add(), COLLECTOR::Append(), BRIGHTENED, CMENU_NOW, COLLECTOR::Combine(), COLLECTOR::Empty(), Format(), COLLECTOR::GetCount(), EDA_ITEM::GetMenuImage(), EDA_ITEM::GetSelectMenuText(), EDA_BASE_FRAME::GetUserUnits(), TOOL_BASE::getView(), COLLECTOR::HasAdditionalItems(), highlight(), info, INVALID_BITMAP, LAYER_SELECT_OVERLAY, m_frame, COLLECTOR::m_MenuTitle, KIGFX::VIEW::Remove(), TOOL_INTERACTIVE::SetContextMenu(), KIGFX::VIEW_GROUP::SetLayer(), TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_CLOSED, TA_CHOICE_MENU_UPDATE, text, unhighlight(), and TOOL_INTERACTIVE::Wait().
Referenced by SelectionMenu(), and selectPoint().
void PCB_SELECTION_TOOL::EnterGroup | ( | ) |
Definition at line 464 of file pcb_selection_tool.cpp.
References KIGFX::VIEW_GROUP::Add(), ClearSelection(), ENTERED, ExitGroup(), SELECTION::GetSize(), m_enteredGroup, m_enteredGroupOverlay, m_selection, PCB_GROUP_T, PCB_GROUP::RunOnChildren(), select(), and EDA_ITEM::SetFlags().
Referenced by GROUP_TOOL::EnterGroup(), and Main().
void PCB_SELECTION_TOOL::ExitGroup | ( | bool | aSelectGroup = false | ) |
Leave the currently entered group.
aSelectGroup | when true will select the group after leaving |
Definition at line 485 of file pcb_selection_tool.cpp.
References KIGFX::VIEW_GROUP::Clear(), EDA_ITEM::ClearFlags(), ClearSelection(), ENTERED, m_enteredGroup, m_enteredGroupOverlay, and select().
Referenced by EnterGroup(), Main(), EDIT_TOOL::Remove(), Reset(), and selectPoint().
|
private |
Expand the current track selection to the next boundary (junctions, pads, or all)
Definition at line 1102 of file pcb_selection_tool.cpp.
References connectedItemFilter(), EDA_ITEM::GetFlags(), SELECTION::GetItems(), m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), selectConnectedTracks(), selectCursor(), EVENTS::SelectedEvent, SELECTION::Size(), SKIP_STRUCT, STOP_AT_JUNCTION, STOP_AT_PAD, and STOP_NEVER.
Referenced by setTransitions().
void PCB_SELECTION_TOOL::FilterCollectedItems | ( | GENERAL_COLLECTOR & | aCollector, |
bool | aMultiSelect | ||
) |
Definition at line 1653 of file pcb_selection_tool.cpp.
References COLLECTOR::GetCount(), and itemPassesFilter().
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, upgrade any pad selection to the selection of its parent footprint.
Definition at line 2710 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), PCB_TOOL_BASE::frame(), COLLECTOR::GetCount(), BOARD_ITEM::GetParent(), COLLECTOR::HasItem(), PCB_TOOL_BASE::IsFootprintEditor(), PCBNEW_SETTINGS::m_AllowFreePads, PCB_PAD_T, COLLECTOR::Remove(), PCB_BASE_FRAME::Settings(), and EDA_ITEM::Type().
Referenced by EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::Flip(), EDIT_TOOL::Mirror(), EDIT_TOOL::Remove(), and EDIT_TOOL::Rotate().
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 2640 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), COLLECTOR::GetCount(), EDA_ITEM::GetFlags(), BOARD_ITEM::GetParent(), COLLECTOR::HasItem(), m_enteredGroup, PCB_TOOL_BASE::m_isFootprintEditor, PCB_FOOTPRINT_T, COLLECTOR::Remove(), EDA_ITEM::SetFlags(), TEMP_SELECTED, 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(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), SelectAll(), selectMultiple(), and selectPoint().
void PCB_SELECTION_TOOL::FilterCollectorForMarkers | ( | GENERAL_COLLECTOR & | aCollector | ) | const |
Apply the SELECTION_FILTER_OPTIONS to a collection of items.
Definition at line 2734 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(), and EDIT_TOOL::Rotate().
|
private |
Return true if the given item passes the current SELECTION_FILTER_OPTIONS.
Definition at line 1621 of file pcb_selection_tool.cpp.
References PCB_TOOL_BASE::board(), ClearSelection(), SELECTION::GetItems(), itemIsIncludedByFilter(), m_frame, m_priv, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), EVENTS::SelectedEvent, and PCB_TOOL_BASE::selection().
Referenced by setTransitions().
void PCB_SELECTION_TOOL::FindItem | ( | BOARD_ITEM * | aItem | ) |
Handle finding an item.
Does not do the actual searching, is called by the find dialog.
aItem | Item that was found and needs to be handled. |
Definition at line 1524 of file pcb_selection_tool.cpp.
References EVENTS::ClearedEvent, ClearSelection(), EDA_DRAW_FRAME::FocusOnLocation(), EDA_DRAW_PANEL_GAL::ForceRefresh(), PCB_BASE_FRAME::GetCanvas(), EDA_ITEM::GetPosition(), SELECTION::GetSize(), m_frame, m_selection, TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), select(), and EVENTS::SelectedEvent.
Referenced by PCB_EDIT_FRAME::FindNext(), and PCB_EDIT_FRAME::ShowFindDialog().
|
inlineprotectedinherited |
Definition at line 167 of file pcb_tool_base.h.
References PCB_TOOL_BASE::board(), and BOARD::GetFirstFootprint().
Referenced by PCB_CONTROL::AppendBoard(), MICROWAVE_TOOL::createBaseFootprint(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), EDIT_TOOL::doMoveSelection(), DRAWING_TOOL::DrawVia(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), BOARD_EDITOR_CONTROL::ExportNetlist(), GuessSelectionCandidates(), hitTestDistance(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectConstraints(), PCB_CONTROL::Paste(), FOOTPRINT_EDITOR_CONTROL::Properties(), PAD_TOOL::pushPadSettings(), BOARD_EDITOR_CONTROL::RepairBoard(), FOOTPRINT_EDITOR_CONTROL::RepairFootprint(), BOARD_INSPECTION_TOOL::reportClearance(), FOOTPRINT_EDITOR_CONTROL::Save(), FOOTPRINT_EDITOR_CONTROL::SaveAs(), select(), Selectable(), selectAllItemsOnSheet(), selectSameSheet(), DRAWING_TOOL::SetAnchor(), and PCB_CONTROL::UpdateMessagePanel().
|
inlineprotectedinherited |
Definition at line 160 of file pcb_tool_base.h.
Referenced by PCB_POINT_EDITOR::addCorner(), AUTOPLACE_TOOL::autoplace(), PCB_TOOL_BASE::canvas(), ZONE_FILLER_TOOL::CheckAllZones(), PNS::TOOL_BASE::checkSnap(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), ROUTER_TOOL::CustomTrackWidthDialog(), FOOTPRINT_EDITOR_CONTROL::DeleteFootprint(), PCB_TOOL_BASE::displayOptions(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::DpDimensionsDialog(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawVia(), DRAWING_TOOL::DrawZone(), PAD_TOOL::EditPad(), PAD_TOOL::EnumeratePads(), PAD_TOOL::explodePad(), BOARD_EDITOR_CONTROL::ExportSpecctraDSN(), ZONE_FILLER_TOOL::FillAllZones(), EDIT_TOOL::FilletTracks(), FilterCollectorForFreePads(), ROUTER_TOOL::finishInteractive(), EDIT_TOOL::Flip(), PCB_CONTROL::FlipPcbView(), GLOBAL_EDIT_TOOL::GlobalDeletions(), ROUTER_TOOL::handleLayerSwitch(), BOARD_INSPECTION_TOOL::HighlightItem(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), BOARD_EDITOR_CONTROL::ImportSpecctraSession(), ROUTER_TOOL::Init(), SCRIPTING_TOOL::Init(), Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), DRAWING_TOOL::InteractivePlaceWithPreview(), PCB_TOOL_BASE::Is45Limited(), PCB_PICKER_TOOL::Main(), Main(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::meanderSettingsDialog(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), PCB_CONTROL::Paste(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), GROUP_TOOL::PickNewMember(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), ROUTER_TOOL::prepareInteractive(), PAD_TOOL::pushPadSettings(), PAD_TOOL::recombinePad(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SCRIPTING_TOOL::reloadPlugins(), EDIT_TOOL::Remove(), PCB_POINT_EDITOR::removeCorner(), RequestSelection(), PAD_TOOL::Reset(), PNS::TOOL_BASE::Reset(), EDIT_TOOL::Rotate(), ROUTER_TOOL::SelectCopperLayerPair(), POSITION_RELATIVE_TOOL::SelectPositionRelativeItem(), PCB_POINT_EDITOR::setEditedPoint(), ROUTER_TOOL::SettingsDialog(), GLOBAL_EDIT_TOOL::swapBoardItem(), GLOBAL_EDIT_TOOL::SwapLayers(), ROUTER_TOOL::switchLayerOnViaPlacement(), PCB_CONTROL::unfilledZoneCheck(), ROUTER_TOOL::UpdateMessagePanel(), EDIT_TOOL::updateModificationPoint(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), ZONE_FILLER_TOOL::ZoneFill(), and ZONE_FILLER_TOOL::ZoneFillAll().
|
inline |
Definition at line 184 of file pcb_selection_tool.h.
References PCB_TOOL_BASE::board().
Referenced by GROUP_CONTEXT_MENU::update().
|
private |
Definition at line 629 of file pcb_selection_tool.cpp.
References PCB_TOOL_BASE::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 PCB_TOOL_BASE::view().
Referenced by selectionContains(), and selectPoint().
|
inlineprotectedinherited |
Return the application window object, casted to requested user type.
Definition at line 184 of file tool_base.h.
References TOOL_BASE::getToolHolderInt().
Referenced by ZONE_CREATE_HELPER::createNewZone().
|
inline |
Definition at line 198 of file pcb_selection_tool.h.
References m_enteredGroup.
Referenced by PCB_CONTROL::placeBoardItems(), and EDIT_TOOL::Remove().
|
inline |
Set up handlers for various events.
Definition at line 173 of file pcb_selection_tool.h.
References m_filter.
Referenced by 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 120 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 143 of file tool_base.h.
References TOOL_BASE::m_toolMgr.
Referenced by BOARD_COMMIT::BOARD_COMMIT(), ZONE_CREATE_HELPER::commitZone(), ZONE_CREATE_HELPER::createNewZone(), PCB_TOOL_BASE::doInteractiveItemPlacement(), ACTION_MENU::getToolManager(), LIB_TREE::onContextMenu(), 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 196 of file tool_base.h.
References TOOL_BASE::getModelInt().
Referenced by ZONE_CREATE_HELPER::commitZone(), and ZONE_CREATE_HELPER::createZoneFromExisting().
|
inlineinherited |
Return the name of the tool.
Tool names are expected to obey the format: application.ToolName (eg. pcbnew.InteractiveSelection).
Definition at line 133 of file tool_base.h.
References TOOL_BASE::m_toolName.
Referenced by TOOL_MANAGER::dispatchInternal(), TOOL_MANAGER::InitTools(), TOOL_MANAGER::invokeTool(), TOOL_MANAGER::RegisterTool(), and TOOL_MANAGER::runTool().
PCB_SELECTION & PCB_SELECTION_TOOL::GetSelection | ( | ) |
Return the set of currently selected items.
Definition at line 502 of file pcb_selection_tool.cpp.
References m_selection.
Referenced by BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), PAD_TOOL::copyPadSettings(), ZONE_CREATE_HELPER::createNewZone(), DRC_TOOL::CrossProbe(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), EDIT_TOOL::DragArcTrack(), GROUP_TOOL::EnterGroup(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::GetAndPlace(), DRAWING_TOOL::getSourceZoneForAction(), BOARD_INSPECTION_TOOL::highlightNet(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), BOARD_EDITOR_CONTROL::modifyLockSelected(), PCB_EDIT_FRAME::OnNetlistChanged(), PCB_POINT_EDITOR::OnSelectionChange(), PAD_TOOL::pastePadProperties(), PCB_CONTROL::placeBoardItems(), 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_CONTROL::UpdateMessagePanel(), and BOARD_EDITOR_CONTROL::ZoneDuplicate().
|
inlineinherited |
Definition at line 77 of file tool_interactive.h.
References TOOL_INTERACTIVE::m_menu.
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_MOVE_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), EE_INSPECTION_TOOL::Init(), PAD_TOOL::Init(), GROUP_TOOL::Init(), CONVERT_TOOL::Init(), EE_POINT_EDITOR::Init(), BOARD_INSPECTION_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_POINT_EDITOR::Init(), SCH_MOVE_TOOL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and LIB_TREE::onContextMenu().
|
inlineinherited |
Return the type of the tool.
Definition at line 108 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(), PL_EDIT_TOOL::DeleteItemCursor(), SCH_EDIT_TOOL::DeleteItemCursor(), PCB_CONTROL::DeleteItemCursor(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), PL_EDIT_TOOL::DoDelete(), SCH_LINE_WIRE_BUS_TOOL::doDrawSegments(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), doSelectionMenu(), COMMON_TOOLS::doZoomFit(), COMMON_TOOLS::doZoomInOut(), COMMON_TOOLS::doZoomToPreset(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), SCH_LINE_WIRE_BUS_TOOL::DrawSegments(), PL_DRAWING_TOOLS::DrawShape(), DRAWING_TOOL::DrawZone(), BOARD_EDITOR_CONTROL::DrillOrigin(), SYMBOL_EDITOR_EDIT_TOOL::Duplicate(), PAD_TOOL::EnumeratePads(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), EE_SELECTION_TOOL::GetNode(), ROUTER_TOOL::getStartLayer(), PCB_CONTROL::GridResetOrigin(), PCB_CONTROL::GridSetOrigin(), ROUTER_TOOL::handleCommonEvents(), PL_SELECTION_TOOL::highlight(), EE_SELECTION_TOOL::highlight(), highlight(), GERBVIEW_CONTROL::HighlightControl(), PNS::TOOL_BASE::highlightNet(), BOARD_INSPECTION_TOOL::highlightNet(), hitTestDistance(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), ROUTER_TOOL::InlineDrag(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), SCH_EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), PL_EDIT_TOOL::moveItem(), SCH_MOVE_TOOL::moveItem(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), COMMON_TOOLS::PanControl(), SYMBOL_EDITOR_EDIT_TOOL::Paste(), PL_EDIT_TOOL::Paste(), SCH_EDITOR_CONTROL::Paste(), ROUTER_TOOL::performRouting(), PNS::TOOL_BASE::pickSingleItem(), BOARD_EDITOR_CONTROL::PlaceFootprint(), PL_DRAWING_TOOLS::PlaceItem(), BOARD_EDITOR_CONTROL::PlaceTarget(), ROUTER_TOOL::prepareInteractive(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), BOARD_EDITOR_CONTROL::Reset(), PNS::TOOL_BASE::Reset(), PCB_CONTROL::Reset(), GERBVIEW_SELECTION_TOOL::Reset(), DRAWING_TOOL::Reset(), EE_SELECTION_TOOL::Reset(), Reset(), EE_TOOL_BASE< SCH_BASE_FRAME >::Reset(), SCH_EDIT_TOOL::Rotate(), GERBVIEW_SELECTION_TOOL::select(), GERBVIEW_SELECTION_TOOL::selectable(), Selectable(), SelectAll(), EE_SELECTION_TOOL::SelectAll(), PL_SELECTION_TOOL::selectionContains(), EE_SELECTION_TOOL::selectionContains(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), selectMultiple(), PL_SELECTION_TOOL::SelectPoint(), ZOOM_TOOL::selectRegion(), GERBVIEW_SELECTION_TOOL::selectVisually(), DRAWING_TOOL::SetAnchor(), SCH_DRAWING_TOOLS::SingleClickPlace(), SCH_EDITOR_CONTROL::ToggleHiddenFields(), SCH_EDITOR_CONTROL::ToggleHiddenPins(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_DRAWING_TOOLS::TwoClickPlace(), PL_SELECTION_TOOL::unhighlight(), EE_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_EDITOR_CONTROL::UpdateFind(), PL_POINT_EDITOR::updateItem(), PCB_POINT_EDITOR::updateItem(), EE_TOOL_BASE< SCH_BASE_FRAME >::updateItem(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), EE_POINT_EDITOR::updatePoints(), PL_POINT_EDITOR::updatePoints(), PCB_POINT_EDITOR::updatePoints(), updateSelection(), PNS::TOOL_BASE::updateStartItem(), PCB_VIEWER_TOOLS::view(), PCB_TOOL_BASE::view(), 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(), SCH_EDITOR_CONTROL::AssignNetclass(), SCH_EDIT_TOOL::BreakWire(), PCB_TOOL_BASE::controls(), EDIT_TOOL::copyToClipboard(), SCH_DRAWING_TOOLS::createSheetPin(), COMMON_TOOLS::CursorControl(), 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(), 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_DRAWING_TOOLS::GetCanvasFreeAreaPixels(), BOARD_INSPECTION_TOOL::HighlightNet(), SCH_EDITOR_CONTROL::HighlightNet(), FOOTPRINT_EDITOR_CONTROL::ImportFootprint(), SCH_EDIT_TOOL::Init(), EDIT_TOOL::Init(), PCB_PICKER_TOOL::Main(), EE_POINT_EDITOR::Main(), PL_EDIT_TOOL::Main(), SYMBOL_EDITOR_MOVE_TOOL::Main(), PL_POINT_EDITOR::Main(), SCH_MOVE_TOOL::Main(), EE_SELECTION_TOOL::Main(), PICKER_TOOL::Main(), ROUTER_TOOL::MainLoop(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), COMMON_TOOLS::OnGridChanged(), PCB_POINT_EDITOR::OnSelectionChange(), 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(), PL_DRAWING_TOOLS::PlaceItem(), SCH_DRAWING_TOOLS::PlaceSymbol(), BOARD_EDITOR_CONTROL::PlaceTarget(), SCH_EDIT_TOOL::Properties(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), SCH_EDIT_TOOL::RepeatDrawItem(), PL_SELECTION_TOOL::RequestSelection(), EE_SELECTION_TOOL::RequestSelection(), PCB_POINT_EDITOR::Reset(), DRAWING_TOOL::Reset(), COMMON_TOOLS::ResetLocalCoords(), GERBVIEW_SELECTION_TOOL::selectCursor(), selectCursor(), PL_SELECTION_TOOL::selectMultiple(), EE_SELECTION_TOOL::selectMultiple(), selectMultiple(), EE_SELECTION_TOOL::SelectNode(), ZOOM_TOOL::selectRegion(), ALIGN_DISTRIBUTE_TOOL::selectTarget(), PCB_PICKER_TOOL::setControls(), PICKER_TOOL::setControls(), PL_POINT_EDITOR::setEditedPoint(), EE_POINT_EDITOR::setEditedPoint(), PCB_POINT_EDITOR::setEditedPoint(), SCH_DRAWING_TOOLS::SingleClickPlace(), SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace(), SCH_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 AUTOPLACE_TOOL::setTransitions(), ZOOM_TOOL::setTransitions(), LENGTH_TUNER_TOOL::setTransitions(), BOARD_REANNOTATE_TOOL::setTransitions(), GERBVIEW_INSPECTION_TOOL::setTransitions(), PCB_PICKER_TOOL::setTransitions(), SCH_NAVIGATE_TOOL::setTransitions(), SYMBOL_EDITOR_PIN_TOOL::setTransitions(), SYMBOL_EDITOR_MOVE_TOOL::setTransitions(), PL_DRAWING_TOOLS::setTransitions(), EE_POINT_EDITOR::setTransitions(), PL_POINT_EDITOR::setTransitions(), ROUTER_TOOL::setTransitions(), SCRIPTING_TOOL::setTransitions(), COMMON_CONTROL::setTransitions(), KICAD_MANAGER_CONTROL::setTransitions(), CONVERT_TOOL::setTransitions(), SYMBOL_EDITOR_DRAWING_TOOLS::setTransitions(), ZONE_FILLER_TOOL::setTransitions(), PCB_VIEWER_TOOLS::setTransitions(), MICROWAVE_TOOL::setTransitions(), EE_INSPECTION_TOOL::setTransitions(), PCB_POINT_EDITOR::setTransitions(), GERBVIEW_CONTROL::setTransitions(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::setTransitions(), PAD_TOOL::setTransitions(), GLOBAL_EDIT_TOOL::setTransitions(), GROUP_TOOL::setTransitions(), PL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_CONTROL::setTransitions(), SYMBOL_EDITOR_EDIT_TOOL::setTransitions(), PL_EDIT_TOOL::setTransitions(), POSITION_RELATIVE_TOOL::setTransitions(), GERBVIEW_SELECTION_TOOL::setTransitions(), SCH_MOVE_TOOL::setTransitions(), SCH_DRAWING_TOOLS::setTransitions(), SCH_EDIT_TOOL::setTransitions(), FOOTPRINT_EDITOR_CONTROL::setTransitions(), ALIGN_DISTRIBUTE_TOOL::setTransitions(), COMMON_TOOLS::setTransitions(), DRC_TOOL::setTransitions(), EDA_3D_CONTROLLER::setTransitions(), PCB_CONTROL::setTransitions(), CVPCB_ASSOCIATION_TOOL::setTransitions(), SCH_LINE_WIRE_BUS_TOOL::setTransitions(), CVPCB_CONTROL::setTransitions(), BOARD_INSPECTION_TOOL::setTransitions(), BOARD_EDITOR_CONTROL::setTransitions(), PICKER_TOOL::setTransitions(), EDIT_TOOL::setTransitions(), setTransitions(), PL_SELECTION_TOOL::setTransitions(), DRAWING_TOOL::setTransitions(), SCH_EDITOR_CONTROL::setTransitions(), and EE_SELECTION_TOOL::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 | is the collector that has a list of items to be queried. |
aWhere | is the selection point to consider |
Definition at line 2476 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), B_SilkS, FOOTPRINT::CoverageRatio(), COLLECTOR::Empty(), F_SilkS, PCB_TOOL_BASE::footprint(), PCB_BASE_FRAME::GetActiveLayer(), COLLECTOR::GetCount(), FOOTPRINT::GetCoverageArea(), GENERAL_COLLECTOR::GetGuide(), BOARD_ITEM::GetLayer(), hitTestDistance(), m_frame, COLLECTORS_GUIDE::OnePixelInIU(), PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_SHAPE_T, PCB_TEXT_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(), and selectPoint().
|
private |
Highlight the item visually.
aItem | is an item to be be highlighted. |
aHighlightMode | should be either SELECTED or BRIGHTENED |
aGroup | is the group to add the item to in the BRIGHTENED mode. |
Definition at line 2258 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 PCB_TOOL_BASE::view().
Referenced by BrightenItem(), doSelectionMenu(), RebuildSelection(), RequestSelection(), and select().
|
private |
Definition at line 2273 of file pcb_selection_tool.cpp.
References BRIGHTENED, KIGFX::VIEW::Hide(), PCB_FOOTPRINT_T, PCB_GROUP_T, SELECTED, EDA_ITEM::SetBrightened(), EDA_ITEM::SetSelected(), EDA_ITEM::Type(), and PCB_TOOL_BASE::view().
Referenced by highlight().
|
private |
Definition at line 2371 of file pcb_selection_tool.cpp.
References SHAPE_LINE_CHAIN::Collide(), SHAPE_POLY_SET::Collide(), distance(), PCB_TOOL_BASE::footprint(), FOOTPRINT::GetBoundingBox(), FOOTPRINT::GetBoundingHull(), BOARD_ITEM::GetEffectiveShape(), EDA_RECT::GetHeight(), BOX2< Vec >::GetHeight(), MARKER_BASE::GetPos(), BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), TOOL_BASE::getView(), KIGFX::VIEW::GetViewport(), EDA_RECT::GetWidth(), BOX2< Vec >::GetWidth(), group, ZONE::HitTestForEdge(), SHAPE_LINE_CHAIN::Move(), PCB_FOOTPRINT_T, PCB_FP_TEXT_T, PCB_GROUP_T, PCB_MARKER_T, PCB_TEXT_T, PCB_ZONE_T, MARKER_BASE::ShapeToPolygon(), text, and EDA_ITEM::Type().
Referenced by GuessSelectionCandidates().
|
overridevirtual |
Init() is called once upon a registration of the tool.
Reimplemented from PCB_TOOL_BASE.
Definition at line 135 of file pcb_selection_tool.cpp.
References PCB_GROUP::AddItem(), EDA_DRAW_FRAME::AddStandardSubMenus(), TOOL_MENU::AddSubMenu(), ACTIONS::cancelInteractive, PCB_TOOL_BASE::frame(), FRAME_FOOTPRINT_VIEWER, FRAME_FOOTPRINT_VIEWER_MODAL, FRAME_PCB_EDITOR, TOOL_MENU::GetMenu(), PCB_ACTIONS::groupLeave, EDA_BASE_FRAME::IsType(), SELECTION_TOOL::m_disambiguateTimer, m_enteredGroup, TOOL_INTERACTIVE::m_menu, SELECTION_CONDITIONS::NotEmpty(), onDisambiguationExpire(), and TOOLS_HOLDER::ToolStackIsEmpty().
|
virtualinherited |
Should the tool use its 45° mode option?
Definition at line 323 of file pcb_tool_base.cpp.
References PCB_TOOL_BASE::frame(), FRAME_PCB_EDITOR, PCBNEW_SETTINGS::m_FpeditUse45DegreeLimit, PCBNEW_SETTINGS::m_PcbUse45DegreeLimit, and PCB_BASE_FRAME::Settings().
Referenced by DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), and DRAWING_TOOL::DrawZone().
|
inlineinherited |
Definition at line 104 of file pcb_tool_base.h.
References PCB_TOOL_BASE::m_isFootprintEditor.
Referenced by BOARD_COMMIT::BOARD_COMMIT(), EDIT_TOOL::doMoveSelection(), FilterCollectorForFreePads(), EDIT_TOOL::Flip(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Remove(), and EDIT_TOOL::Rotate().
|
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(), EDIT_TOOL::isRouterActive(), Main(), BOARD_EDITOR_CONTROL::TrackWidthDec(), and BOARD_EDITOR_CONTROL::TrackWidthInc().
|
private |
Definition at line 1673 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, SELECTION_FILTER_OPTIONS::otherItems, SELECTION_FILTER_OPTIONS::pads, PCB_ARC_T, PCB_DIM_ALIGNED_T, PCB_DIM_CENTER_T, PCB_DIM_LEADER_T, PCB_DIM_ORTHOGONAL_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_ZONE_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_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 244 of file pcb_selection_tool.cpp.
References ARROW, BUT_LEFT, BUT_MIDDLE, BUT_RIGHT, SELECTION::Clear(), ClearSelection(), DRAG, PCB_ACTIONS::drag45Degree, DRAG_ANY, DRAG_FREE_ANGLE, DRAG_SELECTED, PCB_ACTIONS::dragFreeAngle, SELECTION::Empty(), EnterGroup(), ExitGroup(), PCB_BASE_FRAME::FocusOnItem(), PCB_TOOL_BASE::frame(), FRAME_PCB_EDITOR, TOOLS_HOLDER::GetDragAction(), SELECTION::GetItem(), TOOL_MANAGER::GetMousePosition(), SELECTION::GetSize(), TOOL_MANAGER::GetTool(), 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_additive, SELECTION_TOOL::m_canceledMenu, SELECTION_TOOL::m_disambiguateTimer, m_enteredGroup, SELECTION_TOOL::m_exclusive_or, m_frame, SELECTION_TOOL::m_highlight_modifier, TOOL_INTERACTIVE::m_menu, m_nonModifiedCursor, SELECTION_TOOL::m_originalCursor, m_selection, SELECTION_TOOL::m_subtractive, 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, selectCursor(), selectionContains(), selectMultiple(), selectPoint(), SELECTION::SetIsHover(), SELECTION_TOOL::setModifiersState(), PCB_BASE_FRAME::Settings(), TOOL_MENU::ShowContextMenu(), TOOLS_HOLDER::ToolStackIsEmpty(), TOOL_INTERACTIVE::Wait(), ACTIONS::zoomFitObjects, and ACTIONS::zoomFitScreen.
Referenced by setTransitions().
|
private |
Start the process to show our disambiguation menu once the user has kept the mouse down for the minimum time.
aEvent |
Definition at line 217 of file pcb_selection_tool.cpp.
References EVENTS::DisambiguatePoint, TOOL_BASE::m_toolMgr, and TOOL_MANAGER::ProcessEvent().
Referenced by Init(), and ~PCB_SELECTION_TOOL().
void PCB_SELECTION_TOOL::OnIdle | ( | wxIdleEvent & | aEvent | ) |
Definition at line 223 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 1787 of file pcb_selection_tool.cpp.
References GENERAL_COLLECTOR::AllBoardItems, PCB_TOOL_BASE::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, PCB_TOOL_BASE::m_isFootprintEditor, m_selection, SELECTED, EDA_ITEM::SetFlags(), and BOARD::Visit().
Referenced by PCB_BASE_EDIT_FRAME::PutDataInPreviousState(), and BOARD_COMMIT::Revert().
void PCB_SELECTION_TOOL::RemoveItemFromSel | ( | BOARD_ITEM * | aItem, |
bool | aQuietMode = false |
||
) |
Multiple item unselection event handler.
Definition at line 1055 of file pcb_selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_MANAGER::ProcessEvent(), unselect(), and EVENTS::UnselectedEvent.
Referenced by EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), and UnselectItem().
PCB_SELECTION & PCB_SELECTION_TOOL::RequestSelection | ( | CLIENT_SELECTION_FILTER | aClientFilter, |
bool | aConfirmLockedItems = false |
||
) |
Return the current selection set, filtered according to aFlags and aClientFilter.
If the set is empty, performs the legacy-style hover selection.
aConfirmLockedItems | if true the user will be prompted 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 508 of file pcb_selection_tool.cpp.
References COLLECTOR::Append(), SELECTION::ClearReferencePoint(), ClearSelection(), SELECTION::Empty(), EDA_DRAW_PANEL_GAL::ForceRefresh(), PCB_TOOL_BASE::frame(), PCB_BASE_FRAME::GetCanvas(), group, highlight(), BOARD_ITEM::IsLocked(), m_frame, m_selection, TOOL_BASE::m_toolMgr, PCB_GROUP_T, TOOL_MANAGER::RunAction(), SELECTED, PCB_ACTIONS::selectionCursor, SELECTION::SetIsHover(), EDA_ITEM::Type(), unhighlight(), and unselect().
Referenced by 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::FilletTracks(), EDIT_TOOL::Flip(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), GROUP_TOOL::Group(), EDIT_TOOL::Mirror(), EDIT_TOOL::MoveExact(), GROUP_TOOL::PickNewMember(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), EDIT_TOOL::Remove(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), CONVERT_TOOL::SegmentToArc(), and POSITION_RELATIVE_TOOL::SelectPositionRelativeItem().
|
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. |
Reimplemented from PCB_TOOL_BASE.
Definition at line 185 of file pcb_selection_tool.cpp.
References KIGFX::PCB_VIEW::Add(), ClearSelection(), ExitGroup(), KIGFX::VIEW::GetPainter(), KIGFX::PAINTER::GetSettings(), TOOL_BASE::getView(), m_enteredGroup, m_enteredGroupOverlay, m_frame, m_selection, TOOL_BASE::MODEL_RELOAD, KIGFX::PCB_VIEW::Remove(), KIGFX::RENDER_SETTINGS::SetHighlight(), and PCB_TOOL_BASE::view().
|
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().
void PCB_SELECTION_TOOL::select | ( | BOARD_ITEM * | aItem | ) |
Take necessary action mark an item as selected.
aItem | is an item to be selected. |
Definition at line 2235 of file pcb_selection_tool.cpp.
References SELECTION::Contains(), PCB_TOOL_BASE::footprint(), BOARD_ITEM::GetParent(), highlight(), EDA_ITEM::IsSelected(), m_selection, PCB_PAD_T, SELECTED, and EDA_ITEM::Type().
Referenced by AddItemToSel(), EnterGroup(), ExitGroup(), filterSelection(), FindItem(), GROUP_TOOL::Group(), SelectAll(), selectAllItemsOnNet(), selectAllItemsOnSheet(), selectConnectedTracks(), SelectItems(), selectMultiple(), selectNet(), and selectPoint().
bool PCB_SELECTION_TOOL::Selectable | ( | const BOARD_ITEM * | aItem, |
bool | checkVisibilityOnly = false |
||
) | const |
Check conditions for an item to be selected.
Definition at line 1992 of file pcb_selection_tool.cpp.
References LSET::AllLayersMask(), B_Cu, PCB_TOOL_BASE::board(), F_Cu, PCB_TOOL_BASE::footprint(), KIGFX::RENDER_SETTINGS::GetHighContrast(), KIGFX::RENDER_SETTINGS::GetHighContrastLayers(), BOARD_ITEM::GetLayer(), ZONE::GetLayerSet(), KIGFX::VIEW::GetPainter(), BOARD_ITEM::GetParent(), KIGFX::VIEW::GetScale(), KIGFX::PAINTER::GetSettings(), TOOL_BASE::getView(), BOARD::GetVisibleLayers(), FOOTPRINT::GraphicalItems(), group, BOARD::IsElementVisible(), KIGFX::VIEW::IsLayerVisible(), BOARD::IsLayerVisible(), KIGFX::VIEW::IsVisible(), LAYER_MOD_TEXT_INVISIBLE, LAYER_PAD_BK, LAYER_PAD_FR, LAYER_PADS_TH, LAYER_TRACKS, LAYER_VIAS, LAYER_ZONES, PCB_TOOL_BASE::m_isFootprintEditor, SELECTION_TOOL::m_multiple, NOT_USED, NPTH, pad, FOOTPRINT::Pads(), PCB_ARC_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_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, LSET::Seq(), text, ToLAYER_ID(), EDA_ITEM::Type(), TYPE_NOT_INIT, via, PCB_TOOL_BASE::view(), KIGFX::VIEW_ITEM::ViewGetLOD(), and FOOTPRINT::Zones().
Referenced by PCB_CONTROL::DeleteItemCursor(), SelectAll(), selectMultiple(), and selectPoint().
int PCB_SELECTION_TOOL::SelectAll | ( | const TOOL_EVENT & | aEvent | ) |
Multiple item selection event handler.
Definition at line 981 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, KIGFX::VIEW::Query(), select(), Selectable(), BOX2< Vec >::SetMaximum(), and PCB_TOOL_BASE::view().
Referenced by setTransitions().
|
private |
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 1306 of file pcb_selection_tool.cpp.
References PCB_TOOL_BASE::board(), EOT, BOARD::GetConnectivity(), itemPassesFilter(), PCB_ARC_T, PCB_TRACE_T, PCB_VIA_T, select(), and unselect().
Referenced by selectNet().
|
private |
Select all items on a sheet and its subsheets, given the full sheet path.
The path of the root sheet is "/".Select all footprints belonging to same sheet, from Eeschema using cross-probing.
Definition at line 1354 of file pcb_selection_tool.cpp.
References KIID_PATH::AsString(), PCB_TOOL_BASE::board(), alg::contains(), EOT, PCB_TOOL_BASE::footprint(), FOOTPRINT::GetPath(), pad, FOOTPRINT::Pads(), PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, select(), selectConnectedTracks(), and STOP_NEVER.
Referenced by selectSameSheet(), and selectSheetContents().
|
private |
Select connected tracks and vias.
aStopCondition | where to stop selecting more items |
Definition at line 1144 of file pcb_selection_tool.cpp.
References PCB_TOOL_BASE::board(), EOT, BOARD::GetConnectivity(), PCB_TRACK::GetEnd(), BOARD_ITEM::GetLayer(), EDA_ITEM::GetPosition(), PCB_TRACK::GetStart(), pad, PCB_ARC_T, PCB_PAD_T, PCB_TRACE_T, PCB_VIA_T, select(), STOP_AT_JUNCTION, STOP_AT_PAD, TEMP_SELECTED, EDA_ITEM::Type(), UNDEFINED_LAYER, and via.
Referenced by expandConnection(), and selectAllItemsOnSheet().
|
private |
Select an item under the cursor unless there is something already selected or aSelectAlways is true.
aForceSelect | forces to select an item even if there is an item already selected. |
aClientFilter | allows the client to perform tool- or action-specific filtering. |
Definition at line 755 of file pcb_selection_tool.cpp.
References ClearSelection(), SELECTION::Empty(), TOOL_BASE::getViewControls(), m_selection, and selectPoint().
Referenced by CursorSelection(), expandConnection(), Main(), and selectNet().
|
protectedinherited |
Definition at line 307 of file pcb_tool_base.cpp.
References GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.
Referenced by AUTOPLACE_TOOL::autoplaceSelected(), BOARD_INSPECTION_TOOL::calculateSelectionRatsnest(), ROUTER_TOOL::CanInlineDrag(), EDIT_TOOL::ChangeTrackWidth(), PAD_TOOL::copyPadSettings(), EDIT_TOOL::copyToClipboard(), EDIT_TOOL::CreateArray(), DRC_TOOL::CrossProbe(), BOARD_INSPECTION_TOOL::CrossProbePcbToSch(), BOARD_INSPECTION_TOOL::doHideNet(), PCB_TOOL_BASE::doInteractiveItemPlacement(), EDIT_TOOL::doMoveSelection(), EDIT_TOOL::Drag(), EDIT_TOOL::DragArcTrack(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), MICROWAVE_TOOL::drawMicrowaveInductor(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawZone(), EDIT_TOOL::Duplicate(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), PAD_TOOL::EditPad(), GROUP_TOOL::EnterGroup(), PAD_TOOL::EnumeratePads(), GLOBAL_EDIT_TOOL::ExchangeFootprints(), EDIT_TOOL::FilletTracks(), filterSelection(), EDIT_TOOL::Flip(), DRAWING_TOOL::getSourceZoneForAction(), GROUP_TOOL::Group(), BOARD_INSPECTION_TOOL::highlightNet(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectConstraints(), DRAWING_TOOL::InteractivePlaceWithPreview(), BOARD_INSPECTION_TOOL::LocalRatsnestTool(), ROUTER_TOOL::MainLoop(), LENGTH_TUNER_TOOL::MainLoop(), EDIT_TOOL::Mirror(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::MoveExact(), PCB_POINT_EDITOR::OnSelectionChange(), PAD_TOOL::pastePadProperties(), ROUTER_TOOL::performDragging(), ROUTER_TOOL::performRouting(), LENGTH_TUNER_TOOL::performTuning(), PCB_CONTROL::placeBoardItems(), BOARD_EDITOR_CONTROL::PlaceFootprint(), DRAWING_TOOL::PlaceImportedGraphics(), BOARD_EDITOR_CONTROL::PlaceTarget(), DRAWING_TOOL::PlaceText(), POSITION_RELATIVE_TOOL::PositionRelative(), EDIT_TOOL::Properties(), PAD_TOOL::pushPadSettings(), BOARD_REANNOTATE_TOOL::ReannotateDuplicatesInSelection(), GROUP_TOOL::RemoveFromGroup(), GLOBAL_EDIT_TOOL::RemoveUnusedPads(), EDIT_TOOL::Rotate(), selectNet(), DRAWING_TOOL::SetAnchor(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), GROUP_TOOL::Ungroup(), PCB_CONTROL::UpdateMessagePanel(), BOARD_INSPECTION_TOOL::UpdateSelectionRatsnest(), BOARD_EDITOR_CONTROL::ViaSizeDec(), BOARD_EDITOR_CONTROL::ViaSizeInc(), BOARD_EDITOR_CONTROL::ZoneDuplicate(), ZONE_FILLER_TOOL::ZoneFill(), BOARD_EDITOR_CONTROL::ZoneMerge(), and ZONE_FILLER_TOOL::ZoneUnfill().
|
protectedinherited |
Definition at line 315 of file pcb_tool_base.cpp.
References GetSelection(), TOOL_MANAGER::GetTool(), and TOOL_BASE::m_toolMgr.
|
private |
Definition at line 2345 of file pcb_selection_tool.cpp.
References GENERAL_COLLECTOR::AllBoardItems, PCB_TOOL_BASE::board(), GENERAL_COLLECTOR::Collect(), GENERAL_COLLECTOR::FootprintItems, getCollectorsGuide(), COLLECTOR::GetCount(), EDA_ITEM::HitTest(), EDA_ITEM::IsSelected(), PCB_TOOL_BASE::m_isFootprintEditor, GENERAL_COLLECTORS_GUIDE::OnePixelInIU(), and GENERAL_COLLECTORS_GUIDE::SetOnePixelInIU().
Referenced by Main().
int PCB_SELECTION_TOOL::SelectionMenu | ( | const TOOL_EVENT & | aEvent | ) |
Show a popup menu to trim the COLLECTOR passed as aEvent's parameter down to a single item.
Definition at line 1831 of file pcb_selection_tool.cpp.
References doSelectionMenu(), and TOOL_EVENT::Parameter().
Referenced by setTransitions().
int PCB_SELECTION_TOOL::SelectItem | ( | const TOOL_EVENT & | aEvent | ) |
Definition at line 974 of file pcb_selection_tool.cpp.
References AddItemToSel(), and TOOL_EVENT::Parameter().
Referenced by setTransitions().
int PCB_SELECTION_TOOL::SelectItems | ( | const TOOL_EVENT & | aEvent | ) |
Item unselection event handler.
Definition at line 957 of file pcb_selection_tool.cpp.
References TOOL_BASE::m_toolMgr, TOOL_EVENT::Parameter(), TOOL_MANAGER::ProcessEvent(), select(), and EVENTS::SelectedEvent.
Referenced by setTransitions().
|
private |
Handle drawing a selection box that allows one to select many items at the same time.
Definition at line 780 of file pcb_selection_tool.cpp.