mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-01 20:42:10 +00:00
[geometry] Remove all trailing spaces (algorithms)
This commit is contained in:
@@ -227,7 +227,7 @@ struct append<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
RangeOrPoint const& m_range_or_point;
|
||||
int m_ring_index;
|
||||
int m_multi_index;
|
||||
|
||||
|
||||
visitor(RangeOrPoint const& range_or_point,
|
||||
int ring_index,
|
||||
int multi_index):
|
||||
@@ -235,7 +235,7 @@ struct append<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
m_ring_index(ring_index),
|
||||
m_multi_index(multi_index)
|
||||
{}
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
void operator()(Geometry& geometry) const
|
||||
{
|
||||
|
||||
@@ -258,7 +258,7 @@ inline typename default_area_result<Geometry>::type area(Geometry const& geometr
|
||||
>::type strategy_type;
|
||||
|
||||
// detail::throw_on_empty_input(geometry);
|
||||
|
||||
|
||||
return resolve_variant::area<Geometry>::apply(geometry, strategy_type());
|
||||
}
|
||||
|
||||
@@ -293,7 +293,7 @@ inline typename Strategy::return_type area(
|
||||
concept::check<Geometry const>();
|
||||
|
||||
// detail::throw_on_empty_input(geometry);
|
||||
|
||||
|
||||
return resolve_variant::area<Geometry>::apply(geometry, strategy);
|
||||
}
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ inline void assign(Geometry1& geometry1, Geometry2 const& geometry2)
|
||||
{
|
||||
concept::check_concepts_and_equal_dimensions<Geometry1, Geometry2 const>();
|
||||
|
||||
bool const same_point_order =
|
||||
bool const same_point_order =
|
||||
point_order<Geometry1>::value == point_order<Geometry2>::value;
|
||||
bool const same_closure =
|
||||
bool const same_closure =
|
||||
closure<Geometry1>::value == closure<Geometry2>::value;
|
||||
|
||||
BOOST_MPL_ASSERT_MSG
|
||||
|
||||
@@ -381,7 +381,7 @@ struct centroid<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
};
|
||||
|
||||
template <typename Point, typename Strategy>
|
||||
static inline void
|
||||
static inline void
|
||||
apply(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry,
|
||||
Point& out,
|
||||
Strategy const& strategy)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace boost { namespace geometry
|
||||
\details The free function comparable_distance does not necessarily calculate the distance,
|
||||
but it calculates a distance measure such that two distances are comparable to each other.
|
||||
For example: for the Cartesian coordinate system, Pythagoras is used but the square root
|
||||
is not taken, which makes it faster and the results of two point pairs can still be
|
||||
is not taken, which makes it faster and the results of two point pairs can still be
|
||||
compared to each other.
|
||||
\tparam Geometry1 first geometry type
|
||||
\tparam Geometry2 second geometry type
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace boost { namespace geometry
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
// Silence warning C4512: assignment operator could not be generated
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127 4512)
|
||||
#endif
|
||||
|
||||
@@ -127,22 +127,22 @@ struct segment_to_range
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Range1,
|
||||
typename Range2,
|
||||
typename Range1,
|
||||
typename Range2,
|
||||
bool Reverse = false
|
||||
>
|
||||
struct range_to_range
|
||||
{
|
||||
typedef typename reversible_view
|
||||
<
|
||||
Range1 const,
|
||||
Range1 const,
|
||||
Reverse ? iterate_reverse : iterate_forward
|
||||
>::type rview_type;
|
||||
typedef typename closeable_view
|
||||
<
|
||||
rview_type const,
|
||||
rview_type const,
|
||||
geometry::closure<Range1>::value
|
||||
>::type view_type;
|
||||
|
||||
@@ -178,7 +178,7 @@ struct polygon_to_polygon
|
||||
{
|
||||
typedef range_to_range
|
||||
<
|
||||
typename geometry::ring_type<Polygon1>::type,
|
||||
typename geometry::ring_type<Polygon1>::type,
|
||||
typename geometry::ring_type<Polygon2>::type,
|
||||
geometry::point_order<Polygon1>::value
|
||||
!= geometry::point_order<Polygon2>::value
|
||||
@@ -188,7 +188,7 @@ struct polygon_to_polygon
|
||||
{
|
||||
// Clearing managed per ring, and in the resizing of interior rings
|
||||
|
||||
per_ring::apply(geometry::exterior_ring(source),
|
||||
per_ring::apply(geometry::exterior_ring(source),
|
||||
geometry::exterior_ring(destination));
|
||||
|
||||
// Container should be resizeable
|
||||
@@ -292,8 +292,8 @@ struct convert<Segment, LineString, segment_tag, linestring_tag, DimensionCount,
|
||||
template <typename Ring1, typename Ring2, std::size_t DimensionCount>
|
||||
struct convert<Ring1, Ring2, ring_tag, ring_tag, DimensionCount, false>
|
||||
: detail::conversion::range_to_range
|
||||
<
|
||||
Ring1,
|
||||
<
|
||||
Ring1,
|
||||
Ring2,
|
||||
geometry::point_order<Ring1>::value
|
||||
!= geometry::point_order<Ring2>::value
|
||||
@@ -314,8 +314,8 @@ template <typename Box, typename Ring>
|
||||
struct convert<Box, Ring, box_tag, ring_tag, 2, false>
|
||||
: detail::conversion::box_to_range
|
||||
<
|
||||
Box,
|
||||
Ring,
|
||||
Box,
|
||||
Ring,
|
||||
geometry::closure<Ring>::value == closed,
|
||||
geometry::point_order<Ring>::value == counterclockwise
|
||||
>
|
||||
@@ -438,8 +438,8 @@ struct convert<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2>
|
||||
\brief Converts one geometry to another geometry
|
||||
\details The convert algorithm converts one geometry, e.g. a BOX, to another
|
||||
geometry, e.g. a RING. This only works if it is possible and applicable.
|
||||
If the point-order is different, or the closure is different between two
|
||||
geometry types, it will be converted correctly by explicitly reversing the
|
||||
If the point-order is different, or the closure is different between two
|
||||
geometry types, it will be converted correctly by explicitly reversing the
|
||||
points or closing or opening the polygon rings.
|
||||
\ingroup convert
|
||||
\tparam Geometry1 \tparam_geometry
|
||||
|
||||
@@ -230,7 +230,7 @@ struct convex_hull<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
};
|
||||
|
||||
template <typename OutputGeometry, typename Strategy>
|
||||
static inline void
|
||||
static inline void
|
||||
apply(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry,
|
||||
OutputGeometry& out,
|
||||
Strategy const& strategy)
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace boost { namespace geometry
|
||||
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -120,8 +120,8 @@ struct covered_by
|
||||
{
|
||||
concept::within::check
|
||||
<
|
||||
typename tag<Geometry1>::type,
|
||||
typename tag<Geometry2>::type,
|
||||
typename tag<Geometry1>::type,
|
||||
typename tag<Geometry2>::type,
|
||||
typename tag_cast<typename tag<Geometry2>::type, areal_tag>::type,
|
||||
Strategy
|
||||
>();
|
||||
@@ -141,7 +141,7 @@ struct covered_by
|
||||
{
|
||||
typedef typename point_type<Geometry1>::type point_type1;
|
||||
typedef typename point_type<Geometry2>::type point_type2;
|
||||
|
||||
|
||||
typedef typename strategy::covered_by::services::default_strategy
|
||||
<
|
||||
typename tag<Geometry1>::type,
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
namespace detail
|
||||
{
|
||||
// Note: this is moved to namespace detail because the names and parameter orders
|
||||
// are not yet 100% clear.
|
||||
@@ -69,8 +69,8 @@ inline void assign_box_corners(Box const& box,
|
||||
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
namespace detail
|
||||
{
|
||||
|
||||
/*!
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace detail { namespace conversion
|
||||
|
||||
template
|
||||
<
|
||||
typename Source,
|
||||
typename Destination,
|
||||
std::size_t Dimension,
|
||||
typename Source,
|
||||
typename Destination,
|
||||
std::size_t Dimension,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct indexed_to_indexed
|
||||
@@ -44,25 +44,25 @@ struct indexed_to_indexed
|
||||
{
|
||||
typedef typename coordinate_type<Destination>::type coordinate_type;
|
||||
|
||||
geometry::set<min_corner, Dimension>(destination,
|
||||
geometry::set<min_corner, Dimension>(destination,
|
||||
boost::numeric_cast<coordinate_type>(
|
||||
geometry::get<min_corner, Dimension>(source)));
|
||||
geometry::set<max_corner, Dimension>(destination,
|
||||
geometry::set<max_corner, Dimension>(destination,
|
||||
boost::numeric_cast<coordinate_type>(
|
||||
geometry::get<max_corner, Dimension>(source)));
|
||||
|
||||
|
||||
indexed_to_indexed
|
||||
<
|
||||
Source, Destination,
|
||||
Source, Destination,
|
||||
Dimension + 1, DimensionCount
|
||||
>::apply(source, destination);
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Source,
|
||||
typename Destination,
|
||||
typename Source,
|
||||
typename Destination,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct indexed_to_indexed<Source, Destination, DimensionCount, DimensionCount>
|
||||
|
||||
@@ -75,9 +75,9 @@ struct collected_vector
|
||||
|
||||
inline bool same_direction(collected_vector<T> const& other) const
|
||||
{
|
||||
// For high precision arithmetic, we have to be
|
||||
// For high precision arithmetic, we have to be
|
||||
// more relaxed then using ==
|
||||
// Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) )
|
||||
// Because 2/sqrt( (0,0)<->(2,2) ) == 1/sqrt( (0,0)<->(1,1) )
|
||||
// is not always true (at least, it is not for ttmath)
|
||||
return math::equals_with_epsilon(dx, other.dx)
|
||||
&& math::equals_with_epsilon(dy, other.dy);
|
||||
@@ -150,7 +150,7 @@ struct range_collect_vectors
|
||||
}
|
||||
|
||||
// If first one has same direction as last one, remove first one
|
||||
if (boost::size(collection) > 1
|
||||
if (boost::size(collection) > 1
|
||||
&& collection.front().same_direction(collection.back()))
|
||||
{
|
||||
collection.erase(collection.begin());
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <boost/geometry/iterators/ever_circling_iterator.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/detail/assign_box_corners.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/strategies/side.hpp>
|
||||
|
||||
#include <boost/geometry/util/math.hpp>
|
||||
@@ -55,7 +55,7 @@ template <std::size_t Dimension, typename PointType, typename CoordinateType>
|
||||
inline void move_along_vector(PointType& point, PointType const& extreme, CoordinateType const& base_value)
|
||||
{
|
||||
// Moves a point along the vector (point, extreme) in the direction of the extreme point
|
||||
// This adapts the possibly uneven legs of the triangle (or trapezium-like shape)
|
||||
// This adapts the possibly uneven legs of the triangle (or trapezium-like shape)
|
||||
// _____extreme _____
|
||||
// / \ / \ .
|
||||
// /base \ => / \ point .
|
||||
@@ -78,7 +78,7 @@ inline void move_along_vector(PointType& point, PointType const& extreme, Coordi
|
||||
CoordinateType const diff = geometry::get<Dimension>(vector);
|
||||
|
||||
// diff should never be zero
|
||||
// because of the way our triangle/trapezium is build.
|
||||
// because of the way our triangle/trapezium is build.
|
||||
// We just return if it would be the case.
|
||||
if (geometry::math::equals(diff, 0))
|
||||
{
|
||||
@@ -122,8 +122,8 @@ struct extreme_points_on_ring
|
||||
|
||||
template <typename CirclingIterator, typename Points>
|
||||
static inline bool extend(CirclingIterator& it,
|
||||
std::size_t n,
|
||||
coordinate_type max_coordinate_value,
|
||||
std::size_t n,
|
||||
coordinate_type max_coordinate_value,
|
||||
Points& points, int direction)
|
||||
{
|
||||
std::size_t safe_index = 0;
|
||||
@@ -146,8 +146,8 @@ struct extreme_points_on_ring
|
||||
// Overload without adding to poinst
|
||||
template <typename CirclingIterator>
|
||||
static inline bool extend(CirclingIterator& it,
|
||||
std::size_t n,
|
||||
coordinate_type max_coordinate_value,
|
||||
std::size_t n,
|
||||
coordinate_type max_coordinate_value,
|
||||
int direction)
|
||||
{
|
||||
std::size_t safe_index = 0;
|
||||
@@ -166,7 +166,7 @@ struct extreme_points_on_ring
|
||||
}
|
||||
|
||||
template <typename CirclingIterator>
|
||||
static inline bool extent_both_sides(Ring const& ring,
|
||||
static inline bool extent_both_sides(Ring const& ring,
|
||||
point_type extreme,
|
||||
CirclingIterator& left,
|
||||
CirclingIterator& right)
|
||||
@@ -187,9 +187,9 @@ struct extreme_points_on_ring
|
||||
}
|
||||
|
||||
template <typename Collection, typename CirclingIterator>
|
||||
static inline bool collect(Ring const& ring,
|
||||
static inline bool collect(Ring const& ring,
|
||||
point_type extreme,
|
||||
Collection& points,
|
||||
Collection& points,
|
||||
CirclingIterator& left,
|
||||
CirclingIterator& right)
|
||||
{
|
||||
@@ -221,11 +221,11 @@ struct extreme_points_on_ring
|
||||
return;
|
||||
}
|
||||
coordinate_type const min_value = geometry::get<Dimension>(*std::min_element(boost::begin(extremes), boost::end(extremes), compare<Dimension>()));
|
||||
|
||||
|
||||
// Also select left/right (if Dimension=1)
|
||||
coordinate_type const other_min = geometry::get<1 - Dimension>(*std::min_element(boost::begin(extremes), boost::end(extremes), compare<1 - Dimension>()));
|
||||
coordinate_type const other_max = geometry::get<1 - Dimension>(*std::max_element(boost::begin(extremes), boost::end(extremes), compare<1 - Dimension>()));
|
||||
|
||||
|
||||
std::size_t defensive_check_index = 0; // in case we skip over left/right check, collect modifies right too
|
||||
std::size_t const n = boost::size(ring);
|
||||
while (left != right && defensive_check_index < n)
|
||||
@@ -325,7 +325,7 @@ struct extreme_points_on_ring
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int const index = std::distance(boost::begin(ring), max_it);
|
||||
//std::cout << "Extreme point lies at " << index << " having " << geometry::wkt(*max_it) << std::endl;
|
||||
|
||||
@@ -456,7 +456,7 @@ struct extreme_points<Box, 0, box_tag>
|
||||
|
||||
|
||||
/*!
|
||||
\brief Returns extreme points (for Edge=1 in dimension 1, so the top,
|
||||
\brief Returns extreme points (for Edge=1 in dimension 1, so the top,
|
||||
for Edge=0 in dimension 0, the right side)
|
||||
\note We could specify a strategy (less/greater) to get bottom/left side too. However, until now we don't need that.
|
||||
*/
|
||||
@@ -465,7 +465,7 @@ inline bool extreme_points(Geometry const& geometry, Extremes& extremes, Intrude
|
||||
{
|
||||
concept::check<Geometry const>();
|
||||
|
||||
// Extremes is not required to follow a geometry concept (but it should support an output iterator),
|
||||
// Extremes is not required to follow a geometry concept (but it should support an output iterator),
|
||||
// but its elements should fulfil the point-concept
|
||||
concept::check<typename boost::range_value<Extremes>::type>();
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ template <typename AngleInfo>
|
||||
inline void debug_left_turn(AngleInfo const& ai, AngleInfo const& previous)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
|
||||
std::cout << "Angle: " << (ai.incoming ? "i" : "o")
|
||||
<< " " << si(ai.seg_id)
|
||||
std::cout << "Angle: " << (ai.incoming ? "i" : "o")
|
||||
<< " " << si(ai.seg_id)
|
||||
<< " " << (math::r2d * (ai.angle) )
|
||||
<< " turn: " << ai.turn_index << "[" << ai.operation_index << "]"
|
||||
;
|
||||
@@ -52,12 +52,12 @@ inline void debug_left_turn(std::string const& caption, AngleInfo const& ai, Ang
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_BUFFER_OCCUPATION
|
||||
std::cout << " " << caption
|
||||
<< " turn: " << ai.turn_index << "[" << ai.operation_index << "]"
|
||||
<< " " << si(ai.seg_id)
|
||||
<< " " << (ai.incoming ? "i" : "o")
|
||||
<< " " << si(ai.seg_id)
|
||||
<< " " << (ai.incoming ? "i" : "o")
|
||||
<< " " << (math::r2d * (ai.angle) )
|
||||
<< " turn: " << previous.turn_index << "[" << previous.operation_index << "]"
|
||||
<< " " << si(previous.seg_id)
|
||||
<< " " << (previous.incoming ? "i" : "o")
|
||||
<< " " << si(previous.seg_id)
|
||||
<< " " << (previous.incoming ? "i" : "o")
|
||||
<< " " << (math::r2d * (previous.angle) )
|
||||
;
|
||||
|
||||
@@ -71,7 +71,7 @@ inline void debug_left_turn(std::string const& caption, AngleInfo const& ai, Ang
|
||||
|
||||
|
||||
template <typename Operation>
|
||||
inline bool include_operation(Operation const& op,
|
||||
inline bool include_operation(Operation const& op,
|
||||
segment_identifier const& outgoing_seg_id,
|
||||
segment_identifier const& incoming_seg_id)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ inline bool prefer_by_other(Turns const& turns,
|
||||
}
|
||||
|
||||
std::set<segment_identifier> segment_occuring_once;
|
||||
for (std::map<segment_identifier, int>::const_iterator mit = map.begin();
|
||||
for (std::map<segment_identifier, int>::const_iterator mit = map.begin();
|
||||
mit != map.end();++mit)
|
||||
{
|
||||
if (mit->second == 1)
|
||||
@@ -261,7 +261,7 @@ inline void prefer_by_priority(Turns const& turns, std::set<int>& indices)
|
||||
}
|
||||
|
||||
template <typename AngleInfo, typename Angles, typename Turns, typename TurnSegmentIndices>
|
||||
inline void calculate_left_turns(Angles const& angles,
|
||||
inline void calculate_left_turns(Angles const& angles,
|
||||
Turns& turns, TurnSegmentIndices const& turn_segment_indices,
|
||||
std::set<int>& keep_indices)
|
||||
{
|
||||
@@ -295,9 +295,9 @@ inline void calculate_left_turns(Angles const& angles,
|
||||
|
||||
typename AngleInfo::angle_type eps = 0.00001;
|
||||
int b = 1;
|
||||
for(std::size_t d = 0;
|
||||
math::abs(prev->angle - back->angle) < eps
|
||||
&& ! back->incoming
|
||||
for(std::size_t d = 0;
|
||||
math::abs(prev->angle - back->angle) < eps
|
||||
&& ! back->incoming
|
||||
&& d < n;
|
||||
d++)
|
||||
{
|
||||
@@ -309,8 +309,8 @@ inline void calculate_left_turns(Angles const& angles,
|
||||
int f = 1;
|
||||
circling_iterator forward = cit + 1;
|
||||
for(std::size_t d = 0;
|
||||
math::abs(cit->angle - forward->angle) < eps
|
||||
&& forward->incoming
|
||||
math::abs(cit->angle - forward->angle) < eps
|
||||
&& forward->incoming
|
||||
&& d < n;
|
||||
d++)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public :
|
||||
|
||||
inline relaxed_less()
|
||||
{
|
||||
// TODO: adapt for ttmath, and maybe build the map in another way
|
||||
// TODO: adapt for ttmath, and maybe build the map in another way
|
||||
// (e.g. exact constellations of segment-id's), maybe adaptive.
|
||||
epsilon = std::numeric_limits<double>::epsilon() * 100.0;
|
||||
}
|
||||
@@ -226,7 +226,7 @@ public :
|
||||
|
||||
template <typename Point, typename Ring, typename Info>
|
||||
inline void add_incoming_and_outgoing_angles(Point const& map_point, Point const& intersection_point,
|
||||
Ring const& ring,
|
||||
Ring const& ring,
|
||||
int turn_index,
|
||||
int operation_index,
|
||||
segment_identifier seg_id,
|
||||
@@ -266,8 +266,8 @@ inline void add_incoming_and_outgoing_angles(Point const& map_point, Point const
|
||||
// Don't upgrade the ID
|
||||
it = advance_circular(it, ring, seg_id);
|
||||
}
|
||||
for (int defensive_check = 0;
|
||||
comparator.equals(intersection_point, *it) && defensive_check < n;
|
||||
for (int defensive_check = 0;
|
||||
comparator.equals(intersection_point, *it) && defensive_check < n;
|
||||
defensive_check++)
|
||||
{
|
||||
it = advance_circular(it, ring, real_seg_id);
|
||||
@@ -294,7 +294,7 @@ public :
|
||||
typename map_type::iterator it = map.find(point);
|
||||
if (it == boost::end(map))
|
||||
{
|
||||
std::pair<typename map_type::iterator, bool> pair
|
||||
std::pair<typename map_type::iterator, bool> pair
|
||||
= map.insert(std::make_pair(point, OccupationInfo()));
|
||||
it = pair.first;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ template <typename Range, typename Point>
|
||||
inline void append_no_duplicates(Range& range, Point const& point, bool force = false)
|
||||
{
|
||||
if (boost::size(range) == 0
|
||||
|| force
|
||||
|| force
|
||||
|| ! geometry::detail::equals::equals_point_point(*(boost::end(range)-1), point))
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
|
||||
|
||||
@@ -38,7 +38,7 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point)
|
||||
// If a point is equal, or forming a spike, remove the pen-ultimate point because this one caused the spike.
|
||||
// If so, the now-new-pen-ultimate point can again cause a spike (possibly at a corner). So keep doing this.
|
||||
// Besides spikes it will also avoid duplicates.
|
||||
while(boost::size(range) >= 3
|
||||
while(boost::size(range) >= 3
|
||||
&& point_is_spike_or_equal(point, *(boost::end(range) - 3), *(boost::end(range) - 2)))
|
||||
{
|
||||
// Use the Concept/traits, so resize and append again
|
||||
|
||||
@@ -55,8 +55,8 @@ inline void clear_visit_info(Turns& turns)
|
||||
struct backtrack_state
|
||||
{
|
||||
bool m_good;
|
||||
|
||||
inline backtrack_state() : m_good(true) {}
|
||||
|
||||
inline backtrack_state() : m_good(true) {}
|
||||
inline void reset() { m_good = true; }
|
||||
inline bool good() const { return m_good; }
|
||||
};
|
||||
@@ -80,7 +80,7 @@ public :
|
||||
typedef state state_type;
|
||||
|
||||
template <typename Operation, typename Rings, typename Turns, typename RescalePolicy>
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
Rings& rings, typename boost::range_value<Rings>::type& ring,
|
||||
Turns& turns, Operation& operation,
|
||||
std::string const& ,
|
||||
@@ -91,7 +91,7 @@ public :
|
||||
)
|
||||
{
|
||||
state.m_good = false;
|
||||
|
||||
|
||||
// Check self-intersections and throw exception if appropriate
|
||||
if (! state.m_checked)
|
||||
{
|
||||
@@ -124,7 +124,7 @@ public :
|
||||
typedef backtrack_state state_type;
|
||||
|
||||
template <typename Operation, typename Rings, typename Turns>
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
static inline void apply(std::size_t size_at_start,
|
||||
Rings& rings, typename boost::range_value<Rings>::type& ring,
|
||||
Turns& turns, Operation& operation,
|
||||
std::string const& reason,
|
||||
@@ -134,7 +134,7 @@ public :
|
||||
)
|
||||
{
|
||||
std::cout << " REJECT " << reason << std::endl;
|
||||
|
||||
|
||||
state.m_good = false;
|
||||
|
||||
rings.resize(size_at_start);
|
||||
|
||||
@@ -34,7 +34,7 @@ struct calculate_distance_policy
|
||||
static bool const include_degenerate = false;
|
||||
static bool const include_opposite = false;
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Info,
|
||||
typename Point1,
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace detail { namespace overlay
|
||||
|
||||
namespace following
|
||||
{
|
||||
|
||||
|
||||
template <typename Turn, typename Operation>
|
||||
static inline bool is_entering(Turn const& /* TODO remove this parameter */, Operation const& op)
|
||||
{
|
||||
@@ -45,17 +45,17 @@ static inline bool is_entering(Turn const& /* TODO remove this parameter */, Ope
|
||||
;
|
||||
}
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Polygon
|
||||
>
|
||||
static inline bool last_covered_by(Turn const& turn, Operation const& op,
|
||||
static inline bool last_covered_by(Turn const& turn, Operation const& op,
|
||||
LineString const& linestring, Polygon const& polygon)
|
||||
{
|
||||
// Check any point between the this one and the first IP
|
||||
// Check any point between the this one and the first IP
|
||||
typedef typename geometry::point_type<LineString>::type point_type;
|
||||
point_type point_in_between;
|
||||
detail::point_on_border::midpoint_helper
|
||||
@@ -68,20 +68,20 @@ static inline bool last_covered_by(Turn const& turn, Operation const& op,
|
||||
}
|
||||
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Polygon
|
||||
>
|
||||
static inline bool is_leaving(Turn const& turn, Operation const& op,
|
||||
bool entered, bool first,
|
||||
static inline bool is_leaving(Turn const& turn, Operation const& op,
|
||||
bool entered, bool first,
|
||||
LineString const& linestring, Polygon const& polygon)
|
||||
{
|
||||
if (op.operation == operation_union)
|
||||
{
|
||||
return entered
|
||||
return entered
|
||||
|| turn.method == method_crosses
|
||||
|| (first && last_covered_by(turn, op, linestring, polygon))
|
||||
;
|
||||
@@ -90,20 +90,20 @@ static inline bool is_leaving(Turn const& turn, Operation const& op,
|
||||
}
|
||||
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename LineString,
|
||||
typename Polygon
|
||||
>
|
||||
static inline bool is_staying_inside(Turn const& turn, Operation const& op,
|
||||
bool entered, bool first,
|
||||
static inline bool is_staying_inside(Turn const& turn, Operation const& op,
|
||||
bool entered, bool first,
|
||||
LineString const& linestring, Polygon const& polygon)
|
||||
{
|
||||
if (turn.method == method_crosses)
|
||||
{
|
||||
// The normal case, this is completely covered with entering/leaving
|
||||
// The normal case, this is completely covered with entering/leaving
|
||||
// so stay out of this time consuming "covered_by"
|
||||
return false;
|
||||
}
|
||||
@@ -116,11 +116,11 @@ static inline bool is_staying_inside(Turn const& turn, Operation const& op,
|
||||
return false;
|
||||
}
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename Linestring,
|
||||
typename Turn,
|
||||
typename Operation,
|
||||
typename Linestring,
|
||||
typename Polygon
|
||||
>
|
||||
static inline bool was_entered(Turn const& turn, Operation const& op, bool first,
|
||||
@@ -148,14 +148,14 @@ struct action_selector<overlay_intersection>
|
||||
{
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation
|
||||
>
|
||||
static inline void enter(LineStringOut& current_piece,
|
||||
LineString const& ,
|
||||
LineString const& ,
|
||||
segment_identifier& segment_id,
|
||||
int , Point const& point,
|
||||
Operation const& operation, OutputIterator& )
|
||||
@@ -167,10 +167,10 @@ struct action_selector<overlay_intersection>
|
||||
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation
|
||||
>
|
||||
static inline void leave(LineStringOut& current_piece,
|
||||
@@ -212,28 +212,28 @@ struct action_selector<overlay_difference>
|
||||
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation
|
||||
>
|
||||
static inline void enter(LineStringOut& current_piece,
|
||||
LineString const& linestring,
|
||||
segment_identifier& segment_id,
|
||||
int index, Point const& point,
|
||||
static inline void enter(LineStringOut& current_piece,
|
||||
LineString const& linestring,
|
||||
segment_identifier& segment_id,
|
||||
int index, Point const& point,
|
||||
Operation const& operation, OutputIterator& out)
|
||||
{
|
||||
normal_action::leave(current_piece, linestring, segment_id, index,
|
||||
normal_action::leave(current_piece, linestring, segment_id, index,
|
||||
point, operation, out);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename OutputIterator,
|
||||
typename LineStringOut,
|
||||
typename LineString,
|
||||
typename Point,
|
||||
typename Operation
|
||||
>
|
||||
static inline void leave(LineStringOut& current_piece,
|
||||
@@ -298,7 +298,7 @@ class follow
|
||||
|
||||
inline bool use_operation(Turn const& left, Turn const& right) const
|
||||
{
|
||||
// If they are the same, OK.
|
||||
// If they are the same, OK.
|
||||
return operation_order(left) < operation_order(right);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,10 +66,10 @@ namespace boost { namespace geometry
|
||||
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace get_turns
|
||||
@@ -150,12 +150,12 @@ class get_turns_in_sections
|
||||
<
|
||||
typename tag_cast
|
||||
<
|
||||
typename geometry::tag<Geometry>::type,
|
||||
typename geometry::tag<Geometry>::type,
|
||||
areal_tag
|
||||
>::type,
|
||||
>::type,
|
||||
areal_tag
|
||||
>::value
|
||||
&& index1 == 0
|
||||
&& index1 == 0
|
||||
&& index2 >= n - 2
|
||||
;
|
||||
}
|
||||
@@ -584,8 +584,8 @@ struct get_turns_cs
|
||||
bp[0], bp[1], bp[2], bp[3],
|
||||
rescale_policy,
|
||||
turns, interrupt_policy);
|
||||
// Future performance enhancement:
|
||||
// return if told by the interrupt policy
|
||||
// Future performance enhancement:
|
||||
// return if told by the interrupt policy
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -806,7 +806,7 @@ struct get_turns_reversed
|
||||
Geometry2, Geometry1,
|
||||
Reverse2, Reverse1,
|
||||
TurnPolicy
|
||||
>::apply(source_id2, g2, source_id1, g1, rescale_policy,
|
||||
>::apply(source_id2, g2, source_id1, g1, rescale_policy,
|
||||
turns, interrupt_policy);
|
||||
}
|
||||
};
|
||||
@@ -884,7 +884,7 @@ inline void get_turns(Geometry1 const& geometry1,
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
@@ -68,9 +68,9 @@ private :
|
||||
typename geometry::coordinate_system<Geometry1>::type
|
||||
> robust_point_type;
|
||||
|
||||
inline void get_situation_map(Indexed const& left, Indexed const& right,
|
||||
robust_point_type& pi_rob, robust_point_type& pj_rob,
|
||||
robust_point_type& ri_rob, robust_point_type& rj_rob,
|
||||
inline void get_situation_map(Indexed const& left, Indexed const& right,
|
||||
robust_point_type& pi_rob, robust_point_type& pj_rob,
|
||||
robust_point_type& ri_rob, robust_point_type& rj_rob,
|
||||
robust_point_type& si_rob, robust_point_type& sj_rob) const
|
||||
{
|
||||
typename geometry::point_type<Geometry1>::type pi, pj, ri, rj, si, sj;
|
||||
@@ -84,9 +84,9 @@ private :
|
||||
geometry::copy_segment_points<Reverse1, Reverse2>(m_geometry1, m_geometry2,
|
||||
right.subject.other_id,
|
||||
si, sj);
|
||||
geometry::zoom_to_robust(pi, pj, ri, rj, si, sj,
|
||||
pi_rob, pj_rob,
|
||||
ri_rob, rj_rob,
|
||||
geometry::zoom_to_robust(pi, pj, ri, rj, si, sj,
|
||||
pi_rob, pj_rob,
|
||||
ri_rob, rj_rob,
|
||||
si_rob, sj_rob);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ namespace dispatch
|
||||
struct select_rings<box_tag, Box>
|
||||
{
|
||||
template <typename Geometry, typename Map>
|
||||
static inline void apply(Box const& box, Geometry const& ,
|
||||
static inline void apply(Box const& box, Geometry const& ,
|
||||
ring_identifier const& id, Map& map, bool midpoint)
|
||||
{
|
||||
map[id] = typename Map::mapped_type(box, midpoint);
|
||||
}
|
||||
|
||||
template <typename Map>
|
||||
static inline void apply(Box const& box,
|
||||
static inline void apply(Box const& box,
|
||||
ring_identifier const& id, Map& map, bool midpoint)
|
||||
{
|
||||
map[id] = typename Map::mapped_type(box, midpoint);
|
||||
@@ -68,7 +68,7 @@ namespace dispatch
|
||||
}
|
||||
|
||||
template <typename Map>
|
||||
static inline void apply(Ring const& ring,
|
||||
static inline void apply(Ring const& ring,
|
||||
ring_identifier const& id, Map& map, bool midpoint)
|
||||
{
|
||||
if (boost::size(ring) > 0)
|
||||
@@ -248,7 +248,7 @@ template
|
||||
typename IntersectionMap, typename SelectionMap
|
||||
>
|
||||
inline void select_rings(Geometry1 const& geometry1, Geometry2 const& geometry2,
|
||||
IntersectionMap const& intersection_map,
|
||||
IntersectionMap const& intersection_map,
|
||||
SelectionMap& selection_map, bool midpoint)
|
||||
{
|
||||
typedef typename geometry::tag<Geometry1>::type tag1;
|
||||
@@ -271,16 +271,16 @@ template
|
||||
typename IntersectionMap, typename SelectionMap
|
||||
>
|
||||
inline void select_rings(Geometry const& geometry,
|
||||
IntersectionMap const& intersection_map,
|
||||
IntersectionMap const& intersection_map,
|
||||
SelectionMap& selection_map, bool midpoint)
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type tag;
|
||||
|
||||
SelectionMap map_with_all;
|
||||
dispatch::select_rings<tag, Geometry>::apply(geometry,
|
||||
dispatch::select_rings<tag, Geometry>::apply(geometry,
|
||||
ring_identifier(0, -1, -1), map_with_all, midpoint);
|
||||
|
||||
update_selection_map<OverlayType>(geometry, geometry, intersection_map,
|
||||
update_selection_map<OverlayType>(geometry, geometry, intersection_map,
|
||||
map_with_all, selection_map);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace detail { namespace overlay
|
||||
|
||||
template <typename Turn, typename Operation>
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_TRAVERSE
|
||||
inline void debug_traverse(Turn const& turn, Operation op,
|
||||
inline void debug_traverse(Turn const& turn, Operation op,
|
||||
std::string const& header)
|
||||
{
|
||||
std::cout << header
|
||||
@@ -109,7 +109,7 @@ inline bool assign_next_ip(G1 const& g1, G2 const& g2,
|
||||
// If there is no next IP on this segment
|
||||
if (info.enriched.next_ip_index < 0)
|
||||
{
|
||||
if (info.enriched.travels_to_vertex_index < 0
|
||||
if (info.enriched.travels_to_vertex_index < 0
|
||||
|| info.enriched.travels_to_ip_index < 0)
|
||||
{
|
||||
return false;
|
||||
@@ -292,7 +292,7 @@ public :
|
||||
*iit, current_seg_id))
|
||||
{
|
||||
Backtrack::apply(
|
||||
size_at_start,
|
||||
size_at_start,
|
||||
rings, current_output, turns, *current_iit,
|
||||
"No next IP",
|
||||
geometry1, geometry2, rescale_policy, state);
|
||||
@@ -305,7 +305,7 @@ public :
|
||||
current_iit))
|
||||
{
|
||||
Backtrack::apply(
|
||||
size_at_start,
|
||||
size_at_start,
|
||||
rings, current_output, turns, *iit,
|
||||
"Dead end at start",
|
||||
geometry1, geometry2, rescale_policy, state);
|
||||
@@ -327,7 +327,7 @@ public :
|
||||
// It visits a visited node again, without passing the start node.
|
||||
// This makes it suspicious for endless loops
|
||||
Backtrack::apply(
|
||||
size_at_start,
|
||||
size_at_start,
|
||||
rings, current_output, turns, *iit,
|
||||
"Visit again",
|
||||
geometry1, geometry2, rescale_policy, state);
|
||||
@@ -361,7 +361,7 @@ public :
|
||||
// Should not occur in self-intersecting polygons without spikes
|
||||
// Might occur in polygons with spikes
|
||||
Backtrack::apply(
|
||||
size_at_start,
|
||||
size_at_start,
|
||||
rings, current_output, turns, *iit,
|
||||
"Dead end",
|
||||
geometry1, geometry2, rescale_policy, state);
|
||||
@@ -377,7 +377,7 @@ public :
|
||||
// than turn points.
|
||||
// Turn points marked as "ii" can be visited twice.
|
||||
Backtrack::apply(
|
||||
size_at_start,
|
||||
size_at_start,
|
||||
rings, current_output, turns, *iit,
|
||||
"Endless loop",
|
||||
geometry1, geometry2, rescale_policy, state);
|
||||
|
||||
@@ -103,7 +103,7 @@ struct turn_info
|
||||
{
|
||||
return has12(type, type);
|
||||
}
|
||||
|
||||
|
||||
inline bool has(operation_type type) const
|
||||
{
|
||||
return this->operations[0].operation == type
|
||||
|
||||
@@ -39,7 +39,7 @@ inline void divide_box(Box const& box, Box& lower_box, Box& upper_box)
|
||||
}
|
||||
|
||||
// Divide collection into three subsets: lower, upper and oversized
|
||||
// (not-fitting)
|
||||
// (not-fitting)
|
||||
// (lower == left or bottom, upper == right or top)
|
||||
template <typename OverlapsPolicy, typename InputCollection, typename Box>
|
||||
static inline void divide_into_subsets(Box const& lower_box,
|
||||
|
||||
@@ -98,7 +98,7 @@ struct recalculate_indexed<0>
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template
|
||||
template
|
||||
<
|
||||
typename Geometry1,
|
||||
typename Geometry2,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// BSG 2012-02-06: we use this currently only for distance.
|
||||
// For other scalar results area,length,perimeter it is commented on purpose.
|
||||
// Reason is that for distance there is no other choice. distance of two
|
||||
// Reason is that for distance there is no other choice. distance of two
|
||||
// empty geometries (or one empty) should NOT return any value.
|
||||
// But for area it is no problem to be 0.
|
||||
// Suppose: area(intersection(a,b)). We (probably) don't want a throw there...
|
||||
|
||||
@@ -53,7 +53,7 @@ inline OutputIterator difference_insert(Geometry1 const& geometry1,
|
||||
concept::check<Geometry1 const>();
|
||||
concept::check<Geometry2 const>();
|
||||
concept::check<GeometryOut>();
|
||||
|
||||
|
||||
return geometry::dispatch::intersection_insert
|
||||
<
|
||||
Geometry1, Geometry2,
|
||||
|
||||
@@ -472,7 +472,7 @@ struct distance
|
||||
Segment const& segment,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
|
||||
|
||||
typename point_type<Segment>::type p[2];
|
||||
geometry::detail::assign_point_from_index<0>(segment, p[0]);
|
||||
geometry::detail::assign_point_from_index<1>(segment, p[1]);
|
||||
@@ -534,7 +534,7 @@ distance(Geometry1 const& geometry1,
|
||||
{
|
||||
concept::check<Geometry1 const>();
|
||||
concept::check<Geometry2 const>();
|
||||
|
||||
|
||||
detail::throw_on_empty_input(geometry1);
|
||||
detail::throw_on_empty_input(geometry2);
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ struct envelope<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
};
|
||||
|
||||
template <typename Box>
|
||||
static inline void
|
||||
static inline void
|
||||
apply(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry,
|
||||
Box& box)
|
||||
{
|
||||
|
||||
@@ -358,9 +358,9 @@ struct equals<
|
||||
|
||||
/*!
|
||||
\brief \brief_check{are spatially equal}
|
||||
\details \details_check12{equals, is spatially equal}. Spatially equal means
|
||||
\details \details_check12{equals, is spatially equal}. Spatially equal means
|
||||
that the same point set is included. A box can therefore be spatially equal
|
||||
to a ring or a polygon, or a linestring can be spatially equal to a
|
||||
to a ring or a polygon, or a linestring can be spatially equal to a
|
||||
multi-linestring or a segment. This only works theoretically, not all
|
||||
combinations are implemented yet.
|
||||
\ingroup equals
|
||||
|
||||
@@ -269,7 +269,7 @@ length(Geometry const& geometry, Strategy const& strategy)
|
||||
concept::check<Geometry const>();
|
||||
|
||||
// detail::throw_on_empty_input(geometry);
|
||||
|
||||
|
||||
return resolve_variant::length<Geometry>::apply(geometry, strategy);
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace boost { namespace geometry
|
||||
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ struct specific_coordinate_first
|
||||
CoordinateType const lh = geometry::get<Dimension>(lhs);
|
||||
CoordinateType const rh = geometry::get<Dimension>(rhs);
|
||||
|
||||
// If both lhs and rhs equal m_value_to_be_first,
|
||||
// If both lhs and rhs equal m_value_to_be_first,
|
||||
// we should handle conform if lh < rh = FALSE
|
||||
// The first condition meets that, keep it first
|
||||
if (geometry::math::equals(rh, m_value_to_be_first))
|
||||
@@ -148,7 +148,7 @@ inline void calculate_centroid(Point& point, Segments const& segments)
|
||||
if (segments.size() == 3)
|
||||
{
|
||||
// In almost all cases, the segments do have 3 values. In that case we use another
|
||||
// centroid calculation, which should be slightly faster
|
||||
// centroid calculation, which should be slightly faster
|
||||
// and is more precise (case #geos_1_test_overlay => normal centroid is outside! TODO)
|
||||
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
@@ -229,7 +229,7 @@ inline void replace_extremes_for_self_tangencies(Extremes& extremes, Intruders&
|
||||
|
||||
// Then intruders (here "i1" but there may be more) are sorted from left to right
|
||||
// Finally points "a","b" and "c" (in this order) are selected as a new triangle.
|
||||
// This triangle will have a centroid which is inside (assumed that intruders left segment
|
||||
// This triangle will have a centroid which is inside (assumed that intruders left segment
|
||||
// is not equal to extremes left segment, but that polygon would be invalid)
|
||||
|
||||
// Find highest non-self tangent intrusion, if any
|
||||
@@ -264,7 +264,7 @@ inline void replace_extremes_for_self_tangencies(Extremes& extremes, Intruders&
|
||||
// (alternatively we could use the last two points of extremes, and first point of last intruder...):
|
||||
//// ALTERNATIVE: std::copy(extremes.rbegin(), extremes.rbegin() + 2, std::back_inserter(triangle));
|
||||
//// ALTERNATIVE: triangle.push_back(intruders.back().front());
|
||||
|
||||
|
||||
// Now replace extremes with this smaller subset, a triangle, such that centroid calculation will result in a point inside
|
||||
extremes = triangle;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ struct range_remove_spikes
|
||||
typedef typename boost::range_iterator<Range>::type iterator;
|
||||
|
||||
std::deque<point_type> cleaned;
|
||||
for (typename boost::range_iterator<Range const>::type it = boost::begin(range);
|
||||
for (typename boost::range_iterator<Range const>::type it = boost::begin(range);
|
||||
it != boost::end(range); ++it)
|
||||
{
|
||||
// Add point
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace resolve_variant
|
||||
{
|
||||
|
||||
template <typename Geometry>
|
||||
struct reverse
|
||||
struct reverse
|
||||
{
|
||||
static void apply(Geometry& geometry)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user