20#include <boost/test/unit_test.hpp>
39 return aResult.m_Geometry.front();
109 track.SetStart( { 30, -10 } );
110 track.SetEnd( { 30, 10 } );
123 source.
SetEnd( { 10, 0 } );
164 PCB_SHAPE source =
makeArc( extended.GetCenter(), extended.GetArcMid(), 90.0 );
185 SHAPE_ARC boundaryGeometry( boundary.GetStart(), boundary.GetArcMid(), boundary.GetEnd(), 0 );
197 PCB_SHAPE boundary =
makeArc( { 20000000, 0 }, { 20000000, 10000000 }, 180.0 );
211 source.
SetEnd( { 10, 0 } );
215 boundary.
SetEnd( { 20, 10 } );
244 BOX2I world( { -100, -100 }, { 200, 200 } );
256 BOX2I wideWorld( { 0, -100 }, { 1000000000, 200 } );
305 PCB_SHAPE boundary =
makeLine( { -15000000, -15000000 }, { 15000000, 15000000 } );
310 BOOST_REQUIRE_EQUAL(
result.m_Geometry.size(), 1 );
314 BOOST_CHECK(
result.m_Boundaries.empty() );
370 source.
SetArcGeometry( { 25000000, 87000000 }, { 35000000, 70000000 }, { 45000000, 87000000 } );
387 int radius = std::numeric_limits<int>::max() / 2 + 100;
389 BOX2I world( { std::numeric_limits<int>::min() / 2, std::numeric_limits<int>::min() / 2 },
390 { std::numeric_limits<int>::max(), std::numeric_limits<int>::max() } );
403 PCB_SHAPE boundary =
makeLine( { 60000000, 60000000 }, { 120000000, 10000000 } );
void SetLocked(bool aLocked) override
Information pertinent to a Pcbnew printed circuit board.
constexpr const Vec & GetPosition() const
constexpr const SizeVec & GetSize() const
Represent basic circle geometry with utility geometry functions.
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
void SetEnd(const VECTOR2I &aEnd) override
void SetArcGeometry(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
bool Contains(const SEG &aSeg) const
EDA_ANGLE GetCentralAngle() const
Get the "central angle" of the arc - this is the angle at the point of the "pie slice".
const VECTOR2I & GetArcMid() const
const VECTOR2I & GetP1() const
bool Collide(const SEG &aSeg, int aClearance=0, int *aActual=nullptr, VECTOR2I *aLocation=nullptr) const override
Check if the boundary of shape (this) lies closer to the segment aSeg than aClearance,...
const VECTOR2I & GetP0() const
double Distance(const VECTOR2< extended_type > &aVector) const
Compute the distance between two vectors.
PCB_LAYER_ID
A quick note on layer IDs:
BOX2I QueryBounds(const BOARD_ITEM &aSource, GRAPHIC_ENDPOINT aEndpoint, const BOX2I &aWorldBounds)
GRAPHIC_ENDPOINT NearestEndpoint(const BOARD_ITEM &aSource, const VECTOR2I &aPointer)
GRAPHIC_EDIT_RESULT Plan(const BOARD_ITEM &aSource, GRAPHIC_ENDPOINT aEndpoint, const std::vector< const BOARD_ITEM * > &aBoundaries)
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
static PCB_SHAPE makeArc(const VECTOR2I &aCenter, const VECTOR2I &aStart, double aAngle, PCB_LAYER_ID aLayer=Dwgs_User)
BOOST_AUTO_TEST_CASE(ExtendsSelectedLineEndToFiniteLineBoundary)
static const GRAPHIC_EDIT_GEOMETRY & planned(const GRAPHIC_EDIT_RESULT &aResult)
static CIRCLE closedCircle(const GRAPHIC_EDIT_RESULT &aResult)
The circle an arc closed into, for checking.
static PCB_SHAPE makeLine(const VECTOR2I &aStart, const VECTOR2I &aEnd, PCB_LAYER_ID aLayer=Dwgs_User)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
VECTOR3I expected(15, 30, 45)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I