57 "Append a point on x",
58 { vt::POINT, { 500000, 0 } },
59 { { 0, 0 }, { 500000, 0 } },
63 "Append a point on y",
64 { vt::POINT, { 0, 500000 } },
65 { { 0, 0 }, { 0, 500000 } },
69 "Append a Semicircle (clockwise)",
70 { vt::CLOCKWISE_SEMICIRCLE, { 500000, 0 } },
71 { { 0, 0 }, { 500000, 250000 } },
75 "Append a Semicircle (anticlockwise)",
76 { vt::ANTICLOCKWISE_SEMICIRCLE, { 500000, 0 } },
77 { { 0, -250000 }, { 500000, 250000 } },
81 "Append a 90 degree Arc (clockwise)",
82 { vt::CLOCKWISE_ARC, { 250000, 250000 }, { 250000, 0 } },
83 { { 0, 0 }, { 250000, 250000 } },
87 "Append a 90 degree Arc (anticlockwise)",
88 { vt::ANTICLOCKWISE_ARC, { 250000, -250000 }, { 250000, 0 } },
89 { { 0, -250000 }, { 250000, 250000 } },
98 static const std::vector<VECTOR2D> coordinateMultipliers =
111 BOOST_TEST_INFO_SCOPE( c.m_CaseName );
113 for(
const VECTOR2D& mult : coordinateMultipliers )
115 BOOST_TEST_INFO_SCOPE(
"Applied scaling x=" << mult.x <<
" y=" << mult.y );
119 auto transformCoord =
122 int x = double( aPt.x ) * mult.
x;
123 int y = double( aPt.y ) * mult.y;
127 c.m_VertexToAppend.AppendToChain( &chain, transformCoord,
SCH_IU_PER_MM * 0.01 );
129 BOX2I expBoxTransformed;
130 expBoxTransformed.
SetOrigin( transformCoord( c.m_ExpBBox.GetPosition() ) );
131 expBoxTransformed.
SetSize( transformCoord( c.m_ExpBBox.GetSize() ) );
134 BOOST_CHECK_PREDICATE(
135 KI_TEST::IsVecWithinTol<VECTOR2I>,
136 ( chain.BBox().GetPosition() )( expBoxTransformed.
GetPosition() ) ( c.m_ExpBBoxError ) );
138 BOOST_CHECK_PREDICATE(
139 KI_TEST::IsVecWithinTol<VECTOR2I>,
140 ( chain.BBox().GetSize() )( expBoxTransformed.
GetSize() ) ( c.m_ExpBBoxError ) );
constexpr double SCH_IU_PER_MM
Helper functions and common defines between schematic and PCB Archive files.
constexpr const Vec & GetPosition() const
constexpr void SetOrigin(const Vec &pos)
constexpr BOX2< Vec > & Normalize()
Ensure that the height and width are positive.
constexpr void SetSize(const SizeVec &size)
constexpr const SizeVec & GetSize() const
static double DefaultAccuracyForPCB()
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
Represents a vertex in a shape.
CADSTAR_ARCHIVE_PARSER::VERTEX m_VertexToAppend
BOOST_AUTO_TEST_CASE(AppendToChain)
static const std::vector< VERTEX_APPEND_CASE > appendToChainCases
std::function< wxPoint(const wxPoint &)> m_CadstarToKicadPointCallback
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()