KiCad PCB EDA Suite
array_creator.cpp File Reference

Go to the source code of this file.


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. More...

Function Documentation

◆ TransformItem()

static void TransformItem ( const ARRAY_OPTIONS aArrOpts,
int  aIndex,

Transform a BOARD_ITEM from the given ARRAY_OPTIONS and an index into the array.

aArrOptsThe array options that describe the array
aIndexThe index in the array of this item
aItemThe item to transform

Definition at line 43 of file array_creator.cpp.

45 const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() );
47 aItem.Move( transform.m_offset );
48 aItem.Rotate( aItem.GetPosition(), transform.m_rotation );
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.
virtual void Rotate(const VECTOR2I &aRotCentre, const EDA_ANGLE &aAngle)
Rotate this object.
Definition: board_item.cpp:250
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
Definition: board_item.h:266
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249
Transform applied to an object by this array.
Definition: array_options.h:59

References EDA_ITEM::GetPosition(), ARRAY_OPTIONS::GetTransform(), ARRAY_OPTIONS::TRANSFORM::m_offset, ARRAY_OPTIONS::TRANSFORM::m_rotation, BOARD_ITEM::Move(), and BOARD_ITEM::Rotate().

Referenced by ARRAY_CREATOR::Invoke().