KiCad PCB EDA Suite
array_creator.cpp File Reference

Go to the source code of this file.

Functions

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,
BOARD_ITEM aItem 
)
static

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

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

44{
45 const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() );
46
47 aItem.Move( (wxPoint) transform.m_offset );
48 aItem.Rotate( aItem.GetPosition(), transform.m_rotation );
49}
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:228
virtual void Move(const VECTOR2I &aMoveVector)
Move this object.
Definition: board_item.h:250
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:262
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().