|
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 (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 (PolyShorteningRejectsOverrun) | |
| 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 225 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 858 of file test_eda_shape.cpp.
References ARC, ARROW, 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 625 of file test_eda_shape.cpp.
References 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 644 of file test_eda_shape.cpp.
References 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 917 of file test_eda_shape.cpp.
References ARROW, BEZIER, 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 895 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 877 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 957 of file test_eda_shape.cpp.
References ARROW, BEZIER, 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 1132 of file test_eda_shape.cpp.
References SHAPE_LINE_CHAIN::Append(), ARROW, checkVectorEqual(), EDA_SHAPE::GetShortenedBodyPolyPoints(), POLY, SHAPE_LINE_CHAIN::SetClosed(), EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), and EDA_SHAPE::SetStartEndingWidth().
| BOOST_AUTO_TEST_CASE | ( | EffectiveShapesHitEndpointSquare | ) |
Definition at line 763 of file test_eda_shape.cpp.
References 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 577 of file test_eda_shape.cpp.
References 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 600 of file test_eda_shape.cpp.
References ARROW_OPEN, BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), 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 689 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 374 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees(), 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 353 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees(), 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 410 of file test_eda_shape.cpp.
References 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 395 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 319 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), BOOST_CHECK_EQUAL(), expected, EDA_SHAPE::GetPolyPoints(), EDA_SHAPE::GetPolyShape(), SHAPE_POLY_SET::NewOutline(), and POLY.
| BOOST_AUTO_TEST_CASE | ( | LineEndingEndpointsRejectInvalidPolys | ) |
Definition at line 559 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), end, EDA_SHAPE::GetLineEndingEndpoints(), SHAPE_POLY_SET::NewOutline(), POLY, and EDA_SHAPE::SetPolyShape().
| BOOST_AUTO_TEST_CASE | ( | LineEndingEndpointsUseShapeOwnedSources | ) |
Definition at line 512 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), ARC, BEZIER, 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 489 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 294 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), 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 265 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::Append(), 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 663 of file test_eda_shape.cpp.
References SHAPE_POLY_SET::BBox(), 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 792 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 | ( | PolyShorteningRejectsOverrun | ) |
Definition at line 1114 of file test_eda_shape.cpp.
References ARROW, checkVectorClose(), POLY, EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenPolyForEndings().
| BOOST_AUTO_TEST_CASE | ( | PolyShorteningTrimsEnds | ) |
Definition at line 1073 of file test_eda_shape.cpp.
References ARROW, 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 474 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 444 of file test_eda_shape.cpp.
References ARROW_OPEN, BOOST_CHECK_EQUAL(), end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | SegmentShorteningRejectsOverrun | ) |
Definition at line 459 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK_EQUAL(), end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | SetAngleAndEnd | ) |
Definition at line 113 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 177 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 | ( | ShortenArcForEndingsKeepsNegativeSweep | ) |
Definition at line 836 of file test_eda_shape.cpp.
References ANGLE_0, ARC, ARROW, 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 814 of file test_eda_shape.cpp.
References ANGLE_0, ARC, ARROW, 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 935 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 1095 of file test_eda_shape.cpp.
References ARROW_OPEN, checkVectorClose(), POLY, EDA_SHAPE::SetStartEndingLength(), EDA_SHAPE::SetStartEndingStyle(), EDA_SHAPE::SetStartEndingWidth(), and EDA_SHAPE::ShortenPolyForEndings().
| BOOST_AUTO_TEST_CASE | ( | ShortenSegmentForEndingsTrimsStartAndEnd | ) |
Definition at line 429 of file test_eda_shape.cpp.
References ARROW, BOOST_CHECK_EQUAL(), CIRCLE, end, EDA_SHAPE::ShortenSegmentForEndings(), VECTOR2< T >::x, and VECTOR2< T >::y.
| BOOST_AUTO_TEST_CASE | ( | StrokingShapesRejectConsumedSegmentBody | ) |
Definition at line 742 of file test_eda_shape.cpp.
References ARROW, 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 719 of file test_eda_shape.cpp.
References ARROW, BOOST_REQUIRE(), 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 996 of file test_eda_shape.cpp.
References std::abs(), ARROW, BEZIER, BOOST_REQUIRE(), 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 58 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 64 of file test_eda_shape.cpp.
References EDA_ANGLE::AsDegrees().
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 44 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(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
Definition at line 51 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 72 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 92 of file test_eda_shape.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 149 of file test_eda_shape.cpp.
Referenced by BOOST_AUTO_TEST_CASE().