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

45 {
46  const ARRAY_OPTIONS::TRANSFORM transform = aArrOpts.GetTransform( aIndex, aItem.GetPosition() );
47 
48  aItem.Move( (wxPoint) transform.m_offset );
49  aItem.Rotate( aItem.GetPosition(), transform.m_rotation * 10 );
50 }
Transform applied to an object by this array.
Definition: array_options.h:90
virtual void Move(const wxPoint &aMoveVector)
Function Move move this object.
virtual void Rotate(const wxPoint &aRotCentre, double aAngle)
Function Rotate Rotate this object.
virtual const wxPoint GetPosition() const =0
virtual TRANSFORM GetTransform(int aN, const VECTOR2I &aPos) const =0
Get the transform of the n-th point in the array.

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