MCPcopy Create free account
hub / github.com/KiCad/kicad-source-mirror / GetTransform

Method GetTransform

common/array_options.cpp:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79
80
81ARRAY_OPTIONS::TRANSFORM ARRAY_GRID_OPTIONS::GetTransform( int n, const VECTOR2I& aPos ) const
82{
83 VECTOR2I point = gtItemPosRelativeToItem0( n );
84
85 // Bump the item by half the array size
86 if( m_centred )
87 {
88 // Get the array extents
89 const int arrayExtentX = ( m_nx - 1 ) * m_delta.x + ( m_ny - 1 ) * m_offset.x;
90 const int arrayExtentY = ( m_ny - 1 ) * m_delta.y + ( m_nx - 1 ) * m_offset.y;
91
92 point -= VECTOR2I( arrayExtentX, arrayExtentY ) / 2;
93 }
94
95 return { point, ANGLE_0 };
96}
97
98
99wxString ARRAY_GRID_OPTIONS::GetItemNumber( int n ) const

Callers 15

CheckArrayTransformsFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
GetPositionMethod · 0.80
GetPinRootMethod · 0.80
GetPinBoundingBoxMethod · 0.80
drawMethod · 0.80
GetDrawRotationMethod · 0.80
GetBoundingBoxMethod · 0.80
SetPositionMethod · 0.80
GetPositionMethod · 0.80
PlotMethod · 0.80

Calls 4

IsZeroMethod · 0.80
AsDegreesMethod · 0.80
EDA_ANGLEClass · 0.50
RotatePointFunction · 0.50

Tested by 4

CheckArrayTransformsFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
TestTextVarsMethod · 0.64