35 std::set<const EDA_GROUP*> visitedGroups;
36 std::vector<const EDA_GROUP*> pendingGroups;
38 pendingGroups.push_back(
this );
40 while( !pendingGroups.empty() )
43 pendingGroups.pop_back();
45 if( !visitedGroups.insert(
group ).second )
54 pendingGroups.push_back( childGroup );
64 wxCHECK_RET( aItem, wxT(
"Nullptr added to group." ) );
65 wxCHECK_RET( aItem !=
AsEdaItem(), wxT(
"Group added to itself." ) );
69 wxCHECK_RET( !
group->ContainsItem(
AsEdaItem() ), wxT(
"Ancestor group added to group." ) );
74 parentGroup->RemoveItem( aItem );
83 wxCHECK_RET( aItem, wxT(
"Nullptr removed from group." ) );
85 if(
m_items.erase( aItem ) == 1 )
93 item->SetParentGroup(
nullptr );
101 std::vector<KIID> members;
104 members.push_back( item->m_Uuid );
A set of EDA_ITEMs (i.e., without duplicates).
std::unordered_set< EDA_ITEM * > m_items
void RemoveItem(EDA_ITEM *aItem)
Remove item from group.
void AddItem(EDA_ITEM *aItem)
Add item to group.
bool ContainsItem(const EDA_ITEM *aItem) const
Test if an item is a direct or nested member of this group.
std::vector< KIID > GetGroupMemberIds() const
virtual EDA_ITEM * AsEdaItem()=0
A base class for most all the KiCad significant classes used in schematics and boards.
virtual EDA_GROUP * GetParentGroup() const
virtual void SetParentGroup(EDA_GROUP *aGroup)