35 return !aSelection.
Empty();
83 for(
const auto& item : aSelection )
85 if( item->Type() == aType )
95 if( aSelection.
Empty() )
98 for(
const auto& item : aSelection )
100 if( item->Type() != aType )
110 if( aSelection.
Empty() )
113 for(
const auto& item : aSelection )
117 for( std::vector<KICAD_T>::const_iterator it = aTypes.begin(); it != aTypes.end(); ++it )
119 if( item->Type() == *it )
136 if( aSelection.
Empty() )
139 for(
const auto& item : aSelection )
144 while( *type !=
EOT )
146 if( item->Type() == *type )
165 return aSelection.
Size() == aNumber;
171 return aSelection.
Size() > aNumber;
177 return aSelection.
Size() < aNumber;
bool Empty() const
Checks if there is anything selected.
static bool onlyTypeFunc(const SELECTION &aSelection, KICAD_T aType)
Helper function used by OnlyType()
static bool countFunc(const SELECTION &aSelection, int aNumber)
Helper function used by Count()
static SELECTION_CONDITION MoreThan(int aNumber)
Function MoreThan Creates a functor that tests if the number of selected items is greater than the va...
static bool lessThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by LessThan()
static SELECTION_CONDITION HasType(KICAD_T aType)
Function HasType Creates a functor that tests if among the selected items there is at least one of a ...
static SELECTION_CONDITION Count(int aNumber)
Function Count Creates a functor that tests if the number of selected items is equal to the value giv...
static bool NotEmpty(const SELECTION &aSelection)
Function NotEmpty Tests if there are any items selected.
search types array terminator (End Of Types)
KICAD_T
Enum KICAD_T is the set of class identification values, stored in EDA_ITEM::m_StructType.
static bool orFunc(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection)
Helper function used by operator||
static bool onlyTypesFunc(const SELECTION &aSelection, const std::vector< KICAD_T > &aTypes)
Helper function used by OnlyTypes()
SELECTION_CONDITION operator&&(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB)
static SELECTION_CONDITION LessThan(int aNumber)
Function LessThan Creates a functor that tests if the number of selected items is smaller than the va...
static SELECTION_CONDITION OnlyTypes(const std::vector< KICAD_T > &aTypes)
Function OnlyTypes Creates a functor that tests if the selected items are only of given types...
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.
SELECTION_CONDITION operator||(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB)
static bool hasTypeFunc(const SELECTION &aSelection, KICAD_T aType)
Helper function used by HasType()
static bool onlyTypesFuncArr(const SELECTION &aSelection, const KICAD_T aTypes[])
static SELECTION_CONDITION OnlyType(KICAD_T aType)
Function OnlyType Creates a functor that tests if the selected items are only of given type...
static bool andFunc(const SELECTION_CONDITION &aConditionA, const SELECTION_CONDITION &aConditionB, const SELECTION &aSelection)
Helper function used by operator&&
int Size() const
Returns the number of selected parts.
static bool moreThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by MoreThan()