|
KiCad PCB EDA Suite
|
#include <geometry/shape_arc.h>#include <geometry/shape_line_chain.h>#include <trigo.h>#include <qa_utils/geometry/geometry.h>#include <qa_utils/numeric.h>#include <qa_utils/wx_utils/unit_test_utils.h>#include "geom_test_utils.h"Go to the source code of this file.
Classes | |
| struct | SLC_CASES |
| NOTE: Collision of SHAPE_LINE_CHAIN with arcs is tested in test_shape_arc.cpp. More... | |
| struct | CLOSE_TOGGLE_SHAPE_CASE |
| struct | REMOVE_SHAPE_CASE |
Functions | |
| BOOST_AUTO_TEST_CASE (ClipperConstructorCase1) | |
| BOOST_AUTO_TEST_CASE (ArcToPolyline) | |
| BOOST_AUTO_TEST_CASE (ArcToPolylineLargeCoords) | |
| BOOST_AUTO_TEST_CASE (SetClosedDuplicatePoint) | |
| BOOST_AUTO_TEST_CASE (ToggleClosed) | |
| BOOST_AUTO_TEST_CASE (PointInPolygon) | |
| BOOST_AUTO_TEST_CASE (SimplifyDuplicatePoint) | |
| BOOST_AUTO_TEST_CASE (SimplifyKeepEndPoint) | |
| BOOST_AUTO_TEST_CASE (SimplifyPNSChain) | |
| BOOST_AUTO_TEST_CASE (SimplifyComplexChain) | |
| BOOST_AUTO_TEST_CASE (RemoveShape) | |
| BOOST_AUTO_TEST_CASE (RemoveShapeAfterSimplify) | |
| BOOST_AUTO_TEST_CASE (ShapeCount) | |
| BOOST_AUTO_TEST_CASE (NextShape) | |
| BOOST_AUTO_TEST_CASE (AppendArc) | |
| BOOST_AUTO_TEST_CASE (ArcWrappingToStartSharedPoints) | |
| BOOST_AUTO_TEST_CASE (Split) | |
| BOOST_AUTO_TEST_CASE (Slice) | |
| BOOST_AUTO_TEST_CASE (NearestPointPt) | |
| BOOST_AUTO_TEST_CASE (ReplaceChain) | |
| BOOST_AUTO_TEST_CASE (CompareGeometry) | |
| BOOST_AUTO_TEST_CASE (CompareGeometryReversed) | |
| BOOST_AUTO_TEST_CASE (SimplifyWithToleranceIssue22597) | |
| Test for issue #22597: Simplify with tolerance should reduce a polygon created from a rotated rounded rectangle (many small line segments approximating arcs). | |
| BOOST_AUTO_TEST_CASE (SimplifyWithArcs) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_NoIntersection_OpenChain) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_NoIntersection_ClosedChain) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_CrossingSegments) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_ClosedFigureEight) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_VertexOnSegment) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_TwoSegments) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_SinglePoint) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_AdjacentSegmentsIgnored) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_ClosedTriangle) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_ClosedLastFirstNotFalsePositive) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_SpatiallyDistant) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_LargeNonIntersecting) | |
| BOOST_AUTO_TEST_CASE (SelfIntersecting_LargeWithCrossing) | |
Variables | |
| static const std::vector< CLOSE_TOGGLE_SHAPE_CASE > | close_toggle_shape_cases |
| static const std::vector< REMOVE_SHAPE_CASE > | remove_shape_cases |
| BOOST_AUTO_TEST_CASE | ( | AppendArc | ) |
Definition at line 675 of file test_shape_line_chain.cpp.
References ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | ArcToPolyline | ) |
Definition at line 179 of file test_shape_line_chain.cpp.
References ANGLE_180, ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), SHAPE_LINE_CHAIN::CPoints(), SHAPE_LINE_CHAIN::CShapes(), and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | ArcToPolylineLargeCoords | ) |
Definition at line 214 of file test_shape_line_chain.cpp.
References ANGLE_180, SHAPE_LINE_CHAIN::Append(), ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | ArcWrappingToStartSharedPoints | ) |
Definition at line 764 of file test_shape_line_chain.cpp.
References arc2(), ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), and chain.
| BOOST_AUTO_TEST_CASE | ( | ClipperConstructorCase1 | ) |
Definition at line 126 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), BOOST_AUTO_TEST_CASE(), BOOST_CHECK_EQUAL(), SHAPE_LINE_CHAIN::IsClosed(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::ShapeCount().
| BOOST_AUTO_TEST_CASE | ( | CompareGeometry | ) |
Definition at line 1250 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::CompareGeometry(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::SetPoint().
| BOOST_AUTO_TEST_CASE | ( | CompareGeometryReversed | ) |
Definition at line 1299 of file test_shape_line_chain.cpp.
References BOOST_TEST(), and SHAPE_LINE_CHAIN::CompareGeometry().
| BOOST_AUTO_TEST_CASE | ( | NearestPointPt | ) |
Definition at line 1186 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, ARC_HIGH_DEF, SEG::B, BOOST_CHECK_EQUAL(), chain, SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | NextShape | ) |
Definition at line 616 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | PointInPolygon | ) |
Definition at line 349 of file test_shape_line_chain.cpp.
| BOOST_AUTO_TEST_CASE | ( | RemoveShape | ) |
Definition at line 557 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), GEOM_TEST::IsOutlineValid(), remove_shape_cases, SHAPE_LINE_CHAIN::RemoveShape(), and SHAPE_LINE_CHAIN::ShapeCount().
| BOOST_AUTO_TEST_CASE | ( | RemoveShapeAfterSimplify | ) |
Definition at line 576 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::ArcCount(), BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), GEOM_TEST::IsOutlineValid(), remove_shape_cases, SHAPE_LINE_CHAIN::RemoveShape(), SHAPE_LINE_CHAIN::ShapeCount(), and SHAPE_LINE_CHAIN::Simplify().
| BOOST_AUTO_TEST_CASE | ( | ReplaceChain | ) |
Definition at line 1216 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_INFO(), SHAPE_LINE_CHAIN::CLastPoint(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Replace(), and SHAPE_LINE_CHAIN::SetWidth().
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_AdjacentSegmentsIgnored | ) |
Definition at line 1863 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_ClosedFigureEight | ) |
Definition at line 1823 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_ClosedLastFirstNotFalsePositive | ) |
Definition at line 1882 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_ClosedTriangle | ) |
Definition at line 1873 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_CrossingSegments | ) |
Definition at line 1810 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, and result.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_LargeNonIntersecting | ) |
Definition at line 1904 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_LargeWithCrossing | ) |
Definition at line 1916 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_NoIntersection_ClosedChain | ) |
Definition at line 1801 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_NoIntersection_OpenChain | ) |
Definition at line 1793 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_SinglePoint | ) |
Definition at line 1854 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_SpatiallyDistant | ) |
Definition at line 1893 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_TwoSegments | ) |
Definition at line 1846 of file test_shape_line_chain.cpp.
References chain.
| BOOST_AUTO_TEST_CASE | ( | SelfIntersecting_VertexOnSegment | ) |
Definition at line 1833 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, and result.
| BOOST_AUTO_TEST_CASE | ( | SetClosedDuplicatePoint | ) |
Definition at line 258 of file test_shape_line_chain.cpp.
References ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | ShapeCount | ) |
Definition at line 599 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL().
| BOOST_AUTO_TEST_CASE | ( | SimplifyComplexChain | ) |
Definition at line 447 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | SimplifyDuplicatePoint | ) |
Definition at line 380 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | SimplifyKeepEndPoint | ) |
Definition at line 400 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | SimplifyPNSChain | ) |
Definition at line 420 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | SimplifyWithArcs | ) |
Definition at line 1524 of file test_shape_line_chain.cpp.
References SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::Arc(), ARC_HIGH_DEF, SHAPE_LINE_CHAIN::ArcCount(), BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), SHAPE_LINE_CHAIN::Find(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::Simplify().
| BOOST_AUTO_TEST_CASE | ( | SimplifyWithToleranceIssue22597 | ) |
Test for issue #22597: Simplify with tolerance should reduce a polygon created from a rotated rounded rectangle (many small line segments approximating arcs).
This polygon has 164 points that form a rounded rectangle rotated 45 degrees.
Definition at line 1329 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), chain, and GEOM_TEST::IsOutlineValid().
| BOOST_AUTO_TEST_CASE | ( | Slice | ) |
CASE 1: Start at arc endpoint, finish middle of arc /
CASE 2: Start at middle of an arc, finish at arc startpoint /
CASE 3: Full arc, nothing else /
CASE 4: Full arc, and straight segments to next arc start /
Definition at line 896 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, SHAPE_LINE_CHAIN::Append(), SHAPE_LINE_CHAIN::Arc(), ARC_HIGH_DEF, SHAPE_LINE_CHAIN::ArcCount(), SEG::B, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), chain, SHAPE_ARC::Collide(), SHAPE_ARC::ConstructFromStartEndCenter(), SHAPE_ARC::DefaultAccuracyForPCB(), SHAPE_ARC::GetArcMid(), SHAPE_ARC::GetCenter(), SHAPE_ARC::GetP0(), SHAPE_ARC::GetP1(), SHAPE_LINE_CHAIN::GetPoint(), SHAPE_LINE_CHAIN::IsArcEnd(), SHAPE_LINE_CHAIN::IsArcStart(), SHAPE_ARC::IsClockwise(), GEOM_TEST::IsOutlineValid(), SLC_CASES::OnePoint, SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::Slice(), and SLC_CASES::TwoPoints.
| BOOST_AUTO_TEST_CASE | ( | Split | ) |
Definition at line 822 of file test_shape_line_chain.cpp.
References SEG::A, ANGLE_180, ARC_HIGH_DEF, SHAPE_LINE_CHAIN::ArcCount(), SEG::B, BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), chain, SHAPE_ARC::GetP0(), SHAPE_LINE_CHAIN::GetPoint(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::IsSharedPt(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::Split().
| BOOST_AUTO_TEST_CASE | ( | ToggleClosed | ) |
Definition at line 323 of file test_shape_line_chain.cpp.
References BOOST_CHECK_EQUAL(), BOOST_TEST_CONTEXT(), close_toggle_shape_cases, SHAPE_LINE_CHAIN::IsClosed(), GEOM_TEST::IsOutlineValid(), SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SetClosed(), and SHAPE_LINE_CHAIN::ShapeCount().
|
static |
Definition at line 305 of file test_shape_line_chain.cpp.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Definition at line 488 of file test_shape_line_chain.cpp.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().