63 std::unique_ptr<ARRAY_OPTIONS> array_opts;
67 int ret = dialog.ShowModal();
69 if( ret != wxID_OK || array_opts ==
nullptr )
79 for(
int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ )
104 commit.
Modify( this_item );
117 switch( item->
Type() )
138 this_item =
static_cast<PCB_GROUP*
>( item )->DeepDuplicate();
151 items_for_this_block.
Add( this_item );
161 static_cast<PCB_GROUP*
>( this_item )->RunOnDescendants(
170 static_cast<FOOTPRINT*
>( this_item )->RunOnChildren(
178 commit.
Add( this_item );
185 if( this_item && array_opts->ShouldNumberItems() )
190 PAD&
pad =
static_cast<PAD&
>( *this_item );
192 if(
pad.CanHaveNumber() )
195 pad.SetNumber( newNumber );
207 for(
EDA_ITEM* item : items_for_this_block )
208 all_added_items.push_back( item );
214 commit.
Push(
_(
"Create an array" ) );
static void TransformItem(const ARRAY_OPTIONS &aArrOpts, int aIndex, BOARD_ITEM &aItem)
Transform a BOARD_ITEM from the given ARRAY_OPTIONS and an index into the array.
const PCB_SELECTION m_selection
PCB_BASE_FRAME & m_parent
Options that govern the setup of an "array" of multiple item.
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.
Simple class that sequentially provides numbers from an ARRAY_OPTIONS object, making sure that they d...
wxString GetNextPadNumber()
Get the next available pad name.
virtual void Push(const wxString &aMessage=wxT("A commit"), int aCommitFlags=0) override
Revert the commit by restoring the modified items state.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
Rotate this object.
virtual BOARD_ITEM * Duplicate() const
Create a copy of this BOARD_ITEM.
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
FOOTPRINT * GetParentFootprint() const
FOOTPRINT * GetFirstFootprint() const
Get the first footprint on the board or nullptr.
COMMIT & Modify(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Create an undo entry for an item that has been already modified.
COMMIT & Add(EDA_ITEM *aItem, BASE_SCREEN *aScreen=nullptr)
Notify observers that aItem has been added.
A base class for most all the KiCad significant classes used in schematics and boards.
virtual VECTOR2I GetPosition() const
KICAD_T Type() const
Returns the type of object.
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
A set of BOARD_ITEMs (i.e., without duplicates).
virtual void Add(EDA_ITEM *aItem)
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
int Size() const
Returns the number of selected parts.
std::vector< EDA_ITEM * > EDA_ITEMS
Define list of drawing items for screens.
Class to handle a set of BOARD_ITEMs.
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_DIM_ORTHOGONAL_T
class PCB_DIM_ORTHOGONAL, a linear dimension constrained to x/y
@ PCB_DIM_LEADER_T
class PCB_DIM_LEADER, a leader dimension (graphic item)
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
@ PCB_DIM_CENTER_T
class PCB_DIM_CENTER, a center point marking (graphic item)
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
@ PCB_DIM_ALIGNED_T
class PCB_DIM_ALIGNED, a linear dimension (graphic item)
@ PCB_BITMAP_T
class PCB_BITMAP, bitmap on a layer
@ PCB_PAD_T
class PAD, a pad in a footprint
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
@ PCB_DIM_RADIAL_T
class PCB_DIM_RADIAL, a radius or diameter dimension