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 40 of file array_creator.cpp.

41 {
42  const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() );
44  aItem.Move( (wxPoint) transform.m_offset );
45  aItem.Rotate( aItem.GetPosition(), transform.m_rotation * 10 );
46 }
Transform applied to an object by this array.
Definition: array_options.h:55
virtual wxPoint GetPosition() const
Definition: eda_item.h:301
virtual void Move(const wxPoint &aMoveVector)
Move this object.
Definition: board_item.h:277
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Rotate this object.
Definition: board_item.h:294
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.

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().