mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-11 11:52:11 +00:00
Merge branch 'develop' into feature/relate
This commit is contained in:
@@ -10,9 +10,6 @@
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICHMENT_INFO_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/strategies/distance.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@@ -31,19 +28,6 @@ namespace detail { namespace overlay
|
||||
template<typename P>
|
||||
struct enrichment_info
|
||||
{
|
||||
typedef typename strategy::distance::services::return_type
|
||||
<
|
||||
typename strategy::distance::services::comparable_type
|
||||
<
|
||||
typename strategy::distance::services::default_strategy
|
||||
<
|
||||
point_tag,
|
||||
P
|
||||
>::type
|
||||
>::type,
|
||||
P, P
|
||||
>::type distance_type;
|
||||
|
||||
inline enrichment_info()
|
||||
: travels_to_vertex_index(-1)
|
||||
, travels_to_ip_index(-1)
|
||||
@@ -60,7 +44,6 @@ struct enrichment_info
|
||||
|
||||
// index of next IP on this segment, -1 if there is no one
|
||||
int next_ip_index;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ private:
|
||||
typedef typename strategy::side::services::default_strategy<cs_tag>::type side;
|
||||
|
||||
output.push_back(p);
|
||||
register std::size_t output_size = output.size();
|
||||
std::size_t output_size = output.size();
|
||||
while (output_size >= 3)
|
||||
{
|
||||
rev_iterator rit = output.rbegin();
|
||||
|
||||
@@ -58,17 +58,6 @@ struct relate_cartesian_segments
|
||||
{
|
||||
typedef typename Policy::return_type return_type;
|
||||
|
||||
#if defined(BOOST_GEOMETRY_DEBUG_ROBUSTNESS)
|
||||
static inline void debug_segments(std::string const& header, segment_type1 const& a, segment_type2 const& b)
|
||||
{
|
||||
std::cout << "Robustness issue: " << header << std::endl;
|
||||
std::cout
|
||||
<< "A: " << wkt(a) << std::endl
|
||||
<< "B: " << wkt(b) << std::endl
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename D, typename W, typename ResultType>
|
||||
static inline void cramers_rule(D const& dx_a, D const& dy_a,
|
||||
D const& dx_b, D const& dy_b, W const& wx, W const& wy,
|
||||
@@ -202,21 +191,14 @@ struct relate_cartesian_segments
|
||||
// (only calculated for non-collinear segments)
|
||||
if (! collinear)
|
||||
{
|
||||
// Calculate determinants - Cramers rule
|
||||
coordinate_type const wx = get<0, 0>(a) - get<0, 0>(b);
|
||||
coordinate_type const wy = get<0, 1>(a) - get<0, 1>(b);
|
||||
|
||||
promoted_type d, da;
|
||||
cramers_rule(sinfo.dx_a, sinfo.dy_a, sinfo.dx_b, sinfo.dy_b,
|
||||
wx, wy, d, da);
|
||||
|
||||
robust_coordinate_type const robust_wx = get<0>(robust_a1) - get<0>(robust_b1);
|
||||
robust_coordinate_type const robust_wy = get<1>(robust_a1) - get<1>(robust_b1);
|
||||
robust_coordinate_type robust_da0, robust_da;
|
||||
cramers_rule(robust_dx_a, robust_dy_a, robust_dx_b, robust_dy_b,
|
||||
robust_wx, robust_wy, robust_da0, robust_da);
|
||||
|
||||
robust_coordinate_type robust_db0, robust_db;
|
||||
|
||||
cramers_rule(robust_dx_a, robust_dy_a, robust_dx_b, robust_dy_b,
|
||||
get<0>(robust_a1) - get<0>(robust_b1),
|
||||
get<1>(robust_a1) - get<1>(robust_b1),
|
||||
robust_da0, robust_da);
|
||||
|
||||
cramers_rule(robust_dx_b, robust_dy_b, robust_dx_a, robust_dy_a,
|
||||
get<0>(robust_b1) - get<0>(robust_a1),
|
||||
get<1>(robust_b1) - get<1>(robust_a1),
|
||||
@@ -224,13 +206,11 @@ struct relate_cartesian_segments
|
||||
|
||||
if (robust_da0 == 0)
|
||||
{
|
||||
// This is still a collinear case (because of FP imprecision this could, in the past, occur here)
|
||||
// Note it should NOT occur anymore
|
||||
// sides.debug();
|
||||
// If this is the case, no rescaling is done for FP precision.
|
||||
// We set it to collinear, but it indicates a robustness issue.
|
||||
sides.set<0>(0,0);
|
||||
sides.set<1>(0,0);
|
||||
collinear = true;
|
||||
std::cout << "Warning: robust_d=0, SHOULD NOT OCCUR" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -241,7 +221,7 @@ struct relate_cartesian_segments
|
||||
|
||||
if(collinear)
|
||||
{
|
||||
bool collinear_use_first
|
||||
bool const collinear_use_first
|
||||
= geometry::math::abs(robust_dx_a) + geometry::math::abs(robust_dx_b)
|
||||
>= geometry::math::abs(robust_dy_a) + geometry::math::abs(robust_dy_b);
|
||||
if (collinear_use_first)
|
||||
|
||||
Reference in New Issue
Block a user