mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-12 12:12:10 +00:00
Stylistic changes, harmonizing range_const_iterator<T> -> range_iterator<T const>
Removing remove_const or adding remove_const.hpp where possible / necessary [SVN r61526]
This commit is contained in:
@@ -63,7 +63,7 @@ struct append_range
|
||||
static inline void apply(Geometry& geometry, Range const& range,
|
||||
int ring_index, int multi_index)
|
||||
{
|
||||
for (typename boost::range_const_iterator<Range>::type
|
||||
for (typename boost::range_iterator<Range const>::type
|
||||
it = boost::begin(range);
|
||||
it != boost::end(range);
|
||||
++it)
|
||||
|
||||
@@ -122,7 +122,7 @@ struct ring_area<Ring, clockwise, Strategy>
|
||||
return type();
|
||||
}
|
||||
|
||||
typedef typename boost::range_const_iterator<Ring>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Ring const>::type iterator_type;
|
||||
|
||||
typename Strategy::state_type state;
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ struct centroid_ring_state
|
||||
static inline void apply(Ring const& ring,
|
||||
Strategy const& strategy, typename Strategy::state_type& state)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Ring>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Ring const>::type iterator_type;
|
||||
iterator_type it = boost::begin(ring);
|
||||
for (iterator_type previous = it++;
|
||||
it != boost::end(ring);
|
||||
@@ -202,7 +202,7 @@ struct centroid_ring_state
|
||||
segment iterator: 1.985 s...
|
||||
typedef segment_iterator
|
||||
<
|
||||
typename boost::range_const_iterator<Ring>::type,
|
||||
typename boost::range_iterator<Ring const>::type,
|
||||
typename point_type<Ring>::type
|
||||
> iterator_type;
|
||||
|
||||
@@ -249,7 +249,7 @@ struct centroid_linestring
|
||||
// - be made dim-agnostic
|
||||
|
||||
typedef typename point_type<Linestring>::type point_type;
|
||||
typedef typename boost::range_const_iterator<Linestring>::type point_iterator_type;
|
||||
typedef typename boost::range_iterator<Linestring const>::type point_iterator_type;
|
||||
typedef segment_iterator<point_iterator_type, point_type> segment_iterator;
|
||||
|
||||
double length = double();
|
||||
@@ -293,9 +293,9 @@ struct centroid_polygon_state
|
||||
|
||||
per_ring::apply(exterior_ring(poly), strategy, state);
|
||||
|
||||
for (typename boost::range_const_iterator
|
||||
for (typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type it = boost::begin(interior_rings(poly));
|
||||
it != boost::end(interior_rings(poly));
|
||||
++it)
|
||||
|
||||
@@ -136,7 +136,7 @@ struct convert<ring_tag, ring_tag, Dimensions, Ring1, Ring2>
|
||||
static inline void apply(Ring1 const& source, Ring2& destination)
|
||||
{
|
||||
geometry::clear(destination);
|
||||
for (typename boost::range_const_iterator<Ring1>::type it
|
||||
for (typename boost::range_iterator<Ring1 const>::type it
|
||||
= boost::begin(source);
|
||||
it != boost::end(source);
|
||||
++it)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_CONVEX_HULL_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/is_multi.hpp>
|
||||
|
||||
@@ -32,9 +32,9 @@ struct calculate_polygon_sum
|
||||
{
|
||||
ReturnType sum = Policy::apply(exterior_ring(poly), strategy);
|
||||
|
||||
for (typename boost::range_const_iterator
|
||||
for (typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type it = boost::begin(interior_rings(poly));
|
||||
it != boost::end(interior_rings(poly));
|
||||
++it)
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace dispatch
|
||||
template <typename Tag, typename Geometry, typename Section>
|
||||
struct get_section
|
||||
{
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename geometry::range_type<Geometry>::type
|
||||
typename geometry::range_type<Geometry>::type const
|
||||
>::type iterator_type;
|
||||
|
||||
static inline void apply(Geometry const& geometry, Section const& section,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifndef BOOST_GEOMETRY_ALGORITHMS_DISTANCE_HPP
|
||||
#define BOOST_GEOMETRY_ALGORITHMS_DISTANCE_HPP
|
||||
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/range.hpp>
|
||||
|
||||
@@ -111,7 +112,7 @@ struct point_to_range
|
||||
}
|
||||
|
||||
// line of one point: return point square_distance
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
iterator_type it = boost::begin(range);
|
||||
iterator_type prev = it++;
|
||||
if (it == boost::end(range))
|
||||
@@ -191,9 +192,9 @@ struct point_to_polygon
|
||||
distance_containment dc = per_ring::apply(point,
|
||||
exterior_ring(polygon), pp_strategy, ps_strategy);
|
||||
|
||||
for (typename boost::range_const_iterator
|
||||
for (typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type it = boost::begin(interior_rings(polygon));
|
||||
it != boost::end(interior_rings(polygon));
|
||||
++it)
|
||||
@@ -422,33 +423,30 @@ template <typename Geometry1, typename Geometry2, typename Strategy>
|
||||
inline typename Strategy::return_type distance(Geometry1 const& geometry1,
|
||||
Geometry2 const& geometry2, Strategy const& strategy)
|
||||
{
|
||||
typedef typename boost::remove_const<Geometry1>::type ncg1_type;
|
||||
typedef typename boost::remove_const<Geometry2>::type ncg2_type;
|
||||
|
||||
return boost::mpl::if_
|
||||
<
|
||||
typename geometry::reverse_dispatch<Geometry1, Geometry2>::type,
|
||||
dispatch::distance_reversed
|
||||
<
|
||||
typename tag<ncg1_type>::type,
|
||||
typename tag<ncg2_type>::type,
|
||||
ncg1_type,
|
||||
ncg2_type,
|
||||
typename tag<Geometry1>::type,
|
||||
typename tag<Geometry2>::type,
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename strategy_tag<Strategy>::type,
|
||||
Strategy,
|
||||
is_multi<ncg1_type>::value,
|
||||
is_multi<ncg2_type>::value
|
||||
is_multi<Geometry1>::value,
|
||||
is_multi<Geometry2>::value
|
||||
>,
|
||||
dispatch::distance
|
||||
<
|
||||
typename tag<ncg1_type>::type,
|
||||
typename tag<ncg2_type>::type,
|
||||
ncg1_type,
|
||||
ncg2_type,
|
||||
typename tag<Geometry1>::type,
|
||||
typename tag<Geometry2>::type,
|
||||
Geometry1,
|
||||
Geometry2,
|
||||
typename strategy_tag<Strategy>::type,
|
||||
Strategy,
|
||||
is_multi<ncg1_type>::value,
|
||||
is_multi<ncg2_type>::value
|
||||
is_multi<Geometry1>::value,
|
||||
is_multi<Geometry2>::value
|
||||
>
|
||||
>::type::apply(geometry1, geometry2, strategy);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ struct envelope_combine_one
|
||||
template<typename Range, typename Box>
|
||||
inline void envelope_range_additional(Range const& range, Box& mbr)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
|
||||
for (iterator_type it = boost::begin(range);
|
||||
it != boost::end(range);
|
||||
|
||||
@@ -81,7 +81,7 @@ struct range_length
|
||||
{
|
||||
return_type sum = return_type();
|
||||
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
iterator_type it = boost::begin(range);
|
||||
if (it != boost::end(range))
|
||||
{
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/range.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/is_linear.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
@@ -52,9 +51,9 @@ struct polygon_count
|
||||
static inline std::size_t apply(Polygon const& poly)
|
||||
{
|
||||
std::size_t n = boost::size(exterior_ring(poly));
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type iterator;
|
||||
|
||||
for (iterator it = boost::begin(interior_rings(poly));
|
||||
@@ -129,15 +128,13 @@ struct num_points<polygon_tag, false, Geometry>
|
||||
template <typename Geometry>
|
||||
inline std::size_t num_points(Geometry const& geometry)
|
||||
{
|
||||
concept::check<const Geometry>();
|
||||
|
||||
typedef typename boost::remove_const<Geometry>::type ncg_type;
|
||||
concept::check<Geometry const>();
|
||||
|
||||
return dispatch::num_points
|
||||
<
|
||||
typename tag<Geometry>::type,
|
||||
is_linear<ncg_type>::value,
|
||||
ncg_type
|
||||
is_linear<Geometry>::value,
|
||||
Geometry
|
||||
>::apply(geometry);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ OutputIterator clip_linestring_with_box(Box const& b, Linestring const& linestri
|
||||
|
||||
OutputLinestring line_out;
|
||||
|
||||
typedef typename boost::range_const_iterator<Linestring>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Linestring const>::type iterator_type;
|
||||
iterator_type vertex = boost::begin(linestring);
|
||||
for(iterator_type previous = vertex++;
|
||||
vertex != boost::end(linestring);
|
||||
|
||||
@@ -44,7 +44,7 @@ struct copy_segments_ring
|
||||
SegmentIdentifier const& seg_id, int to_index,
|
||||
RangeOut& current_output)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Ring>::type iterator;
|
||||
typedef typename boost::range_iterator<Ring const>::type iterator;
|
||||
|
||||
typedef geometry::ever_circling_iterator<iterator> ec_iterator;
|
||||
|
||||
@@ -64,11 +64,12 @@ struct copy_segments_ring
|
||||
// [2..4] -> 4 - 2 + 1 = 3 -> {2,3,4} -> OK
|
||||
// [4..2],size=6 -> 6 - 4 + 2 + 1 = 5 -> {4,5,0,1,2} -> OK
|
||||
// [1..1], travel the whole ring round
|
||||
int count = from_index <= to_index
|
||||
typedef typename boost::range_difference<Ring>::type size_type;
|
||||
size_type count = from_index <= to_index
|
||||
? to_index - from_index + 1
|
||||
: boost::size(ring) - from_index + to_index + 1;
|
||||
|
||||
for (int i = 0; i < count; ++i, ++it)
|
||||
for (size_type i = 0; i < count; ++i, ++it)
|
||||
{
|
||||
#ifdef BOOST_GEOMETRY_DEBUG_INTERSECTION
|
||||
std::cout << " add: ("
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
@@ -102,14 +101,14 @@ public :
|
||||
InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename geometry::range_type<Geometry1>::type
|
||||
typename geometry::range_type<Geometry1>::type const
|
||||
>::type range1_iterator;
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename geometry::range_type<Geometry2>::type
|
||||
typename geometry::range_type<Geometry2>::type const
|
||||
>::type range2_iterator;
|
||||
|
||||
int const dir1 = sec1.directions[0];
|
||||
@@ -341,12 +340,12 @@ class get_turns_generic
|
||||
Sections1 const& sec1, Sections2 const& sec2,
|
||||
Map& map)
|
||||
{
|
||||
for (typename boost::range_const_iterator<Sections1>::type
|
||||
for (typename boost::range_iterator<Sections1 const>::type
|
||||
it1 = sec1.begin();
|
||||
it1 != sec1.end();
|
||||
++it1)
|
||||
{
|
||||
for (typename boost::range_const_iterator<Sections2>::type
|
||||
for (typename boost::range_iterator<Sections2 const>::type
|
||||
it2 = sec2.begin();
|
||||
it2 != sec2.end();
|
||||
++it2)
|
||||
@@ -703,9 +702,9 @@ struct get_turns
|
||||
{
|
||||
typedef typename geometry::ring_type<Polygon>::type ring_type;
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type iterator_type;
|
||||
|
||||
|
||||
@@ -760,9 +759,9 @@ struct get_turns
|
||||
int source_id2, Box const& box,
|
||||
Turns& turns, InterruptPolicy& interrupt_policy)
|
||||
{
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
Ring
|
||||
Ring const
|
||||
>::type iterator_type;
|
||||
|
||||
typedef detail::get_turns::get_turns_cs
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
#include <boost/range.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/is_multi.hpp>
|
||||
@@ -55,12 +53,12 @@ struct get_turns
|
||||
sections_type sec;
|
||||
geometry::sectionalize(geometry, sec);
|
||||
|
||||
for (typename boost::range_const_iterator<sections_type>::type
|
||||
for (typename boost::range_iterator<sections_type const>::type
|
||||
it1 = sec.begin();
|
||||
it1 != sec.end();
|
||||
++it1)
|
||||
{
|
||||
for (typename boost::range_const_iterator<sections_type>::type
|
||||
for (typename boost::range_iterator<sections_type const>::type
|
||||
it2 = sec.begin();
|
||||
it2 != sec.end();
|
||||
++it2)
|
||||
@@ -198,13 +196,12 @@ inline void get_turns(Geometry const& geometry,
|
||||
typename boost::range_value<Turns>::type
|
||||
>::segment_intersection_strategy_type strategy_type;
|
||||
|
||||
typedef typename boost::remove_const<Geometry>::type ncg_type;
|
||||
|
||||
dispatch::self_get_turn_points
|
||||
<
|
||||
typename tag<ncg_type>::type,
|
||||
is_multi<ncg_type>::type::value,
|
||||
ncg_type,
|
||||
typename tag<Geometry>::type,
|
||||
is_multi<Geometry>::type::value,
|
||||
Geometry,
|
||||
Turns, strategy_type,
|
||||
AssignPolicy, InterruptPolicy
|
||||
>::apply(geometry, turns, interrupt_policy);
|
||||
|
||||
@@ -150,9 +150,13 @@ struct simplify_polygon
|
||||
typedef typename ring_type<Polygon>::type ring_type;
|
||||
|
||||
typedef typename boost::range_iterator
|
||||
<typename interior_type<Polygon>::type>::type iterator_type;
|
||||
typedef typename boost::range_const_iterator
|
||||
<typename interior_type<Polygon>::type>::type const_iterator_type;
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
>::type iterator_type;
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type const_iterator_type;
|
||||
|
||||
// Note that if there are inner rings, and distance is too large,
|
||||
// they might intersect with the outer ring in the output,
|
||||
|
||||
@@ -128,7 +128,7 @@ inline bool transform_range_out(Range const& range,
|
||||
OutputIterator out, Strategy const& strategy)
|
||||
{
|
||||
PointOut point_out;
|
||||
for(typename boost::range_const_iterator<Range>::type
|
||||
for(typename boost::range_iterator<Range const>::type
|
||||
it = boost::begin(range);
|
||||
it != boost::end(range);
|
||||
++it)
|
||||
@@ -170,9 +170,9 @@ struct transform_polygon
|
||||
|
||||
interior_rings(poly2).resize(num_interior_rings(poly1));
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
interior1_type
|
||||
interior1_type const
|
||||
>::type iterator1_type;
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
|
||||
@@ -181,7 +181,7 @@ struct point_in_ring
|
||||
return false;
|
||||
}
|
||||
|
||||
typedef typename boost::range_const_iterator<Ring>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Ring const>::type iterator_type;
|
||||
|
||||
typename Strategy::state_type state;
|
||||
|
||||
@@ -219,9 +219,9 @@ struct point_in_polygon
|
||||
if (per_ring::apply(point, exterior_ring(poly), strategy))
|
||||
{
|
||||
|
||||
for (typename boost::range_const_iterator
|
||||
for (typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type it = boost::begin(interior_rings(poly));
|
||||
it != boost::end(interior_rings(poly));
|
||||
++it)
|
||||
|
||||
@@ -59,8 +59,8 @@ template <typename G>
|
||||
struct dimension
|
||||
: core_dispatch::dimension
|
||||
<
|
||||
typename tag<G>::type,
|
||||
typename boost::remove_const<G>::type
|
||||
typename tag<G>::type,
|
||||
typename boost::remove_const<G>::type
|
||||
>
|
||||
{};
|
||||
|
||||
@@ -74,8 +74,8 @@ inline void assert_dimension()
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::mpl::equal_to
|
||||
<
|
||||
geometry::dimension<G>,
|
||||
boost::mpl::int_<D>
|
||||
geometry::dimension<G>,
|
||||
boost::mpl::int_<D>
|
||||
>::type::value
|
||||
));
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
@@ -75,6 +76,7 @@ struct coordinate_system
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#ifndef BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_CORE_COORDINATE_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
@@ -82,9 +82,9 @@ struct replace_point_type<polygon_tag, Geometry, NewPointType>
|
||||
template <typename Geometry, typename NewPointType>
|
||||
struct replace_point_type : core_dispatch::replace_point_type
|
||||
<
|
||||
typename tag<Geometry>::type,
|
||||
typename boost::remove_const<Geometry>::type,
|
||||
NewPointType
|
||||
typename tag<Geometry>::type,
|
||||
typename boost::remove_const<Geometry>::type,
|
||||
NewPointType
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ struct tag
|
||||
{
|
||||
typedef typename traits::tag
|
||||
<
|
||||
typename boost::remove_const<Geometry>::type
|
||||
typename boost::remove_const<Geometry>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
|
||||
#include <boost/mpl/int.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
|
||||
@@ -59,7 +59,7 @@ struct range_midpoints
|
||||
bool start_and_end, Iterator out)
|
||||
{
|
||||
typedef typename point_type<Range>::type point_type;
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
|
||||
iterator_type it = boost::begin(range);
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ struct close_to_range
|
||||
}
|
||||
|
||||
typedef typename point_type<R>::type point_type;
|
||||
typedef typename boost::range_const_iterator<R>::type iterator_type;
|
||||
typedef typename boost::range_iterator<R const>::type iterator_type;
|
||||
|
||||
iterator_type it = boost::begin(range);
|
||||
if (n == 1)
|
||||
|
||||
@@ -136,7 +136,7 @@ struct veshape_range
|
||||
template <typename Char, typename Traits>
|
||||
static inline void stream(std::basic_ostream<Char, Traits>& os, R const& range)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<R>::type iterator;
|
||||
typedef typename boost::range_iterator<R const>::type iterator;
|
||||
|
||||
bool first = true;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ struct wkt_range
|
||||
static inline void apply(std::basic_ostream<Char, Traits>& os,
|
||||
Range const& range)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
|
||||
bool first = true;
|
||||
|
||||
@@ -167,8 +167,10 @@ struct wkt_poly
|
||||
Polygon const& poly)
|
||||
{
|
||||
typedef typename ring_type<Polygon>::type ring;
|
||||
typedef typename boost::range_const_iterator<
|
||||
typename interior_type<Polygon>::type>::type iterator;
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type iterator;
|
||||
|
||||
os << PrefixPolicy::apply();
|
||||
// TODO: check EMPTY here
|
||||
|
||||
@@ -35,7 +35,7 @@ struct wkt_multi
|
||||
// TODO: check EMPTY here
|
||||
os << "(";
|
||||
|
||||
for (typename boost::range_const_iterator<Multi>::type
|
||||
for (typename boost::range_iterator<Multi const>::type
|
||||
it = boost::begin(geometry);
|
||||
it != boost::end(geometry);
|
||||
++it)
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
@@ -188,18 +190,18 @@ class svg_mapper : boost::noncopyable
|
||||
{
|
||||
if (! m_matrix)
|
||||
{
|
||||
m_matrix.reset(new transformer_type(m_bounding_box,
|
||||
m_matrix.reset(new transformer_type(m_bounding_box,
|
||||
m_width, m_height));
|
||||
|
||||
m_stream << "<?xml version=\"1.0\" standalone=\"no\"?>"
|
||||
m_stream << "<?xml version=\"1.0\" standalone=\"no\"?>"
|
||||
<< std::endl
|
||||
<< "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\""
|
||||
<< "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\""
|
||||
<< std::endl
|
||||
<< "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"
|
||||
<< "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"
|
||||
<< std::endl
|
||||
<< "<svg width=\"100%\" height=\"100%\" version=\"1.1\""
|
||||
<< "<svg width=\"100%\" height=\"100%\" version=\"1.1\""
|
||||
<< std::endl
|
||||
<< "xmlns=\"http://www.w3.org/2000/svg\">"
|
||||
<< "xmlns=\"http://www.w3.org/2000/svg\">"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
@@ -223,16 +225,16 @@ public :
|
||||
{
|
||||
if (boost::geometry::num_points(geometry) > 0)
|
||||
{
|
||||
boost::geometry::combine(m_bounding_box,
|
||||
boost::geometry::combine(m_bounding_box,
|
||||
boost::geometry::make_envelope
|
||||
<
|
||||
boost::geometry::box<Point>
|
||||
boost::geometry::box<Point>
|
||||
>(geometry));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
void map(Geometry const& geometry, std::string const& style,
|
||||
void map(Geometry const& geometry, std::string const& style,
|
||||
int size = -1)
|
||||
{
|
||||
init_matrix();
|
||||
@@ -240,14 +242,14 @@ public :
|
||||
}
|
||||
|
||||
template <typename TextPoint>
|
||||
void text(TextPoint const& point, std::string const& s,
|
||||
void text(TextPoint const& point, std::string const& s,
|
||||
std::string const& style,
|
||||
int offset_x = 0, int offset_y = 0, int lineheight = 10)
|
||||
{
|
||||
init_matrix();
|
||||
map_point_type map_point;
|
||||
boost::geometry::transform(point, map_point, *m_matrix);
|
||||
m_stream
|
||||
m_stream
|
||||
<< "<text style=\"" << style << "\""
|
||||
<< " x=\"" << boost::geometry::get<0>(map_point) + offset_x << "\""
|
||||
<< " y=\"" << boost::geometry::get<1>(map_point) + offset_y << "\""
|
||||
@@ -264,13 +266,13 @@ public :
|
||||
boost::split(splitted, s, boost::is_any_of("\n"));
|
||||
for (std::vector<std::string>::const_iterator it
|
||||
= splitted.begin();
|
||||
it != splitted.end();
|
||||
it != splitted.end();
|
||||
++it, offset_y += lineheight)
|
||||
{
|
||||
m_stream
|
||||
<< "<tspan x=\"" << boost::geometry::get<0>(map_point) + offset_x
|
||||
<< "\""
|
||||
<< " y=\"" << boost::geometry::get<1>(map_point) + offset_y
|
||||
m_stream
|
||||
<< "<tspan x=\"" << boost::geometry::get<0>(map_point) + offset_x
|
||||
<< "\""
|
||||
<< " y=\"" << boost::geometry::get<1>(map_point) + offset_y
|
||||
<< "\""
|
||||
<< ">" << *it << "</tspan>";
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ struct svg_range
|
||||
static inline void apply(std::basic_ostream<Char, Traits>& os,
|
||||
Range const& range, std::string const& style, int size)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator;
|
||||
|
||||
bool first = true;
|
||||
|
||||
@@ -115,7 +115,7 @@ struct svg_poly
|
||||
Polygon const& polygon, std::string const& style, int size)
|
||||
{
|
||||
typedef typename geometry::ring_type<Polygon>::type ring_type;
|
||||
typedef typename boost::range_const_iterator<ring_type>::type iterator_type;
|
||||
typedef typename boost::range_iterator<ring_type const>::type iterator_type;
|
||||
|
||||
bool first = true;
|
||||
os << "<g fill-rule=\"evenodd\"><path d=\"";
|
||||
@@ -133,9 +133,9 @@ struct svg_poly
|
||||
|
||||
// Inner rings:
|
||||
{
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename geometry::interior_type<Polygon>::type
|
||||
typename geometry::interior_type<Polygon>::type const
|
||||
>::type ring_iterator_type;
|
||||
for (ring_iterator_type rit = boost::begin(interior_rings(polygon));
|
||||
rit != boost::end(interior_rings(polygon));
|
||||
|
||||
@@ -28,7 +28,7 @@ struct svg_multi
|
||||
static inline void apply(std::basic_ostream<Char, Traits>& os,
|
||||
MultiGeometry const& multi, std::string const& style, int size)
|
||||
{
|
||||
for (typename boost::range_const_iterator<MultiGeometry>::type
|
||||
for (typename boost::range_iterator<MultiGeometry const>::type
|
||||
it = boost::begin(multi);
|
||||
it != boost::end(multi);
|
||||
++it)
|
||||
|
||||
@@ -90,7 +90,7 @@ inline bool range_in_circle(R const& range, C const& c)
|
||||
assert_dimension<R, 2>();
|
||||
assert_dimension<C, 2>();
|
||||
|
||||
for (typename boost::range_const_iterator<R>::type it = boost::begin(range);
|
||||
for (typename boost::range_iterator<R const>::type it = boost::begin(range);
|
||||
it != boost::end(range); ++it)
|
||||
{
|
||||
if (! point_in_circle(*it, c))
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#ifndef BOOST_GEOMETRY_ITERATORS_RANGE_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_ITERATORS_RANGE_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace detail
|
||||
template<typename G, typename S, typename B, size_t D>
|
||||
struct section_iterator : public detail::iterators::iterator_base<
|
||||
section_iterator<G, S, B, D>,
|
||||
typename boost::range_const_iterator<G>::type
|
||||
typename boost::range_iterator<G const>::type
|
||||
>
|
||||
{
|
||||
friend class boost::iterator_core_access;
|
||||
@@ -112,8 +112,8 @@ struct section_iterator : public detail::iterators::iterator_base<
|
||||
}
|
||||
|
||||
|
||||
typedef typename boost::range_const_iterator<G>::type IT;
|
||||
typedef typename boost::range_const_iterator<S>::type SIT;
|
||||
typedef typename boost::range_iterator<G const>::type IT;
|
||||
typedef typename boost::range_iterator<S const>::type SIT;
|
||||
|
||||
const G& m_ring;
|
||||
const S& m_sections;
|
||||
@@ -129,10 +129,10 @@ struct section_iterator : public detail::iterators::iterator_base<
|
||||
template<typename G, typename SEC, typename B, size_t D>
|
||||
struct one_section_segment_iterator : public detail::iterators::iterator_base<
|
||||
one_section_segment_iterator<G, SEC, B, D>
|
||||
, typename boost::range_const_iterator<G>::type>
|
||||
, typename boost::range_iterator<G const>::type>
|
||||
{
|
||||
friend class boost::iterator_core_access;
|
||||
typedef typename boost::range_const_iterator<G>::type normal_iterator;
|
||||
typedef typename boost::range_iterator<G const>::type normal_iterator;
|
||||
|
||||
inline one_section_segment_iterator(const G& ring, const SEC& section, const B& box)
|
||||
: m_box(&box)
|
||||
|
||||
@@ -77,7 +77,7 @@ struct centroid_multi
|
||||
|
||||
typename Strategy::state_type state;
|
||||
|
||||
for (typename boost::range_const_iterator<Multi>::type
|
||||
for (typename boost::range_iterator<Multi const>::type
|
||||
it = boost::begin(multi);
|
||||
it != boost::end(multi);
|
||||
++it)
|
||||
|
||||
@@ -30,9 +30,9 @@ struct multi_sum
|
||||
static inline ReturnType apply(MultiGeometry const& geometry, Strategy const& strategy)
|
||||
{
|
||||
ReturnType sum = ReturnType();
|
||||
for (typename boost::range_const_iterator
|
||||
for (typename boost::range_iterator
|
||||
<
|
||||
MultiGeometry
|
||||
MultiGeometry const
|
||||
>::type it = boost::begin(geometry);
|
||||
it != boost::end(geometry);
|
||||
++it)
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace dispatch
|
||||
template <typename MultiPolygon, typename Section>
|
||||
struct get_section<multi_polygon_tag, MultiPolygon, Section>
|
||||
{
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename geometry::range_type<MultiPolygon>::type
|
||||
typename geometry::range_type<MultiPolygon>::type const
|
||||
>::type iterator_type;
|
||||
|
||||
static inline void apply(MultiPolygon const& multi_polygon,
|
||||
|
||||
@@ -33,7 +33,7 @@ struct sectionalize_multi
|
||||
static inline void apply(MultiGeometry const& multi, Sections& sections)
|
||||
{
|
||||
int multi_index = 0;
|
||||
for (typename boost::range_const_iterator<MultiGeometry>::type
|
||||
for (typename boost::range_iterator<MultiGeometry const>::type
|
||||
it = boost::begin(multi);
|
||||
it != boost::end(multi);
|
||||
++it, ++multi_index)
|
||||
|
||||
@@ -50,7 +50,7 @@ struct distance_single_to_multi
|
||||
>::type
|
||||
>::highest());
|
||||
|
||||
for(typename range_const_iterator<MultiGeometry>::type it = begin(multi);
|
||||
for(typename range_iterator<MultiGeometry const>::type it = begin(multi);
|
||||
it != end(multi);
|
||||
++it)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ struct distance_multi_to_multi
|
||||
>::type
|
||||
>::highest());
|
||||
|
||||
for(typename range_const_iterator<Multi1>::type it = begin(multi1);
|
||||
for(typename range_iterator<Multi1 const>::type it = begin(multi1);
|
||||
it != end(multi1);
|
||||
++it)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ struct envelope_multi_linestring
|
||||
static inline void apply(MultiLinestring const& mp, Box& mbr)
|
||||
{
|
||||
assign_inverse(mbr);
|
||||
for (typename boost::range_const_iterator<MultiLinestring>::type
|
||||
for (typename boost::range_iterator<MultiLinestring const>::type
|
||||
it = mp.begin();
|
||||
it != mp.end();
|
||||
++it)
|
||||
|
||||
@@ -31,10 +31,9 @@ struct multi_count
|
||||
static inline size_t apply(MultiGeometry const& geometry)
|
||||
{
|
||||
typedef typename boost::range_value<MultiGeometry>::type geometry_type;
|
||||
typedef typename boost::remove_const<geometry_type>::type ncg;
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
MultiGeometry
|
||||
MultiGeometry const
|
||||
>::type iterator_type;
|
||||
|
||||
size_t n = 0;
|
||||
@@ -42,8 +41,12 @@ struct multi_count
|
||||
it != boost::end(geometry);
|
||||
++it)
|
||||
{
|
||||
n += dispatch::num_points<typename tag<ncg>::type,
|
||||
geometry::is_linear<ncg>::value, ncg>::apply(*it);
|
||||
n += dispatch::num_points
|
||||
<
|
||||
typename tag<geometry_type>::type,
|
||||
geometry::is_linear<geometry_type>::value,
|
||||
geometry_type
|
||||
>::apply(*it);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ struct simplify_multi
|
||||
|
||||
typename boost::range_iterator<MultiGeometry>::type it_out
|
||||
= boost::begin(out);
|
||||
for (typename boost::range_const_iterator<MultiGeometry>::type it_in
|
||||
for (typename boost::range_iterator<MultiGeometry const>::type it_in
|
||||
= boost::begin(multi);
|
||||
it_in != boost::end(multi);
|
||||
++it_in, ++it_out)
|
||||
|
||||
@@ -33,7 +33,7 @@ struct transform_multi
|
||||
{
|
||||
multi2.resize(boost::size(multi1));
|
||||
|
||||
typename boost::range_const_iterator<Multi1>::type it1
|
||||
typename boost::range_iterator<Multi1 const>::type it1
|
||||
= boost::begin(multi1);
|
||||
typename boost::range_iterator<Multi2>::type it2
|
||||
= boost::begin(multi2);
|
||||
|
||||
@@ -36,7 +36,7 @@ struct geometry_in_multi
|
||||
MultiGeometry const& multi,
|
||||
Strategy const& strategy)
|
||||
{
|
||||
for (typename boost::range_const_iterator<MultiGeometry>::type it
|
||||
for (typename boost::range_iterator<MultiGeometry const>::type it
|
||||
= boost::begin(multi);
|
||||
it != boost::end(multi);
|
||||
++it)
|
||||
|
||||
@@ -31,9 +31,9 @@ struct dsv_multi
|
||||
{
|
||||
os << settings.list_open;
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
MultiGeometry
|
||||
MultiGeometry const
|
||||
>::type iterator;
|
||||
for(iterator it = boost::begin(multi);
|
||||
it != boost::end(multi);
|
||||
|
||||
@@ -275,9 +275,9 @@ public:
|
||||
|
||||
typedef typename range_type<InputGeometry>::type range_type;
|
||||
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
range_type
|
||||
range_type const
|
||||
>::type range_iterator;
|
||||
|
||||
detail::get_extremes
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#ifndef BOOST_GEOMETRY_UTIL_AS_RANGE_HPP
|
||||
#define BOOST_GEOMETRY_UTIL_AS_RANGE_HPP
|
||||
|
||||
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/is_multi.hpp>
|
||||
|
||||
@@ -32,7 +32,7 @@ struct range_iterator_const_if_c
|
||||
typedef typename boost::mpl::if_c
|
||||
<
|
||||
IsConst,
|
||||
typename boost::range_const_iterator<Range>::type,
|
||||
typename boost::range_iterator<Range const>::type,
|
||||
typename boost::range_iterator<Range>::type
|
||||
>::type type;
|
||||
};
|
||||
|
||||
@@ -162,7 +162,7 @@ struct dsv_range
|
||||
Range const& range,
|
||||
dsv_settings const& settings)
|
||||
{
|
||||
typedef typename boost::range_const_iterator<Range>::type iterator_type;
|
||||
typedef typename boost::range_iterator<Range const>::type iterator_type;
|
||||
|
||||
bool first = true;
|
||||
|
||||
@@ -206,9 +206,9 @@ struct dsv_poly
|
||||
dsv_settings const& settings)
|
||||
{
|
||||
typedef typename ring_type<Polygon>::type ring;
|
||||
typedef typename boost::range_const_iterator
|
||||
typedef typename boost::range_iterator
|
||||
<
|
||||
typename interior_type<Polygon>::type
|
||||
typename interior_type<Polygon>::type const
|
||||
>::type iterator_type;
|
||||
|
||||
os << settings.list_open;
|
||||
|
||||
Reference in New Issue
Block a user