Merge pull request #640 from barendgehrels/minor/sort_and_test
Minor changes
This commit is contained in:
commit
c5ef6985ef
@ -34,8 +34,8 @@ struct distance_measure
|
||||
: measure(T())
|
||||
{}
|
||||
|
||||
bool is_small() const { return true; }
|
||||
bool is_zero() const { return true; }
|
||||
bool is_small() const { return false; }
|
||||
bool is_zero() const { return false; }
|
||||
bool is_positive() const { return false; }
|
||||
bool is_negative() const { return false; }
|
||||
};
|
||||
|
@ -52,9 +52,8 @@ struct ranked_point
|
||||
, operation(operation_none)
|
||||
{}
|
||||
|
||||
template <typename Op>
|
||||
ranked_point(const Point& p, signed_size_type ti, int oi,
|
||||
direction_type d, Op op)
|
||||
ranked_point(Point const& p, signed_size_type ti, int oi,
|
||||
direction_type d, operation_type op, segment_identifier const& si)
|
||||
: point(p)
|
||||
, rank(0)
|
||||
, zone(-1)
|
||||
@ -63,8 +62,8 @@ struct ranked_point
|
||||
, direction(d)
|
||||
, count_left(0)
|
||||
, count_right(0)
|
||||
, operation(op.operation)
|
||||
, seg_id(op.seg_id)
|
||||
, operation(op)
|
||||
, seg_id(si)
|
||||
{}
|
||||
|
||||
Point point;
|
||||
@ -126,8 +125,8 @@ template <typename Point, typename SideStrategy, typename LessOnSame, typename C
|
||||
struct less_by_side
|
||||
{
|
||||
less_by_side(const Point& p1, const Point& p2, SideStrategy const& strategy)
|
||||
: m_p1(p1)
|
||||
, m_p2(p2)
|
||||
: m_origin(p1)
|
||||
, m_turn_point(p2)
|
||||
, m_strategy(strategy)
|
||||
{}
|
||||
|
||||
@ -139,16 +138,16 @@ struct less_by_side
|
||||
LessOnSame on_same;
|
||||
Compare compare;
|
||||
|
||||
int const side_first = m_strategy.apply(m_p1, m_p2, first.point);
|
||||
int const side_second = m_strategy.apply(m_p1, m_p2, second.point);
|
||||
int const side_first = m_strategy.apply(m_origin, m_turn_point, first.point);
|
||||
int const side_second = m_strategy.apply(m_origin, m_turn_point, second.point);
|
||||
|
||||
if (side_first == 0 && side_second == 0)
|
||||
{
|
||||
// Both collinear. They might point into different directions: <------*------>
|
||||
// If so, order the one going backwards as the very first.
|
||||
|
||||
int const first_code = direction_code<cs_tag>(m_p1, m_p2, first.point);
|
||||
int const second_code = direction_code<cs_tag>(m_p1, m_p2, second.point);
|
||||
int const first_code = direction_code<cs_tag>(m_origin, m_turn_point, first.point);
|
||||
int const second_code = direction_code<cs_tag>(m_origin, m_turn_point, second.point);
|
||||
|
||||
// Order by code, backwards first, then forward.
|
||||
return first_code != second_code
|
||||
@ -157,14 +156,14 @@ struct less_by_side
|
||||
;
|
||||
}
|
||||
else if (side_first == 0
|
||||
&& direction_code<cs_tag>(m_p1, m_p2, first.point) == -1)
|
||||
&& direction_code<cs_tag>(m_origin, m_turn_point, first.point) == -1)
|
||||
{
|
||||
// First collinear and going backwards.
|
||||
// Order as the very first, so return always true
|
||||
return true;
|
||||
}
|
||||
else if (side_second == 0
|
||||
&& direction_code<cs_tag>(m_p1, m_p2, second.point) == -1)
|
||||
&& direction_code<cs_tag>(m_origin, m_turn_point, second.point) == -1)
|
||||
{
|
||||
// Second is collinear and going backwards
|
||||
// Order as very last, so return always false
|
||||
@ -180,7 +179,7 @@ struct less_by_side
|
||||
|
||||
// They are both left, both right, and/or both collinear (with each other and/or with p1,p2)
|
||||
// Check mutual side
|
||||
int const side_second_wrt_first = m_strategy.apply(m_p2, first.point, second.point);
|
||||
int const side_second_wrt_first = m_strategy.apply(m_turn_point, first.point, second.point);
|
||||
|
||||
if (side_second_wrt_first == 0)
|
||||
{
|
||||
@ -197,7 +196,8 @@ struct less_by_side
|
||||
}
|
||||
|
||||
private :
|
||||
Point m_p1, m_p2;
|
||||
Point const& m_origin;
|
||||
Point const& m_turn_point;
|
||||
SideStrategy const& m_strategy;
|
||||
};
|
||||
|
||||
@ -245,6 +245,35 @@ public :
|
||||
, m_strategy(strategy)
|
||||
{}
|
||||
|
||||
void add_segment_from(signed_size_type turn_index, int op_index,
|
||||
Point const& point_from,
|
||||
operation_type op, segment_identifier const& si,
|
||||
bool is_origin)
|
||||
{
|
||||
m_ranked_points.push_back(rp(point_from, turn_index, op_index, dir_from, op, si));
|
||||
if (is_origin)
|
||||
{
|
||||
m_origin = point_from;
|
||||
m_origin_count++;
|
||||
}
|
||||
}
|
||||
|
||||
void add_segment_to(signed_size_type turn_index, int op_index,
|
||||
Point const& point_to,
|
||||
operation_type op, segment_identifier const& si)
|
||||
{
|
||||
m_ranked_points.push_back(rp(point_to, turn_index, op_index, dir_to, op, si));
|
||||
}
|
||||
|
||||
void add_segment(signed_size_type turn_index, int op_index,
|
||||
Point const& point_from, Point const& point_to,
|
||||
operation_type op, segment_identifier const& si,
|
||||
bool is_origin)
|
||||
{
|
||||
add_segment_from(turn_index, op_index, point_from, op, si, is_origin);
|
||||
add_segment_to(turn_index, op_index, point_to, op, si);
|
||||
}
|
||||
|
||||
template <typename Operation, typename Geometry1, typename Geometry2>
|
||||
Point add(Operation const& op, signed_size_type turn_index, int op_index,
|
||||
Geometry1 const& geometry1,
|
||||
@ -255,14 +284,7 @@ public :
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(geometry1, geometry2,
|
||||
op.seg_id, point1, point2, point3);
|
||||
Point const& point_to = op.fraction.is_one() ? point3 : point2;
|
||||
|
||||
m_ranked_points.push_back(rp(point1, turn_index, op_index, dir_from, op));
|
||||
m_ranked_points.push_back(rp(point_to, turn_index, op_index, dir_to, op));
|
||||
if (is_origin)
|
||||
{
|
||||
m_origin = point1;
|
||||
m_origin_count++;
|
||||
}
|
||||
add_segment(turn_index, op_index, point1, point_to, op.operation, op.seg_id, is_origin);
|
||||
return point1;
|
||||
}
|
||||
|
||||
@ -642,6 +664,23 @@ public :
|
||||
};
|
||||
|
||||
|
||||
//! Metafunction to define side_order (clockwise, ccw) by operation_type
|
||||
template <operation_type OpType>
|
||||
struct side_compare {};
|
||||
|
||||
template <>
|
||||
struct side_compare<operation_union>
|
||||
{
|
||||
typedef std::greater<int> type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct side_compare<operation_intersection>
|
||||
{
|
||||
typedef std::less<int> type;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace detail::overlay::sort_by_side
|
||||
#endif //DOXYGEN_NO_DETAIL
|
||||
|
||||
|
@ -72,24 +72,6 @@ inline void debug_traverse(Turn const& , Operation, const char*, bool = true)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//! Metafunction to define side_order (clockwise, ccw) by operation_type
|
||||
template <operation_type OpType>
|
||||
struct side_compare {};
|
||||
|
||||
template <>
|
||||
struct side_compare<operation_union>
|
||||
{
|
||||
typedef std::greater<int> type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct side_compare<operation_intersection>
|
||||
{
|
||||
typedef std::less<int> type;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
bool Reverse1,
|
||||
@ -124,7 +106,7 @@ private :
|
||||
|
||||
static const operation_type target_operation = operation_from_overlay<OverlayType>::value;
|
||||
|
||||
typedef typename side_compare<target_operation>::type side_compare_type;
|
||||
typedef typename sort_by_side::side_compare<target_operation>::type side_compare_type;
|
||||
typedef typename boost::range_value<Turns>::type turn_type;
|
||||
typedef typename turn_type::turn_operation_type turn_operation_type;
|
||||
|
||||
|
@ -57,9 +57,14 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::point<int, 2, bg::cs::cartesian> >();
|
||||
test_all<bg::model::point<float, 2, bg::cs::cartesian> >();
|
||||
test_all<bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TTMATH
|
||||
test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();
|
||||
|
@ -235,8 +235,13 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -397,11 +397,18 @@ void test_invalid()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
//test_all<bg::model::point<tt, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_invalid<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
// test_invalid<true, bg::model::point<long double, 2, bg::cs::cartesian> >();
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
test_invalid<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_invalid<true, bg::model::point<long double, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -446,6 +446,13 @@ void test_aimes()
|
||||
double aimes_width = static_cast<double>(width) / 1000000.0;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) && ! defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
if (i > 10)
|
||||
{
|
||||
// Several cases (11,20,40 etc) are still reported as invalid
|
||||
settings.test_validity = false;
|
||||
}
|
||||
#endif
|
||||
std::ostringstream name;
|
||||
try
|
||||
{
|
||||
@ -474,6 +481,9 @@ void test_aimes()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_aimes<bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_aimes<bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -214,8 +214,13 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -206,8 +206,13 @@ void test_many_points_per_circle()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_COMPILER_MODE_RELEASE) && ! defined(BOOST_GEOMETRY_COMPILER_MODE_DEBUG)
|
||||
test_many_points_per_circle<bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
|
@ -368,9 +368,7 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_d", rt_d, join_round, end_flat, 18.8726, 0.3);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_e", rt_e, join_round, end_flat, 14.1866, 0.3);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g1", rt_g1, join_round, end_flat, 24.719, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_g3", rt_g3, join_miter, end_flat, 16.5711, 1.0);
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_d", rt_d, join_miter, end_flat, 19.8823, 0.3);
|
||||
@ -386,8 +384,8 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_i", rt_i, join_round, end_flat, 10.7528, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_i", rt_i, join_miter, end_flat, 13.6569, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_j", rt_j, join_round, end_flat, 28.7309, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_j", rt_j, join_round, end_flat, 28.7309, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_j", rt_j, join_miter, end_flat, 35.1421, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_k", rt_k, join_round, end_flat, 42.0092, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_k", rt_k, join_miter, end_flat, 48.0563, 1.0);
|
||||
@ -413,15 +411,14 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p5", rt_p5, join_miter, end_flat, 17.0, 1.0);
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p6", rt_p6, join_miter, end_flat, 18.4853, 1.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p7", rt_p7, join_miter, end_flat, 26.2279, 1.0);
|
||||
#endif
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p8", rt_p8, join_miter, end_flat, 29.0563, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p9", rt_p9, join_miter, end_flat, 26.1421, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p8", rt_p8, join_miter, end_flat, 29.0563, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p9", rt_p9, join_miter, end_flat, 26.1421, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p10", rt_p10, join_miter, end_flat, 23.3995, 1.0);
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p11", rt_p11, join_miter, end_flat, 28.7426, 1.0);
|
||||
@ -435,11 +432,15 @@ void test_all()
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p17", rt_p17, join_miter, end_flat, 25.3137, 1.0);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p18", rt_p18, join_miter, end_flat, 23.3137, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p19", rt_p19, join_miter, end_flat, 25.5637, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p20", rt_p20, join_miter, end_flat, 25.4853, 1.0);
|
||||
#endif
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p21", rt_p21, join_miter, end_flat, 17.1716, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_p22", rt_p22, join_miter, end_flat, 26.5711, 1.0);
|
||||
#endif
|
||||
|
||||
@ -447,12 +448,14 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_q2", rt_q2, join_miter, end_flat, 26.4853, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_q2", rt_q2, join_miter, end_flat, 0.9697, -0.25);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_r", rt_r, join_miter, end_flat, 21.0761, 1.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_s1", rt_s1, join_miter, end_flat, 20.4853, 1.0);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<multi_polygon_type, polygon_type>("rt_s2", rt_s2, join_miter, end_flat, 24.6495, 1.0);
|
||||
#endif
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_t1", rt_t, join_miter, end_flat, 15.6569, 1.0);
|
||||
test_one<multi_polygon_type, polygon_type>("rt_t2", rt_t, join_miter, end_flat, 0.1679, -0.25);
|
||||
@ -514,9 +517,13 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
//test_all<bg::model::point<ttmath_big, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -30,7 +30,12 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
@ -35,8 +35,13 @@ void test_point()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_point<true, bg::model::point<double, 2, bg::cs::geographic<bg::degree> > >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_point<true, bg::model::point<default_test_type, 2, bg::cs::geographic<bg::degree> > >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_point<true, bg::model::point<long double, 2, bg::cs::geographic<bg::degree> > >();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -374,9 +374,7 @@ void test_all()
|
||||
test_one<polygon_type, polygon_type>("snake4", snake, join_miter, end_flat, 64.44, 0.4);
|
||||
test_one<polygon_type, polygon_type>("snake5", snake, join_miter, end_flat, 72, 0.5);
|
||||
test_one<polygon_type, polygon_type>("snake6", snake, join_miter, end_flat, 75.44, 0.6);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<polygon_type, polygon_type>("snake16", snake, join_miter, end_flat, 114.24, 1.6);
|
||||
#endif
|
||||
|
||||
test_one<polygon_type, polygon_type>("funnelgate2", funnelgate, join_miter, end_flat, 120.982, 2.0);
|
||||
test_one<polygon_type, polygon_type>("funnelgate3", funnelgate, join_miter, end_flat, 13.0*13.0, 3.0);
|
||||
@ -830,16 +828,22 @@ void test_mixed()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
typedef bg::model::point<double, 2, bg::cs::cartesian> dpoint;
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
typedef bg::model::point<default_test_type, 2, bg::cs::cartesian> dpoint;
|
||||
|
||||
test_all<true, dpoint>();
|
||||
test_all<false, dpoint>();
|
||||
|
||||
typedef bg::model::point<float, 2, bg::cs::cartesian> fpoint;
|
||||
test_deflate_special_cases<true, fpoint>();
|
||||
test_deflate_special_cases<true, dpoint>();
|
||||
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, dpoint>();
|
||||
test_deflate_special_cases<false, dpoint>();
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
typedef bg::model::point<float, 2, bg::cs::cartesian> fpoint;
|
||||
test_deflate_special_cases<true, fpoint>();
|
||||
|
||||
test_mixed<dpoint, dpoint, false, false, true, true>();
|
||||
test_mixed<dpoint, dpoint, false, true, true, true>();
|
||||
|
@ -34,9 +34,15 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
test_all<false, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<false, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
test_all<true, bg::model::point<float, 2, bg::cs::cartesian> >();
|
||||
test_all<false, bg::model::point<float, 2, bg::cs::cartesian> >();
|
||||
#endif
|
||||
|
@ -133,6 +133,9 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<true, bg::model::point<double, 2, bg::cs::cartesian> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
|
||||
test_all<true, bg::model::point<default_test_type, 2, bg::cs::cartesian> >();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1476,6 +1476,24 @@ static std::string ticket_12503[2] =
|
||||
"MULTIPOLYGON(((13 18,18 18,18 23,13 23,13 18)))"
|
||||
};
|
||||
|
||||
static std::string issue_630_a[2] =
|
||||
{
|
||||
"MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))",
|
||||
"MULTIPOLYGON(((-0.605 +0.1575,+0.254777333596 +1.0172773336,+1.53436796127 -0.262313294074,+0.674590627671 -1.12209062767,-0.605 +0.1575)))"
|
||||
};
|
||||
|
||||
static std::string issue_630_b[2] =
|
||||
{
|
||||
"MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))",
|
||||
"MULTIPOLYGON(((-1.215 +0.7675000000000001,-0.4962799075873666 +1.486220092412633,+0.665763075292561 +0.324177109532706,-0.05295701712007228 -0.3945429828799273,-1.215 +0.7675000000000001)))"
|
||||
};
|
||||
|
||||
static std::string issue_630_c[2] =
|
||||
{
|
||||
"MULTIPOLYGON(((-0.3 -0.1475,-0.3 +0.1475,+0.3 +0.1475,+0.3 -0.1475,-0.3 -0.1475)))",
|
||||
"MULTIPOLYGON(((-0.9099999999999999 +0.4625,-0.1912799075873667 +1.181220092412633,+0.9707630752925609 +0.01917710953270602,+0.2520429828799277 -0.6995429828799273,-0.9099999999999999 +0.4625)))"
|
||||
};
|
||||
|
||||
static std::string bug_21155501[2] =
|
||||
{
|
||||
"MULTIPOLYGON(((-8.3935546875 27.449790329784214,4.9658203125 18.729501999072138,11.8212890625 23.563987128451217,9.7119140625 25.48295117535531,9.8876953125 31.728167146023935,8.3056640625 32.99023555965106,8.5693359375 37.16031654673677,-1.8896484375 35.60371874069731,-0.5712890625 32.02670629333614,-8.9208984375 29.458731185355344,-8.3935546875 27.449790329784214)))",
|
||||
|
@ -200,8 +200,8 @@ void test_all()
|
||||
8, 36, 2.43452380952381,
|
||||
7, 33, 3.18452380952381);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// Fails, a-b is partly generated, b-a does not have any output
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Fails with rescaling, a-b is partly generated, b-a does not have any output
|
||||
// It failed already in 1.59
|
||||
test_one<polygon, polygon, polygon>("case_58_iet",
|
||||
case_58[0], case_58[2],
|
||||
@ -215,8 +215,8 @@ void test_all()
|
||||
1, 9, 44.5,
|
||||
1, 10, 84.5);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
// Fails, holes are not subtracted
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Fails without rescaling, holes are not subtracted
|
||||
test_one<polygon, polygon, polygon>("case_81",
|
||||
case_81[0], case_81[1],
|
||||
1, 8, 80.5,
|
||||
@ -244,42 +244,42 @@ void test_all()
|
||||
TEST_DIFFERENCE(case_106, 1, 17.5, 2, 32.5, 3);
|
||||
TEST_DIFFERENCE(case_107, 2, 18.0, 2, 29.0, 4);
|
||||
|
||||
TEST_DIFFERENCE(case_precision_1, 1, 14.0, 1, BG_IF_RESCALED(8.00001, 8.0), 1);
|
||||
TEST_DIFFERENCE(case_precision_1, 1, 14.0, 1, BG_IF_KRAMER(8.00001, 8.0), 1);
|
||||
TEST_DIFFERENCE(case_precision_2, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_3, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_4, 1, 14.0, 1, 8.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_5, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_6, 0, 0.0, 1, 57.0, 1);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_7, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_8, 0, 0.0, 1, 59.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_9, 0, 0.0, 1, 59.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_10, 0, 0.0, 1, 59.0, 1);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_11, 0, 0.0, 1, 59.0, 1);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_12, 1, 12.0, 0, 0.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_13, 1, BG_IF_RESCALED(12.00002, 12.0), 0, 0.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_13, 1, BG_IF_KRAMER(12.00002, 12.0), 0, 0.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_14, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_15, 0, 0.0, 1, 59.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_16, 0, 0.0, 1, 59.0, 1);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_17, 0, 0.0, 1, 59.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_18, 0, 0.0, 1, 59.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
TEST_DIFFERENCE(case_precision_19, 0, 0.0, 1, 59.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_19, 1, 0.0, 1, 59.0, 2);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_20, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_21, 1, 14.0, 1, 7.99999, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_22, 0, 0.0, 1, 59.0, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
TEST_DIFFERENCE(case_precision_23, 0, 0.0, 1, 59.0, 1);
|
||||
#endif
|
||||
TEST_DIFFERENCE(case_precision_24, 1, 14.0, 1, 8.0, 1);
|
||||
TEST_DIFFERENCE(case_precision_25, 1, 14.0, 1, 7.99999, 1);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_precision_26, 0, 0.0, 1, 59.0, 1);
|
||||
#endif
|
||||
|
||||
@ -345,17 +345,17 @@ void test_all()
|
||||
settings);
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
{
|
||||
ut_settings settings;
|
||||
settings.percentage = 0.01;
|
||||
settings.percentage = 0.1;
|
||||
settings.test_validity = false;
|
||||
|
||||
// SQL Server gives: 0.28937764436705 and 0.000786406897532288 with 44/35 rings
|
||||
// PostGIS gives: 0.30859375 and 0.033203125 with 35/35 rings
|
||||
TEST_DIFFERENCE_WITH(geos_1,
|
||||
-1, BG_IF_KRAMER(0.29171, 0.189697476),
|
||||
-1, BG_IF_KRAMER(0.00076855, 0.000018266),
|
||||
-1, BG_IF_KRAMER(0.29171, 0.20705),
|
||||
-1, BG_IF_KRAMER(0.00076855, 0.00060440758),
|
||||
-1);
|
||||
}
|
||||
#endif
|
||||
@ -486,7 +486,7 @@ void test_all()
|
||||
{
|
||||
ut_settings settings;
|
||||
settings.test_validity = BG_IF_RESCALED(true, false);
|
||||
#if !defined(BOOST_GEOMETRY_USE_RESCALING) && defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) && defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
const int expected_count = 1; // Wrong, considers all consecutive polygons as one
|
||||
#else
|
||||
const int expected_count = 6;
|
||||
@ -645,7 +645,8 @@ void test_specific()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type> >();
|
||||
|
||||
test_specific<bg::model::d2::point_xy<int>, false, false>();
|
||||
|
||||
|
@ -154,7 +154,7 @@ void test_areal()
|
||||
|
||||
{
|
||||
// With rescaling, A is invalid (this is a robustness problem) and the other
|
||||
// output is discarded because of zero (rescaled) area
|
||||
// output is discarded because of zero area
|
||||
// POSTGIS areas: 3.75893745345145, 2.5810000723917e-15
|
||||
ut_settings settings;
|
||||
settings.sym_difference = BG_IF_RESCALED(false, true);
|
||||
@ -163,7 +163,8 @@ void test_areal()
|
||||
// No output for B
|
||||
TEST_DIFFERENCE_WITH(0, 1, bug_21155501, 1, 3.758937, 0, 0.0, 1);
|
||||
#else
|
||||
// Very small sliver for B
|
||||
// Very small sliver for B, and sym difference is not considered valid
|
||||
settings.test_validity = false;
|
||||
TEST_DIFFERENCE_WITH(0, 1, bug_21155501, 1, 3.758937, 1, 1.7763568394002505e-15, 2);
|
||||
#endif
|
||||
}
|
||||
@ -174,8 +175,10 @@ void test_areal()
|
||||
ut_settings settings;
|
||||
settings.percentage = 0.001;
|
||||
settings.test_validity = BG_IF_RESCALED(false, true);
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9081, 2, 0.0907392476356186,
|
||||
4, 0.126018011439877, BG_IF_RESCALED(4, 3));
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9081,
|
||||
2, 0.0907392476356186,
|
||||
4, 0.126018011439877,
|
||||
BG_IF_RESCALED(4, 3));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -319,7 +322,8 @@ void test_areal()
|
||||
TEST_DIFFERENCE(case_recursive_boxes_60, 6, 5.25, 7, 5.25, 11);
|
||||
TEST_DIFFERENCE(case_recursive_boxes_61, 2, 1.5, 6, 2.0, 7);
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Misses one triangle. It is NOT related to rescaling.
|
||||
// Misses one triangle, should be fixed in traversal.
|
||||
// It is not related to rescaling.
|
||||
TEST_DIFFERENCE(case_recursive_boxes_62, 5, 5.0, 11, 5.75, 12);
|
||||
#endif
|
||||
|
||||
@ -349,7 +353,7 @@ void test_areal()
|
||||
TEST_DIFFERENCE(case_recursive_boxes_82, 5, 7.25, 7, 4.5, 8);
|
||||
TEST_DIFFERENCE(case_recursive_boxes_83, 9, 5.25, 8, 5.25, 12);
|
||||
TEST_DIFFERENCE(case_recursive_boxes_84, 4, 8.0, 7, 9.0, 4);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_DIFFERENCE(case_recursive_boxes_85, 4, 4.0, 7, 3.75, 9);
|
||||
#endif
|
||||
|
||||
@ -401,7 +405,11 @@ void test_specific_areal()
|
||||
settings.sym_difference = false;
|
||||
settings.test_validity = false;
|
||||
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_11674, 3, 9105781.5, 5, 119059.5, -1);
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_11674,
|
||||
BG_IF_KRAMER(3, 4),
|
||||
BG_IF_KRAMER(9105781.5, 9105473.5),
|
||||
5,
|
||||
BG_IF_KRAMER(119059.5, 119423), -1);
|
||||
}
|
||||
|
||||
{
|
||||
@ -411,8 +419,21 @@ void test_specific_areal()
|
||||
ut_settings settings;
|
||||
settings.remove_spikes = true;
|
||||
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_12751, 1, 2781965.0, 1, 597.0, 2);
|
||||
TEST_DIFFERENCE_WITH(2, 3, ticket_12751, 2, 2537992.5, 2, 294963.5, 3);
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_12751, 1,
|
||||
BG_IF_KRAMER(2781965.0, 2782114), 1,
|
||||
BG_IF_KRAMER(597.0, 598.0), 2);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER)
|
||||
// Fails with general line form intersection, symmetric version misses one outcut
|
||||
// TODO GENERAL FORM
|
||||
settings.test_validity = false;
|
||||
settings.sym_difference = false;
|
||||
#endif
|
||||
|
||||
TEST_DIFFERENCE_WITH(2, 3, ticket_12751,
|
||||
2, BG_IF_KRAMER(2537992.5, 2538305),
|
||||
2, BG_IF_KRAMER(294963.5, 294737),
|
||||
3);
|
||||
}
|
||||
|
||||
{
|
||||
@ -421,25 +442,42 @@ void test_specific_areal()
|
||||
ut_settings settings;
|
||||
settings.remove_spikes = true;
|
||||
settings.sym_difference = false;
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_12752, 3, 2776692.0, 3, 7893.0, 2);
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_12752,
|
||||
BG_IF_KRAMER(3, 2), BG_IF_KRAMER(2776692.0, 2776657),
|
||||
3, BG_IF_KRAMER(7893.0, 7710.5),
|
||||
2);
|
||||
}
|
||||
|
||||
{
|
||||
std::string a_min_b =
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Fails completely with general line form intersection
|
||||
// There is something with scale.
|
||||
// TODO GENERAL FORM
|
||||
const std::string a_min_b =
|
||||
TEST_DIFFERENCE(ticket_10661, 2, 1441632.5, 2, 13167454, 4);
|
||||
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("ticket_10661_2",
|
||||
a_min_b, ticket_10661[2],
|
||||
1, 8, 825192.0,
|
||||
1, 10, 27226370.5,
|
||||
1, 10, BG_IF_KRAMER(27226370.5, 27842811),
|
||||
1, -1, 825192.0 + 27226370.5);
|
||||
#endif
|
||||
}
|
||||
|
||||
{
|
||||
ut_settings settings;
|
||||
settings.sym_difference = false;
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9942, 4, 7427727.5, 4, 131506, 4);
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9942a, 2, 412676.5, 2, 76779.5, 4);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Fails with general line form intersection
|
||||
// Misses one clip
|
||||
// TODO GENERAL FORM
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9942, 4, 7427727.5, 4,
|
||||
BG_IF_KRAMER(131506, 130083.5), 4);
|
||||
#endif
|
||||
TEST_DIFFERENCE_WITH(0, 1, ticket_9942a, 2,
|
||||
BG_IF_KRAMER(412676.5, 413183.5), 2,
|
||||
BG_IF_KRAMER(76779.5, 76924), 4);
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,7 +492,8 @@ void test_specific()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type> >();
|
||||
|
||||
test_specific<bg::model::d2::point_xy<int>, false, false>();
|
||||
|
||||
|
@ -192,7 +192,7 @@ void test_areal()
|
||||
{
|
||||
test_one<Polygon, Polygon, Polygon>("geos_1",
|
||||
geos_1[0], geos_1[1],
|
||||
1, -1, 3461.12321694, // MSVC 14 reports 3461.025390625
|
||||
1, -1, BG_IF_RESCALED(3461.12321694, BG_IF_KRAMER(3461.02336, 3461.105448)), // MSVC 14 reports 3461.025390625
|
||||
ut_settings(0.01, false));
|
||||
}
|
||||
|
||||
@ -256,7 +256,7 @@ void test_areal()
|
||||
TEST_INTERSECTION(ggl_list_20190307_matthieu_1, 2, -1, 0.035136);
|
||||
TEST_INTERSECTION(ggl_list_20190307_matthieu_2, 1, -1, 3.64285);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || !defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
|
||||
1, 4, 0.00029437899183903937, ut_settings(0.01));
|
||||
#endif
|
||||
@ -929,7 +929,8 @@ void test_ticket_10868(std::string const& wkt_out)
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::d2::point_xy<float> >();
|
||||
|
@ -137,13 +137,10 @@ void test_areal()
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
{
|
||||
ut_settings ignore_validity;
|
||||
|
||||
// Rescaling misses one intersection
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("case_108_multi",
|
||||
case_108_multi[0], case_108_multi[1],
|
||||
7, -1, 7.5,
|
||||
ignore_validity);
|
||||
7, -1, 7.5);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -326,7 +323,7 @@ void test_areal()
|
||||
TEST_INTERSECTION(case_recursive_boxes_82, 5, -1, 8.5);
|
||||
TEST_INTERSECTION(case_recursive_boxes_83, 5, -1, 10.25);
|
||||
TEST_INTERSECTION(case_recursive_boxes_84, 1, -1, 0.5);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
TEST_INTERSECTION(case_recursive_boxes_85, 1, -1, 0.25);
|
||||
#endif
|
||||
TEST_INTERSECTION(case_recursive_boxes_86, 0, -1, 0.0);
|
||||
@ -371,6 +368,16 @@ void test_areal()
|
||||
|
||||
TEST_INTERSECTION(ticket_12503, 2, 13, 17.375);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Result is wrong with rescaling
|
||||
TEST_INTERSECTION(issue_630_a, 1, -1, 0.1770);
|
||||
#endif
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Two cases produce either too large, or no output if Kramer rule is used
|
||||
TEST_INTERSECTION(issue_630_b, 1, -1, 0.1714);
|
||||
TEST_INTERSECTION(issue_630_c, 1, -1, 0.1770);
|
||||
#endif
|
||||
|
||||
test_one<Polygon, MultiPolygon, MultiPolygon>("mysql_23023665_7",
|
||||
mysql_23023665_7[0], mysql_23023665_7[1],
|
||||
2, 11, 9.80505786783);
|
||||
@ -486,7 +493,8 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::d2::point_xy<float> >();
|
||||
|
@ -34,6 +34,13 @@
|
||||
(test_one<Polygon, Polygon, Polygon>) \
|
||||
( #caseid "_rev", caseid[1], caseid[0], clips, holes, points, area)
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) \
|
||||
&& defined(BOOST_GEOMETRY_USE_KRAMER_RULE) \
|
||||
&& ! defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// These testcases are failing for non-rescaled Kramer rule
|
||||
#define BOOST_GEOMETRY_EXCLUDE
|
||||
#endif
|
||||
|
||||
|
||||
template <typename Ring, typename Polygon>
|
||||
void test_areal()
|
||||
@ -274,7 +281,7 @@ void test_areal()
|
||||
TEST_UNION(case_precision_17, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_18, 1, 1, -1, 73.0);
|
||||
TEST_UNION(case_precision_19, 1, 1, -1, 73.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
TEST_UNION(case_precision_20, 1, 0, -1, 22.0);
|
||||
#endif
|
||||
TEST_UNION(case_precision_21, 1, 0, -1, 22.0);
|
||||
@ -303,7 +310,7 @@ void test_areal()
|
||||
TEST_UNION_REV(case_precision_17, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_18, 1, 1, -1, 73.0);
|
||||
TEST_UNION_REV(case_precision_19, 1, 1, -1, 73.0);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
TEST_UNION_REV(case_precision_20, 1, 0, -1, 22.0);
|
||||
#endif
|
||||
TEST_UNION_REV(case_precision_21, 1, 0, -1, 22.0);
|
||||
@ -362,7 +369,7 @@ void test_areal()
|
||||
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
|
||||
1, 1, 15, 129904.197692871);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
test_one<Polygon, Polygon, Polygon>("ggl_list_20110820_christophe",
|
||||
ggl_list_20110820_christophe[0], ggl_list_20110820_christophe[1],
|
||||
-1, // Either 1 or 2, depending if the intersection/turn point (eps.region) is missed
|
||||
@ -444,7 +451,7 @@ void test_areal()
|
||||
test_one<Polygon, Polygon, Polygon>("ticket_11725", ticket_11725[0], ticket_11725[1],
|
||||
1, 1, 10, 7.5);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// With rescaling an extra overlapping polygon is generated
|
||||
TEST_UNION(issue_548, 1, 0, -1, 617382720000);
|
||||
#endif
|
||||
@ -480,7 +487,7 @@ void test_areal()
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_a_rev", buffer_rt_a[1], buffer_rt_a[0],
|
||||
1, 0, -1, 19.28, settings);
|
||||
}
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f", buffer_rt_f[0], buffer_rt_f[1],
|
||||
1, 0, -1, 4.60853);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_f_rev", buffer_rt_f[1], buffer_rt_f[0],
|
||||
@ -490,7 +497,7 @@ void test_areal()
|
||||
1, 0, -1, 16.571);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_g_rev", buffer_rt_g[1], buffer_rt_g[0],
|
||||
1, 0, -1, 16.571);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_i", buffer_rt_i[0], buffer_rt_i[1],
|
||||
1, 0, -1, 13.6569);
|
||||
#endif
|
||||
@ -521,7 +528,7 @@ void test_areal()
|
||||
1, 0, -1, 18.5710);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_q_rev", buffer_rt_q[1], buffer_rt_q[0],
|
||||
1, 0, -1, 18.5710);
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
#if ! defined(BOOST_GEOMETRY_EXCLUDE)
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_r", buffer_rt_r[0], buffer_rt_r[1],
|
||||
1, 0, -1, 21.07612);
|
||||
test_one<Polygon, Polygon, Polygon>("buffer_rt_r_rev", buffer_rt_r[1], buffer_rt_r[0],
|
||||
@ -619,7 +626,8 @@ void test_all()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double> >();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type> >();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
|
||||
|
@ -416,6 +416,16 @@ void test_areal()
|
||||
|
||||
TEST_UNION(ticket_12503, 42, 1, -1, 945.625);
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_USE_RESCALING) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Failure with rescaling
|
||||
TEST_UNION(issue_630_a, 1, 0, -1, 2.200326);
|
||||
#endif
|
||||
TEST_UNION(issue_630_b, 1, 0, -1, 1.675976);
|
||||
#if ! defined(BOOST_GEOMETRY_USE_KRAMER_RULE) || defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
// Failure with Kramer rule
|
||||
TEST_UNION(issue_630_c, 1, 0, -1, 1.670367);
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
// Two polygons, should ideally be merged
|
||||
TEST_UNION(mail_2019_01_21_johan, 2, 0, -1, 0.00058896);
|
||||
@ -463,7 +473,9 @@ void test_specific()
|
||||
|
||||
int test_main(int, char* [])
|
||||
{
|
||||
test_all<bg::model::d2::point_xy<double>, true, true>();
|
||||
BoostGeometryWriteTestConfiguration();
|
||||
test_all<bg::model::d2::point_xy<default_test_type>, true, true>();
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
test_all<bg::model::d2::point_xy<double>, false, false>();
|
||||
|
||||
|
@ -161,6 +161,8 @@ struct mathematical_policy
|
||||
|
||||
};
|
||||
|
||||
typedef double default_test_type;
|
||||
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
#define BG_IF_RESCALED(a, b) a
|
||||
#else
|
||||
@ -173,4 +175,28 @@ struct mathematical_policy
|
||||
#define BG_IF_KRAMER(a, b) b
|
||||
#endif
|
||||
|
||||
inline void BoostGeometryWriteTestConfiguration()
|
||||
{
|
||||
std::cout << std::endl << "Test configuration:" << std::endl;
|
||||
#if defined(BOOST_GEOMETRY_USE_RESCALING)
|
||||
std::cout << " - Using rescaling" << std::endl;
|
||||
#endif
|
||||
#if defined(BOOST_GEOMETRY_USE_KRAMER_RULE)
|
||||
std::cout << " - Using Kramer rule" << std::endl;
|
||||
#else
|
||||
std::cout << " - Using general form" << std::endl;
|
||||
#endif
|
||||
#if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE)
|
||||
std::cout << " - Testing only one type" << std::endl;
|
||||
#endif
|
||||
#if defined(BOOST_GEOMETRY_TEST_ONLY_ONE_ORDER)
|
||||
std::cout << " - Testing only one order" << std::endl;
|
||||
#endif
|
||||
#if defined(BOOST_GEOMETRY_TEST_FAILURES)
|
||||
std::cout << " - Including failing test cases" << std::endl;
|
||||
#endif
|
||||
std::cout << " - Default test type: " << string_from_type<default_test_type>::name() << std::endl;
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
#endif // GEOMETRY_TEST_GEOMETRY_TEST_COMMON_HPP
|
||||
|
@ -201,11 +201,9 @@ bool test_buffer(MultiPolygon& result, int& index,
|
||||
|
||||
|
||||
typedef typename bg::coordinate_type<MultiPolygon>::type coordinate_type;
|
||||
typedef typename bg::point_type<MultiPolygon>::type point_type;
|
||||
typedef bg::strategy::buffer::distance_asymmetric<coordinate_type> distance_strategy_type;
|
||||
distance_strategy_type distance_strategy(settings.distance, settings.distance);
|
||||
|
||||
typedef typename boost::range_value<MultiPolygon>::type polygon_type;
|
||||
MultiPolygon buffered;
|
||||
|
||||
std::ostringstream out;
|
||||
|
Loading…
Reference in New Issue
Block a user