31 using namespace std::placeholders;
38 if( aSelection.
Empty() )
41 for(
const auto &item : aSelection )
43 auto type = item->Type();
74 if( aSelection.
Empty() )
79 for(
const auto& aitem : aSelection )
81 int current_netcode = -1;
84 dynamic_cast<const BOARD_CONNECTED_ITEM*>( aitem );
92 if( !aAllowUnconnected )
99 assert( current_netcode >= 0 );
103 netcode = current_netcode;
108 else if( netcode != current_netcode )
120 if( aSelection.
Empty() )
126 for(
const auto& i : aSelection )
128 auto item = static_cast<BOARD_ITEM*>( i );
129 layerSet &= item->GetLayerSet();
131 if( !layerSet.any() )
140 const std::set<SHAPE_T> aTypes )
142 if( aSelection.
Empty() )
145 for(
const EDA_ITEM* item : aSelection )
150 SHAPE_T shape = static_cast<const PCB_SHAPE*>( item )->GetShape();
152 if( !aTypes.count( shape ) )
static bool sameLayerFunc(const SELECTION &aSelection)
Helper function used by OnlyGraphicShapeTypes()
Class that groups generic conditions for selected items.
class FP_SHAPE, a footprint edge
class PAD, a pad in a footprint
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
static SELECTION_CONDITION SameLayer()
Creates a functor that tests if selection contains items that belong exclusively to the same layer.
static SELECTION_CONDITION OnlyGraphicShapeTypes(const std::set< SHAPE_T > aTypes)
Create a functor that tests if the selection contains PCB_SHAPE* items of certain shapes.
class PCB_TRACK, a track segment (segment on a copper layer)
LSET is a set of PCB_LAYER_IDs.
static bool onlyGraphicShapeTypesFunc(const SELECTION &aSelection, const std::set< SHAPE_T > aTypes)
class ZONE, a copper pour area
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
bool Empty() const
Checks if there is anything selected.
A base class for most all the KiCad significant classes used in schematics and boards.
static SELECTION_CONDITION SameNet(bool aAllowUnconnected=false)
Create a functor that tests if selection contains items belonging to the same net or are unconnected ...
class PCB_VIA, a via (like a track segment on a copper layer)
static bool sameNetFunc(const SELECTION &aSelection, bool aAllowUnconnected)
< Helper function used by SameNet()
class PCB_SHAPE, a segment not on copper layers
static const int UNCONNECTED
Constant that forces initialization of a netinfo item to the NETINFO_ITEM ORPHANED (typically -1) whe...
static bool OnlyConnectedItems(const SELECTION &aSelection)
Test if selection contains exclusively connected items (pads, tracks, vias, zones).