mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-12 05:51:47 +00:00
[test][overlay] Update cases wrt recent changes (user-defined strategy).
This commit is contained in:
parent
7dcba58943
commit
1dad2eb97c
@ -31,6 +31,9 @@
|
||||
# include <boost/geometry/io/svg/svg_mapper.hpp>
|
||||
#endif
|
||||
|
||||
#include <boost/geometry/strategies/side.hpp>
|
||||
#include <boost/geometry/strategies/cartesian/side_by_triangle.hpp>
|
||||
|
||||
|
||||
template <typename P, typename T>
|
||||
void test_with_point(std::string const& /*caseid*/,
|
||||
@ -46,7 +49,12 @@ void test_with_point(std::string const& /*caseid*/,
|
||||
P si = bg::make<P>(si_x, si_y);
|
||||
P sj = bg::make<P>(sj_x, sj_y);
|
||||
|
||||
int order = bg::detail::overlay::get_relative_order<P>::apply(pi, pj, ri, rj, si, sj);
|
||||
typedef typename bg::strategy::side::services::default_strategy
|
||||
<
|
||||
typename bg::cs_tag<P>::type
|
||||
>::type strategy_type;
|
||||
|
||||
int order = bg::detail::overlay::get_relative_order::apply(pi, pj, ri, rj, si, sj, strategy_type());
|
||||
|
||||
BOOST_CHECK_EQUAL(order, expected_order);
|
||||
|
||||
|
@ -49,12 +49,14 @@ template
|
||||
typename Turns,
|
||||
typename Clusters,
|
||||
typename Geometry1,
|
||||
typename Geometry2
|
||||
typename Geometry2,
|
||||
typename SideStrategy
|
||||
>
|
||||
std::vector<std::size_t> test_gather_cluster_properties(std::string const& case_id,
|
||||
Clusters& clusters, Turns& turns,
|
||||
bg::detail::overlay::operation_type for_operation,
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2)
|
||||
Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
SideStrategy const& strategy)
|
||||
{
|
||||
using namespace boost::geometry;
|
||||
using namespace boost::geometry::detail::overlay;
|
||||
@ -69,7 +71,7 @@ std::vector<std::size_t> test_gather_cluster_properties(std::string const& case_
|
||||
// right side
|
||||
typedef sort_by_side::side_sorter
|
||||
<
|
||||
Reverse1, Reverse2, OverlayType, point_type, std::less<int>
|
||||
Reverse1, Reverse2, OverlayType, point_type, SideStrategy, std::less<int>
|
||||
> sbs_type;
|
||||
|
||||
for (typename Clusters::iterator mit = clusters.begin();
|
||||
@ -82,7 +84,7 @@ std::vector<std::size_t> test_gather_cluster_properties(std::string const& case_
|
||||
return result;
|
||||
}
|
||||
|
||||
sbs_type sbs;
|
||||
sbs_type sbs(strategy);
|
||||
point_type turn_point; // should be all the same for all turns in cluster
|
||||
|
||||
bool first = true;
|
||||
@ -165,7 +167,7 @@ std::vector<std::size_t> apply_overlay(std::string const& case_id,
|
||||
// Gather cluster properties, with test option
|
||||
return test_gather_cluster_properties<Reverse1, Reverse2, OverlayType>(case_id,
|
||||
clusters, turns, bg::detail::overlay::operation_from_overlay<OverlayType>::value,
|
||||
geometry1, geometry2);
|
||||
geometry1, geometry2, strategy.get_side_strategy());
|
||||
}
|
||||
|
||||
|
||||
|
@ -89,13 +89,14 @@ std::vector<std::size_t> apply_get_turns(std::string const& case_id,
|
||||
|
||||
// Define sorter, sorting counter-clockwise such that polygons are on the
|
||||
// right side
|
||||
typedef typename Strategy::side_strategy_type side_strategy;
|
||||
typedef bg::detail::overlay::sort_by_side::side_sorter
|
||||
<
|
||||
false, false, overlay_union,
|
||||
point_type, std::less<int>
|
||||
point_type, side_strategy, std::less<int>
|
||||
> sbs_type;
|
||||
|
||||
sbs_type sbs;
|
||||
sbs_type sbs(strategy.get_side_strategy());
|
||||
|
||||
std::cout << "Case: " << case_id << std::endl;
|
||||
|
||||
@ -187,7 +188,7 @@ std::vector<std::size_t> apply_get_turns(std::string const& case_id,
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOST_CHECK_MESSAGE(right_count[rank] == ranked_point.count_right,
|
||||
BOOST_CHECK_MESSAGE(right_count[rank] == int(ranked_point.count_right),
|
||||
" caseid=" << case_id
|
||||
<< " ranks: conflict in right_count=" << ranked_point.count_right
|
||||
<< " vs " << right_count[rank]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user