|
KiCad PCB EDA Suite
|
#include <qa_utils/wx_utils/unit_test_utils.h>#include <cmath>#include <base_units.h>#include <eda_shape.h>#include <math/util.h>#include <tool/point_editor_behavior.h>#include <qa_utils/geometry/geometry.h>#include <geometry/shape_arc.h>#include <geometry/shape_line_chain.h>#include <geometry/shape_segment.h>#include <render_settings.h>#include <stroke_params.h>Go to the source code of this file.
Classes | |
| class | EDA_SHAPE_MOCK |
| struct | SET_ANGLE_END_CASE |
| struct | SET_ARC_GEOMETRY_CASE |
| class | STROKE_TEST_RENDER_SETTINGS |
Functions | |
| static void | checkVectorClose (const VECTOR2D &aActual, const VECTOR2D &aExpected, double aTolerance=1e-6) |
| static void | checkVectorEqual (const VECTOR2I &aActual, const VECTOR2I &aExpected) |
| static void | checkAngleClose (const EDA_ANGLE &aActual, double aExpectedDegrees, double aTolerance=1e-6) |
| static void | checkAngleInRange (const EDA_ANGLE &aActual, double aMinDegrees, double aMaxDegrees) |
| static void | deleteShapes (std::vector< SHAPE * > &aShapes) |
| BOOST_AUTO_TEST_CASE (SetAngleAndEnd) | |
| BOOST_AUTO_TEST_CASE (SetArcGeometry) | |
| BOOST_AUTO_TEST_CASE (SetArcGeometryKeepsMidWhenEndsSwap) | |
| SetArcGeometry must keep the supplied midpoint for arcs it stores with swapped ends, as it does for unswapped ones, so an unedited arc saves back unchanged (issue 10442) | |
| BOOST_AUTO_TEST_CASE (ArcEditKeepsSmallSchematicRadius) | |
| Editing a small eeschema arc must not snap its radius up to the PCB-scale 1 mil minimum. | |
| BOOST_AUTO_TEST_CASE (PolygonBehaviorSurvivesAssignment) | |
| Verify that EDA_POLYGON_POINT_EDIT_BEHAVIOR survives EDA_SHAPE assignment. | |
| BOOST_AUTO_TEST_CASE (PolygonBehaviorSignalsRebuildWhenShapeMorphs) | |
| BOOST_AUTO_TEST_CASE (GetPolyPointsPreservesOrderAcrossOutlines) | |
| BOOST_AUTO_TEST_CASE (EllipseBasicAccessors) | |
| BOOST_AUTO_TEST_CASE (EllipseArcIsOpenCurve) | |
| BOOST_AUTO_TEST_CASE (EllipsePerimeterForCircleCase) | |
| BOOST_AUTO_TEST_CASE (EllipseMakeEffectiveShapesNonEmpty) | |
| BOOST_AUTO_TEST_CASE (ShortenSegmentForEndingsTrimsStartAndEnd) | |
| BOOST_AUTO_TEST_CASE (SegmentOpenArrowLeavesBody) | |
| BOOST_AUTO_TEST_CASE (SegmentShorteningRejectsOverrun) | |
| BOOST_AUTO_TEST_CASE (SegmentEndingTangentsPointOutward) | |
| BOOST_AUTO_TEST_CASE (OpenArrowBezierTangentsUseDepth) | |
| BOOST_AUTO_TEST_CASE (LineEndingEndpointsUseShapeOwnedSources) | |
| BOOST_AUTO_TEST_CASE (LineEndingEndpointsRejectInvalidPolys) | |
| BOOST_AUTO_TEST_CASE (EffectiveShapesIncludeClosedEnding) | |
| BOOST_AUTO_TEST_CASE (EffectiveShapesIncludeOpenArrowLegs) | |
| BOOST_AUTO_TEST_CASE (BBoxIncludesCenteredEnding) | |
| BOOST_AUTO_TEST_CASE (BBoxUsesRotatedEndingGeometry) | |
| BOOST_AUTO_TEST_CASE (PolygonConversionAppendsEndings) | |
| BOOST_AUTO_TEST_CASE (EffectiveShapesShortenArrowBody) | |
| BOOST_AUTO_TEST_CASE (StrokingShapesShortenArrowBodyOnly) | |
| BOOST_AUTO_TEST_CASE (StrokingShapesRejectConsumedSegmentBody) | |
| BOOST_AUTO_TEST_CASE (EffectiveShapesHitEndpointSquare) | |
| BOOST_AUTO_TEST_CASE (PolygonConversionShortensArrowBody) | |
| BOOST_AUTO_TEST_CASE (ShortenArcForEndingsKeepsPositiveSweep) | |
| BOOST_AUTO_TEST_CASE (ShortenArcForEndingsKeepsNegativeSweep) | |
| BOOST_AUTO_TEST_CASE (ArcShorteningRejectsOverrun) | |
| BOOST_AUTO_TEST_CASE (BezierNoEndingsReturnsSource) | |
| BOOST_AUTO_TEST_CASE (BezierCurveTrimsBothEnds) | |
| BOOST_AUTO_TEST_CASE (BezierCurveRejectsOverrun) | |
| BOOST_AUTO_TEST_CASE (ShortenedBezierPolylineUsesShortenedCurve) | |
| BOOST_AUTO_TEST_CASE (BezierPolylineRejectsOverrun) | |
| BOOST_AUTO_TEST_CASE (StrokingShortenedBezierDashes) | |
| BOOST_AUTO_TEST_CASE (PolyShorteningTrimsEnds) | |
| BOOST_AUTO_TEST_CASE (ShortenPolyForEndingsLeavesOpenArrowBody) | |
| BOOST_AUTO_TEST_CASE (BodyPolyPointsShortenFirstOpenOutline) | |
Variables | |
| static const std::vector< SET_ANGLE_END_CASE > | set_angle_end_cases |
| static const std::vector< SET_ARC_GEOMETRY_CASE > | set_arc_geometry_cases |
| BOOST_AUTO_TEST_CASE | ( | ArcEditKeepsSmallSchematicRadius | ) |
Editing a small eeschema arc must not snap its radius up to the PCB-scale 1 mil minimum.
The edit helpers used to hard-code pcbIUScale, which in schematic IUs (1 IU = 100 nm) is a 25400 IU == 100 mil floor. See https://gitlab.com/kicad/code/kicad/-/issues/24396.
Definition at line 255 of file test_eda_shape.cpp.
References ARC, arc2(), center, KI_ARC_EDIT::EditArcEndpointKeepCenter(), KI_ARC_EDIT::EditArcMidKeepCenter(), end, EDA_SHAPE::GetRadius(), KiROUND(), radius, schIUScale, and EDA_SHAPE::SetArcGeometry().
| BOOST_AUTO_TEST_CASE | ( | ArcShorteningRejectsOverrun | ) |
Definition at line 888 of file test_eda_shape.cpp.
References ARC, ARROW, BOOST_CHECK(), checkAngleClose(), DEGREES_T, EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenArcForEndings().
| BOOST_AUTO_TEST_CASE | ( | BBoxIncludesCenteredEnding | ) |
Definition at line 655 of file test_eda_shape.cpp.
References BOOST_CHECK(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), EDA_SHAPE::GetLineEndingsBoundingBox(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), and SQUARE.
| BOOST_AUTO_TEST_CASE | ( | BBoxUsesRotatedEndingGeometry | ) |
Definition at line 674 of file test_eda_shape.cpp.
References BOOST_CHECK(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), EDA_SHAPE::GetLineEndingsBoundingBox(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), and SQUARE.
| BOOST_AUTO_TEST_CASE | ( | BezierCurveRejectsOverrun | ) |
Definition at line 947 of file test_eda_shape.cpp.
References ARROW, BEZIER, BOOST_CHECK(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenedBezierCurve().
| BOOST_AUTO_TEST_CASE | ( | BezierCurveTrimsBothEnds | ) |
Definition at line 925 of file test_eda_shape.cpp.
References ARROW, BEZIER, BOOST_REQUIRE(), checkVectorClose(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenedBezierCurve().
| BOOST_AUTO_TEST_CASE | ( | BezierNoEndingsReturnsSource | ) |
Definition at line 907 of file test_eda_shape.cpp.
References BEZIER, BOOST_REQUIRE(), checkVectorClose(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), and EDA_SHAPE::ShortenedBezierCurve().
| BOOST_AUTO_TEST_CASE | ( | BezierPolylineRejectsOverrun | ) |
Definition at line 987 of file test_eda_shape.cpp.
References ARROW, BEZIER, BOOST_CHECK(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenedBezierPolyline().
| BOOST_AUTO_TEST_CASE | ( | BodyPolyPointsShortenFirstOpenOutline | ) |
Definition at line 1144 of file test_eda_shape.cpp.
References SHAPE_LINE_CHAIN::Append(), ARROW, BOOST_CHECK(), BOOST_REQUIRE_EQUAL(), checkVectorEqual(), EDA_SHAPE::GetPolyShape(), EDA_SHAPE::GetShortenedBodyPolyPoints(), SHAPE_POLY_SET::Outline(), POLY, SHAPE_LINE_CHAIN::SetClosed(), EDA_SHAPE::SetPolyShape(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), and EDA_SHAPE::SetStartEndingWidth().
| BOOST_AUTO_TEST_CASE | ( | EffectiveShapesHitEndpointSquare | ) |
Definition at line 793 of file test_eda_shape.cpp.
References BOOST_CHECK(), deleteShapes(), SHAPE_SEGMENT::GetSeg(), EDA_SHAPE::GetWidth(), EDA_SHAPE::MakeEffectiveShapesWithLineEndings(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), EDA_SHAPE::SetWidth(), and SQUARE.
| BOOST_AUTO_TEST_CASE | ( | EffectiveShapesIncludeClosedEnding | ) |
Definition at line 607 of file test_eda_shape.cpp.
References BOOST_CHECK(), BOOST_REQUIRE_EQUAL(), CIRCLE, deleteShapes(), BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), EDA_SHAPE::MakeLineEndingEffectiveShapes(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | EffectiveShapesIncludeOpenArrowLegs | ) |
Definition at line 630 of file test_eda_shape.cpp.
References ARROW_OPEN, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), deleteShapes(), SHAPE_SEGMENT::GetWidth(), EDA_SHAPE::MakeLineEndingEffectiveShapes(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStrokeWidth(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | EffectiveShapesShortenArrowBody | ) |
Definition at line 719 of file test_eda_shape.cpp.
References ARROW, BOOST_REQUIRE(), checkVectorEqual(), deleteShapes(), SHAPE_SEGMENT::GetEnd(), SHAPE_SEGMENT::GetStart(), EDA_SHAPE::GetWidth(), EDA_SHAPE::MakeEffectiveShapesWithLineEndings(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), and EDA_SHAPE::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | EllipseArcIsOpenCurve | ) |
Definition at line 404 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK(), DEGREES_T, ELLIPSE_ARC, EDA_SHAPE::GetEllipseEndAngle(), EDA_SHAPE::GetEllipseStartAngle(), EDA_SHAPE::GetShape(), EDA_SHAPE::IsClosed(), EDA_SHAPE::SetEllipseCenter(), EDA_SHAPE::SetEllipseEndAngle(), EDA_SHAPE::SetEllipseMajorRadius(), EDA_SHAPE::SetEllipseMinorRadius(), EDA_SHAPE::SetEllipseRotation(), and EDA_SHAPE::SetEllipseStartAngle().
| BOOST_AUTO_TEST_CASE | ( | EllipseBasicAccessors | ) |
Definition at line 383 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), DEGREES_T, ELLIPSE, EDA_SHAPE::GetEllipseCenter(), EDA_SHAPE::GetEllipseMajorRadius(), EDA_SHAPE::GetEllipseMinorRadius(), EDA_SHAPE::GetEllipseRotation(), EDA_SHAPE::GetShape(), EDA_SHAPE::IsClosed(), EDA_SHAPE::SetEllipseCenter(), EDA_SHAPE::SetEllipseMajorRadius(), EDA_SHAPE::SetEllipseMinorRadius(), EDA_SHAPE::SetEllipseRotation(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | EllipseMakeEffectiveShapesNonEmpty | ) |
Definition at line 440 of file test_eda_shape.cpp.
References BOOST_CHECK(), DEGREES_T, ELLIPSE, EDA_SHAPE::MakeEffectiveShapes(), EDA_SHAPE::SetEllipseCenter(), EDA_SHAPE::SetEllipseMajorRadius(), EDA_SHAPE::SetEllipseMinorRadius(), and EDA_SHAPE::SetEllipseRotation().
| BOOST_AUTO_TEST_CASE | ( | EllipsePerimeterForCircleCase | ) |
Definition at line 425 of file test_eda_shape.cpp.
References DEGREES_T, ELLIPSE, expected, EDA_SHAPE::GetLength(), M_PI, EDA_SHAPE::SetEllipseCenter(), EDA_SHAPE::SetEllipseMajorRadius(), EDA_SHAPE::SetEllipseMinorRadius(), and EDA_SHAPE::SetEllipseRotation().
| BOOST_AUTO_TEST_CASE | ( | GetPolyPointsPreservesOrderAcrossOutlines | ) |
Definition at line 349 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), expected, EDA_SHAPE::GetPolyPoints(), EDA_SHAPE::GetPolyShape(), SHAPE_POLY_SET::NewOutline(), and POLY.
| BOOST_AUTO_TEST_CASE | ( | LineEndingEndpointsRejectInvalidPolys | ) |
Definition at line 589 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK(), end, EDA_SHAPE::GetLineEndingEndpoints(), SHAPE_POLY_SET::NewOutline(), POLY, and EDA_SHAPE::SetPolyShape().
| BOOST_AUTO_TEST_CASE | ( | LineEndingEndpointsUseShapeOwnedSources | ) |
Definition at line 542 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), ARC, BEZIER, BOOST_CHECK(), checkVectorEqual(), end, EDA_SHAPE::GetLineEndingEndpoints(), SHAPE_POLY_SET::NewOutline(), SHAPE_POLY_SET::Outline(), POLY, SEGMENT, SHAPE_LINE_CHAIN::SetClosed(), EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | OpenArrowBezierTangentsUseDepth | ) |
Definition at line 519 of file test_eda_shape.cpp.
References ARROW_OPEN, BEZIER, checkAngleInRange(), EDA_SHAPE::GetEndingTangents(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), and EDA_SHAPE::SetStartEndingWidth().
| BOOST_AUTO_TEST_CASE | ( | PolygonBehaviorSignalsRebuildWhenShapeMorphs | ) |
Definition at line 324 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK(), EDA_SHAPE::GetPolyShape(), EDA_POLYGON_POINT_EDIT_BEHAVIOR::MakePoints(), SHAPE_POLY_SET::NewOutline(), POLY, RECTANGLE, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetShape(), EDA_SHAPE::SetStart(), and EDA_POLYGON_POINT_EDIT_BEHAVIOR::UpdatePoints().
| BOOST_AUTO_TEST_CASE | ( | PolygonBehaviorSurvivesAssignment | ) |
Verify that EDA_POLYGON_POINT_EDIT_BEHAVIOR survives EDA_SHAPE assignment.
EDA_SHAPE::operator= replaces m_poly with a new unique_ptr. The behavior must resolve GetPolyShape() on each call rather than caching a reference that goes stale. See https://gitlab.com/kicad/code/kicad/-/issues/23648
Definition at line 295 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK(), BOOST_CHECK_EQUAL(), copy, EDA_SHAPE::GetPolyShape(), EDA_POLYGON_POINT_EDIT_BEHAVIOR::MakePoints(), SHAPE_POLY_SET::NewOutline(), EDIT_POINTS::PointsSize(), POLY, and EDA_POLYGON_POINT_EDIT_BEHAVIOR::UpdatePoints().
| BOOST_AUTO_TEST_CASE | ( | PolygonConversionAppendsEndings | ) |
Definition at line 693 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::BBox(), BOOST_CHECK(), ERROR_OUTSIDE, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), EDA_SHAPE::GetWidth(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), SQUARE, EDA_SHAPE::TransformLineEndingsToPolygon(), and EDA_SHAPE::TransformShapeToPolygon().
| BOOST_AUTO_TEST_CASE | ( | PolygonConversionShortensArrowBody | ) |
Definition at line 822 of file test_eda_shape.cpp.
References ARROW, SHAPE_POLY_SET::BBox(), ERROR_OUTSIDE, BOX2< Vec >::GetRight(), EDA_SHAPE::GetWidth(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetWidth(), EDA_SHAPE::TransformLineEndingsToPolygon(), EDA_SHAPE::TransformShapeToPolygon(), and EDA_SHAPE::TransformWithLineEndingsToPolygon().
| BOOST_AUTO_TEST_CASE | ( | PolyShorteningTrimsEnds | ) |
Definition at line 1103 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK(), checkVectorClose(), CIRCLE, POLY, EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenPolyForEndings().
| BOOST_AUTO_TEST_CASE | ( | SegmentEndingTangentsPointOutward | ) |
Definition at line 504 of file test_eda_shape.cpp.
References checkAngleClose(), EDA_SHAPE::GetEndingTangents(), SEGMENT, EDA_SHAPE::SetEnd(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | SegmentOpenArrowLeavesBody | ) |
Definition at line 474 of file test_eda_shape.cpp.
References ARROW_OPEN, BOOST_CHECK(), BOOST_CHECK_EQUAL(), end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | SegmentShorteningRejectsOverrun | ) |
Definition at line 489 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK(), BOOST_CHECK_EQUAL(), end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | SetAngleAndEnd | ) |
Definition at line 117 of file test_eda_shape.cpp.
References ARC, BOOST_CHECK_EQUAL(), BOOST_CHECK_PREDICATE(), SHAPE_ARC::DefaultAccuracyForPCB(), DEGREES_T, EDA_SHAPE::EndsSwapped(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), KI_TEST::IsVecWithinTol(), set_angle_end_cases, EDA_SHAPE::SetArcAngleAndEnd(), EDA_SHAPE::SetCenter(), and EDA_SHAPE::SetStart().
| BOOST_AUTO_TEST_CASE | ( | SetArcGeometry | ) |
Definition at line 181 of file test_eda_shape.cpp.
References ARC, EDA_ANGLE::AsDegrees(), BOOST_CHECK_EQUAL(), BOOST_CHECK_PREDICATE(), center, SHAPE_ARC::DefaultAccuracyForPCB(), EDA_SHAPE::EndsSwapped(), EDA_SHAPE::GetArcAngle(), EDA_SHAPE::getCenter(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetStart(), KI_TEST::IsVecWithinTol(), KI_TEST::IsWithin(), KI_TEST::IsWithinWrapped(), radius, set_arc_geometry_cases, and EDA_SHAPE::SetArcGeometry().
| BOOST_AUTO_TEST_CASE | ( | SetArcGeometryKeepsMidWhenEndsSwap | ) |
SetArcGeometry must keep the supplied midpoint for arcs it stores with swapped ends, as it does for unswapped ones, so an unedited arc saves back unchanged (issue 10442)
Definition at line 227 of file test_eda_shape.cpp.
References ARC, BOOST_CHECK_EQUAL(), BOOST_REQUIRE_EQUAL(), EDA_SHAPE::EndsSwapped(), EDA_SHAPE::GetArcMid(), EDA_SHAPE::SetArcGeometry(), and swap.
| BOOST_AUTO_TEST_CASE | ( | ShortenArcForEndingsKeepsNegativeSweep | ) |
Definition at line 866 of file test_eda_shape.cpp.
References ANGLE_0, ARC, ARROW, BOOST_CHECK(), checkAngleClose(), DEGREES_T, M_PI, radius, EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenArcForEndings().
| BOOST_AUTO_TEST_CASE | ( | ShortenArcForEndingsKeepsPositiveSweep | ) |
Definition at line 844 of file test_eda_shape.cpp.
References ANGLE_0, ARC, ARROW, BOOST_CHECK(), checkAngleClose(), DEGREES_T, M_PI, radius, EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenArcForEndings().
| BOOST_AUTO_TEST_CASE | ( | ShortenedBezierPolylineUsesShortenedCurve | ) |
Definition at line 965 of file test_eda_shape.cpp.
References ARROW, BEZIER, checkVectorClose(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenedBezierPolyline().
| BOOST_AUTO_TEST_CASE | ( | ShortenPolyForEndingsLeavesOpenArrowBody | ) |
Definition at line 1125 of file test_eda_shape.cpp.
References ARROW_OPEN, BOOST_CHECK(), checkVectorClose(), POLY, EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenPolyForEndings().
| BOOST_AUTO_TEST_CASE | ( | ShortenSegmentForEndingsTrimsStartAndEnd | ) |
Definition at line 459 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK(), BOOST_CHECK_EQUAL(), CIRCLE, end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | StrokingShapesRejectConsumedSegmentBody | ) |
Definition at line 772 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK(), deleteShapes(), EDA_SHAPE::GetWidth(), EDA_SHAPE::MakeEffectiveShapesForStroking(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | StrokingShapesShortenArrowBodyOnly | ) |
Definition at line 749 of file test_eda_shape.cpp.
References ARROW, BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), checkVectorEqual(), deleteShapes(), SHAPE_SEGMENT::GetEnd(), SHAPE_SEGMENT::GetStart(), EDA_SHAPE::GetWidth(), EDA_SHAPE::MakeEffectiveShapesForStroking(), SEGMENT, EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), and EDA_SHAPE::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | StrokingShortenedBezierDashes | ) |
Definition at line 1026 of file test_eda_shape.cpp.
References std::abs(), ARROW, BEZIER, BOOST_REQUIRE(), BOOST_REQUIRE_EQUAL(), BOOST_REQUIRE_MESSAGE(), chain, DASH, deleteShapes(), end, VECTOR2< T >::EuclideanNorm(), expected, KIGFX::RENDER_SETTINGS::GetDashLength(), KIGFX::RENDER_SETTINGS::GetGapLength(), EDA_SHAPE::GetWidth(), EDA_SHAPE::MakeEffectiveShapesForStroking(), EDA_SHAPE::SetBezierC1(), EDA_SHAPE::SetBezierC2(), EDA_SHAPE::SetEnd(), EDA_SHAPE::SetEndEndingLength(), EDA_SHAPE::SetEndEndingStyle(), EDA_SHAPE::SetEndEndingWidth(), EDA_SHAPE::SetStart(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), EDA_SHAPE::SetWidth(), and STROKE_PARAMS::Stroke().
|
static |
Definition at line 62 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 68 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 48 of file test_eda_shape.cpp.
References VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Definition at line 55 of file test_eda_shape.cpp.
References BOOST_CHECK_EQUAL(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 76 of file test_eda_shape.cpp.
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(), and BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 96 of file test_eda_shape.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 153 of file test_eda_shape.cpp.
Referenced by BOOST_AUTO_TEST_CASE().