KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_shape_line_chain.cpp File Reference

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 (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_CASEclose_toggle_shape_cases
 
static const std::vector< REMOVE_SHAPE_CASEremove_shape_cases
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/36]

BOOST_AUTO_TEST_CASE ( AppendArc )

◆ BOOST_AUTO_TEST_CASE() [2/36]

◆ BOOST_AUTO_TEST_CASE() [3/36]

BOOST_AUTO_TEST_CASE ( ArcToPolylineLargeCoords )

◆ BOOST_AUTO_TEST_CASE() [4/36]

BOOST_AUTO_TEST_CASE ( ArcWrappingToStartSharedPoints )

Definition at line 768 of file test_shape_line_chain.cpp.

References arc2(), ARC_HIGH_DEF, BOOST_CHECK_EQUAL(), and chain.

◆ BOOST_AUTO_TEST_CASE() [5/36]

◆ BOOST_AUTO_TEST_CASE() [6/36]

◆ BOOST_AUTO_TEST_CASE() [7/36]

BOOST_AUTO_TEST_CASE ( CompareGeometryReversed )

◆ BOOST_AUTO_TEST_CASE() [8/36]

BOOST_AUTO_TEST_CASE ( NearestPointPt )

◆ BOOST_AUTO_TEST_CASE() [9/36]

BOOST_AUTO_TEST_CASE ( NextShape )

Definition at line 620 of file test_shape_line_chain.cpp.

References BOOST_CHECK_EQUAL().

◆ BOOST_AUTO_TEST_CASE() [10/36]

BOOST_AUTO_TEST_CASE ( PointInPolygon )

Definition at line 353 of file test_shape_line_chain.cpp.

◆ BOOST_AUTO_TEST_CASE() [11/36]

◆ BOOST_AUTO_TEST_CASE() [12/36]

◆ BOOST_AUTO_TEST_CASE() [13/36]

◆ BOOST_AUTO_TEST_CASE() [14/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_AdjacentSegmentsIgnored )

Definition at line 1598 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [15/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_ClosedFigureEight )

Definition at line 1558 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [16/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_ClosedLastFirstNotFalsePositive )

Definition at line 1617 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [17/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_ClosedTriangle )

Definition at line 1608 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [18/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_CrossingSegments )

Definition at line 1545 of file test_shape_line_chain.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, and result.

◆ BOOST_AUTO_TEST_CASE() [19/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_LargeNonIntersecting )

Definition at line 1639 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [20/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_LargeWithCrossing )

Definition at line 1651 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [21/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_NoIntersection_ClosedChain )

Definition at line 1536 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [22/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_NoIntersection_OpenChain )

Definition at line 1528 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [23/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_SinglePoint )

Definition at line 1589 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [24/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_SpatiallyDistant )

Definition at line 1628 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [25/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_TwoSegments )

Definition at line 1581 of file test_shape_line_chain.cpp.

References chain.

◆ BOOST_AUTO_TEST_CASE() [26/36]

BOOST_AUTO_TEST_CASE ( SelfIntersecting_VertexOnSegment )

Definition at line 1568 of file test_shape_line_chain.cpp.

References BOOST_CHECK_EQUAL(), BOOST_REQUIRE(), chain, and result.

◆ BOOST_AUTO_TEST_CASE() [27/36]

BOOST_AUTO_TEST_CASE ( SetClosedDuplicatePoint )

◆ BOOST_AUTO_TEST_CASE() [28/36]

BOOST_AUTO_TEST_CASE ( ShapeCount )

Definition at line 603 of file test_shape_line_chain.cpp.

References BOOST_CHECK_EQUAL().

◆ BOOST_AUTO_TEST_CASE() [29/36]

BOOST_AUTO_TEST_CASE ( SimplifyComplexChain )

◆ BOOST_AUTO_TEST_CASE() [30/36]

BOOST_AUTO_TEST_CASE ( SimplifyDuplicatePoint )

◆ BOOST_AUTO_TEST_CASE() [31/36]

BOOST_AUTO_TEST_CASE ( SimplifyKeepEndPoint )

◆ BOOST_AUTO_TEST_CASE() [32/36]

BOOST_AUTO_TEST_CASE ( SimplifyPNSChain )

◆ BOOST_AUTO_TEST_CASE() [33/36]

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 1333 of file test_shape_line_chain.cpp.

References BOOST_CHECK_EQUAL(), BOOST_TEST_MESSAGE(), chain, and GEOM_TEST::IsOutlineValid().

◆ BOOST_AUTO_TEST_CASE() [34/36]

◆ BOOST_AUTO_TEST_CASE() [35/36]

◆ BOOST_AUTO_TEST_CASE() [36/36]

Variable Documentation

◆ close_toggle_shape_cases

const std::vector<CLOSE_TOGGLE_SHAPE_CASE> close_toggle_shape_cases
static
Initial value:
=
{
{ "Circle1Arc", SLC_CASES().Circle1Arc, true, 1, 15, 1, 16 },
{ "Circle2Arcs", SLC_CASES().Circle2Arcs, true, 2, 16, 2, 17 },
{ "ArcsCoincident", SLC_CASES().ArcsCoincident, false, 2, 14, 3, 14 },
{ "ArcsCoincidentClosed", SLC_CASES().ArcsCoincidentClosed, true, 3, 14, 2, 14 },
{ "ArcsIndependent", SLC_CASES().ArcsIndependent, false, 3, 18, 4, 18 },
{ "DuplicateArcs", SLC_CASES().DuplicateArcs, false, 4, 20, 5, 20 },
{ "ArcAndPoint", SLC_CASES().ArcAndPoint, false, 2, 10, 3, 10 },
{ "ArcsAndSegMixed", SLC_CASES().ArcsAndSegMixed, false, 4, 19, 5, 19 },
{ "OnePoint", SLC_CASES().OnePoint, false, 0, 1, 0, 1 },
{ "TwoPoints", SLC_CASES().TwoPoints, false, 1, 2, 2, 2 },
{ "ThreePoints", SLC_CASES().ThreePoints, false, 2, 3, 3, 3 },
}
NOTE: Collision of SHAPE_LINE_CHAIN with arcs is tested in test_shape_arc.cpp.
SHAPE_LINE_CHAIN Circle1Arc
SHAPE_LINE_CHAIN Circle2Arcs

Definition at line 309 of file test_shape_line_chain.cpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ remove_shape_cases

const std::vector<REMOVE_SHAPE_CASE> remove_shape_cases
static

Definition at line 492 of file test_shape_line_chain.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().