|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <cmath>#include <limits>#include <chrono>#include <random>#include <stdexcept>#include <geometry/eda_angle.h>#include <geometry/shape_ellipse.h>#include <geometry/shape_line_chain.h>#include <geometry/shape_circle.h>#include <geometry/shape_rect.h>#include <geometry/shape_arc.h>Go to the source code of this file.
Functions | |
| static BOX2I | bruteForceEllipseBBox (const VECTOR2I &aCenter, int aMajorR, int aMinorR, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle, bool aIsArc, int aNSamples=10000) |
| Compute a bounding box by sampling 10,000 points around the ellipse Used as ground truth to verify BBox() implementation. | |
| BOOST_AUTO_TEST_CASE (ConstructorSwapsMajorMinor) | |
| BOOST_AUTO_TEST_CASE (ConstructorClampsDegenerate) | |
| BOOST_AUTO_TEST_CASE (AxisAlignedEllipseBBox) | |
| BOOST_AUTO_TEST_CASE (RotatedEllipseBBoxAt45Degrees) | |
| BOOST_AUTO_TEST_CASE (RandomClosedEllipseBBoxVsBruteForce) | |
| BOOST_AUTO_TEST_CASE (RandomEllipticalArcBBoxVsBruteForce) | |
| BOOST_AUTO_TEST_CASE (CirclePerimeterViaRamanujan) | |
| BOOST_AUTO_TEST_CASE (EllipsePerimeterMatchesHighResIntegration) | |
| BOOST_AUTO_TEST_CASE (SemiCircleArcLength) | |
| BOOST_AUTO_TEST_CASE (QuarterCircleArcLength) | |
| BOOST_AUTO_TEST_CASE (PointInsideClosedAxisAligned) | |
| BOOST_AUTO_TEST_CASE (PointInsideRotatedEllipse) | |
| BOOST_AUTO_TEST_CASE (PointInsideArcAlwaysFalse) | |
| BOOST_AUTO_TEST_CASE (SquaredDistanceCircleAgreesWithRadialDistance) | |
| BOOST_AUTO_TEST_CASE (SquaredDistanceZeroInsideClosedEllipse) | |
| BOOST_AUTO_TEST_CASE (SquaredDistanceOutlineOnlyReturnsBoundaryDist) | |
| BOOST_AUTO_TEST_CASE (ConvertToPolylineClosedEllipseIsClosed) | |
| BOOST_AUTO_TEST_CASE (ConvertToPolylineArcIsOpenWithCorrectEndpoints) | |
| BOOST_AUTO_TEST_CASE (ConvertToPolylineAllPointsWithinMaxError) | |
| BOOST_AUTO_TEST_CASE (ConvertToPolylineTighterErrorYieldsMorePoints) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentThroughClosedEllipse) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentEndpointInsideClosedEllipse) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentOutsideFar) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentNearMissWithinClearance) | |
| BOOST_AUTO_TEST_CASE (CollideDegenerateSegmentAtCenter) | |
| BOOST_AUTO_TEST_CASE (CollideDegenerateSegmentFarAway) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentVsRotatedEllipse) | |
| BOOST_AUTO_TEST_CASE (CollideSegmentVsArcUpperHalf) | |
| BOOST_AUTO_TEST_CASE (CollideCircleDegenerateAgreesWithShapeCircle) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsCircleOverlap) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsCircleDisjoint) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsRectContainsEllipse) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsRectDisjoint) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsRectEdgeIntersects) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsLineChainIntersects) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseInsideClosedChain) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsArcOverlap) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsEllipseOverlap) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsEllipseDisjoint) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseInsideAnotherEllipse) | |
| BOOST_AUTO_TEST_CASE (CollideEllipseVsRect) | |
| BOOST_AUTO_TEST_CASE (RotateByFullTurnPreservesBBox) | |
| BOOST_AUTO_TEST_CASE (RotateCircleAboutCenterIsBBoxInvariant) | |
| BOOST_AUTO_TEST_CASE (RotateAboutNonCenterTranslatesAndRotates) | |
| BOOST_AUTO_TEST_CASE (MirrorLeftRightFlipsCenter) | |
| BOOST_AUTO_TEST_CASE (MirrorTopBottomFlipsCenter) | |
| BOOST_AUTO_TEST_CASE (MirrorLeftRightTwiceIsIdentity) | |
| BOOST_AUTO_TEST_CASE (MirrorTopBottomTwiceIsIdentity) | |
| BOOST_AUTO_TEST_CASE (MirrorArcSwapsAndReflectsSweep) | |
| BOOST_AUTO_TEST_CASE (MirrorArcAsymmetricSwapsSweep) | |
| BOOST_AUTO_TEST_CASE (FormatContainsExpectedFields) | |
| BOOST_AUTO_TEST_CASE (FuzzRandomEllipsesInvariantsAndDeterminism) | |
| BOOST_AUTO_TEST_CASE (CrossCheckSegmentCollideAgainstTessellation) | |
| BOOST_AUTO_TEST_CASE (NormalizeArcAnglesOnSwap) | |
| Test that normalize() adjusts arc angles when swapping major/minor radii. | |
| BOOST_AUTO_TEST_CASE (NormalizeClosedEllipseNoAngleShift) | |
| Test that normalize() does NOT adjust angles for closed ellipses (only arcs). | |
| BOOST_AUTO_TEST_CASE (FullSweepAngleInSweep) | |
| Test that isAngleInSweep handles full-sweep (start=0, end=360) correctly. | |
| BOOST_AUTO_TEST_CASE (CacheConsistencyAfterSetRotation) | |
| Test that the cache is consistent after SetRotation. | |
| BOOST_AUTO_TEST_CASE (CacheConsistencyAfterSetMajorRadius) | |
| Test that the cache is consistent after SetMajorRadius. | |
| BOOST_AUTO_TEST_CASE (PointInsideAfterRotationChange) | |
| Test PointInside after rotation change. | |
| BOOST_AUTO_TEST_CASE | ( | AxisAlignedEllipseBBox | ) |
Definition at line 118 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::BBox(), BOOST_CHECK_EQUAL(), DEGREES_T, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), and BOX2< Vec >::GetTop().
| BOOST_AUTO_TEST_CASE | ( | CacheConsistencyAfterSetMajorRadius | ) |
Test that the cache is consistent after SetMajorRadius.
Definition at line 1016 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::BBox(), BOOST_CHECK_EQUAL(), DEGREES_T, BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), and SHAPE_ELLIPSE::SetMajorRadius().
| BOOST_AUTO_TEST_CASE | ( | CacheConsistencyAfterSetRotation | ) |
Test that the cache is consistent after SetRotation.
Definition at line 995 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::BBox(), BOOST_CHECK_EQUAL(), DEGREES_T, BOX2< Vec >::GetHeight(), BOX2< Vec >::GetWidth(), and SHAPE_ELLIPSE::SetRotation().
| BOOST_AUTO_TEST_CASE | ( | CirclePerimeterViaRamanujan | ) |
Definition at line 227 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::GetLength(), and M_PI.
| BOOST_AUTO_TEST_CASE | ( | CollideCircleDegenerateAgreesWithShapeCircle | ) |
Definition at line 521 of file test_shape_ellipse.cpp.
References BOOST_CHECK_EQUAL(), SHAPE_CIRCLE::Collide(), SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideDegenerateSegmentAtCenter | ) |
Definition at line 465 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideDegenerateSegmentFarAway | ) |
Definition at line 476 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseInsideAnotherEllipse | ) |
Definition at line 654 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseInsideClosedChain | ) |
Definition at line 608 of file test_shape_ellipse.cpp.
References chain, SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsArcOverlap | ) |
Definition at line 624 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsCircleDisjoint | ) |
Definition at line 554 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsCircleOverlap | ) |
Definition at line 544 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsEllipseDisjoint | ) |
Definition at line 644 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsEllipseOverlap | ) |
Definition at line 634 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsLineChainIntersects | ) |
Definition at line 595 of file test_shape_ellipse.cpp.
References chain, SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsRect | ) |
Definition at line 664 of file test_shape_ellipse.cpp.
References actual, ANGLE_0, and BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsRectContainsEllipse | ) |
Definition at line 564 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsRectDisjoint | ) |
Definition at line 575 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideEllipseVsRectEdgeIntersects | ) |
Definition at line 585 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentEndpointInsideClosedEllipse | ) |
Definition at line 427 of file test_shape_ellipse.cpp.
References actual, BOOST_CHECK_EQUAL(), SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentNearMissWithinClearance | ) |
Definition at line 450 of file test_shape_ellipse.cpp.
References std::abs(), actual, SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentOutsideFar | ) |
Definition at line 440 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentThroughClosedEllipse | ) |
Definition at line 414 of file test_shape_ellipse.cpp.
References actual, BOOST_CHECK_EQUAL(), SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentVsArcUpperHalf | ) |
Definition at line 501 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | CollideSegmentVsRotatedEllipse | ) |
Definition at line 486 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | ConstructorClampsDegenerate | ) |
Definition at line 101 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::GetMajorRadius(), and SHAPE_ELLIPSE::GetMinorRadius().
| BOOST_AUTO_TEST_CASE | ( | ConstructorSwapsMajorMinor | ) |
Definition at line 89 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetMajorRadius(), SHAPE_ELLIPSE::GetMinorRadius(), and SHAPE_ELLIPSE::GetRotation().
| BOOST_AUTO_TEST_CASE | ( | ConvertToPolylineAllPointsWithinMaxError | ) |
Definition at line 382 of file test_shape_ellipse.cpp.
References chain, SHAPE_ELLIPSE::ConvertToPolyline(), DEGREES_T, and SHAPE_ELLIPSE::SquaredDistance().
| BOOST_AUTO_TEST_CASE | ( | ConvertToPolylineArcIsOpenWithCorrectEndpoints | ) |
Definition at line 368 of file test_shape_ellipse.cpp.
References chain, SHAPE_ELLIPSE::ConvertToPolyline(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | ConvertToPolylineClosedEllipseIsClosed | ) |
Definition at line 357 of file test_shape_ellipse.cpp.
References chain, SHAPE_ELLIPSE::ConvertToPolyline(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | ConvertToPolylineTighterErrorYieldsMorePoints | ) |
Definition at line 402 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::ConvertToPolyline(), DEGREES_T, and SHAPE_LINE_CHAIN::PointCount().
| BOOST_AUTO_TEST_CASE | ( | CrossCheckSegmentCollideAgainstTessellation | ) |
Definition at line 882 of file test_shape_ellipse.cpp.
References SEG::A, SEG::B, BOOST_TEST_MESSAGE(), chain, clearance, SHAPE_ELLIPSE::Collide(), SHAPE_ELLIPSE::ConvertToPolyline(), DEGREES_T, SHAPE_ELLIPSE::IsArc(), N, SHAPE_ELLIPSE::PointInside(), and rng.
| BOOST_AUTO_TEST_CASE | ( | EllipsePerimeterMatchesHighResIntegration | ) |
Definition at line 237 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::GetLength(), M_PI, and N.
| BOOST_AUTO_TEST_CASE | ( | FormatContainsExpectedFields | ) |
Definition at line 812 of file test_shape_ellipse.cpp.
References DEGREES_T, and SHAPE_ELLIPSE::Format().
| BOOST_AUTO_TEST_CASE | ( | FullSweepAngleInSweep | ) |
Test that isAngleInSweep handles full-sweep (start=0, end=360) correctly.
Definition at line 979 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::Collide(), and DEGREES_T.
| BOOST_AUTO_TEST_CASE | ( | FuzzRandomEllipsesInvariantsAndDeterminism | ) |
Definition at line 830 of file test_shape_ellipse.cpp.
References SHAPE_ELLIPSE::BBox(), BOOST_CHECK_EQUAL(), center, DEGREES_T, BOX2< Vec >::GetHeight(), SHAPE_ELLIPSE::GetMajorRadius(), SHAPE_ELLIPSE::GetMinorRadius(), BOX2< Vec >::GetWidth(), SHAPE_ELLIPSE::IsArc(), N, SHAPE_ELLIPSE::PointInside(), rng, and SHAPE_ELLIPSE::SquaredDistance().
| BOOST_AUTO_TEST_CASE | ( | MirrorArcAsymmetricSwapsSweep | ) |
Definition at line 798 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), DEGREES_T, SHAPE_ELLIPSE::GetEndAngle(), SHAPE_ELLIPSE::GetStartAngle(), LEFT_RIGHT, and SHAPE_ELLIPSE::Mirror().
| BOOST_AUTO_TEST_CASE | ( | MirrorArcSwapsAndReflectsSweep | ) |
Definition at line 784 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), DEGREES_T, SHAPE_ELLIPSE::GetEndAngle(), SHAPE_ELLIPSE::GetStartAngle(), LEFT_RIGHT, and SHAPE_ELLIPSE::Mirror().
| BOOST_AUTO_TEST_CASE | ( | MirrorLeftRightFlipsCenter | ) |
Definition at line 723 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetRotation(), LEFT_RIGHT, SHAPE_ELLIPSE::Mirror(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | MirrorLeftRightTwiceIsIdentity | ) |
Definition at line 751 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetRotation(), LEFT_RIGHT, SHAPE_ELLIPSE::Mirror(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | MirrorTopBottomFlipsCenter | ) |
Definition at line 737 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetRotation(), SHAPE_ELLIPSE::Mirror(), TOP_BOTTOM, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | MirrorTopBottomTwiceIsIdentity | ) |
Definition at line 768 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetRotation(), SHAPE_ELLIPSE::Mirror(), TOP_BOTTOM, VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | NormalizeArcAnglesOnSwap | ) |
Test that normalize() adjusts arc angles when swapping major/minor radii.
When minor > major, radii swap and rotation += 90. For arcs, angles must shift by -90 to keep the same physical arc.
Definition at line 937 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetEndAngle(), SHAPE_ELLIPSE::GetMajorRadius(), SHAPE_ELLIPSE::GetMinorRadius(), SHAPE_ELLIPSE::GetRotation(), and SHAPE_ELLIPSE::GetStartAngle().
| BOOST_AUTO_TEST_CASE | ( | NormalizeClosedEllipseNoAngleShift | ) |
Test that normalize() does NOT adjust angles for closed ellipses (only arcs).
Definition at line 964 of file test_shape_ellipse.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), DEGREES_T, SHAPE_ELLIPSE::GetMajorRadius(), SHAPE_ELLIPSE::GetMinorRadius(), SHAPE_ELLIPSE::GetRotation(), and SHAPE_ELLIPSE::IsArc().
| BOOST_AUTO_TEST_CASE | ( | PointInsideAfterRotationChange | ) |
Test PointInside after rotation change.
Test if cache is stale.
Definition at line 1035 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::PointInside(), and SHAPE_ELLIPSE::SetRotation().
| BOOST_AUTO_TEST_CASE | ( | PointInsideArcAlwaysFalse | ) |
Definition at line 313 of file test_shape_ellipse.cpp.
References DEGREES_T, and SHAPE_ELLIPSE::PointInside().
| BOOST_AUTO_TEST_CASE | ( | PointInsideClosedAxisAligned | ) |
Definition at line 287 of file test_shape_ellipse.cpp.
References DEGREES_T, and SHAPE_ELLIPSE::PointInside().
| BOOST_AUTO_TEST_CASE | ( | PointInsideRotatedEllipse | ) |
Definition at line 301 of file test_shape_ellipse.cpp.
References DEGREES_T, and SHAPE_ELLIPSE::PointInside().
| BOOST_AUTO_TEST_CASE | ( | QuarterCircleArcLength | ) |
Definition at line 277 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::GetLength(), and M_PI.
| BOOST_AUTO_TEST_CASE | ( | RandomClosedEllipseBBoxVsBruteForce | ) |
Definition at line 147 of file test_shape_ellipse.cpp.
References std::abs(), SHAPE_ELLIPSE::BBox(), bruteForceEllipseBBox(), center, DEGREES_T, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), N, and rng.
| BOOST_AUTO_TEST_CASE | ( | RandomEllipticalArcBBoxVsBruteForce | ) |
Definition at line 183 of file test_shape_ellipse.cpp.
References std::abs(), EDA_ANGLE::AsDegrees(), SHAPE_ELLIPSE::BBox(), BOOST_CHECK_EQUAL(), bruteForceEllipseBBox(), center, DEGREES_T, end, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), N, and rng.
| BOOST_AUTO_TEST_CASE | ( | RotateAboutNonCenterTranslatesAndRotates | ) |
Definition at line 709 of file test_shape_ellipse.cpp.
References std::abs(), EDA_ANGLE::AsDegrees(), DEGREES_T, SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetRotation(), SHAPE_ELLIPSE::Rotate(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | RotateByFullTurnPreservesBBox | ) |
Definition at line 674 of file test_shape_ellipse.cpp.
References std::abs(), SHAPE_ELLIPSE::BBox(), DEGREES_T, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), and SHAPE_ELLIPSE::Rotate().
| BOOST_AUTO_TEST_CASE | ( | RotateCircleAboutCenterIsBBoxInvariant | ) |
Definition at line 692 of file test_shape_ellipse.cpp.
References std::abs(), SHAPE_ELLIPSE::BBox(), DEGREES_T, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), and SHAPE_ELLIPSE::Rotate().
| BOOST_AUTO_TEST_CASE | ( | RotatedEllipseBBoxAt45Degrees | ) |
Definition at line 132 of file test_shape_ellipse.cpp.
References std::abs(), SHAPE_ELLIPSE::BBox(), DEGREES_T, expected, BOX2< Vec >::GetHeight(), and BOX2< Vec >::GetWidth().
| BOOST_AUTO_TEST_CASE | ( | SemiCircleArcLength | ) |
Definition at line 267 of file test_shape_ellipse.cpp.
References DEGREES_T, SHAPE_ELLIPSE::GetLength(), and M_PI.
| BOOST_AUTO_TEST_CASE | ( | SquaredDistanceCircleAgreesWithRadialDistance | ) |
Definition at line 323 of file test_shape_ellipse.cpp.
References std::abs(), DEGREES_T, expected, and SHAPE_ELLIPSE::SquaredDistance().
| BOOST_AUTO_TEST_CASE | ( | SquaredDistanceOutlineOnlyReturnsBoundaryDist | ) |
Definition at line 345 of file test_shape_ellipse.cpp.
References std::abs(), DEGREES_T, and SHAPE_ELLIPSE::SquaredDistance().
| BOOST_AUTO_TEST_CASE | ( | SquaredDistanceZeroInsideClosedEllipse | ) |
Definition at line 337 of file test_shape_ellipse.cpp.
References BOOST_CHECK_EQUAL(), DEGREES_T, and SHAPE_ELLIPSE::SquaredDistance().
|
static |
Compute a bounding box by sampling 10,000 points around the ellipse Used as ground truth to verify BBox() implementation.
Definition at line 46 of file test_shape_ellipse.cpp.
References bruteForceEllipseBBox(), and M_PI.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and bruteForceEllipseBBox().