50 auto snapIsSetToAllLayers =
55 if(
frame->GetMagneticItemsSettings() )
56 return frame->GetMagneticItemsSettings()->allLayers;
91 wxT(
"PCB_PICKER_TOOL::Main() called without a source event" ) );
94 frame->PushTool( sourceEvent );
114 cursorPos =
controls->GetMousePosition();
119 grid.SetUseGrid(
getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
121 controls->ForceCursorPosition(
true, cursorPos );
124 if( evt->IsCancelInteractive() || evt->IsActivate() )
130 (*m_cancelHandler)();
132 catch( std::exception& )
138 if( evt->IsActivate() )
147 bool getNext =
false;
155 getNext = (*m_clickHandler)( *m_picked );
157 catch( std::exception& )
174 else if( evt->IsMotion() )
180 (*m_motionHandler)( cursorPos );
182 catch( std::exception& )
212 (*m_finalizeHandler)( finalize_state );
214 catch( std::exception& )
220 controls->ForceCursorPosition(
false );
224 frame->PopTool( sourceEvent );
258 frame()->PushTool( aEvent );
261 statusPopup.SetText( wxGetTranslation( params.
m_Prompt ) );
263 const auto sendPoint =
264 [&](
const std::optional<VECTOR2I>& aPoint )
275 [&](
const VECTOR2D& aPoint ) ->
bool
279 sendPoint( snapped ? *snapped :
VECTOR2I( aPoint ) );
294 sendPoint( std::nullopt );
298 [&](
const int& aFinalState )
312 frame()->PopTool( aEvent );
326 frame()->PushTool( aEvent );
329 statusPopup.SetText( wxGetTranslation( params.
m_Prompt ) );
331 const auto sendItem =
343 [&](
const VECTOR2D& aPoint ) ->
bool
354 anchor_item = sel.
Front();
359 sendItem( sel.
Front() );
373 sendItem( anchor_item );
377 [&](
const int& aFinalState )
391 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,...
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
VECTOR2< double > VECTOR2D