49 "Issue 13626: clockwise semicircle",
50 {-428880000, 117229160 },
51 {-430060565, 113472820 },
53 {-431241130, 109716480 },
57 "Issue 13626: anticlockwise arc",
58 { -431241130, 109716480 },
59 { -434923630, 112954230 },
61 { -439827050, 112936200 },
71 BOOST_TEST_INFO_SCOPE( c.m_CaseName );
79 BOOST_CHECK_EQUAL( shape.
EndsSwapped(), c.m_ExpectedStartEndSwapped );
83 BOOST_CHECK_PREDICATE(
84 KI_TEST::IsVecWithinTol<VECTOR2I>,
108 "Issue 15694: clockwise arc",
119 "Issue 15694: anticlockwise arc",
133 const double angle_tol = 0.1;
137 BOOST_TEST_INFO_SCOPE( c.m_CaseName );
145 BOOST_CHECK_PREDICATE(
146 KI_TEST::IsVecWithinTol<VECTOR2I>,
151 BOOST_CHECK_PREDICATE(
152 KI_TEST::IsWithin<int>,
155 BOOST_CHECK_EQUAL( shape.
EndsSwapped(), c.m_ExpectedStartEndSwapped );
159 BOOST_CHECK_PREDICATE(
160 KI_TEST::IsVecWithinTol<VECTOR2I>,
165 BOOST_CHECK_PREDICATE(
166 KI_TEST::IsWithinWrapped<double>,
167 ( angle.
AsDegrees() )( c.m_ExpectedAngleAfterSwapDeg )( 360.0 )( angle_tol ) );
EDA_SHAPE_MOCK(SHAPE_T aShapeType)
EDA_ANGLE GetArcAngle() const
void SetCenter(const VECTOR2I &aCenter)
VECTOR2I getCenter() const
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
bool EndsSwapped() const
Have the start and end points been swapped since they were set?
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Set the three controlling points for an arc.
void SetArcAngleAndEnd(const EDA_ANGLE &aAngle, bool aCheckNegativeAngle=false)
Set the end point from the angle center and start.
static double DefaultAccuracyForPCB()
@ ARC
use RECTANGLE instead of RECT to avoid collision in a Windows header
bool m_ExpectedStartEndSwapped
VECTOR2I m_ExpectedEndBeforeSwap
bool m_ExpectedStartEndSwapped
VECTOR2I m_ExpectedCenter
double m_ExpectedAngleAfterSwapDeg
VECTOR2I m_ExpectedEndAfterSwap
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
static const std::vector< SET_ARC_GEOMETRY_CASE > set_arc_geometry_cases
BOOST_AUTO_TEST_CASE(SetAngleAndEnd)
static const std::vector< SET_ANGLE_END_CASE > set_angle_end_cases
BOOST_AUTO_TEST_SUITE_END()