KiCad PCB EDA Suite
|
Footprint display filter. More...
#include <footprint_filter.h>
Classes | |
class | ITERATOR |
Inner iterator class returned by begin() and end(). More... | |
Public Member Functions | |
FOOTPRINT_FILTER (FOOTPRINT_LIST &aList) | |
Construct a filter. | |
FOOTPRINT_FILTER () | |
Construct a filter without assigning a footprint list. | |
void | SetList (FOOTPRINT_LIST &aList) |
Set the list to filter. | |
void | ClearFilters () |
Clear all filter criteria. | |
void | FilterByLibrary (const wxString &aLibName) |
Add library name to filter criteria. | |
void | FilterByPinCount (int aPinCount) |
Set a pin count to filter by. | |
void | FilterByFootprintFilters (const wxArrayString &aFilters) |
Set a list of footprint filters to filter by. | |
void | FilterByTextPattern (const wxString &aPattern) |
Add a pattern to filter by name, including wildcards and optionally a colon-delimited library name. | |
ITERATOR | begin () |
Get an iterator to the beginning of the filtered view. | |
ITERATOR | end () |
Get an iterator to the end of the filtered view. | |
Private Types | |
enum | FP_FILTER_T : int { UNFILTERED_FP_LIST = 0 , FILTERING_BY_COMPONENT_FP_FILTER = 0x0001 , FILTERING_BY_PIN_COUNT = 0x0002 , FILTERING_BY_LIBRARY = 0x0004 , FILTERING_BY_TEXT_PATTERN = 0x0008 } |
Filter setting constants. More... | |
Private Attributes | |
FOOTPRINT_LIST * | m_list |
wxString | m_lib_name |
wxString | m_filter_pattern |
int | m_pin_count |
int | m_filter_type |
std::vector< std::unique_ptr< EDA_COMBINED_MATCHER > > | m_pattern_filters |
std::vector< std::unique_ptr< EDA_PATTERN_MATCH > > | m_footprint_filters |
Footprint display filter.
Takes a list of footprints and filtering settings, and provides an iterable view of the filtered data.
Definition at line 33 of file footprint_filter.h.
|
private |
Filter setting constants.
The filter type is a bitwise OR of these flags, and only footprints matching all selected filter types are shown.
Enumerator | |
---|---|
UNFILTERED_FP_LIST | |
FILTERING_BY_COMPONENT_FP_FILTER | |
FILTERING_BY_PIN_COUNT | |
FILTERING_BY_LIBRARY | |
FILTERING_BY_TEXT_PATTERN |
Definition at line 129 of file footprint_filter.h.
FOOTPRINT_FILTER::FOOTPRINT_FILTER | ( | FOOTPRINT_LIST & | aList | ) |
Construct a filter.
aList | - unfiltered list of footprints |
Definition at line 161 of file footprint_filter.cpp.
References SetList().
FOOTPRINT_FILTER::FOOTPRINT_FILTER | ( | ) |
Construct a filter without assigning a footprint list.
The filter MUST NOT be iterated over until SetList() is called.
Definition at line 168 of file footprint_filter.cpp.
FOOTPRINT_FILTER_IT FOOTPRINT_FILTER::begin | ( | ) |
Get an iterator to the beginning of the filtered view.
Definition at line 232 of file footprint_filter.cpp.
void FOOTPRINT_FILTER::ClearFilters | ( | ) |
Clear all filter criteria.
Definition at line 182 of file footprint_filter.cpp.
References m_filter_type, and UNFILTERED_FP_LIST.
Referenced by FOOTPRINT_SELECT_WIDGET::ClearFilters().
FOOTPRINT_FILTER_IT FOOTPRINT_FILTER::end | ( | ) |
Get an iterator to the end of the filtered view.
The end iterator is invalid and may not be dereferenced, only compared against.
Definition at line 238 of file footprint_filter.cpp.
References FOOTPRINT_LIST::GetCount(), m_list, and FOOTPRINT_FILTER::ITERATOR::m_pos.
void FOOTPRINT_FILTER::FilterByFootprintFilters | ( | const wxArrayString & | aFilters | ) |
Set a list of footprint filters to filter by.
Definition at line 202 of file footprint_filter.cpp.
References FILTERING_BY_COMPONENT_FP_FILTER, m_filter_type, and m_footprint_filters.
Referenced by FOOTPRINT_SELECT_WIDGET::FilterByFootprintFilters().
void FOOTPRINT_FILTER::FilterByLibrary | ( | const wxString & | aLibName | ) |
Add library name to filter criteria.
Definition at line 188 of file footprint_filter.cpp.
References FILTERING_BY_LIBRARY, m_filter_type, and m_lib_name.
void FOOTPRINT_FILTER::FilterByPinCount | ( | int | aPinCount | ) |
Set a pin count to filter by.
Definition at line 195 of file footprint_filter.cpp.
References FILTERING_BY_PIN_COUNT, m_filter_type, and m_pin_count.
Referenced by FOOTPRINT_SELECT_WIDGET::FilterByPinCount().
void FOOTPRINT_FILTER::FilterByTextPattern | ( | const wxString & | aPattern | ) |
Add a pattern to filter by name, including wildcards and optionally a colon-delimited library name.
Definition at line 216 of file footprint_filter.cpp.
References CTX_LIBITEM, FILTERING_BY_TEXT_PATTERN, m_filter_pattern, m_filter_type, and m_pattern_filters.
void FOOTPRINT_FILTER::SetList | ( | FOOTPRINT_LIST & | aList | ) |
Set the list to filter.
Definition at line 176 of file footprint_filter.cpp.
References m_list.
Referenced by FOOTPRINT_FILTER(), and FOOTPRINT_SELECT_WIDGET::Load().
|
private |
Definition at line 141 of file footprint_filter.h.
Referenced by FilterByTextPattern().
|
private |
Definition at line 143 of file footprint_filter.h.
Referenced by ClearFilters(), FilterByFootprintFilters(), FilterByLibrary(), FilterByPinCount(), and FilterByTextPattern().
|
private |
Definition at line 146 of file footprint_filter.h.
Referenced by FilterByFootprintFilters().
|
private |
Definition at line 140 of file footprint_filter.h.
Referenced by FilterByLibrary().
|
private |
Definition at line 138 of file footprint_filter.h.
Referenced by FOOTPRINT_FILTER::ITERATOR::dereference(), end(), and SetList().
|
private |
Definition at line 145 of file footprint_filter.h.
Referenced by FilterByTextPattern().
|
private |
Definition at line 142 of file footprint_filter.h.
Referenced by FilterByPinCount().