KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PICKER_TOOL_BASE Class Reference

#include <picker_tool.h>

Inheritance diagram for PICKER_TOOL_BASE:
PCB_PICKER_TOOL PICKER_TOOL

Public Types

enum  pickerEndState {
  WAIT_CANCEL , CLICK_CANCEL , END_ACTIVATE , EVT_CANCEL ,
  EXCEPTION_CANCEL
}
 
typedef std::function< bool(const VECTOR2D &)> CLICK_HANDLER
 < Event handler types.
 
typedef std::function< void(const VECTOR2D &)> MOTION_HANDLER
 
typedef std::function< void(void)> CANCEL_HANDLER
 
typedef std::function< void(const int &)> FINALIZE_HANDLER
 

Public Member Functions

 PICKER_TOOL_BASE ()
 
virtual ~PICKER_TOOL_BASE ()=default
 
void SetCursor (KICURSOR aCursor)
 
void SetSnapping (bool aSnap)
 
void SetClickHandler (CLICK_HANDLER aHandler)
 Set a handler for mouse click event.
 
void SetMotionHandler (MOTION_HANDLER aHandler)
 Set a handler for mouse motion.
 
void SetCancelHandler (CANCEL_HANDLER aHandler)
 Set a handler for cancel events (ESC or context-menu Cancel).
 
void SetFinalizeHandler (FINALIZE_HANDLER aHandler)
 Set a handler for the finalize event.
 
int CurrentModifiers () const
 

Protected Member Functions

virtual void reset ()
 < Reinitializes tool to its initial state.
 

Protected Attributes

EDA_DRAW_FRAMEm_frame
 
KICURSOR m_cursor
 
bool m_snap
 
int m_modifiers
 
std::optional< CLICK_HANDLERm_clickHandler
 
std::optional< MOTION_HANDLERm_motionHandler
 
std::optional< CANCEL_HANDLERm_cancelHandler
 
std::optional< FINALIZE_HANDLERm_finalizeHandler
 
std::optional< VECTOR2Dm_picked
 

Detailed Description

Definition at line 36 of file picker_tool.h.

Member Typedef Documentation

◆ CANCEL_HANDLER

typedef std::function<void(void)> PICKER_TOOL_BASE::CANCEL_HANDLER

Definition at line 42 of file picker_tool.h.

◆ CLICK_HANDLER

typedef std::function<bool(const VECTOR2D&)> PICKER_TOOL_BASE::CLICK_HANDLER

< Event handler types.

Definition at line 40 of file picker_tool.h.

◆ FINALIZE_HANDLER

typedef std::function<void(const int&)> PICKER_TOOL_BASE::FINALIZE_HANDLER

Definition at line 43 of file picker_tool.h.

◆ MOTION_HANDLER

typedef std::function<void(const VECTOR2D&)> PICKER_TOOL_BASE::MOTION_HANDLER

Definition at line 41 of file picker_tool.h.

Member Enumeration Documentation

◆ pickerEndState

Enumerator
WAIT_CANCEL 
CLICK_CANCEL 
END_ACTIVATE 
EVT_CANCEL 
EXCEPTION_CANCEL 

Definition at line 45 of file picker_tool.h.

Constructor & Destructor Documentation

◆ PICKER_TOOL_BASE()

PICKER_TOOL_BASE::PICKER_TOOL_BASE ( )
inline

Definition at line 54 of file picker_tool.h.

References reset().

◆ ~PICKER_TOOL_BASE()

virtual PICKER_TOOL_BASE::~PICKER_TOOL_BASE ( )
virtualdefault

Member Function Documentation

◆ CurrentModifiers()

int PICKER_TOOL_BASE::CurrentModifiers ( ) const
inline

Definition at line 110 of file picker_tool.h.

References m_modifiers.

Referenced by PCB_PICKER_TOOL::SelectPointInteractively().

◆ reset()

void PICKER_TOOL_BASE::reset ( )
protectedvirtual

< Reinitializes tool to its initial state.

Reimplemented in PCB_PICKER_TOOL.

Definition at line 32 of file picker_tool.cpp.

References m_cancelHandler, m_clickHandler, m_cursor, m_finalizeHandler, m_motionHandler, m_picked, and m_snap.

Referenced by PICKER_TOOL::Main(), PICKER_TOOL_BASE(), and PCB_PICKER_TOOL::reset().

◆ SetCancelHandler()

void PICKER_TOOL_BASE::SetCancelHandler ( CANCEL_HANDLER  aHandler)
inline

Set a handler for cancel events (ESC or context-menu Cancel).

Definition at line 93 of file picker_tool.h.

References m_cancelHandler.

Referenced by EDIT_TOOL::pickReferencePoint(), PCB_PICKER_TOOL::SelectItemInteractively(), and PCB_PICKER_TOOL::SelectPointInteractively().

◆ SetClickHandler()

◆ SetCursor()

◆ SetFinalizeHandler()

◆ SetMotionHandler()

◆ SetSnapping()

void PICKER_TOOL_BASE::SetSnapping ( bool  aSnap)
inline

Member Data Documentation

◆ m_cancelHandler

std::optional<CANCEL_HANDLER> PICKER_TOOL_BASE::m_cancelHandler
protected

Definition at line 123 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetCancelHandler().

◆ m_clickHandler

std::optional<CLICK_HANDLER> PICKER_TOOL_BASE::m_clickHandler
protected

Definition at line 121 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetClickHandler().

◆ m_cursor

KICURSOR PICKER_TOOL_BASE::m_cursor
protected

Definition at line 117 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetCursor().

◆ m_finalizeHandler

std::optional<FINALIZE_HANDLER> PICKER_TOOL_BASE::m_finalizeHandler
protected

Definition at line 124 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetFinalizeHandler().

◆ m_frame

EDA_DRAW_FRAME* PICKER_TOOL_BASE::m_frame
protected

Definition at line 116 of file picker_tool.h.

Referenced by PICKER_TOOL::Init(), and PICKER_TOOL::Main().

◆ m_modifiers

int PICKER_TOOL_BASE::m_modifiers
protected

Definition at line 119 of file picker_tool.h.

Referenced by CurrentModifiers(), and PICKER_TOOL::Main().

◆ m_motionHandler

std::optional<MOTION_HANDLER> PICKER_TOOL_BASE::m_motionHandler
protected

Definition at line 122 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetMotionHandler().

◆ m_picked

std::optional<VECTOR2D> PICKER_TOOL_BASE::m_picked
protected

Definition at line 126 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), and reset().

◆ m_snap

bool PICKER_TOOL_BASE::m_snap
protected

Definition at line 118 of file picker_tool.h.

Referenced by PICKER_TOOL::Main(), PCB_PICKER_TOOL::Main(), reset(), and SetSnapping().


The documentation for this class was generated from the following files: