|
KiCad PCB EDA Suite
|
#include <boost/test/unit_test.hpp>#include <board.h>#include <geometry/circle.h>#include <geometry/seg.h>#include <geometry/shape_arc.h>#include <layer_ids.h>#include <pcb_shape.h>#include <pcb_track.h>#include <tools/graphic_extend.h>#include <limits>Go to the source code of this file.
Functions | |
| static const GRAPHIC_EDIT_GEOMETRY & | planned (const GRAPHIC_EDIT_RESULT &aResult) |
| static PCB_SHAPE | makeLine (const VECTOR2I &aStart, const VECTOR2I &aEnd, PCB_LAYER_ID aLayer=Dwgs_User) |
| static PCB_SHAPE | makeArc (const VECTOR2I &aCenter, const VECTOR2I &aStart, double aAngle, PCB_LAYER_ID aLayer=Dwgs_User) |
| BOOST_AUTO_TEST_CASE (ExtendsSelectedLineEndToFiniteLineBoundary) | |
| BOOST_AUTO_TEST_CASE (ExtendsSelectedLineStartInOppositeDirection) | |
| BOOST_AUTO_TEST_CASE (ChoosesNearestPositiveIntersection) | |
| BOOST_AUTO_TEST_CASE (IgnoresWrongLayerAndNonGraphicItems) | |
| BOOST_AUTO_TEST_CASE (RejectsTrackSource) | |
| BOOST_AUTO_TEST_CASE (ExtendsLineToFiniteArcBoundary) | |
| BOOST_AUTO_TEST_CASE (ExtendsArcEndToFiniteLineBoundary) | |
| BOOST_AUTO_TEST_CASE (ExtendsArcStartBackwardAlongCurvature) | |
| BOOST_AUTO_TEST_CASE (ExtendsArcToFiniteArcBoundary) | |
| BOOST_AUTO_TEST_CASE (ExtendsToATangentTouch) | |
| BOOST_AUTO_TEST_CASE (LockedSourceIsRejectedButLockedBoundaryIsEligible) | |
| BOOST_AUTO_TEST_CASE (PointerChoosesNearestEndpoint) | |
| BOOST_AUTO_TEST_CASE (QueryBoundsFollowTheExtensionRay) | |
| BOOST_AUTO_TEST_CASE (ExtendsBoardScaleLineForward) | |
| BOOST_AUTO_TEST_CASE (IgnoresBoundaryBehindTheExtendedEndpoint) | |
| static CIRCLE | closedCircle (const GRAPHIC_EDIT_RESULT &aResult) |
| The circle an arc closed into, for checking. | |
| BOOST_AUTO_TEST_CASE (ArcPastAFullTurnClosesIntoACircle) | |
| BOOST_AUTO_TEST_CASE (ArcWithNothingToReachClosesIntoACircle) | |
| BOOST_AUTO_TEST_CASE (ReachableBoundaryBeatsClosingTheCircle) | |
| BOOST_AUTO_TEST_CASE (LineWithNothingToReachStillRefuses) | |
| BOOST_AUTO_TEST_CASE (WideArcWhoseChordIsOutOfReachCloses) | |
| BOOST_AUTO_TEST_CASE (DegenerateSourcesReportWhyTheyWereRefused) | |
| BOOST_AUTO_TEST_CASE (ExtendedLargeArcLandsOnItsBoundary) | |
| BOOST_AUTO_TEST_CASE (CollinearBoundariesAreRejectedInBothEndpointOrders) | |
| BOOST_AUTO_TEST_CASE (ExtendsNegativeSweepArc) | |
| BOOST_AUTO_TEST_CASE | ( | ArcPastAFullTurnClosesIntoACircle | ) |
Definition at line 302 of file test_graphic_extend.cpp.
References std::abs(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), CIRCLE, closedCircle(), END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ArcWithNothingToReachClosesIntoACircle | ) |
Definition at line 319 of file test_graphic_extend.cpp.
References std::abs(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), CIRCLE, closedCircle(), END, makeArc(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), result, and START.
| BOOST_AUTO_TEST_CASE | ( | ChoosesNearestPositiveIntersection | ) |
Definition at line 90 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | CollinearBoundariesAreRejectedInBothEndpointOrders | ) |
Definition at line 412 of file test_graphic_extend.cpp.
References END, makeLine(), and GRAPHIC_EXTEND_PLANNER::Plan().
| BOOST_AUTO_TEST_CASE | ( | DegenerateSourcesReportWhyTheyWereRefused | ) |
Definition at line 384 of file test_graphic_extend.cpp.
References DEGENERATE, END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), GRAPHIC_EXTEND_PLANNER::QueryBounds(), and radius.
| BOOST_AUTO_TEST_CASE | ( | ExtendedLargeArcLandsOnItsBoundary | ) |
Definition at line 400 of file test_graphic_extend.cpp.
References BOOST_REQUIRE(), SEG::Contains(), END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsArcEndToFiniteLineBoundary | ) |
Definition at line 145 of file test_graphic_extend.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DEGREES_T, END, SHAPE_ARC::GetCentralAngle(), EDA_SHAPE::GetStart(), makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsArcStartBackwardAlongCurvature | ) |
Definition at line 161 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DEGREES_T, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), result, and START.
| BOOST_AUTO_TEST_CASE | ( | ExtendsArcToFiniteArcBoundary | ) |
Definition at line 176 of file test_graphic_extend.cpp.
References std::abs(), EDA_ANGLE::AsDegrees(), BOOST_REQUIRE(), SHAPE_ARC::Collide(), DEGREES_T, END, expected, SHAPE_ARC::GetCentralAngle(), makeArc(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsBoardScaleLineForward | ) |
Definition at line 264 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsLineToFiniteArcBoundary | ) |
Definition at line 133 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsNegativeSweepArc | ) |
Definition at line 423 of file test_graphic_extend.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), DEGREES_T, expected, SHAPE_ARC::GetCentralAngle(), makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), result, and START.
| BOOST_AUTO_TEST_CASE | ( | ExtendsSelectedLineEndToFiniteLineBoundary | ) |
Definition at line 64 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | ExtendsSelectedLineStartInOppositeDirection | ) |
Definition at line 77 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), result, and START.
| BOOST_AUTO_TEST_CASE | ( | ExtendsToATangentTouch | ) |
Definition at line 194 of file test_graphic_extend.cpp.
References BOOST_REQUIRE(), END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | IgnoresBoundaryBehindTheExtendedEndpoint | ) |
Definition at line 276 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | IgnoresWrongLayerAndNonGraphicItems | ) |
Definition at line 104 of file test_graphic_extend.cpp.
References Cmts_User, END, makeLine(), NO_INTERSECTION, GRAPHIC_EXTEND_PLANNER::Plan(), and result.
| BOOST_AUTO_TEST_CASE | ( | LineWithNothingToReachStillRefuses | ) |
Definition at line 354 of file test_graphic_extend.cpp.
References END, makeLine(), NO_INTERSECTION, GRAPHIC_EXTEND_PLANNER::Plan(), and result.
| BOOST_AUTO_TEST_CASE | ( | LockedSourceIsRejectedButLockedBoundaryIsEligible | ) |
Definition at line 206 of file test_graphic_extend.cpp.
References Dwgs_User, END, LOCKED_SOURCE, GRAPHIC_EXTEND_PLANNER::Plan(), result, SEGMENT, PCB_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), BOARD_ITEM::SetLocked(), and PCB_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | PointerChoosesNearestEndpoint | ) |
Definition at line 228 of file test_graphic_extend.cpp.
References END, makeLine(), GRAPHIC_EXTEND_PLANNER::NearestEndpoint(), and START.
| BOOST_AUTO_TEST_CASE | ( | QueryBoundsFollowTheExtensionRay | ) |
Definition at line 241 of file test_graphic_extend.cpp.
References BOOST_CHECK_EQUAL(), END, BOX2< Vec >::GetPosition(), BOX2< Vec >::GetSize(), makeLine(), GRAPHIC_EXTEND_PLANNER::QueryBounds(), and START.
| BOOST_AUTO_TEST_CASE | ( | ReachableBoundaryBeatsClosingTheCircle | ) |
Definition at line 340 of file test_graphic_extend.cpp.
References ARC, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), END, makeArc(), makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), and result.
| BOOST_AUTO_TEST_CASE | ( | RejectsTrackSource | ) |
Definition at line 119 of file test_graphic_extend.cpp.
References END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), result, PCB_TRACK::SetEnd(), PCB_TRACK::SetStart(), and UNSUPPORTED_SOURCE.
| BOOST_AUTO_TEST_CASE | ( | WideArcWhoseChordIsOutOfReachCloses | ) |
Definition at line 367 of file test_graphic_extend.cpp.
References ARC, BOOST_REQUIRE(), CIRCLE, closedCircle(), Dwgs_User, END, makeLine(), GRAPHIC_EXTEND_PLANNER::Plan(), planned(), result, PCB_SHAPE::SetArcGeometry(), and PCB_SHAPE::SetLayer().
|
static |
The circle an arc closed into, for checking.
Definition at line 293 of file test_graphic_extend.cpp.
References CIRCLE, VECTOR2< T >::Distance(), GRAPHIC_EDIT_GEOMETRY::m_End, GRAPHIC_EDIT_GEOMETRY::m_Start, and planned().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 53 of file test_graphic_extend.cpp.
References ARC, DEGREES_T, Dwgs_User, SHAPE_ARC::GetArcMid(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), PCB_SHAPE::SetArcGeometry(), and PCB_SHAPE::SetLayer().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
static |
Definition at line 43 of file test_graphic_extend.cpp.
References Dwgs_User, SEGMENT, PCB_SHAPE::SetEnd(), PCB_SHAPE::SetLayer(), and PCB_SHAPE::SetStart().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and makeLine().
|
static |
Definition at line 37 of file test_graphic_extend.cpp.
References planned().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), closedCircle(), and planned().