51 const auto snapIsSetToAllLayers =
55 return frame->GetMagneticItemsSettings()->allLayers;
89 wxT(
"PCB_PICKER_TOOL::Main() called without a source event" ) );
92 frame->PushTool( sourceEvent );
117 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
122 if( evt->IsCancelInteractive() || evt->IsActivate() )
128 (*m_cancelHandler)();
130 catch( std::exception& )
136 if( evt->IsActivate() )
145 bool getNext =
false;
153 getNext = (*m_clickHandler)( *m_picked );
155 catch( std::exception& )
172 else if( evt->IsMotion() )
178 (*m_motionHandler)( cursorPos );
180 catch( std::exception& )
210 (*m_finalizeHandler)( finalize_state );
212 catch( std::exception& )
222 frame->PopTool( sourceEvent );
256 frame()->PushTool( aEvent );
259 statusPopup.SetText( wxGetTranslation( params.
m_Prompt ) );
261 const auto sendPoint = [&](
const std::optional<VECTOR2I>& aPoint )
272 [&](
const VECTOR2D& aPoint ) ->
bool
276 sendPoint( snapped ? *snapped :
VECTOR2I( aPoint ) );
291 sendPoint( std::nullopt );
295 [&](
const int& aFinalState )
308 frame()->PopTool( aEvent );
321 frame()->PushTool( aEvent );
324 statusPopup.SetText( wxGetTranslation( params.
m_Prompt ) );
326 const auto sendItem = [&](
const EDA_ITEM* aItem )
337 [&](
const VECTOR2D& aPoint ) ->
bool
349 anchor_item = sel.
Front();
354 sendItem( sel.
Front() );
368 sendItem( anchor_item );
372 [&](
const int& aFinalState )
385 frame()->PopTool( aEvent );
static TOOL_ACTION pickerSubTool
static TOOL_ACTION cancelInteractive
static TOOL_ACTION pickerTool
static TOOL_ACTION selectionClear
Clear the current selection.
void SetStatusPopup(wxWindow *aPopup)
A base class for most all the KiCad significant classes used in schematics and boards.
Used when the right click button is pressed, or when the select tool is in effect.
std::optional< VECTOR2I > GetSnappedPoint() const
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual void CaptureCursor(bool aEnabled)
Force the cursor to stay within the drawing panel area.
virtual void ForceCursorPosition(bool aEnabled, const VECTOR2D &aPosition=VECTOR2D(0, 0))
Place the cursor immediately at a given point.
virtual void ShowCursor(bool aEnabled)
Enable or disables display of cursor.
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
virtual void SetAutoPan(bool aEnabled)
Turn on/off auto panning (this feature is used when there is a tool active (eg.
static const LSET & AllLayersMask()
static TOOL_ACTION magneticSnapAllLayers
static TOOL_ACTION magneticSnapActiveLayer
Snapping controls.
static TOOL_ACTION selectPointInteractively
static TOOL_ACTION selectItemInteractively
Selection of reference points/items.
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
bool Empty() const
Checks if there is anything selected.
std::vector< FAB_LAYER_COLOR > dummy
VECTOR2< int32_t > VECTOR2I