|
KiCad PCB EDA Suite
|
The board item under the pointer, and the highlight that follows it. More...
#include <hover_picker.h>
Public Types | |
| using | ACCEPTS = std::function<bool( BOARD_ITEM& aItem )> |
| Everything it sees is already selectable. | |
| using | PROXIMITY = std::function<double( const BOARD_ITEM& aItem, const VECTOR2I& aPointer )> |
| Optional tie-break among what the selection heuristics left. Nearest wins. | |
Public Member Functions | |
| HOVER_PICKER (TOOL_MANAGER *aToolMgr) | |
| ~HOVER_PICKER () | |
| Puts back whatever is still lit, so an early exit cannot strand a highlight. | |
| BOARD_ITEM * | Pick (const VECTOR2I &aPointer, const ACCEPTS &aAccepts, const PROXIMITY &aProximity=nullptr) const |
| The item a click would take, or null. | |
| void | Brighten (BOARD_ITEM *aItem) |
| void | BrightenOnly (const std::vector< BOARD_ITEM * > &aItems) |
| Light exactly these, leaving what is already lit alone. | |
| void | ClearBrightening () |
| Items go back by id, so a commit that replaced one still puts the original back. | |
Private Attributes | |
| TOOL_MANAGER * | m_toolMgr |
| PCB_SELECTION_TOOL * | m_selectionTool |
| std::vector< KIID > | m_brightened |
The board item under the pointer, and the highlight that follows it.
Definition at line 34 of file hover_picker.h.
| using HOVER_PICKER::ACCEPTS = std::function<bool( BOARD_ITEM& aItem )> |
Everything it sees is already selectable.
Definition at line 38 of file hover_picker.h.
| using HOVER_PICKER::PROXIMITY = std::function<double( const BOARD_ITEM& aItem, const VECTOR2I& aPointer )> |
Optional tie-break among what the selection heuristics left. Nearest wins.
Definition at line 41 of file hover_picker.h.
|
explicit |
Definition at line 32 of file hover_picker.cpp.
References m_selectionTool, and m_toolMgr.
| HOVER_PICKER::~HOVER_PICKER | ( | ) |
Puts back whatever is still lit, so an early exit cannot strand a highlight.
Definition at line 39 of file hover_picker.cpp.
References ClearBrightening().
| void HOVER_PICKER::Brighten | ( | BOARD_ITEM * | aItem | ) |
Definition at line 83 of file hover_picker.cpp.
References m_brightened, m_selectionTool, and EDA_ITEM::m_Uuid.
| void HOVER_PICKER::BrightenOnly | ( | const std::vector< BOARD_ITEM * > & | aItems | ) |
Light exactly these, leaving what is already lit alone.
A preview recomputes its whole set on every motion, and clearing it first would redraw items that did not change.
Definition at line 90 of file hover_picker.cpp.
References m_brightened, m_selectionTool, m_toolMgr, and BOARD::ResolveItem().
Referenced by GRAPHIC_EDIT_TOOL::runInteractive().
| void HOVER_PICKER::ClearBrightening | ( | ) |
Items go back by id, so a commit that replaced one still puts the original back.
Definition at line 120 of file hover_picker.cpp.
References m_brightened, m_selectionTool, m_toolMgr, and BOARD::ResolveItem().
Referenced by GRAPHIC_EDIT_TOOL::runInteractive(), and ~HOVER_PICKER().
| BOARD_ITEM * HOVER_PICKER::Pick | ( | const VECTOR2I & | aPointer, |
| const ACCEPTS & | aAccepts, | ||
| const PROXIMITY & | aProximity = nullptr ) const |
The item a click would take, or null.
CollectPoint() decides, so the layer and size preferences and the Selection Filter all apply. Highlights nothing by itself.
Definition at line 45 of file hover_picker.cpp.
References COLLECTOR::GetCount(), m_selectionTool, and COLLECTOR::Remove().
Referenced by GRAPHIC_EDIT_TOOL::runInteractive().
|
private |
Definition at line 65 of file hover_picker.h.
Referenced by Brighten(), BrightenOnly(), and ClearBrightening().
|
private |
Definition at line 64 of file hover_picker.h.
Referenced by Brighten(), BrightenOnly(), ClearBrightening(), HOVER_PICKER(), and Pick().
|
private |
Definition at line 63 of file hover_picker.h.
Referenced by BrightenOnly(), ClearBrightening(), and HOVER_PICKER().