53 if(
m_items.erase( aItem ) == 1 )
66 item->SetParentGroup(
nullptr );
78 && !aFootprintEditor )
89 return candidate == aScope ? nullptr : candidate;
106 if( parent == scope )
145 newGroup->
AddItem( static_cast<PCB_GROUP*>( member )->DeepClone() );
147 newGroup->
AddItem( static_cast<BOARD_ITEM*>( member->Clone() ) );
162 newGroup->
AddItem( static_cast<PCB_GROUP*>( member )->DeepDuplicate() );
164 newGroup->
AddItem( static_cast<BOARD_ITEM*>( member->Duplicate() ) );
198 area.
Merge( item->GetBoundingBox() );
208 for(
const KICAD_T* stype = aScanTypes; *stype !=
EOT; ++stype )
211 if( *stype ==
Type() )
227 aSet |= item->GetLayerSet();
238 if( item->IsOnLayer( aLayer ) )
258 return std::numeric_limits<double>::max();
265 member->Move( aMoveVector );
272 item->Rotate( aRotCentre, aAngle );
279 item->Flip( aCentre, aFlipLeftRight );
305 aList.emplace_back(
_(
"Group" ),
m_name.empty() ?
_(
"<unnamed>" ) :
m_name );
317 catch( std::bad_function_call& )
319 wxFAIL_MSG( wxT(
"Error calling function in PCB_GROUP::RunOnChildren" ) );
333 static_cast<PCB_GROUP*>( item )->RunOnDescendants( aFunction );
336 catch( std::bad_function_call& )
338 wxFAIL_MSG( wxT(
"Error calling function in PCB_GROUP::RunOnDescendants" ) );
PCB_GROUP * GetParentGroup() const
void ViewGetLayers(int aLayers[], int &aCount) const override
bool AddItem(BOARD_ITEM *aItem)
Add item to group.
wxString GetSelectMenuText(EDA_UNITS aUnits) const override
Return a pointer to an image to be used in menus.
const BITMAP_OPAQUE module_xpm[1]
void Merge(const EDA_RECT &aRect)
Modify the position and size of the rectangle in order to contain aRect.
PNG memory record (file in memory).
void SwapData(BOARD_ITEM *aImage) override
Test to see if this object is on the given layer.
static bool WithinScope(BOARD_ITEM *item, PCB_GROUP *scope)
This file is part of the common library.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
class PCB_GROUP, a set of BOARD_ITEMs
A set of BOARD_ITEMs (i.e., without duplicates).
anchor of items having an anchor point (texts, footprints)
wxPoint GetPosition() const override
SEARCH_RESULT Visit(INSPECTOR aInspector, void *aTestData, const KICAD_T aScanTypes[]) override
PCB_GROUP * DeepClone() const
const EDA_RECT GetBoundingBox() const override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
The base class for create windows for drawing purpose.
void Flip(const wxPoint &aCentre, bool aFlipLeftRight) override
Return the text to display to be used in the selection clarification context menu when multiple items...
PCB_GROUP * DeepDuplicate() const
Swap data between aItem and aImage.
const INSPECTOR_FUNC & INSPECTOR
search types array terminator (End Of Types)
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void Rotate(const wxPoint &aRotCentre, double aAngle) override
Flip this object, i.e.
PCB_LAYER_ID
A quick note on layer IDs:
LSET is a set of PCB_LAYER_IDs.
static PCB_GROUP * TopLevelGroup(BOARD_ITEM *aItem, PCB_GROUP *aScope, bool aFootprintEditor)
bool HitTest(const wxPoint &aPosition, int aAccuracy=0) const override
Test if aPosition is contained within or on the bounding box of an item.
void Move(const wxPoint &aMoveVector) override
Rotate this object.
LSET GetLayerSet() const override
Set the layer this item is on.
bool RemoveItem(BOARD_ITEM *aItem)
Remove item from group.
void RunOnDescendants(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all descendants of the group.
BITMAP_DEF GetMenuImage() const override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
double ViewGetLOD(int aLayer, KIGFX::VIEW *aView) const override
Move this object.
class FOOTPRINT, a footprint
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
bool IsOnLayer(PCB_LAYER_ID aLayer) const override
Test if aPosition is contained within or on the bounding box of an item.
void SetPosition(const wxPoint &aNewpos) override
Return a std::bitset of all layers on which the item physically resides.
Handle the component boundary box.
A base class for most all the KiCad significant classes used in schematics and boards.
void RunOnChildren(const std::function< void(BOARD_ITEM *)> &aFunction) const
Invoke a function on all members of the group.
virtual BOARD_ITEM * Duplicate() const
Create a copy of a of this BOARD_ITEM.
Hold a (potentially large) number of VIEW_ITEMs and renders them on a graphics device provided by the...
Message panel definition file.
BOARD_ITEM_CONTAINER * GetParent() const
static constexpr int Millimeter2iu(double mm)
std::unordered_set< BOARD_ITEM * > m_items
PCB_GROUP(BOARD_ITEM *aParent)
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
EDA_RECT & Inflate(wxCoord dx, wxCoord dy)
Inflate the rectangle horizontally by dx and vertically by dy.
KICAD_T Type() const
Returns the type of object.
bool IsLayerVisible(int aLayer) const
Return information about visibility of a particular layer.
void SetParentGroup(PCB_GROUP *aGroup)