24#include <boost/test/unit_test.hpp> 
   25#include <boost/test/data/test_case.hpp> 
   49    int aRadius, 
int aError )
 
   51    const auto diffA = aRadCentre - aSeg.A;
 
   52    const auto diffB = aRadCentre - aSeg.B;
 
   53    const auto diffC = aRadCentre - aSeg.Center();
 
   68            ( diffC )( aSeg.A - aSeg.B )( perpendularityMaxError ) );
 
 
   90    const VECTOR2I radCentre { aSquareSize / 2 - aRadius,
 
   91        aSquareSize / 2 - aRadius };
 
   95    for( ; segIter; segIter++ )
 
  106    BOOST_CHECK( checked > 0 );
 
 
  147    const VECTOR2I radCentre { aSquareSize / 2 - aRadius,
 
  148        aSquareSize / 2 + aRadius };
 
  152    for( ; segIter; segIter++ )
 
  163    BOOST_CHECK( checked > 0 );
 
 
  175        return os << 
"Square size: " << testCase.
squareSize << 
", Radius: " << testCase.
radius 
  176                  << 
", Error: " << testCase.
error;
 
 
 
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
 
void SetClosed(bool aClosed)
Mark the line chain as closed (i.e.
 
void Append(int aX, int aY, bool aAllowDuplication=false)
Append a new point at the end of the line chain.
 
Represent a set of closed polygons.
 
int AddOutline(const SHAPE_LINE_CHAIN &aOutline)
Adds a new outline to the set and returns its index.
 
SEGMENT_ITERATOR IterateSegments(int aFirst, int aLast, bool aIterateHoles=false)
Return an iterator object, for iterating between aFirst and aLast outline, with or without holes (def...
 
int OutlineCount() const
Return the number of outlines in the set.
 
static constexpr EDA_ANGLE ANGLE_90
 
Utilities for creating useful line chain idioms commonly founds in QA utilities and tests.
 
Utility functions for testing geometry functions.
 
bool SegmentCompletelyWithinRadius(const SEG &aSeg, const VECTOR2I &aPt, const int aRadius)
 
SHAPE_POLY_SET FilletPolySet(SHAPE_POLY_SET &aPolySet, int aRadius, int aError)
 
bool SegmentCompletelyInQuadrant(const SEG &aSeg, QUADRANT aQuadrant)
 
bool ArePerpendicular(const VECTOR2< T > &a, const VECTOR2< T > &b, const EDA_ANGLE &aTolerance)
 
SHAPE_LINE_CHAIN BuildSquareChain(int aSize, const VECTOR2I &aCentre)
Builds a square SHAPE_LINE_CHAIN of a certain size at a certain centre.
 
bool IsWithinAndBelow(T aValue, T aNominal, T aErrorBelow)
value is in range [aNominal - aErrorBelow, aNominal]
 
friend std::ostream & operator<<(std::ostream &os, const SquareFilletTestCase &testCase)
 
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
 
const std::vector< SquareFilletTestCase > squareFilletCases
 
void TestConcaveSquareFillet(int aSquareSize, int aRadius, int aError)
: Create a square concave corner, fillet and check correctness
 
void TestFilletSegmentConstraints(const SEG &aSeg, VECTOR2I aRadCentre, int aRadius, int aError)
 
BOOST_DATA_TEST_CASE(SquareConcaveFillet, boost::unit_test::data::make(squareFilletCases), testCase)
Tests the SHAPE_POLY_SET::FilletPolygon method against certain geometric constraints.
 
void TestSquareFillet(int aSquareSize, int aRadius, int aError)
: Create a square, fillet it, and check a corner for correctness
 
BOOST_AUTO_TEST_SUITE_END()
 
BOOST_CHECK_PREDICATE(ArePolylineEndPointsNearCircle,(chain)(c.m_geom.m_center_point)(radius)(accuracy+epsilon))
 
BOOST_CHECK_EQUAL(result, "25.4")
 
VECTOR2< int32_t > VECTOR2I