52 for(
int i = aCollector.
GetCount() - 1; i >= 0; --i )
54 if( !aAccepts( *aCollector[i] ) )
59 if( candidates.empty() )
63 return candidates.front();
66 double bestProximity = std::numeric_limits<double>::infinity();
70 double proximity = aProximity( *item, aPointer );
72 if( proximity < bestProximity )
74 bestProximity = proximity;
92 std::set<KIID> wanted;
95 wanted.insert( item->m_Uuid );
101 if( !wanted.contains(
id ) )
112 if( !lit.contains( item->m_Uuid ) )
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
BOARD_ITEM * ResolveItem(const KIID &aID, bool aAllowNullptrReturn=false) const
int GetCount() const
Return the number of objects in the list.
void Remove(int aIndex)
Remove the item at aIndex (first position is 0).
Used when the right click button is pressed, or when the select tool is in effect.
PCB_SELECTION_TOOL * m_selectionTool
void Brighten(BOARD_ITEM *aItem)
HOVER_PICKER(TOOL_MANAGER *aToolMgr)
std::function< double(const BOARD_ITEM &aItem, const VECTOR2I &aPointer)> PROXIMITY
Optional tie-break among what the selection heuristics left. Nearest wins.
~HOVER_PICKER()
Puts back whatever is still lit, so an early exit cannot strand a highlight.
std::function< bool(BOARD_ITEM &aItem)> ACCEPTS
Everything it sees is already selectable.
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.
BOARD_ITEM * Pick(const VECTOR2I &aPointer, const ACCEPTS &aAccepts, const PROXIMITY &aProximity=nullptr) const
The item a click would take, or null.
std::vector< KIID > m_brightened
VECTOR2< int32_t > VECTOR2I