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

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_LISTm_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
 

Detailed Description

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.

Member Enumeration Documentation

◆ FP_FILTER_T

enum FOOTPRINT_FILTER::FP_FILTER_T : int
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.

Constructor & Destructor Documentation

◆ FOOTPRINT_FILTER() [1/2]

FOOTPRINT_FILTER::FOOTPRINT_FILTER ( FOOTPRINT_LIST aList)

Construct a filter.

Parameters
aList- unfiltered list of footprints

Definition at line 161 of file footprint_filter.cpp.

References SetList().

◆ FOOTPRINT_FILTER() [2/2]

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.

Member Function Documentation

◆ begin()

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.

◆ ClearFilters()

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().

◆ end()

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.

◆ FilterByFootprintFilters()

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().

◆ FilterByLibrary()

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.

◆ FilterByPinCount()

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().

◆ FilterByTextPattern()

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.

◆ SetList()

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().

Member Data Documentation

◆ m_filter_pattern

wxString FOOTPRINT_FILTER::m_filter_pattern
private

Definition at line 141 of file footprint_filter.h.

Referenced by FilterByTextPattern().

◆ m_filter_type

int FOOTPRINT_FILTER::m_filter_type
private

◆ m_footprint_filters

std::vector<std::unique_ptr<EDA_PATTERN_MATCH> > FOOTPRINT_FILTER::m_footprint_filters
private

Definition at line 146 of file footprint_filter.h.

Referenced by FilterByFootprintFilters().

◆ m_lib_name

wxString FOOTPRINT_FILTER::m_lib_name
private

Definition at line 140 of file footprint_filter.h.

Referenced by FilterByLibrary().

◆ m_list

FOOTPRINT_LIST* FOOTPRINT_FILTER::m_list
private

Definition at line 138 of file footprint_filter.h.

Referenced by FOOTPRINT_FILTER::ITERATOR::dereference(), end(), and SetList().

◆ m_pattern_filters

std::vector<std::unique_ptr<EDA_COMBINED_MATCHER> > FOOTPRINT_FILTER::m_pattern_filters
private

Definition at line 145 of file footprint_filter.h.

Referenced by FilterByTextPattern().

◆ m_pin_count

int FOOTPRINT_FILTER::m_pin_count
private

Definition at line 142 of file footprint_filter.h.

Referenced by FilterByPinCount().


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