24#include <boost/test/unit_test.hpp>
74 footprint.
SetValue( wxS(
"LineEndingFootprint" ) );
79 line->SetEnd(
VECTOR2I( 1000000, 0 ) );
81 line->SetWidth( 100000 );
84 line->SetStartEndingLength( 300000 );
85 line->SetStartEndingWidth( 200000 );
86 line->SetStartEndingStrokeWidth( 50000 );
89 line->SetEndEndingLength( 500000 );
90 line->SetEndEndingWidth( 400000 );
91 line->SetEndEndingStrokeWidth( 100000 );
96 const std::filesystem::path libPath = tempLib.
CreateChildDir(
"line_ending_roundtrip.pretty" );
97 const std::filesystem::path savePath = libPath /
"line_ending_roundtrip.kicad_mod";
100 std::unique_ptr<FOOTPRINT> loadedFootprint =
105 PCB_SHAPE* loadedLine = findFirstSegment( loadedFootprint.get() );
116 footprint.
SetValue( wxS(
"LineEndingEqualSizeFootprint" ) );
118 auto* line =
new PCB_SHAPE( &footprint );
121 line->SetEnd(
VECTOR2I( 1000000, 0 ) );
123 line->SetWidth( 100000 );
126 line->SetStartEndingLength( 300000 );
127 line->SetStartEndingWidth( 300000 );
132 const std::filesystem::path libPath =
134 const std::filesystem::path savePath = libPath /
"line_ending_equal_size.kicad_mod";
137 std::unique_ptr<FOOTPRINT> loadedFootprint =
142 PCB_SHAPE* loadedLine = findFirstSegment( loadedFootprint.get() );
General utilities for PCB file IO for QA programs.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
const LINE_ENDING & GetStartEnding() const
const LINE_ENDING & GetEndEnding() const
std::filesystem::path CreateChildDir(const wxString &aName) const
Create and return the path to a direct child directory.
Decorative shape (arrowhead, circle, square) at the start or end of a graphic line,...
int GetLength() const
Along-line size. 0 = auto.
int GetWidth() const
Perpendicular size. 0 = auto.
LINE_ENDING_STYLE GetStyle() const
int GetStrokeWidth() const
Outline stroke width.
LINE_ENDING_STYLE
Line ending styles for graphic lines, arcs, and beziers.
void DumpFootprintToFile(const FOOTPRINT &aFootprint, const std::filesystem::path &aLibraryPath)
Same as DumpBoardToFile, but for footprints.
std::unique_ptr< FOOTPRINT > ReadFootprintFromFileOrStream(const std::string &aFilename, std::istream &aFallback)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(FootprintLineEndingsRoundTrip)
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I