mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 21:44:04 +00:00
commit
91b80a94c1
@ -4,8 +4,8 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
#include <boost/geometry/strategies/concepts/convex_hull_concept.hpp>
|
||||
#include <boost/geometry/strategies/default_strategy.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
#include <boost/geometry/views/detail/range_type.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_points.hpp>
|
||||
@ -123,7 +125,7 @@ struct convex_hull<Box, box_tag>
|
||||
boost::array<typename point_type<Box>::type, 4> range;
|
||||
geometry::detail::assign_box_corners_oriented<Reverse>(box, range);
|
||||
geometry::append(out, range);
|
||||
if (Close)
|
||||
if (BOOST_GEOMETRY_CONDITION(Close))
|
||||
{
|
||||
geometry::append(out, *boost::begin(range));
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/buffer.hpp>
|
||||
@ -892,7 +893,7 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
|
||||
collection.get_turns();
|
||||
collection.classify_turns(linear);
|
||||
if (areal)
|
||||
if (BOOST_GEOMETRY_CONDITION(areal))
|
||||
{
|
||||
collection.check_remaining_points(distance_strategy);
|
||||
}
|
||||
@ -913,7 +914,8 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator
|
||||
// - the output is counter clockwise
|
||||
// and avoid reversing twice
|
||||
bool reverse = distance_strategy.negative() && areal;
|
||||
if (geometry::point_order<GeometryOutput>::value == counterclockwise)
|
||||
if (BOOST_GEOMETRY_CONDITION(
|
||||
geometry::point_order<GeometryOutput>::value == counterclockwise))
|
||||
{
|
||||
reverse = ! reverse;
|
||||
}
|
||||
|
@ -35,6 +35,8 @@
|
||||
|
||||
#include <boost/geometry/algorithms/detail/distance/is_comparable.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@ -271,7 +273,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (is_comparable<Strategy>::value)
|
||||
if (BOOST_GEOMETRY_CONDITION(is_comparable<Strategy>::value))
|
||||
{
|
||||
return (std::min)(cd_min1, cd_min2);
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/util/calculation_type.hpp>
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/distance.hpp>
|
||||
@ -151,7 +152,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if (is_comparable<Strategy>::value)
|
||||
if (BOOST_GEOMETRY_CONDITION(is_comparable<Strategy>::value))
|
||||
{
|
||||
return cd[imin];
|
||||
}
|
||||
|
@ -18,6 +18,8 @@
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/distance.hpp>
|
||||
#include <boost/geometry/strategies/tags.hpp>
|
||||
|
||||
@ -96,7 +98,7 @@ public:
|
||||
std::size_t imin = std::distance(boost::addressof(d[0]),
|
||||
std::min_element(d, d + 4));
|
||||
|
||||
if (is_comparable<Strategy>::value)
|
||||
if (BOOST_GEOMETRY_CONDITION(is_comparable<Strategy>::value))
|
||||
{
|
||||
return d[imin];
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
@ -311,7 +312,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( CheckRingValidityOnly )
|
||||
if (BOOST_GEOMETRY_CONDITION(CheckRingValidityOnly))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp>
|
||||
#include <boost/geometry/algorithms/detail/equals/point_point.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
|
||||
@ -42,7 +43,7 @@ inline bool points_equal_or_close(Point1 const& point1,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! RobustPolicy::enabled)
|
||||
if (BOOST_GEOMETRY_CONDITION(! RobustPolicy::enabled))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -127,7 +128,7 @@ inline void clean_closing_dups_and_spikes(Range& range,
|
||||
iterator_type first = boost::begin(range);
|
||||
iterator_type second = first + 1;
|
||||
iterator_type ultimate = boost::end(range) - 1;
|
||||
if (closed)
|
||||
if (BOOST_GEOMETRY_CONDITION(closed))
|
||||
{
|
||||
ultimate--;
|
||||
}
|
||||
@ -137,7 +138,7 @@ inline void clean_closing_dups_and_spikes(Range& range,
|
||||
if (point_is_spike_or_equal(*second, *ultimate, *first, robust_policy))
|
||||
{
|
||||
range::erase(range, first);
|
||||
if (closed)
|
||||
if (BOOST_GEOMETRY_CONDITION(closed))
|
||||
{
|
||||
// Remove closing last point
|
||||
range::resize(range, boost::size(range) - 1);
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014.
|
||||
// Modifications copyright (c) 2013-2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013, 2014, 2015.
|
||||
// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
|
@ -14,6 +14,8 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LA_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_LA_HPP
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp>
|
||||
|
||||
@ -224,7 +226,7 @@ struct get_turn_info_linear_areal
|
||||
// TODO: move this into the append_xxx and call for each turn?
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ignore_spike
|
||||
|| ! append_opposite_spikes<append_touches>( // for 'i' or 'c' i???
|
||||
tp, inters, is_p_last, is_q_last, out) )
|
||||
@ -261,7 +263,7 @@ struct get_turn_info_linear_areal
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ! append_collinear_spikes(tp, inters, is_p_last, is_q_last,
|
||||
method_touch, append_equal, out) )
|
||||
{
|
||||
@ -324,7 +326,7 @@ struct get_turn_info_linear_areal
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ! append_collinear_spikes(tp, inters, is_p_last, is_q_last,
|
||||
method_replace, version, out) )
|
||||
{
|
||||
@ -338,7 +340,7 @@ struct get_turn_info_linear_areal
|
||||
turn_transformer_ec<false> transformer(method_touch_interior);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( handle_spikes )
|
||||
if ( BOOST_GEOMETRY_CONDITION(handle_spikes) )
|
||||
{
|
||||
append_opposite_spikes<append_collinear_opposite>(
|
||||
tp, inters, is_p_last, is_q_last, out);
|
||||
@ -363,7 +365,7 @@ struct get_turn_info_linear_areal
|
||||
case '0' :
|
||||
{
|
||||
// degenerate points
|
||||
if (AssignPolicy::include_degenerate)
|
||||
if ( BOOST_GEOMETRY_CONDITION(AssignPolicy::include_degenerate) )
|
||||
{
|
||||
only_convert::apply(tp, inters.i_info());
|
||||
|
||||
@ -529,7 +531,9 @@ struct get_turn_info_linear_areal
|
||||
bool is_p_last, bool /*is_q_last*/,
|
||||
OutIt out)
|
||||
{
|
||||
bool is_p_spike = ( Version == append_touches ?
|
||||
static const bool is_version_touches = (Version == append_touches);
|
||||
|
||||
bool is_p_spike = ( is_version_touches ?
|
||||
( tp.operations[0].operation == operation_continue
|
||||
|| tp.operations[0].operation == operation_intersection ) : // i ???
|
||||
true )
|
||||
@ -551,9 +555,10 @@ struct get_turn_info_linear_areal
|
||||
else*/
|
||||
if ( is_p_spike )
|
||||
{
|
||||
if ( Version == append_touches || inters.d_info().arrival[0] == 1 )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_version_touches)
|
||||
|| inters.d_info().arrival[0] == 1 )
|
||||
{
|
||||
if ( Version == append_touches )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_version_touches) )
|
||||
{
|
||||
tp.operations[0].is_collinear = true;
|
||||
//tp.operations[1].is_collinear = false;
|
||||
@ -583,7 +588,7 @@ struct get_turn_info_linear_areal
|
||||
/*else if ( is_q_spike )
|
||||
{
|
||||
tp.operations[0].is_collinear = true;
|
||||
tp.method = Version == append_touches ? method_touch : method_touch_interior;
|
||||
tp.method = is_version_touches ? method_touch : method_touch_interior;
|
||||
tp.operations[0].operation = operation_continue;
|
||||
tp.operations[1].operation = operation_continue; // boundary
|
||||
*out++ = tp;
|
||||
@ -644,7 +649,7 @@ struct get_turn_info_linear_areal
|
||||
operation_type & op1 = turn.operations[1].operation;
|
||||
|
||||
// NOTE: probably only if methods are WRT IPs, not segments!
|
||||
if ( IsFront
|
||||
if ( BOOST_GEOMETRY_CONDITION(IsFront)
|
||||
|| op0 == operation_intersection || op0 == operation_union
|
||||
|| op1 == operation_intersection || op1 == operation_union )
|
||||
{
|
||||
@ -724,7 +729,8 @@ struct get_turn_info_linear_areal
|
||||
|
||||
// IP on the first point of Linear Geometry
|
||||
bool was_first_point_handled = false;
|
||||
if ( EnableFirst && is_p_first && ip0.is_pi && !ip0.is_qi ) // !q0i prevents duplication
|
||||
if ( BOOST_GEOMETRY_CONDITION(EnableFirst)
|
||||
&& is_p_first && ip0.is_pi && !ip0.is_qi ) // !q0i prevents duplication
|
||||
{
|
||||
TurnInfo tp = tp_model;
|
||||
tp.operations[0].position = position_front;
|
||||
@ -802,7 +808,7 @@ struct get_turn_info_linear_areal
|
||||
// ANALYSE AND ASSIGN LAST
|
||||
|
||||
// IP on the last point of Linear Geometry
|
||||
if ( EnableLast
|
||||
if ( BOOST_GEOMETRY_CONDITION(EnableLast)
|
||||
&& is_p_last
|
||||
&& ( ip_count > 1 ? (ip1.is_pj && !ip1.is_qi) : (ip0.is_pj && !ip0.is_qi) ) ) // prevents duplication
|
||||
{
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014.
|
||||
// Modifications copyright (c) 2013-2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013, 2014, 2015.
|
||||
// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -17,6 +17,8 @@
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info.hpp>
|
||||
#include <boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
namespace boost { namespace geometry {
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
@ -262,7 +264,7 @@ struct get_turn_info_linear_linear
|
||||
// TODO: move this into the append_xxx and call for each turn?
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ! append_opposite_spikes<append_touches>(tp, inters,
|
||||
is_p_last, is_q_last,
|
||||
out) )
|
||||
@ -307,7 +309,7 @@ struct get_turn_info_linear_linear
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ! append_collinear_spikes(tp, inters,
|
||||
is_p_last, is_q_last,
|
||||
method_touch, spike_op,
|
||||
@ -380,7 +382,7 @@ struct get_turn_info_linear_linear
|
||||
AssignPolicy::apply(tp, pi, qi, inters);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( ! handle_spikes
|
||||
if ( ! BOOST_GEOMETRY_CONDITION(handle_spikes)
|
||||
|| ! append_collinear_spikes(tp, inters,
|
||||
is_p_last, is_q_last,
|
||||
method_replace, spike_op,
|
||||
@ -396,7 +398,7 @@ struct get_turn_info_linear_linear
|
||||
turn_transformer_ec transformer(method_touch_interior);
|
||||
|
||||
// conditionally handle spikes
|
||||
if ( handle_spikes )
|
||||
if ( BOOST_GEOMETRY_CONDITION(handle_spikes) )
|
||||
{
|
||||
append_opposite_spikes<append_collinear_opposite>(tp, inters,
|
||||
is_p_last, is_q_last,
|
||||
@ -421,7 +423,7 @@ struct get_turn_info_linear_linear
|
||||
case '0' :
|
||||
{
|
||||
// degenerate points
|
||||
if (AssignPolicy::include_degenerate)
|
||||
if ( BOOST_GEOMETRY_CONDITION(AssignPolicy::include_degenerate) )
|
||||
{
|
||||
only_convert::apply(tp, inters.i_info());
|
||||
|
||||
@ -545,13 +547,15 @@ struct get_turn_info_linear_linear
|
||||
bool is_p_last, bool is_q_last,
|
||||
OutIt out)
|
||||
{
|
||||
bool is_p_spike = ( Version == append_touches ?
|
||||
static const bool is_version_touches = (Version == append_touches);
|
||||
|
||||
bool is_p_spike = ( is_version_touches ?
|
||||
( tp.operations[0].operation == operation_continue
|
||||
|| tp.operations[0].operation == operation_intersection ) :
|
||||
true )
|
||||
&& ! is_p_last
|
||||
&& inters.is_spike_p();
|
||||
bool is_q_spike = ( Version == append_touches ?
|
||||
bool is_q_spike = ( is_version_touches ?
|
||||
( tp.operations[1].operation == operation_continue
|
||||
|| tp.operations[1].operation == operation_intersection ) :
|
||||
true )
|
||||
@ -560,9 +564,11 @@ struct get_turn_info_linear_linear
|
||||
|
||||
bool res = false;
|
||||
|
||||
if ( is_p_spike && ( Version == append_touches || inters.d_info().arrival[0] == 1 ) )
|
||||
if ( is_p_spike
|
||||
&& ( BOOST_GEOMETRY_CONDITION(is_version_touches)
|
||||
|| inters.d_info().arrival[0] == 1 ) )
|
||||
{
|
||||
if ( Version == append_touches )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_version_touches) )
|
||||
{
|
||||
tp.operations[0].is_collinear = true;
|
||||
tp.operations[1].is_collinear = false;
|
||||
@ -591,9 +597,11 @@ struct get_turn_info_linear_linear
|
||||
res = true;
|
||||
}
|
||||
|
||||
if ( is_q_spike && ( Version == append_touches || inters.d_info().arrival[1] == 1 ) )
|
||||
if ( is_q_spike
|
||||
&& ( BOOST_GEOMETRY_CONDITION(is_version_touches)
|
||||
|| inters.d_info().arrival[1] == 1 ) )
|
||||
{
|
||||
if ( Version == append_touches )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_version_touches) )
|
||||
{
|
||||
tp.operations[0].is_collinear = false;
|
||||
tp.operations[1].is_collinear = true;
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
@ -96,7 +98,7 @@ struct self_section_visitor
|
||||
m_rescale_policy,
|
||||
m_turns, m_interrupt_policy);
|
||||
}
|
||||
if (m_interrupt_policy.has_intersections)
|
||||
if (BOOST_GEOMETRY_CONDITION(m_interrupt_policy.has_intersections))
|
||||
{
|
||||
// TODO: we should give partition an interrupt policy.
|
||||
// Now we throw, and catch below, to stop the partition loop.
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <boost/geometry/algorithms/detail/recalculate.hpp>
|
||||
#include <boost/geometry/policies/robustness/robust_point_type.hpp>
|
||||
#include <boost/geometry/strategies/side.hpp>
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
@ -91,7 +92,7 @@ static inline bool point_is_spike_or_equal(Point1 const& last_point,
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! RobustPolicy::enabled)
|
||||
if (BOOST_GEOMETRY_CONDITION(! RobustPolicy::enabled))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_AREAL_AREAL_HPP
|
||||
|
||||
#include <boost/geometry/core/topological_dimension.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_interior_rings.hpp>
|
||||
@ -197,7 +199,7 @@ struct areal_areal
|
||||
// The result should be FFFFFFFFF
|
||||
relate::set<exterior, exterior, result_dimension<Geometry2>::value>(result);// FFFFFFFFd, d in [1,9] or T
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
|
||||
// get and analyse turns
|
||||
@ -207,17 +209,17 @@ struct areal_areal
|
||||
interrupt_policy_areal_areal<Result> interrupt_policy(geometry1, geometry2, result);
|
||||
|
||||
turns::get_turns<Geometry1, Geometry2>::apply(turns, geometry1, geometry2, interrupt_policy);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
|
||||
no_turns_aa_pred<Geometry2, Result, false> pred1(geometry2, result);
|
||||
for_each_disjoint_geometry_if<0, Geometry1>::apply(turns.begin(), turns.end(), geometry1, pred1);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
|
||||
no_turns_aa_pred<Geometry1, Result, true> pred2(geometry1, result);
|
||||
for_each_disjoint_geometry_if<1, Geometry2>::apply(turns.begin(), turns.end(), geometry2, pred2);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
|
||||
if ( turns.empty() )
|
||||
@ -242,7 +244,7 @@ struct areal_areal
|
||||
turns_analyser<turn_type, 0> analyser;
|
||||
analyse_each_turn(result, analyser, turns.begin(), turns.end());
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -257,7 +259,7 @@ struct areal_areal
|
||||
uncertain_rings_analyser<0, Result, Geometry1, Geometry2> rings_analyser(result, geometry1, geometry2);
|
||||
analyse_uncertain_rings<0>::apply(rings_analyser, turns.begin(), turns.end());
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -281,7 +283,7 @@ struct areal_areal
|
||||
turns_analyser<turn_type, 1> analyser;
|
||||
analyse_each_turn(result, analyser, turns.begin(), turns.end());
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -549,7 +551,7 @@ struct areal_areal
|
||||
{
|
||||
analyser.apply(res, it);
|
||||
|
||||
if ( res.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(res.interrupt) )
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
//#include <boost/geometry/algorithms/detail/sub_range.hpp>
|
||||
|
||||
@ -375,14 +376,14 @@ static inline bool is_ip_on_boundary(IntersectionPoint const& ip,
|
||||
bool res = false;
|
||||
|
||||
// IP on the last point of the linestring
|
||||
if ( (BoundaryQuery == boundary_back || BoundaryQuery == boundary_any)
|
||||
if ( BOOST_GEOMETRY_CONDITION(BoundaryQuery == boundary_back || BoundaryQuery == boundary_any)
|
||||
&& operation_info.position == overlay::position_back )
|
||||
{
|
||||
// check if this point is a boundary
|
||||
res = boundary_checker.template is_endpoint_boundary<boundary_back>(ip);
|
||||
}
|
||||
// IP on the last point of the linestring
|
||||
else if ( (BoundaryQuery == boundary_front || BoundaryQuery == boundary_any)
|
||||
else if ( BOOST_GEOMETRY_CONDITION(BoundaryQuery == boundary_front || BoundaryQuery == boundary_any)
|
||||
&& operation_info.position == overlay::position_front )
|
||||
{
|
||||
// check if this point is a boundary
|
||||
|
@ -17,6 +17,8 @@
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/core/topological_dimension.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/num_interior_rings.hpp>
|
||||
@ -229,7 +231,7 @@ struct linear_areal
|
||||
// The result should be FFFFFFFFF
|
||||
relate::set<exterior, exterior, result_dimension<Geometry2>::value, TransposeResult>(result);// FFFFFFFFd, d in [1,9] or T
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
// get and analyse turns
|
||||
@ -239,7 +241,7 @@ struct linear_areal
|
||||
interrupt_policy_linear_areal<Geometry2, Result> interrupt_policy(geometry2, result);
|
||||
|
||||
turns::get_turns<Geometry1, Geometry2>::apply(turns, geometry1, geometry2, interrupt_policy);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
boundary_checker<Geometry1> boundary_checker1(geometry1);
|
||||
@ -251,12 +253,12 @@ struct linear_areal
|
||||
TransposeResult
|
||||
> pred1(geometry2, result, boundary_checker1);
|
||||
for_each_disjoint_geometry_if<0, Geometry1>::apply(turns.begin(), turns.end(), geometry1, pred1);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
no_turns_la_areal_pred<Result, !TransposeResult> pred2(result);
|
||||
for_each_disjoint_geometry_if<1, Geometry2>::apply(turns.begin(), turns.end(), geometry2, pred2);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
if ( turns.empty() )
|
||||
@ -265,7 +267,7 @@ struct linear_areal
|
||||
// This is set here because in the case if empty Areal geometry were passed
|
||||
// those shouldn't be set
|
||||
relate::set<exterior, interior, '2', TransposeResult>(result);// FFFFFF2Fd
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
{
|
||||
@ -277,7 +279,7 @@ struct linear_areal
|
||||
geometry1, geometry2,
|
||||
boundary_checker1);
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
}
|
||||
|
||||
@ -693,7 +695,7 @@ struct linear_areal
|
||||
m_exit_watcher.reset_detected_exit();
|
||||
}
|
||||
|
||||
if ( is_multi<OtherGeometry>::value
|
||||
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
|
||||
&& m_first_from_unknown )
|
||||
{
|
||||
// For MultiPolygon many x/u operations may be generated as a first IP
|
||||
@ -881,7 +883,7 @@ struct linear_areal
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_multi<OtherGeometry>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value ) )
|
||||
{
|
||||
m_first_from_unknown = false;
|
||||
m_first_from_unknown_boundary_detected = false;
|
||||
@ -968,7 +970,7 @@ struct linear_areal
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_multi<OtherGeometry>::value
|
||||
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
|
||||
/*&& ( op == overlay::operation_blocked
|
||||
|| op == overlay::operation_union )*/ ) // if we're here it's u or x
|
||||
{
|
||||
@ -996,7 +998,7 @@ struct linear_areal
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_multi<OtherGeometry>::value
|
||||
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
|
||||
/*&& ( op == overlay::operation_blocked
|
||||
|| op == overlay::operation_union )*/ ) // if we're here it's u or x
|
||||
{
|
||||
@ -1046,7 +1048,7 @@ struct linear_areal
|
||||
// For MultiPolygon many x/u operations may be generated as a first IP
|
||||
// if for all turns x/u was generated and any of the Polygons doesn't contain the LineString
|
||||
// then we know that the LineString is outside
|
||||
if ( is_multi<OtherGeometry>::value
|
||||
if ( BOOST_GEOMETRY_CONDITION( is_multi<OtherGeometry>::value )
|
||||
&& m_first_from_unknown )
|
||||
{
|
||||
update<interior, exterior, '1', TransposeResult>(res);
|
||||
@ -1284,7 +1286,7 @@ struct linear_areal
|
||||
geometry, other_geometry,
|
||||
boundary_checker);
|
||||
|
||||
if ( res.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( res.interrupt ) )
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014.
|
||||
// Modifications copyright (c) 2013-2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013, 2014, 2015.
|
||||
// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -16,6 +16,7 @@
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
#include <boost/geometry/util/range.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/sub_range.hpp>
|
||||
@ -117,7 +118,7 @@ struct linear_linear
|
||||
{
|
||||
// The result should be FFFFFFFFF
|
||||
relate::set<exterior, exterior, result_dimension<Geometry1>::value>(result);// FFFFFFFFd, d in [1,9] or T
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
// get and analyse turns
|
||||
@ -133,19 +134,19 @@ struct linear_linear
|
||||
detail::get_turns::get_turn_info_type<Geometry1, Geometry2, turns::assign_policy<true> >
|
||||
>::apply(turns, geometry1, geometry2, interrupt_policy);
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
boundary_checker<Geometry1> boundary_checker1(geometry1);
|
||||
disjoint_linestring_pred<Result, boundary_checker<Geometry1>, false> pred1(result, boundary_checker1);
|
||||
for_each_disjoint_geometry_if<0, Geometry1>::apply(turns.begin(), turns.end(), geometry1, pred1);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
boundary_checker<Geometry2> boundary_checker2(geometry2);
|
||||
disjoint_linestring_pred<Result, boundary_checker<Geometry2>, true> pred2(result, boundary_checker2);
|
||||
for_each_disjoint_geometry_if<1, Geometry2>::apply(turns.begin(), turns.end(), geometry2, pred2);
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
if ( turns.empty() )
|
||||
@ -171,7 +172,7 @@ struct linear_linear
|
||||
boundary_checker1, boundary_checker2);
|
||||
}
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( result.interrupt ) )
|
||||
return;
|
||||
|
||||
if ( may_update<interior, interior, '1', true>(result)
|
||||
@ -766,7 +767,7 @@ struct linear_linear
|
||||
geometry, other_geometry,
|
||||
boundary_checker, other_boundary_checker);
|
||||
|
||||
if ( res.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION( res.interrupt ) )
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014.
|
||||
// Modifications copyright (c) 2013, 2014, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013, 2014, 2015.
|
||||
// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_POINT_GEOMETRY_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_POINT_GEOMETRY_HPP
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
|
||||
#include <boost/geometry/algorithms/detail/relate/topology_check.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
@ -54,7 +56,7 @@ struct point_geometry
|
||||
|
||||
set<exterior, exterior, result_dimension<Point>::value, Transpose>(result);
|
||||
|
||||
if ( result.interrupt )
|
||||
if ( BOOST_GEOMETRY_CONDITION(result.interrupt) )
|
||||
return;
|
||||
|
||||
// the point is on the boundary
|
||||
|
@ -2,15 +2,15 @@
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2013, 2014.
|
||||
// Modifications copyright (c) 2013, 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2013, 2014, 2015.
|
||||
// Modifications copyright (c) 2013-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RESULT_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_RESULT_HPP
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include <boost/mpl/vector_c.hpp>
|
||||
|
||||
#include <boost/geometry/core/topological_dimension.hpp>
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
// TEMP - move this header to geometry/detail
|
||||
#include <boost/geometry/index/detail/tuples.hpp>
|
||||
@ -241,11 +242,11 @@ struct interrupt_dispatch<Mask, true>
|
||||
template <char V>
|
||||
static inline bool check(char m)
|
||||
{
|
||||
if ( V >= '0' && V <= '9' )
|
||||
if ( BOOST_GEOMETRY_CONDITION(V >= '0' && V <= '9') )
|
||||
{
|
||||
return m == 'F' || ( m < V && m >= '0' && m <= '9' );
|
||||
}
|
||||
else if ( V == 'T' )
|
||||
else if ( BOOST_GEOMETRY_CONDITION(V == 'T') )
|
||||
{
|
||||
return m == 'F';
|
||||
}
|
||||
|
@ -27,11 +27,15 @@
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/check.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/point_is_spike_or_equal.hpp>
|
||||
#include <boost/geometry/algorithms/detail/interior_iterator.hpp>
|
||||
#include <boost/geometry/algorithms/clear.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
/*
|
||||
Remove spikes from a ring/polygon.
|
||||
@ -95,7 +99,7 @@ struct range_remove_spikes
|
||||
}
|
||||
|
||||
// For a closed-polygon, remove closing point, this makes checking first point(s) easier and consistent
|
||||
if (geometry::closure<Range>::value == geometry::closed)
|
||||
if ( BOOST_GEOMETRY_CONDITION(geometry::closure<Range>::value == geometry::closed) )
|
||||
{
|
||||
cleaned.pop_back();
|
||||
}
|
||||
@ -128,7 +132,7 @@ struct range_remove_spikes
|
||||
}
|
||||
|
||||
// Close if necessary
|
||||
if (geometry::closure<Range>::value == geometry::closed)
|
||||
if ( BOOST_GEOMETRY_CONDITION(geometry::closure<Range>::value == geometry::closed) )
|
||||
{
|
||||
cleaned.push_back(cleaned.front());
|
||||
}
|
||||
|
@ -9,6 +9,9 @@
|
||||
#ifndef BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_BUFFER_DISTANCE_SYMMETRIC_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_BUFFER_DISTANCE_SYMMETRIC_HPP
|
||||
|
||||
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/buffer.hpp>
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
|
||||
@ -76,6 +79,8 @@ public :
|
||||
inline NumericType max_distance(JoinStrategy const& join_strategy,
|
||||
EndStrategy const& end_strategy) const
|
||||
{
|
||||
boost::ignore_unused(join_strategy, end_strategy);
|
||||
|
||||
NumericType const dist = geometry::math::abs(m_distance);
|
||||
return (std::max)(join_strategy.max_distance(dist),
|
||||
end_strategy.max_distance(dist));
|
||||
|
44
include/boost/geometry/util/condition.hpp
Normal file
44
include/boost/geometry/util/condition.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_UTIL_CONDITION_HPP
|
||||
#define BOOST_GEOMETRY_UTIL_CONDITION_HPP
|
||||
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
// The macro defined in this file allows to suppress the MSVC
|
||||
// compiler warning C4127: conditional expression is constant
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
|
||||
// NOTE: The code commented out below contains an alternative implementation
|
||||
// of a macro using a free function. It was left here in case if in the future
|
||||
// version of MSVC for the code currently used in the macro implementation
|
||||
// the warning was generated.
|
||||
|
||||
//#ifndef DOXYGEN_NO_DETAIL
|
||||
//namespace boost { namespace geometry { namespace detail {
|
||||
//BOOST_FORCEINLINE bool condition(bool const b) { return b; }
|
||||
//}}} // boost::geometry::detail
|
||||
//#endif // DOXYGEN_NO_DETAIL
|
||||
//#define BOOST_GEOMETRY_CONDITION(CONDITION) boost::geometry::detail::condition(CONDITION)
|
||||
|
||||
#define BOOST_GEOMETRY_CONDITION(CONDITION) ((void)0, (CONDITION))
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_GEOMETRY_CONDITION(CONDITION) (CONDITION)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_UTIL_CONDITION_HPP
|
@ -396,7 +396,7 @@ void test_all()
|
||||
test_one<multi_polygon_type, polygon_type>("rt_u6", rt_u6, join_round, end_flat, 115.4461, 1.0);
|
||||
|
||||
test_one<multi_polygon_type, polygon_type>("rt_u7", rt_u7, join_miter, end_flat, 42.6421, 1.0);
|
||||
if (Clockwise)
|
||||
if ( BOOST_GEOMETRY_CONDITION(Clockwise) )
|
||||
{
|
||||
// This configuration is not yet stable. By the changed sorting of turns, they now fail
|
||||
// (the change was irrelevant to this, so they succeeded earlier by luck).
|
||||
|
@ -53,6 +53,8 @@
|
||||
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
#if defined(TEST_WITH_SVG)
|
||||
|
||||
@ -449,8 +451,9 @@ void test_buffer(std::string const& caseid, Geometry const& geometry,
|
||||
std::string join_name = JoinTestProperties<JoinStrategy>::name();
|
||||
std::string end_name = EndTestProperties<EndStrategy>::name();
|
||||
|
||||
if (boost::is_same<tag, bg::point_tag>::value
|
||||
|| boost::is_same<tag, bg::multi_point_tag>::value)
|
||||
if ( BOOST_GEOMETRY_CONDITION((
|
||||
boost::is_same<tag, bg::point_tag>::value
|
||||
|| boost::is_same<tag, bg::multi_point_tag>::value )) )
|
||||
{
|
||||
join_name.clear();
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/io/wkt/wkt.hpp>
|
||||
|
||||
#include <boost/geometry/util/condition.hpp>
|
||||
|
||||
|
||||
template <int DimensionCount, bool Reverse, typename Geometry>
|
||||
@ -73,7 +73,7 @@ void test_sectionalize(std::string const& caseid, std::string const& wkt,
|
||||
{
|
||||
Geometry geometry;
|
||||
bg::read_wkt(wkt, geometry);
|
||||
if (bg::closure<Geometry>::value == bg::open)
|
||||
if ( BOOST_GEOMETRY_CONDITION( bg::closure<Geometry>::value == bg::open ) )
|
||||
{
|
||||
geometry.outer().resize(geometry.outer().size() - 1);
|
||||
}
|
||||
|
@ -5,8 +5,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014.
|
||||
// Modifications copyright (c) 2014 Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014, 2015.
|
||||
// Modifications copyright (c) 2014-2015 Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
@ -15,8 +17,6 @@
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
#include "test_get_turns.hpp"
|
||||
#include <boost/geometry/geometries/geometries.hpp>
|
||||
|
||||
@ -215,7 +215,7 @@ void test_all()
|
||||
expected("muu++"));
|
||||
|
||||
// 29.01.2015
|
||||
if ( boost::is_same<T, double>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) )
|
||||
{
|
||||
// FAILING
|
||||
/*test_geometry<ls, ls>("LINESTRING(3 -0.6,0 -0.9)",
|
||||
@ -264,7 +264,7 @@ void test_all()
|
||||
"LINESTRING(-5 -4,3 0,7 -4,2 -1)",
|
||||
expected("tii++")("mxu==")("miu==")("mui=+"));
|
||||
|
||||
if ( boost::is_same<T, double>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) )
|
||||
{
|
||||
// FAILING
|
||||
/*
|
||||
|
@ -774,7 +774,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
|
||||
test_traverse<polygon, polygon, operation_intersection>::apply("hv3", 1, 1623.8265057282042, hv_3[0], hv_3[1], deviation);
|
||||
|
||||
|
||||
if (! is_float)
|
||||
if ( BOOST_GEOMETRY_CONDITION(! is_float) )
|
||||
{
|
||||
test_traverse<polygon, polygon, operation_union>::apply("hv4", 1, 1626.5146964146334, hv_4[0], hv_4[1], deviation);
|
||||
test_traverse<polygon, polygon, operation_intersection>::apply("hv4", 1, 1626.2580370864305, hv_4[0], hv_4[1], deviation);
|
||||
@ -798,7 +798,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
|
||||
// the chance is 50% that the segments are not sorted correctly and the wrong
|
||||
// decision is taken.
|
||||
// Solved now (by sorting on sides in those cases)
|
||||
if (! is_float_on_non_msvc)
|
||||
if ( BOOST_GEOMETRY_CONDITION(! is_float_on_non_msvc) )
|
||||
{
|
||||
test_traverse<polygon, polygon, operation_intersection>::apply("dz_1",
|
||||
2, 16.887537949472005, dz_1[0], dz_1[1]);
|
||||
@ -844,7 +844,7 @@ void test_all(bool test_self_tangencies = true, bool test_mixed = false)
|
||||
float_might_deviate_more);
|
||||
}
|
||||
|
||||
if (! is_float)
|
||||
if ( BOOST_GEOMETRY_CONDITION(! is_float) )
|
||||
{
|
||||
|
||||
/* TODO check this BSG 2013-09-24
|
||||
|
@ -71,7 +71,8 @@ void test_linestring_linestring()
|
||||
test_geometry<ls, ls>("ls2d_overl_ring2", "LINESTRING(0 0,5 0,5 5,0 5,0 0)", "LINESTRING(5 5,5 0,0 0,0 5,5 5,5 0)", true);
|
||||
|
||||
// https://svn.boost.org/trac/boost/ticket/10904
|
||||
if ( boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(
|
||||
boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value ) )
|
||||
{
|
||||
test_geometry<ls, ls>("ls2d_small1",
|
||||
"LINESTRING(5.6956521739130430148634331999347 -0.60869565217391330413931882503675,5.5 -0.50000000000000066613381477509392)",
|
||||
|
@ -302,7 +302,8 @@ void test_polygon_polygon()
|
||||
"212101212");
|
||||
}
|
||||
|
||||
if ( boost::is_same<typename bg::coordinate_type<P>::type, double>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((
|
||||
boost::is_same<typename bg::coordinate_type<P>::type, double>::value )) )
|
||||
{
|
||||
// original - assertion for CCW
|
||||
//"POLYGON((-0.593220338983050821113352 -8.05084745762711939676137,1.14285714285714279370154 -4,1.50731707317073171381594 1.10243902439024443751237,1.73758865248226967992196 1.37588652482269591104114,1.21739130434782616418943 -3.82608695652173924628414,2 -2,2 1.68750000000000044408921,2.35384615384615436539661 2.10769230769230775379697,2 2.16666666666666651863693,2 4,1.81967213114754100544701 2.1967213114754100544701,1.5882352941176469673934 2.2352941176470588757752,1.8148148148148146585612 5.4074074074074074403029,-0.538461538461538546940233 4.23076923076923083755219,-1.76510067114094004736558 2.89261744966443012927471,-1.64864864864864868465588 2.7567567567567570208098,-1.83962264150943455298659 2.81132075471698161805989,-1.84337349397590433142113 2.80722891566265086993326,-2.14285714285714279370154 2.85714285714285720629846,-2.11111111111111116045436 2.88888888888888883954564,-2.87234042553191448732264 3.10638297872340407579372,-2.91803278688524558859285 3.4262295081967208965068,-3.1733333333333324510761 3.26666666666666660745477,-2.99999999999999822364316 3.14285714285714234961233,-3.25490196078431326398572 3.21568627450980359938626,-3.47368421052631504153396 3.07894736842105265495206,-7.32000000000000028421709 3.72000000000000019539925,-7.54716981132075481752963 3.62264150943396234794136,-7.75 3.79166666666666651863693,-7.79999999999999982236432 3.79999999999999982236432,-7.59999999999999964472863 3.60000000000000008881784,-8.8556701030927822415606 3.06185567010309300783888,-8.82945736434108674473009 2.8914728682170549589614,-7.73333333333333339254523 2.193939393939393855959,-8 2,-5.94736842105263185942476 -1.42105263157894645686952,-5.32558139534883689947264 -0.488372093023255016142059,-5.85714285714285765038767 1.00000000000000066613381,-4.78723404255319184841255 0.319148936170212838003835,-5.32558139534883689947264 -0.488372093023255016142059,-4.74019607843137258385013 -2.12745098039215774221589,-3.17647058823529437887601 -0.705882352941176627325603,-2.93103448275862055183438 -0.862068965517241436735674,-3 -1,-4.57894736842105309904127 -2.57894736842105265495206,-4.47887323943661996850096 -2.85915492957746497637572,-7.58620689655172419918472 -5.18965517241379359347775,-7.52525252525252508206677 -5.5858585858585865224768,-4.18644067796610119813749 -3.67796610169491522412955,-3.44041450777202051369841 -5.76683937823834202873741,-3.73611111111111116045436 -6.56944444444444464181743,-2.8823529411764705621124 -7.7647058823529411242248,-2.88235294117647100620161 -7.7647058823529411242248,-0.593220338983050821113352 -8.05084745762711939676137),(1.66666666666666696272614 1.59999999999999875655021,1.43749999999999911182158 1.8750000000000002220446,0.0869565217391310429917439 2.26086956521739113057379,0.466666666666667118157363 2.60606060606060552231611,1.04878048780487764801705 2.34146341463414664474385,1.43749999999999911182158 1.8750000000000002220446,1.56756756756756754356275 1.83783783783783771781373,1.66666666666666696272614 1.59999999999999875655021))"
|
||||
|
@ -389,7 +389,8 @@ void test_multi_linestring_polygon()
|
||||
"POLYGON((5 0,0 -5,-5 0,0 5,5 0))",
|
||||
"1F10F0212");
|
||||
|
||||
if ( boost::is_same<typename bg::coordinate_type<P>::type, double>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((
|
||||
boost::is_same<typename bg::coordinate_type<P>::type, double>::value )) )
|
||||
{
|
||||
// assertion failure in 1.57
|
||||
test_geometry<mls, poly>("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))",
|
||||
|
@ -185,7 +185,8 @@ void test_linestring_linestring()
|
||||
// Point/Point
|
||||
//test_geometry<ls, ls>("LINESTRING(0 0)", "LINESTRING(0 0)", "0FFFFFFF2");
|
||||
|
||||
if ( boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(
|
||||
boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value ) )
|
||||
{
|
||||
// https://svn.boost.org/trac/boost/ticket/10904
|
||||
// very small segments
|
||||
@ -333,7 +334,7 @@ void test_linestring_multi_linestring()
|
||||
"10FF0F102"); // |
|
||||
// |
|
||||
|
||||
if ( boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point<typename bg::coordinate_type<ls>::type>::value) )
|
||||
{
|
||||
// related to https://svn.boost.org/trac/boost/ticket/10904
|
||||
test_geometry<ls, mls>("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)",
|
||||
@ -401,7 +402,8 @@ void test_multi_linestring_multi_linestring()
|
||||
"MULTILINESTRING((5 5,0 5),(5 5,5 0),(10 10,10 5,5 5,5 10,10 10))",
|
||||
"10FFFFFF2");
|
||||
|
||||
if ( boost::is_same<typename bg::coordinate_type<P>::type, double>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((
|
||||
boost::is_same<typename bg::coordinate_type<P>::type, double>::value )) )
|
||||
{
|
||||
// assertion failure in 1.57
|
||||
test_geometry<mls, mls>("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))",
|
||||
|
@ -109,7 +109,8 @@ void check_geometry(Geometry1 const& geometry1,
|
||||
<< " -> Expected: " << expected1);
|
||||
}
|
||||
|
||||
if ( bg::detail::relate::interruption_enabled<Geometry1, Geometry2>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION((
|
||||
bg::detail::relate::interruption_enabled<Geometry1, Geometry2>::value )) )
|
||||
{
|
||||
// brake the expected output
|
||||
std::string expected_interrupt = expected1;
|
||||
|
@ -84,7 +84,7 @@ void test_ordered_ring(std::string const& wkt_point,
|
||||
Point point;
|
||||
|
||||
bg::read_wkt(wkt_geometry, ring);
|
||||
if (! Clockwise)
|
||||
if ( BOOST_GEOMETRY_CONDITION(! Clockwise) )
|
||||
{
|
||||
std::reverse(boost::begin(ring), boost::end(ring));
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void test_all()
|
||||
1, 61, 10.2717);
|
||||
#endif
|
||||
|
||||
if (boost::is_same<ct, double>::value)
|
||||
if ( BOOST_GEOMETRY_CONDITION((boost::is_same<ct, double>::value)) )
|
||||
{
|
||||
test_one<polygon, polygon, polygon>("buffer_mp2",
|
||||
buffer_mp2[0], buffer_mp2[1],
|
||||
@ -316,7 +316,7 @@ void test_all()
|
||||
1, 4, 3200.4,
|
||||
0.01);
|
||||
|
||||
if (! boost::is_same<ct, float>::value)
|
||||
if ( BOOST_GEOMETRY_CONDITION((! boost::is_same<ct, float>::value)) )
|
||||
{
|
||||
test_one<polygon, polygon, polygon>("ggl_list_20110716_enrico",
|
||||
ggl_list_20110716_enrico[0], ggl_list_20110716_enrico[1],
|
||||
|
@ -181,7 +181,7 @@ void test_areal()
|
||||
1, -1, 0.08368849);
|
||||
|
||||
|
||||
if (! ccw && open)
|
||||
if ( BOOST_GEOMETRY_CONDITION(! ccw && open) )
|
||||
{
|
||||
// Pointcount for ttmath/double (both 5) or float (4)
|
||||
// double returns 5 (since method append_no_dups_or_spikes)
|
||||
|
@ -355,7 +355,7 @@ struct test_valid
|
||||
}
|
||||
}
|
||||
|
||||
if ( is_convertible_to_polygon<Geometry>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_convertible_to_polygon<Geometry>::value) )
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "...checking geometry converted to polygon..."
|
||||
@ -366,7 +366,7 @@ struct test_valid
|
||||
base_test(polygon, expected_result);
|
||||
}
|
||||
|
||||
if ( is_convertible_to_multipolygon<Geometry>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(is_convertible_to_multipolygon<Geometry>::value) )
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_TEST_DEBUG
|
||||
std::cout << "...checking geometry converted to multi-polygon..."
|
||||
|
@ -242,8 +242,8 @@ void test_all()
|
||||
test_wrong_wkt<bg::model::box<P> >("BOX(1 1,2 2,3 3)", "box should have 2");
|
||||
test_wrong_wkt<bg::model::box<P> >("BOX(1 1,2 2) )", "too much tokens");
|
||||
|
||||
if (boost::is_floating_point<T>::type::value
|
||||
|| ! boost::is_fundamental<T>::type::value)
|
||||
if ( BOOST_GEOMETRY_CONDITION(boost::is_floating_point<T>::type::value
|
||||
|| ! boost::is_fundamental<T>::type::value ) )
|
||||
{
|
||||
test_wkt<P>("POINT(1.1 2.1)", 1);
|
||||
}
|
||||
|
@ -205,8 +205,9 @@ void test_all()
|
||||
bg::srs::spheroid<double> gda_spheroid(gda_a, gda_b);
|
||||
|
||||
// Test fractional coordinates only for non-integral types
|
||||
if ( ! boost::is_integral<typename bg::coordinate_type<P1>::type>::value
|
||||
&& ! boost::is_integral<typename bg::coordinate_type<P2>::type>::value )
|
||||
if ( BOOST_GEOMETRY_CONDITION(
|
||||
! boost::is_integral<typename bg::coordinate_type<P1>::type>::value
|
||||
&& ! boost::is_integral<typename bg::coordinate_type<P2>::type>::value ) )
|
||||
{
|
||||
// Flinders Peak -> Buninyong
|
||||
test_vincenty<P1, P2>(azimuth(144,25,29.52440), azimuth(-37,57,3.72030),
|
||||
|
@ -72,14 +72,7 @@ struct access<rw_lon_lat_point<CoordinateType, CoordinateSystem>, Dimension>
|
||||
void set(rw_lon_lat_point<CoordinateType, CoordinateSystem>& p,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
if (Dimension == 0)
|
||||
{
|
||||
p.longitude = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
p.latitude = value;
|
||||
}
|
||||
( Dimension == 0 ? p.longitude : p.latitude ) = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user