|
KiCad PCB EDA Suite
|
A set of EDA_ITEMs (i.e., without duplicates). More...
#include <eda_group.h>
Public Member Functions | |
| virtual EDA_ITEM * | AsEdaItem ()=0 |
| virtual | ~EDA_GROUP ()=default |
| virtual bool | DeserializeGroup (const google::protobuf::Any &aContainer, COMMIT *aCommit)=0 |
| Deserializes the given protobuf message into this group. | |
| virtual void | FinalizeGroupDeserialization () |
| 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< KIID > | GetGroupMemberIds () const |
| bool | HasDesignBlockLink () const |
| void | SetDesignBlockLibId (const LIB_ID &aLibId) |
| const LIB_ID & | GetDesignBlockLibId () const |
Protected Attributes | |
| std::unordered_set< EDA_ITEM * > | m_items |
| wxString | m_name |
| LIB_ID | m_designBlockLibId |
| std::unordered_set< EDA_ITEM * > | m_deserializedItems |
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.
|
virtualdefault |
| 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_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(), BOOST_FIXTURE_TEST_CASE(), checkGroupChannelRepeatLayout(), PCB_GENERATOR::DeepClone(), PCB_GROUP::DeepClone(), SCH_GROUP::DeepClone(), PCB_GROUP::DeepDuplicate(), SCH_GROUP::DeepDuplicate(), SCH_DRAWING_TOOLS::DrawSheet(), PCB_VIA_STITCH::EditCancel(), PCB_TUNING_PATTERN::EditFinish(), BOARD::ExchangeFootprint(), FinalizeGroupDeserialization(), 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().
|
pure virtual |
Implemented in PCB_GROUP, and SCH_GROUP.
Referenced by AddItem(), GROUP_TOOL::AddToGroup(), MULTICHANNEL_TOOL::AutogenerateRuleAreas(), BOOST_FIXTURE_TEST_CASE(), MULTICHANNEL_TOOL::copyRuleAreaContents(), EDIT_TOOL::DeleteItems(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), EDIT_TOOL::doMoveSelection(), BOARD::ExchangeFootprint(), VIA_STITCH_TOOL::ExcludeStitchVia(), PCB_PROPERTIES_PANEL::filterOutReadOnlyGenChildren(), MULTICHANNEL_TOOL::GeneratePotentialRuleAreas(), PCB_SELECTION_TOOL::Main(), BOARD_EDITOR_CONTROL::modifyLockSelected(), EDIT_TOOL::Properties(), BOARD_COMMIT::Push(), PCB_SELECTION_TOOL::Selectable(), PCB_SELECTION_TOOL::selectAllConnectedTracks(), DIALOG_GROUP_PROPERTIES::TransferDataFromWindow(), PCB_SELECTION_TOOL::unrouteSegment(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::visitItem(), PCB_GROUP::WithinScope(), and SCH_GROUP::WithinScope().
| 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.
|
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.
NB: this routine only adds members to the group's m_deserializedItems list. They must be added to the proper members list (m_items) by FinalizeGroupDeserialization() once the group has passed all the sanity checks and will be kept). Otherwise we can end up with dangling parentGroup pointers in the member items if the group ends up being thrown away.
| aContainer | is a protobuf message to be unpacked and deserialized. |
| aCommit | is an active commit which may contain new items that belong in the group. |
|
inlinevirtual |
Definition at line 66 of file eda_group.h.
References AddItem(), and m_deserializedItems.
Referenced by API_HANDLER_BOARD::handleCreateUpdateItemsInternal(), and API_HANDLER_SCH::handleCreateUpdateItemsInternal().
|
inline |
Definition at line 102 of file eda_group.h.
References m_designBlockLibId.
Referenced by PCB_IO_KICAD_SEXPR::format(), SCH_IO_KICAD_SEXPR::saveGroup(), PCB_GROUP::Serialize(), and PCB_EDIT_FRAME::UpdateDesignBlockFromSelection().
| std::vector< KIID > EDA_GROUP::GetGroupMemberIds | ( | ) | const |
Definition at line 95 of file eda_group.cpp.
References m_items.
|
inline |
Definition at line 78 of file eda_group.h.
References m_items.
Referenced by 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_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_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), collectGroupBoardItems(), collectGroupFootprints(), MULTICHANNEL_TOOL::copyRuleAreaContents(), EDIT_TOOL::DeleteItems(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_SELECTION_TOOL::itemPassesFilter(), FOOTPRINT::operator=(), PCB_VIA_STACK::Regenerate(), BOARD_INSPECTION_TOOL::reportClearance(), PCB_VIA_STACK::reuseMembers(), SCH_IO_KICAD_SEXPR::saveGroup(), PCB_GROUP::Serialize(), PCB_TUNING_PATTERN::Serialize(), PCB_VIA_STACK::Serialize(), PCB_VIA_STITCH::Serialize(), testGroupEqual(), and BOARD_NETLIST_UPDATER::updateFootprintGroup().
|
inline |
Definition at line 79 of file eda_group.h.
References m_items.
|
inline |
Definition at line 75 of file eda_group.h.
References m_name.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), createBoard(), KIGFX::PCB_PAINTER::draw(), KIGFX::SCH_PAINTER::draw(), PCB_IO_KICAD_SEXPR::format(), PCB_IO_KICAD_SEXPR::format(), PCB_GROUP::Matches(), SCH_GROUP::Matches(), PCB_GROUP_DESC::PCB_GROUP_DESC(), SCH_IO_KICAD_SEXPR::saveGroup(), SCH_GROUP_DESC::SCH_GROUP_DESC(), PCB_GROUP::Serialize(), SCH_GROUP::Serialize(), testGroupEqual(), BOARD_NETLIST_UPDATER::updateFootprintGroup(), and BOARD_NETLIST_UPDATER::updateGroups().
|
inline |
Definition at line 99 of file eda_group.h.
References m_designBlockLibId.
Referenced by PCB_CONTROL::ApplyDesignBlockLayout(), PCB_IO_KICAD_SEXPR::format(), PCB_SELECTION_TOOL::Init(), SCH_IO_KICAD_SEXPR::saveGroup(), and PCB_GROUP::Serialize().
| void EDA_GROUP::RemoveAll | ( | ) |
Definition at line 86 of file eda_group.cpp.
References m_items.
Referenced by PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), and BOARD_NETLIST_UPDATER::updateFootprintGroup().
| void EDA_GROUP::RemoveItem | ( | EDA_ITEM * | aItem | ) |
Remove item from group.
Definition at line 77 of file eda_group.cpp.
References m_items, and EDA_ITEM::SetParentGroup().
Referenced by BOARD::ExchangeFootprint(), PCB_CONTROL::Paste(), BOARD_COMMIT::Push(), PCB_VIA_STACK::Regenerate(), PCB_VIA_STITCH::Update(), and BOARD_NETLIST_UPDATER::updateFootprintGroup().
|
inline |
Definition at line 101 of file eda_group.h.
References m_designBlockLibId.
Referenced by PCB_GROUP::DeserializeGroup(), SCH_DRAWING_TOOLS::DrawSheet(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), and SCH_EDIT_FRAME::UpdateDesignBlockFromSelection().
|
inline |
Definition at line 76 of file eda_group.h.
References m_name.
Referenced by 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(), BOOST_FIXTURE_TEST_CASE(), checkGroupChannelRepeatLayout(), createBoard(), CADSTAR_PCB_ARCHIVE_LOADER::createUniqueGroupID(), PCB_GROUP::DeserializeGroup(), SCH_GROUP::DeserializeGroup(), SCH_DRAWING_TOOLS::DrawSheet(), CADSTAR_PCB_ARCHIVE_LOADER::loadGroups(), PCB_GROUP_DESC::PCB_GROUP_DESC(), PCB_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_EDIT_FRAME::SaveSelectionAsDesignBlock(), SCH_GROUP_DESC::SCH_GROUP_DESC(), PCB_EDIT_FRAME::UpdateDesignBlockFromSelection(), SCH_EDIT_FRAME::UpdateDesignBlockFromSelection(), and BOARD_NETLIST_UPDATER::updateFootprintGroup().
|
protected |
Definition at line 109 of file eda_group.h.
Referenced by PCB_TUNING_PATTERN::Deserialize(), PCB_VIA_STACK::Deserialize(), PCB_VIA_STITCH::Deserialize(), PCB_GROUP::DeserializeGroup(), SCH_GROUP::DeserializeGroup(), and FinalizeGroupDeserialization().
|
protected |
Definition at line 107 of file eda_group.h.
Referenced by GetDesignBlockLibId(), HasDesignBlockLink(), SetDesignBlockLibId(), and SCH_GROUP::swapData().
|
protected |
Definition at line 105 of file eda_group.h.
Referenced by AddItem(), PCB_GENERATOR::DeepClone(), PCB_GROUP::DeepClone(), SCH_GROUP::DeepClone(), PCB_GROUP::DeepDuplicate(), SCH_GROUP::DeepDuplicate(), PCB_TUNING_PATTERN::Deserialize(), PCB_VIA_STACK::Deserialize(), PCB_VIA_STITCH::Deserialize(), PCB_GROUP::DeserializeGroup(), SCH_GROUP::DeserializeGroup(), PCB_GROUP::Flip(), PCB_GROUP::GetBoardItems(), PCB_GROUP::GetBoundingBox(), PCB_TUNING_PATTERN::GetBoundingBox(), SCH_GROUP::GetBoundingBox(), GetGroupMemberIds(), PCB_GROUP::GetItemDescription(), SCH_GROUP::GetItemDescription(), GetItems(), GetItems(), PCB_GROUP::GetLayerSet(), PCB_GROUP::GetMsgPanelInfo(), SCH_GROUP::GetMsgPanelInfo(), SCH_GROUP::GetSchItems(), PCB_GROUP::IsOnLayer(), PCB_GROUP::Mirror(), SCH_GROUP::MirrorHorizontally(), SCH_GROUP::MirrorVertically(), PCB_GROUP::Move(), SCH_GROUP::Move(), PCB_GROUP::operator==(), SCH_GROUP::operator==(), RemoveAll(), RemoveItem(), PCB_GROUP::Rotate(), SCH_GROUP::Rotate(), SCH_GROUP::RunOnChildren(), SCH_GROUP::Serialize(), PCB_TUNING_PATTERN::ShowPropertiesDialog(), PCB_GROUP::Similarity(), SCH_GROUP::Similarity(), and SCH_GROUP::swapData().
|
protected |
Definition at line 106 of file eda_group.h.
Referenced by PCB_GROUP::GetItemDescription(), SCH_GROUP::GetItemDescription(), PCB_GROUP::GetMsgPanelInfo(), SCH_GROUP::GetMsgPanelInfo(), GetName(), PCB_TUNING_PATTERN::PCB_TUNING_PATTERN(), PCB_VIA_STACK::PCB_VIA_STACK(), PCB_VIA_STITCH::PCB_VIA_STITCH(), SetName(), and SCH_GROUP::swapData().