43 std::vector<VECTOR2I> ptsA{
47 std::vector<VECTOR2I> ptsB = ptsA;
49 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
59 std::vector<VECTOR2I> ptsA{
63 std::vector<VECTOR2I> ptsB{
68 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
78 std::vector<VECTOR2I> ptsA{
84 std::vector<VECTOR2I> ptsB{
89 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
103 std::vector<VECTOR2I> ptsA = {
109 std::vector<VECTOR2I> ptsB = {
116 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
130 const int pitchXA = 1000;
131 const int pitchY = 1000;
132 const int pitchXB = 1100;
136 std::vector<VECTOR2I> ptsA {
140 { pitchXA, -pitchY },
144 std::vector<VECTOR2I> ptsB {
148 { pitchXB, -pitchY },
153 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
155 const int expectedTranslationX = -
std::abs( pitchXB - pitchXA ) / 2;
156 const int expectedTranslationY = 0;
160 BOOST_TEST( transform->m_Translation ==
VECTOR2I( expectedTranslationX, expectedTranslationY ) );
168 const int pitch = 1000;
171 std::vector<VECTOR2I> ptsA = {
178 std::vector<VECTOR2I> ptsB = {
185 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform = m_aligner.GetTransform( ptsA, ptsB );
189 const VECTOR2I expectedTranslation( 1000, -1000 );
193 BOOST_TEST( transform->m_Translation == expectedTranslation );
ItemRealignmentOrthoTestFixture()
ORTHO_ITEM_REALIGNER m_aligner
This is a relatively straight-forward implementation of the ITEM_REALIGNER_BASE that should handle mo...
static constexpr EDA_ANGLE ANGLE_0
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_270
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_TEST(contains==c.ExpectedContains)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(SimpleNull)
VECTOR2< int32_t > VECTOR2I