KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDA_GROUP Class Referenceabstract

A set of EDA_ITEMs (i.e., without duplicates). More...

#include <eda_group.h>

Inheritance diagram for EDA_GROUP:
PCB_GROUP SCH_GROUP PCB_GENERATOR PCB_GENERATOR_POLY PCB_TUNING_PATTERN PCB_VIA_STACK PCB_VIA_STITCH BASELINE_ACCESSOR

Public Member Functions

virtual EDA_ITEMAsEdaItem ()=0
 
virtual ~EDA_GROUP ()=default
 
virtual bool DeserializeGroup (const google::protobuf::Any &aContainer, COMMIT *aCommit)=0
 Deserializes the given protobuf message into this group.
 
wxString GetName () const
 
void SetName (const wxString &aName)
 
std::unordered_set< EDA_ITEM * > & GetItems ()
 
const std::unordered_set< EDA_ITEM * > & GetItems () const
 
bool ContainsItem (const EDA_ITEM *aItem) const
 Test if an item is a direct or nested member of this group.
 
void AddItem (EDA_ITEM *aItem)
 Add item to group.
 
void RemoveItem (EDA_ITEM *aItem)
 Remove item from group.
 
void RemoveAll ()
 
std::vector< KIIDGetGroupMemberIds () const
 
bool HasDesignBlockLink () const
 
void SetDesignBlockLibId (const LIB_ID &aLibId)
 
const LIB_IDGetDesignBlockLibId () const
 

Protected Attributes

std::unordered_set< EDA_ITEM * > m_items
 
wxString m_name
 
LIB_ID m_designBlockLibId
 

Detailed Description

A set of EDA_ITEMs (i.e., without duplicates).

The group parent is always board/sheet, not logical parent group. The group is transparent container - e.g., its position is derived from the position of its members. A selection containing a group implicitly contains its members. However other operations on sets of items, like committing, updating the view, etc the set is explicit.

Definition at line 42 of file eda_group.h.

Constructor & Destructor Documentation

◆ ~EDA_GROUP()

virtual EDA_GROUP::~EDA_GROUP ( )
virtualdefault

Member Function Documentation

◆ AddItem()

void EDA_GROUP::AddItem ( EDA_ITEM * aItem)

Add item to group.

Does not take ownership of item.

Definition at line 58 of file eda_group.cpp.

References AsEdaItem(), EDA_ITEM::GetParentGroup(), group, m_items, and EDA_ITEM::SetParentGroup().

Referenced by PCB_VIA_STACK::addMember(), CADSTAR_PCB_ARCHIVE_LOADER::addToGroup(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), PCB_GENERATOR::DeepClone(), PCB_GROUP::DeepClone(), SCH_GROUP::DeepClone(), PCB_GROUP::DeepDuplicate(), SCH_GROUP::DeepDuplicate(), PCB_GROUP::DeserializeGroup(), SCH_GROUP::DeserializeGroup(), SCH_DRAWING_TOOLS::DrawSheet(), PCB_VIA_STITCH::EditCancel(), PCB_TUNING_PATTERN::EditFinish(), BOARD::ExchangeFootprint(), API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), CADSTAR_PCB_ARCHIVE_LOADER::loadGroups(), GENERATOR_TOOL::MakeViaStackFromSelection(), FOOTPRINT::operator=(), SCH_COMMIT::pushSchEdit(), SPRINT_LAYOUT_PARSER::resolveGroups(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), PCB_VIA_STITCH::Update(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), and BOARD_NETLIST_UPDATER::updateFootprintGroup().

◆ AsEdaItem()

◆ ContainsItem()

bool EDA_GROUP::ContainsItem ( const EDA_ITEM * aItem) const

Test if an item is a direct or nested member of this group.

Definition at line 26 of file eda_group.cpp.

References group.

◆ DeserializeGroup()

virtual bool EDA_GROUP::DeserializeGroup ( const google::protobuf::Any & aContainer,
COMMIT * aCommit )
pure virtual

Deserializes the given protobuf message into this group.

Groups may contain references to items in the current commit that are not yet present in the board or schematic. When necessary, items in the provided commit are used when populating the items contained in the group.

Parameters
aContaineris a protobuf message to be unpacked and deserialized.
aCommitis an active commit which may contain new items that belong in the group.
Returns
true if unpacking and deserialization succeeded.

Implemented in PCB_GROUP, and SCH_GROUP.

◆ GetDesignBlockLibId()

const LIB_ID & EDA_GROUP::GetDesignBlockLibId ( ) const
inline

◆ GetGroupMemberIds()

std::vector< KIID > EDA_GROUP::GetGroupMemberIds ( ) const

Definition at line 95 of file eda_group.cpp.

References m_items.

◆ GetItems() [1/2]

◆ GetItems() [2/2]

const std::unordered_set< EDA_ITEM * > & EDA_GROUP::GetItems ( ) const
inline

Definition at line 65 of file eda_group.h.

References m_items.

◆ GetName()

◆ HasDesignBlockLink()

bool EDA_GROUP::HasDesignBlockLink ( ) const
inline

◆ RemoveAll()

◆ RemoveItem()

◆ SetDesignBlockLibId()

◆ SetName()

Member Data Documentation

◆ m_designBlockLibId

LIB_ID EDA_GROUP::m_designBlockLibId
protected

◆ m_items

◆ m_name


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