Removed temporary BOOST_GEOMETRY_CHECK_RATIO information and define

This commit is contained in:
Barend Gehrels
2014-03-30 13:52:46 +02:00
parent 46125dccb5
commit fc595715e1
5 changed files with 3 additions and 97 deletions

View File

@@ -138,16 +138,6 @@ struct base_turn_handler
geometry::convert(info.intersections[index], ti.point);
ti.operations[0].fraction = info.fractions[index].robust_ra;
ti.operations[1].fraction = info.fractions[index].robust_rb;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
ti.operations[0].r = info.fractions[index].ra;
ti.operations[1].r = info.fractions[index].rb;
geometry::convert(info.intersections_check[index], ti.point_check);
ti.operations[0].x = geometry::get<0>(ti.point);
ti.operations[0].y = geometry::get<1>(ti.point);
ti.operations[1].x = geometry::get<0>(ti.point);
ti.operations[1].y = geometry::get<1>(ti.point);
#endif
}
template <typename IntersectionInfo>

View File

@@ -62,11 +62,6 @@ struct turn_operation
segment_identifier other_id;
SegmentRatio fraction;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
double r;
double x, y;
#endif
inline turn_operation()
: operation(operation_none)
{}
@@ -96,9 +91,6 @@ struct turn_info
typedef Container container_type;
Point point;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
Point point_check;
#endif
method_type method;
bool discarded;

View File

@@ -49,7 +49,7 @@ struct segments_intersection_points
>
static inline return_type segments_crosses(side_info const&,
SegmentIntersectionInfo const& sinfo,
Segment1 const& s1, Segment2 const& s2)
Segment1 const& s1, Segment2 const& )
{
typedef typename geometry::coordinate_type
<
@@ -90,21 +90,6 @@ struct segments_intersection_points
result.fractions[0].assign(sinfo);
#ifdef BOOST_GEOMETRY_CHECK_RATIO
{
promoted_type const s2x = get<0, 0>(s2);
promoted_type const s2y = get<0, 1>(s2);
promoted_type const dx = sinfo.dx_b;
promoted_type const dy = sinfo.dy_b;
set<0>(result.intersections_check[0],
boost::numeric_cast<return_coordinate_type>(s2x + sinfo.rb * dx));
set<1>(result.intersections_check[0],
boost::numeric_cast<return_coordinate_type>(s2y + sinfo.rb * dy));
}
#else
boost::ignore_unused_variable_warning(s2);
#endif
return result;
}

View File

@@ -238,50 +238,8 @@ struct relate_cartesian_segments
}
else
{
#ifdef BOOST_GEOMETRY_CHECK_RATIO
// TODO remove this
if (!boost::is_same
<
robust_coordinate_type,
typename ratio_type::numeric_type
>::type::value)
{
std::cout
<< typeid(robust_coordinate_type).name()
<< " vs " << typeid(typename ratio_type::numeric_type).name()
// << " " << typeid(typename ratio_type::source_type).name()
<< std::endl;
}
// END TODO
#endif
sinfo.robust_ra.assign(robust_da, robust_da0);
sinfo.robust_rb.assign(robust_db, robust_db0);
#ifdef BOOST_GEOMETRY_CHECK_RATIO
promoted_type db0, db;
cramers_rule(sinfo.dx_b, sinfo.dy_b, sinfo.dx_a, sinfo.dy_a,
get<0, 0>(b) - get<0, 0>(a), // wx = d(x) between 2 segments
get<0, 1>(b) - get<0, 1>(a), // wy = d(y) between 2 segments
db0, db);
sinfo.rb = db0 != 0 ? db / db0 : -9999;
// std::cout << "CHECK: " << std::setprecision(16) << sinfo.r << " " << sinfo.rb
// << " " << boost::rational_cast<double>(sinfo.robust_ra)
// << " " << boost::rational_cast<double>(sinfo.robust_rb)
// << std::endl;
// std::cout << " robust: "
// << double(sinfo.dx_b) / double(sinfo.dx_a)
// << " " << double(sinfo.dy_b) / double(sinfo.dy_a)
// << " " << double(wx) / double(wy)
// << " " << double(robust_dx_b) / double(robust_dx_a)
// << " " << double(robust_dy_b) / double(robust_dy_a)
// << " " << double(robust_wx) / double(robust_wy)
// << std::endl;
#endif
}
}

View File

@@ -157,11 +157,9 @@ struct de9im_segment : public de9im
template <typename SegmentRatio>
struct fraction_type
{
SegmentRatio robust_ra;
SegmentRatio robust_ra; // TODO this can be renamed now to "ra"
SegmentRatio robust_rb;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
double ra, rb;
#endif
bool initialized;
inline fraction_type()
: initialized(false)
@@ -173,10 +171,6 @@ struct fraction_type
initialized = true;
robust_ra = info.robust_ra;
robust_rb = info.robust_rb;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
ra = info.r;
rb = info.rb;
#endif
}
inline void assign(SegmentRatio const& a, SegmentRatio const& b)
@@ -184,10 +178,6 @@ struct fraction_type
initialized = true;
robust_ra = a;
robust_rb = b;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
ra = -9999;
rb = -9999;
#endif
}
};
@@ -207,10 +197,6 @@ struct segment_intersection_points
fraction_type<SegmentRatio> fractions[2];
typedef Point point_type;
#ifdef BOOST_GEOMETRY_CHECK_RATIO
Point intersections_check[2];
#endif
segment_intersection_points()
: count(0)
{}
@@ -226,11 +212,6 @@ struct segment_intersection_info
CoordinateType dx_b, dy_b; // TODO b can be removed
SegmentRatio robust_ra;
SegmentRatio robust_rb;
// TEMP to check calculations
#ifdef BOOST_GEOMETRY_CHECK_RATIO
PromotedType rb;
#endif
};