84 std::vector<ARC_POINT> points;
85 points.emplace_back( 0.0, 0.0 );
86 points.emplace_back( 100.0, 0.0,
ARC{ 50.0, 0.0, 50.0, 180.0, -180.0 } );
88 BOOST_REQUIRE_EQUAL( points.size(), 2 );
100 double bboxMinX = -50.0, bboxMinY = -50.0;
101 double bboxMaxX = 50.0, bboxMaxY = 50.0;
102 int startAngleTenths = 900;
103 int deltaAngleTenths = -900;
105 double cx = ( bboxMinX + bboxMaxX ) / 2.0;
106 double cy = ( bboxMinY + bboxMaxY ) / 2.0;
107 double radius = ( bboxMaxX - bboxMinX ) / 2.0;
108 double startAngle = startAngleTenths / 10.0;
109 double deltaAngle = deltaAngleTenths / 10.0;
111 BOOST_CHECK_CLOSE( cx, 0.0, 0.001 );
112 BOOST_CHECK_CLOSE( cy, 0.0, 0.001 );
113 BOOST_CHECK_CLOSE(
radius, 50.0, 0.001 );
114 BOOST_CHECK_CLOSE( startAngle, 90.0, 0.001 );
115 BOOST_CHECK_CLOSE( deltaAngle, -90.0, 0.001 );
123 double bboxMinX = 75.0, bboxMinY = 175.0;
124 double bboxMaxX = 125.0, bboxMaxY = 225.0;
126 double cx = ( bboxMinX + bboxMaxX ) / 2.0;
127 double cy = ( bboxMinY + bboxMaxY ) / 2.0;
128 double radius = ( bboxMaxX - bboxMinX ) / 2.0;
130 BOOST_CHECK_CLOSE( cx, 100.0, 0.001 );
131 BOOST_CHECK_CLOSE( cy, 200.0, 0.001 );
132 BOOST_CHECK_CLOSE(
radius, 25.0, 0.001 );
139 std::string line =
"0 0 900 -900 -50 -50 50 50";
140 std::istringstream iss( line );
143 int startAngleTenths, deltaAngleTenths;
144 double bboxMinX, bboxMinY, bboxMaxX, bboxMaxY;
147 bool hasArc =
static_cast<bool>( iss >> startAngleTenths >> deltaAngleTenths
148 >> bboxMinX >> bboxMinY >> bboxMaxX >> bboxMaxY );
150 BOOST_CHECK( hasArc );
159 std::string line =
"100 200";
160 std::istringstream iss( line );
163 int startAngleTenths, deltaAngleTenths;
164 double bboxMinX, bboxMinY, bboxMaxX, bboxMaxY;
167 bool hasArc =
static_cast<bool>( iss >> startAngleTenths >> deltaAngleTenths
168 >> bboxMinX >> bboxMinY >> bboxMaxX >> bboxMaxY );
170 BOOST_CHECK( !hasArc );
171 BOOST_CHECK_CLOSE( dx, 100.0, 0.001 );
172 BOOST_CHECK_CLOSE( dy, 200.0, 0.001 );
BOOST_CHECK_EQUAL(result, "25.4")