22#ifndef __PNS_ITEMSET_H
23#define __PNS_ITEMSET_H
39 ITEM_SET(
ITEM* aInitialItem =
nullptr,
bool aBecomeOwner =
false )
42 m_items.emplace_back( aInitialItem );
44 if( aBecomeOwner && aInitialItem )
45 aInitialItem->SetOwner(
this );
66 int Count(
int aKindMask = -1 )
const
71 return static_cast<int>(
m_items.size() );
75 if( item->Kind() & aKindMask )
114 return static_cast<int>(
m_items.size() );
127 std::vector<ITEM*>::const_iterator
cbegin()
const {
return m_items.cbegin(); }
128 std::vector<ITEM*>::const_iterator
cend()
const {
return m_items.cend(); }
130 void Add(
ITEM* aItem,
bool aBecomeOwner =
false )
158 std::vector<ITEM*>::iterator f = std::find(
m_items.begin(),
m_items.end(), aItem );
171 if( item->OfKind( kind ) )
174 return static_cast<T*
>( item );
void Prepend(ITEM *aItem, bool aBecomeOwner=false)
ITEM_SET & operator=(const ITEM_SET &aOther)
int Count(int aKindMask=-1) const
ITEM_SET & FilterNet(NET_HANDLE aNet, bool aInvert=false)
std::vector< ITEM * > m_items
void Add(const LINE &aLine)
ITEM_SET & ExcludeItem(const ITEM *aItem)
std::vector< ITEM * >::const_iterator cbegin() const
ITEM_SET & FilterMarker(int aMarker, bool aInvert=false)
bool Contains(ITEM *aItem) const
ITEM_SET(const ITEM_SET &aOther)
ITEM_SET & FilterKinds(int aKindMask, bool aInvert=false)
ITEM_SET & ExcludeNet(NET_HANDLE aNet)
ITEM_SET & FilterLayers(int aStart, int aEnd=-1, bool aInvert=false)
std::vector< ITEM * > & Items()
ITEM_SET & ExcludeLayers(int aStart, int aEnd=-1)
ITEM_SET(ITEM *aInitialItem=nullptr, bool aBecomeOwner=false)
std::vector< ITEM * >::const_iterator cend() const
ITEM_SET & ExcludeKinds(int aKindMask)
std::vector< ITEM * >::iterator end()
void Prepend(const LINE &aLine)
std::vector< ITEM * >::iterator begin()
ITEM * operator[](size_t aIndex) const
T * FindByKind(ITEM::PnsKind kind, int index=0)
void Add(ITEM *aItem, bool aBecomeOwner=false)
const std::vector< ITEM * > & CItems() const
Base class for PNS router board items.
PnsKind
< Supported item types
Represents a track on a PCB, connecting two non-trivial joints (that is, vias, pads,...
void SetOwner(const ITEM_OWNER *aOwner)
Set the node that owns this item.
Push and Shove diff pair dimensions (gap) settings dialog.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.