mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 21:44:04 +00:00
[closest_points] Remove comments, fix typos, change style
This commit is contained in:
parent
f29ce40e3f
commit
707f593eaf
@ -10,7 +10,6 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_CLOSEST_POINTS_IMPLEMENTATION_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CLOSEST_POINTS_IMPLEMENTATION_HPP
|
||||
|
||||
// the implementation details
|
||||
#include <boost/geometry/algorithms/detail/distance/implementation.hpp>
|
||||
#include <boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp>
|
||||
//#include <boost/geometry/algorithms/detail/closest_points/multipoint_to_geometry.hpp>
|
||||
|
@ -127,7 +127,7 @@ public:
|
||||
cd_min);
|
||||
|
||||
auto closest_point = strategies.closest_points(point, range)
|
||||
.apply(point, *it_pair.first, *it_pair.second);
|
||||
.apply(point, it_pair->first, it_pair->second);
|
||||
|
||||
set_segment_from_points::apply(point, closest_point, shortest_seg);
|
||||
}
|
||||
|
@ -47,32 +47,6 @@ struct cartesian
|
||||
{
|
||||
return strategy::closest_points::projected_point<CalculationType>();
|
||||
}
|
||||
/*
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
static auto closest_points(Geometry1 const&, Geometry2 const&,
|
||||
distance::detail::enable_if_pb_t<Geometry1, Geometry2> * = nullptr)
|
||||
{
|
||||
return strategy::distance::pythagoras_point_box<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
static auto closest_points(Geometry1 const&, Geometry2 const&,
|
||||
distance::detail::enable_if_sb_t<Geometry1, Geometry2> * = nullptr)
|
||||
{
|
||||
return strategy::distance::cartesian_segment_box
|
||||
<
|
||||
CalculationType,
|
||||
strategy::distance::pythagoras<CalculationType>
|
||||
>();
|
||||
}
|
||||
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
static auto closest_points(Geometry1 const&, Geometry2 const&,
|
||||
distance::detail::enable_if_bb_t<Geometry1, Geometry2> * = nullptr)
|
||||
{
|
||||
return strategy::distance::pythagoras_box_box<CalculationType>();
|
||||
}
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,14 +60,14 @@ using cartesian = bg::strategies::closest_points::cartesian<double>;
|
||||
template <typename Segment>
|
||||
static inline Segment swap(Segment const& s)
|
||||
{
|
||||
Segment s_swaped;
|
||||
Segment swapped;
|
||||
|
||||
bg::set<0, 0>(s_swaped, bg::get<1, 0>(s));
|
||||
bg::set<0, 1>(s_swaped, bg::get<1, 1>(s));
|
||||
bg::set<1, 0>(s_swaped, bg::get<0, 0>(s));
|
||||
bg::set<1, 1>(s_swaped, bg::get<0, 1>(s));
|
||||
bg::set<0, 0>(swapped, bg::get<1, 0>(s));
|
||||
bg::set<0, 1>(swapped, bg::get<1, 1>(s));
|
||||
bg::set<1, 0>(swapped, bg::get<0, 0>(s));
|
||||
bg::set<1, 1>(swapped, bg::get<0, 1>(s));
|
||||
|
||||
return s_swaped;
|
||||
return swapped;
|
||||
}
|
||||
|
||||
template <int i, int j, typename Segment>
|
||||
@ -102,7 +102,7 @@ void compute_result(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Segment const& exp_resulting_segment,
|
||||
Strategy const& strategy,
|
||||
bool const& default_strategy)
|
||||
bool default_strategy)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG_CLOSEST_POINTS
|
||||
//std::cout << "CS: " << typeid(typename bg::cs_tag<Geometry1>::type).name()
|
||||
@ -137,14 +137,13 @@ void compute_result(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2,
|
||||
Segment const& exp_resulting_segment,
|
||||
Strategy const& strategy,
|
||||
bool const& swap_geometries,
|
||||
bool const& default_strategy)
|
||||
bool swap_geometries,
|
||||
bool default_strategy)
|
||||
{
|
||||
compute_result(geometry1, geometry2, exp_resulting_segment, strategy,
|
||||
default_strategy);
|
||||
if (swap_geometries)
|
||||
{
|
||||
//TODO: enable
|
||||
// swap input geometries and expected segment
|
||||
compute_result(geometry2, geometry1,
|
||||
swap(exp_resulting_segment), strategy,
|
||||
|
Loading…
x
Reference in New Issue
Block a user