60 std::unique_ptr<ARRAY_OPTIONS> array_opts;
64 int ret = dialog.ShowModal();
66 if( ret != wxID_OK || array_opts ==
NULL )
80 item = static_cast<FOOTPRINT*>( item )->
GetParent();
84 for(
int ptN = 0; ptN < array_opts->GetArraySize(); ptN++ )
107 switch( item->
Type() )
140 this_item = new_item;
150 static_cast<FOOTPRINT*>( this_item )->RunOnChildren(
157 commit.
Add( new_item );
164 commit.
Modify( this_item );
171 if( this_item && array_opts->ShouldNumberItems() )
176 PAD& pad = static_cast<PAD&>( *this_item );
188 commit.
Push(
_(
"Create an array" ) );
COMMIT & Modify(EDA_ITEM *aItem)
Create an undo entry for an item that has been already modified.
class ALIGNED_DIMENSION, a linear dimension (graphic item)
class LEADER, a leader dimension (graphic item)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
COMMIT & Add(EDA_ITEM *aItem)
Notify observers that aItem has been added.
class CENTER_DIMENSION, a center point marking (graphic item)
virtual VECTOR2I GetCenter() const
Returns the center point of the selection area bounding box.
PCB_BASE_FRAME & m_parent
const PCB_SELECTION & m_selection
void SetName(const wxString &aName)
Set the pad name (sometimes called pad number, although it can be an array reference like AA12).
class PCB_TEXT, text on a layer
class PAD, a pad in a footprint
virtual wxPoint GetPosition() const
wxString GetNextPadName()
Get the next available pad name.
class TRACK, a track segment (segment on a copper layer)
Simple class that sequentially provides names from an ARRAY_OPTIONS object, making sure that they do ...
Options that govern the setup of an "array" of multiple item.
FOOTPRINT * GetFirstFootprint() const
Gets the first footprint on the board or nullptr.
virtual void Move(const wxPoint &aMoveVector)
Move this object.
bool PadCanHaveName(const PAD &aPad)
Check if a pad should be named.
class ZONE, a copper pour area
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Rotate this object.
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.
class PCB_TARGET, a target (graphic item)
class FOOTPRINT, a footprint
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.
int Size() const
Returns the number of selected parts.
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Revert the commit by restoring the modified items state.
virtual BOARD_ITEM * Duplicate() const
Create a copy of a of this BOARD_ITEM.
class ORTHOGONAL_DIMENSION, a linear dimension constrained to x/y
class VIA, a via (like a track segment on a copper layer)
BOARD_ITEM_CONTAINER * GetParent() const
class PCB_SHAPE, a segment not on copper layers
KICAD_T Type() const
Returns the type of object.