|
KiCad PCB EDA Suite
|
Supplies the footprints matching a symbol's footprint filter patterns. More...
Public Member Functions | |
| FP_FILTER_MATCHER (KIWAY &aKiway) | |
| FOOTPRINT_MATCH_RESULT | GetMatches (const std::vector< wxString > &aPatterns) |
| Return the case-insensitively sorted, de-duplicated union of the footprints matching any of the given patterns. | |
| void | PruneCache (const std::vector< wxString > &aPatterns) |
| Drop the cached results for the patterns that are not in aPatterns. | |
Private Member Functions | |
| FOOTPRINT_MATCH_RESULT | fetchMatches (const wxString &aPattern) |
| Return the matches for a single pattern, querying the libraries when it is not cached yet. | |
Private Attributes | |
| KIWAY & | m_kiway |
| std::map< wxString, FOOTPRINT_MATCH_RESULT > | m_cache |
Static Private Attributes | |
| static constexpr int | MAX_MATCH_RESULTS = 500 |
Supplies the footprints matching a symbol's footprint filter patterns.
Queries are made one pattern at a time through the pcbnew kiface and the result for each pattern is cached, so editing one filter re-queries only that filter (and backspacing doesn't trigger a new query for patterns that are already cached).
Definition at line 59 of file panel_footprint_filters.cpp.
|
inlineexplicit |
Definition at line 62 of file panel_footprint_filters.cpp.
References m_kiway.
|
inlineprivate |
Return the matches for a single pattern, querying the libraries when it is not cached yet.
Matching is case-insensitive, so patterns differing only in case share an entry.
Definition at line 131 of file panel_footprint_filters.cpp.
References m_cache, m_kiway, FOOTPRINT_MATCH_QUERY::m_MaxResults, FOOTPRINT_MATCH_QUERY::m_Patterns, MAX_MATCH_RESULTS, QueryMatchingFootprints(), and result.
Referenced by GetMatches().
|
inline |
Return the case-insensitively sorted, de-duplicated union of the footprints matching any of the given patterns.
Definition at line 71 of file panel_footprint_filters.cpp.
References fetchMatches(), FOOTPRINT_MATCH_RESULT::m_IsLimited, FOOTPRINT_MATCH_RESULT::m_MatchingNames, FOOTPRINT_MATCH_RESULT::m_Success, and result.
|
inline |
Drop the cached results for the patterns that are not in aPatterns.
The filter list is the only place a pattern can persist, so dropping the rest keeps the cache bounded. A pattern from a live-preview edit never reaches the list, so it is dropped here once the edit is done.
Definition at line 112 of file panel_footprint_filters.cpp.
References m_cache.
|
private |
Definition at line 157 of file panel_footprint_filters.cpp.
Referenced by fetchMatches(), and PruneCache().
|
private |
Definition at line 156 of file panel_footprint_filters.cpp.
Referenced by fetchMatches(), and FP_FILTER_MATCHER().
|
staticconstexprprivate |
Definition at line 154 of file panel_footprint_filters.cpp.
Referenced by fetchMatches().