63 const int lineWidth = 100;
72 int aStrokeWidth,
int aExpected )
74 const int lineWidth = 100;
76 LINE_ENDING ending( aStyle, aLength, aWidth, aStrokeWidth );
83 int aStrokeWidth,
int aExpected )
85 const int lineWidth = 100;
87 LINE_ENDING ending( aStyle, aLength, aWidth, aStrokeWidth );
118 BOOST_CHECK_NE( explicitSquare.find(
"(length " ), std::string::npos );
119 BOOST_CHECK_NE( explicitSquare.find(
"(width " ), std::string::npos );
124 BOOST_CHECK_NE( autoWidthArrow.find(
"(length " ), std::string::npos );
140 const VECTOR2I endpoint( 1000, 2000 );
157 openArrow.GetShapes( endpoint, tangent, 100,
polygon );
constexpr EDA_IU_SCALE pcbIUScale
static double square(double x)
Decorative shape (arrowhead, circle, square) at the start or end of a graphic line,...
int GetShortenDepth(int aLineWidth) const
Return how far the line should be shortened at this ending.
int GetCurveOrientationDepth(int aLineWidth) const
Return how far along a curved body to look when orienting this ending.
VECTOR2I GetEffectiveSize(int aLineWidth) const
Return the rendered size per axis, applying auto-sizing when length or width is 0.
void GetShapes(const VECTOR2I &aPoint, const EDA_ANGLE &aTangent, int aLineWidth, std::vector< VECTOR2I > &aPolygon) const
Generate ending geometry as polygon vertices at the given point and direction.
void Format(OUTPUTFORMATTER *aOut, const EDA_IU_SCALE &aIuScale, const char *aToken) const
LINE_ENDING_STYLE
Line ending styles for graphic lines, arcs, and beziers.
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(FormatDoesNotWriteFill)
static void checkDoesNotWriteFill(const std::string &aFormatted)
static void checkShortenDepth(LINE_ENDING_STYLE aStyle, int aLength, int aWidth, int aStrokeWidth, int aExpected)
static void checkEffectiveSize(int aLength, int aWidth, const VECTOR2I &aExpected)
static void checkVectorEqual(const VECTOR2I &aActual, const VECTOR2I &aExpected)
static std::string formatLineEnding(LINE_ENDING_STYLE aStyle, int aLength=0, int aWidth=0)
static void checkCurveOrientationDepth(LINE_ENDING_STYLE aStyle, int aLength, int aWidth, int aStrokeWidth, int aExpected)
SHAPE_CIRCLE circle(c.m_circle_center, c.m_circle_radius)
VECTOR2< int32_t > VECTOR2I
static PIECE polygon(std::vector< VIA_CROSS_SECTION_GEOMETRY::POINT > aPoints, bool aMixed=false)