use std::tuple with std::get<>
This commit is contained in:
artemp 2013-10-11 12:35:34 +01:00
parent c5763f07d6
commit 3edfc69c81
27 changed files with 125 additions and 128 deletions

View file

@ -114,7 +114,7 @@ boost::python::dict attributes(mapnik::feature_impl const& f)
for ( ;itr!=end; ++itr)
{
attributes[boost::get<0>(*itr)] = boost::get<1>(*itr);
attributes[std::get<0>(*itr)] = std::get<1>(*itr);
}
return attributes;

View file

@ -40,7 +40,7 @@ struct resolution_to_tuple
{
static PyObject* convert(query::resolution_type const& x)
{
python::object tuple(python::make_tuple(x.get<0>(), x.get<1>()));
python::object tuple(python::make_tuple(std::get<0>(x), std::get<1>(x)));
return python::incref(tuple.ptr());
}

View file

@ -190,8 +190,8 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
for ( ;itr!=end; ++itr)
{
info.push_back(QPair<QString,QString>(QString(boost::get<0>(*itr).c_str()),
boost::get<1>(*itr).to_string().c_str()));
info.push_back(QPair<QString,QString>(QString(std::get<0>(*itr).c_str()),
std::get<1>(*itr).to_string().c_str()));
}
typedef mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type> path_type;

View file

@ -43,11 +43,11 @@ class feature_impl;
class MAPNIK_DECL feature_kv_iterator :
public boost::iterator_facade<feature_kv_iterator,
boost::tuple<std::string , value> const,
std::tuple<std::string , value> const,
boost::forward_traversal_tag>
{
public:
typedef boost::tuple<std::string,value> value_type;
typedef std::tuple<std::string,value> value_type;
feature_kv_iterator (feature_impl const& f, bool begin = false);
private:
@ -69,7 +69,7 @@ struct value_not_null
{
bool operator() (feature_kv_iterator::value_type const& kv) const
{
return !boost::apply_visitor(is_null, boost::get<1>(kv).base());
return !boost::apply_visitor(is_null, std::get<1>(kv).base());
}
};

View file

@ -93,21 +93,21 @@ template <typename Iter>
inline bool point_inside_path(double x,double y,Iter start,Iter end)
{
bool inside=false;
double x0=boost::get<0>(*start);
double y0=boost::get<1>(*start);
double x0=std::get<0>(*start);
double y0=std::get<1>(*start);
double x1 = 0;
double y1 = 0;
while (++start!=end)
{
if ( boost::get<2>(*start) == SEG_MOVETO)
if ( std::get<2>(*start) == SEG_MOVETO)
{
x0 = boost::get<0>(*start);
y0 = boost::get<1>(*start);
x0 = std::get<0>(*start);
y0 = std::get<1>(*start);
continue;
}
x1=boost::get<0>(*start);
y1=boost::get<1>(*start);
x1=std::get<0>(*start);
y1=std::get<1>(*start);
if ((((y1 <= y) && (y < y0)) ||
((y0 <= y) && (y < y1))) &&
@ -172,20 +172,20 @@ inline double point_to_segment_distance(double x, double y,
template <typename Iter>
inline bool point_on_path(double x,double y,Iter start,Iter end, double tol)
{
double x0=boost::get<0>(*start);
double y0=boost::get<1>(*start);
double x0=std::get<0>(*start);
double y0=std::get<1>(*start);
double x1 = 0;
double y1 = 0;
while (++start != end)
{
if ( boost::get<2>(*start) == SEG_MOVETO)
if ( std::get<2>(*start) == SEG_MOVETO)
{
x0 = boost::get<0>(*start);
y0 = boost::get<1>(*start);
x0 = std::get<0>(*start);
y0 = std::get<1>(*start);
continue;
}
x1=boost::get<0>(*start);
y1=boost::get<1>(*start);
x1=std::get<0>(*start);
y1=std::get<1>(*start);
double distance = point_to_segment_distance(x,y,x0,y0,x1,y1);
if (distance < tol)

View file

@ -38,7 +38,7 @@
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/fusion/include/at.hpp>
#include <boost/fusion/include/cons.hpp>
@ -177,7 +177,7 @@ template <typename OutputIterator>
struct feature_generator_grammar:
karma::grammar<OutputIterator, mapnik::feature_impl const&()>
{
typedef boost::tuple<std::string, mapnik::value> pair_type;
typedef std::tuple<std::string, mapnik::value> pair_type;
typedef make_properties_range::properties_range_type range_type;
feature_generator_grammar()

View file

@ -38,7 +38,7 @@
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/spirit/include/phoenix_statement.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/math/special_functions/trunc.hpp> // for vc++ and android whose c++11 libs lack std::trunct
namespace boost { namespace spirit { namespace traits {
@ -74,14 +74,14 @@ struct get_first
result_type operator() (geometry_type const& geom) const
{
geometry_type::value_type coord;
boost::get<0>(coord) = geom.vertex(0,&boost::get<1>(coord),&boost::get<2>(coord));
std::get<0>(coord) = geom.vertex(0,&std::get<1>(coord),&std::get<2>(coord));
return coord;
}
};
struct multi_geometry_type
{
typedef boost::tuple<unsigned,bool> result_type;
typedef std::tuple<unsigned,bool> result_type;
result_type operator() (geometry_container const& geom) const
{
unsigned type = 0u;
@ -100,7 +100,7 @@ struct multi_geometry_type
type = itr->type();
}
if (geom.size() > 1) type +=3;
return boost::tuple<unsigned,bool>(type, collection);
return std::tuple<unsigned,bool>(type, collection);
}
};
#else
@ -123,7 +123,7 @@ struct get_first
geometry_type::value_type const operator() (geometry_type const& geom) const
{
geometry_type::value_type coord;
boost::get<0>(coord) = geom.vertex(0,&boost::get<1>(coord),&boost::get<2>(coord));
std::get<0>(coord) = geom.vertex(0,&std::get<1>(coord),&std::get<2>(coord));
return coord;
}
};
@ -131,9 +131,9 @@ struct get_first
struct multi_geometry_type
{
template <typename T>
struct result { typedef boost::tuple<unsigned,bool> type; };
struct result { typedef std::tuple<unsigned,bool> type; };
boost::tuple<unsigned,bool> operator() (geometry_container const& geom) const
std::tuple<unsigned,bool> operator() (geometry_container const& geom) const
{
unsigned type = 0u;
bool collection = false;
@ -151,7 +151,7 @@ struct multi_geometry_type
type = itr->type();
}
if (geom.size() > 1) type +=3;
return boost::tuple<unsigned,bool>(type, collection);
return std::tuple<unsigned,bool>(type, collection);
}
};
#endif
@ -269,7 +269,7 @@ struct geometry_generator_grammar :
template <typename OutputIterator>
struct multi_geometry_generator_grammar :
karma::grammar<OutputIterator, karma::locals<boost::tuple<unsigned,bool> >,
karma::grammar<OutputIterator, karma::locals<std::tuple<unsigned,bool> >,
geometry_container const& ()>
{
@ -323,11 +323,11 @@ struct multi_geometry_generator_grammar :
}
// rules
karma::rule<OutputIterator, karma::locals<boost::tuple<unsigned,bool> >,
karma::rule<OutputIterator, karma::locals<std::tuple<unsigned,bool> >,
geometry_container const&()> start;
karma::rule<OutputIterator, karma::locals<boost::tuple<unsigned,bool> >,
karma::rule<OutputIterator, karma::locals<std::tuple<unsigned,bool> >,
geometry_container const&()> geometry_collection;
karma::rule<OutputIterator, karma::locals<boost::tuple<unsigned,bool> >,
karma::rule<OutputIterator, karma::locals<std::tuple<unsigned,bool> >,
geometry_container const&()> geometry;
karma::rule<OutputIterator, karma::locals<unsigned>,
geometry_type const&()> geometry2;

View file

@ -38,7 +38,7 @@ namespace mapnik {
class query
{
public:
typedef boost::tuple<double,double> resolution_type;
typedef std::tuple<double,double> resolution_type;
query(box2d<double> const& bbox,
resolution_type const& resolution,

View file

@ -28,12 +28,12 @@
namespace mapnik
{
typedef boost::tuple<double,double,double,double> segment_t;
typedef std::tuple<double,double,double,double> segment_t;
static bool y_order(segment_t const& first,segment_t const& second)
{
double miny0 = std::min(first.get<1>(),first.get<3>());
double miny1 = std::min(second.get<1>(),second.get<3>());
double miny0 = std::min(std::get<1>(first), std::get<3>(first));
double miny1 = std::min(std::get<1>(second), std::get<3>(second));
return miny0 > miny1;
}

View file

@ -42,7 +42,7 @@ namespace mapnik { namespace svg {
#include <boost/spirit/include/phoenix_bind.hpp>
#include <boost/fusion/include/std_pair.hpp>
#include <boost/fusion/include/struct.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
/*!
* mapnik::svg::path_output_attributes is adapted as a fusion sequence

View file

@ -170,10 +170,10 @@ private:
/*!
* @brief Specialization of geometry_iterator, as needed by mapnik::svg::svg_path_data_grammar.
* The Value type is a boost::tuple that holds 5 elements, the command and the x and y coordinate.
* The Value type is a std::tuple that holds 5 elements, the command and the x and y coordinate.
* Each coordinate is stored twice to match the needs of the grammar.
*/
//typedef path_iterator<boost::tuple<unsigned, geometry_type::coord_type, geometry_type::value_type>,
//typedef path_iterator<std::tuple<unsigned, geometry_type::coord_type, geometry_type::value_type>,
// coord_transform<CoordTransform, geometry_type> > path_iterator_type;
}}

View file

@ -39,7 +39,7 @@
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/spirit/include/phoenix_statement.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/type_traits/remove_pointer.hpp>
@ -111,7 +111,7 @@ namespace mapnik { namespace util {
{
typename geometry_type::value_type coord;
geom.rewind(0);
boost::get<0>(coord) = geom.vertex(&boost::get<1>(coord),&boost::get<2>(coord));
std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord));
return coord;
}
};
@ -140,7 +140,7 @@ namespace mapnik { namespace util {
{
typename geometry_type::value_type coord;
geom.rewind(0);
boost::get<0>(coord) = geom.vertex(&boost::get<1>(coord),&boost::get<2>(coord));
std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord));
return coord;
}
};

View file

@ -36,7 +36,7 @@
#include <boost/spirit/include/phoenix_fusion.hpp>
#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/spirit/include/phoenix_statement.hpp>
#include <boost/fusion/include/boost_tuple.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/math/special_functions/trunc.hpp> // for vc++ and android whose c++11 libs lack std::trunct
@ -81,7 +81,7 @@ struct get_first
{
typename geometry_type::value_type coord;
geom.rewind(0);
boost::get<0>(coord) = geom.vertex(&boost::get<1>(coord),&boost::get<2>(coord));
std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord));
return coord;
}
};
@ -109,7 +109,7 @@ struct get_x
double operator() (value_type const& val) const
{
return boost::get<1>(val);
return std::get<1>(val);
}
};
@ -123,7 +123,7 @@ struct get_y
double operator() (value_type const& val) const
{
return boost::get<2>(val);
return std::get<2>(val);
}
};
@ -133,9 +133,9 @@ struct multi_geometry_type
typedef T geometry_container;
template <typename U>
struct result { typedef boost::tuple<unsigned,bool> type; };
struct result { typedef std::tuple<unsigned,bool> type; };
boost::tuple<unsigned,bool> operator() (geometry_container const& geom) const;
std::tuple<unsigned,bool> operator() (geometry_container const& geom) const;
};
@ -200,14 +200,14 @@ struct wkt_generator :
template <typename OutputIterator, typename GeometryContainer>
struct wkt_multi_generator :
karma::grammar<OutputIterator, karma::locals< boost::tuple<unsigned,bool> >, GeometryContainer const& ()>
karma::grammar<OutputIterator, karma::locals< std::tuple<unsigned,bool> >, GeometryContainer const& ()>
{
typedef GeometryContainer geometry_contaner;
typedef boost::remove_pointer<typename geometry_container::value_type>::type geometry_type;
wkt_multi_generator();
// rules
karma::rule<OutputIterator, karma::locals<boost::tuple<unsigned,bool> >, GeometryContainer const& ()> wkt;
karma::rule<OutputIterator, karma::locals<std::tuple<unsigned,bool> >, GeometryContainer const& ()> wkt;
karma::rule<OutputIterator, GeometryContainer const& ()> geometry;
karma::rule<OutputIterator, geometry_type const& ()> single_geometry;
karma::rule<OutputIterator, GeometryContainer const& ()> multi_geometry;

View file

@ -35,14 +35,14 @@ namespace mapnik { namespace util {
template <typename T>
class path_iterator
: public boost::iterator_facade< path_iterator<T>,
boost::tuple<unsigned,double,double> const,
std::tuple<unsigned,double,double> const,
boost::forward_traversal_tag
>
{
public:
typedef T path_type;
typedef typename boost::tuple<unsigned, double, double> value_type;
typedef typename std::tuple<unsigned, double, double> value_type;
path_iterator()
: v_(mapnik::SEG_END,0,0),
@ -61,12 +61,12 @@ private:
void increment()
{
boost::get<0>(v_) = vertices_->vertex( &boost::get<1>(v_), &boost::get<2>(v_));
std::get<0>(v_) = vertices_->vertex( &std::get<1>(v_), &std::get<2>(v_));
}
bool equal( path_iterator const& other) const
{
return boost::get<0>(v_) == boost::get<0>(other.v_);
return std::get<0>(v_) == std::get<0>(other.v_);
}
value_type const& dereference() const

View file

@ -53,7 +53,7 @@ class vertex_vector : private mapnik::noncopyable
};
public:
// required for iterators support
typedef boost::tuple<unsigned,coord_type,coord_type> value_type;
typedef std::tuple<unsigned,coord_type,coord_type> value_type;
typedef std::size_t size_type;
typedef std::uint8_t command_size;
private:

View file

@ -31,8 +31,7 @@
// boost
#include <boost/format.hpp>
#include <boost/make_shared.hpp>
#include <boost/variant/apply_visitor.hpp>
// stl
#include <cmath>
@ -90,23 +89,8 @@ feature_ptr gdal_featureset::next()
if (first_)
{
first_ = false;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Next feature in Dataset=" << &dataset_;
query *q = boost::get<query>(&gquery_);
if (q)
{
return get_feature(*q);
}
else
{
coord2d *p = boost::get<coord2d>(&gquery_);
if (p)
{
return get_feature_at_point(*p);
}
}
// should never reach here
return boost::apply_visitor(query_dispatch(*this), gquery_);
}
return feature_ptr();
}
@ -138,8 +122,8 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
box2d<double> box = t.forward(intersect);
//size of resized output pixel in source image domain
double margin_x = 1.0 / (std::fabs(dx_) * boost::get<0>(q.resolution()));
double margin_y = 1.0 / (std::fabs(dy_) * boost::get<1>(q.resolution()));
double margin_x = 1.0 / (std::fabs(dx_) * std::get<0>(q.resolution()));
double margin_y = 1.0 / (std::fabs(dy_) * std::get<1>(q.resolution()));
if (margin_x < 1)
{
margin_x = 1.0;
@ -191,13 +175,13 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Raster extent=" << raster_extent_;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: View extent=" << intersect;
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Query resolution=" << boost::get<0>(q.resolution()) << "," << boost::get<1>(q.resolution());
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Query resolution=" << std::get<0>(q.resolution()) << "," << std::get<1>(q.resolution());
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: StartX=" << x_off << " StartY=" << y_off << " Width=" << width << " Height=" << height;
if (width > 0 && height > 0)
{
double width_res = boost::get<0>(q.resolution());
double height_res = boost::get<1>(q.resolution());
double width_res = std::get<0>(q.resolution());
double height_res = std::get<1>(q.resolution());
int im_width = int(width_res * intersect.width() + 0.5);
int im_height = int(height_res * intersect.height() + 0.5);

View file

@ -39,6 +39,24 @@ typedef boost::variant<mapnik::query, mapnik::coord2d> gdal_query;
class gdal_featureset : public mapnik::Featureset
{
struct query_dispatch : public boost::static_visitor<mapnik::feature_ptr>
{
query_dispatch( gdal_featureset & featureset)
: featureset_(featureset) {}
mapnik::feature_ptr operator() (mapnik::query const& q) const
{
return featureset_.get_feature(q);
}
mapnik::feature_ptr operator() (mapnik::coord2d const& p) const
{
return featureset_.get_feature_at_point(p);
}
gdal_featureset & featureset_;
};
public:
gdal_featureset(GDALDataset& dataset,
int band,

View file

@ -151,8 +151,8 @@ geojson_datasource::geojson_datasource(parameters const& params)
mapnik::feature_kv_iterator f_end = f->end();
for ( ;f_itr!=f_end; ++f_itr)
{
desc_.add_descriptor(mapnik::attribute_descriptor(boost::get<0>(*f_itr),
boost::apply_visitor(attr_value_converter(),boost::get<1>(*f_itr).base())));
desc_.add_descriptor(mapnik::attribute_descriptor(std::get<0>(*f_itr),
boost::apply_visitor(attr_value_converter(),std::get<1>(*f_itr).base())));
}
}
else

View file

@ -506,8 +506,8 @@ featureset_ptr occi_datasource::features(query const& q) const
#endif
box2d<double> const& box = q.get_bbox();
const double px_gw = 1.0 / boost::get<0>(q.resolution());
const double px_gh = 1.0 / boost::get<1>(q.resolution());
const double px_gw = 1.0 / std::get<0>(q.resolution());
const double px_gh = 1.0 / std::get<1>(q.resolution());
const double scale_denom = q.scale_denominator();
std::ostringstream s;

View file

@ -722,8 +722,8 @@ featureset_ptr postgis_datasource::features_with_context(query const& q,processo
std::ostringstream s;
const double px_gw = 1.0 / boost::get<0>(q.resolution());
const double px_gh = 1.0 / boost::get<1>(q.resolution());
const double px_gw = 1.0 / std::get<0>(q.resolution());
const double px_gh = 1.0 / std::get<1>(q.resolution());
s << "SELECT ST_AsBinary(";

View file

@ -67,14 +67,14 @@ feature_ptr rasterlite_featureset::next()
{
first_ = false;
query *q = boost::get<query>(&gquery_);
query *q = std::get<query>(&gquery_);
if (q)
{
return get_feature(*q);
}
else
{
coord2d *p = boost::get<coord2d>(&gquery_);
coord2d *p = std::get<coord2d>(&gquery_);
if (p)
{
return get_feature_at_point(*p);
@ -97,8 +97,8 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q)
box2d<double> raster_extent(x0, y0, x1, y1);
box2d<double> intersect = raster_extent.intersect(q.get_bbox());
const int width = static_cast<int>(boost::get<0>(q.resolution()) * intersect.width() + 0.5);
const int height = static_cast<int>(boost::get<0>(q.resolution()) * intersect.height() + 0.5);
const int width = static_cast<int>(std::get<0>(q.resolution()) * intersect.width() + 0.5);
const int height = static_cast<int>(std::get<0>(q.resolution()) * intersect.height() + 0.5);
const double pixel_size = (intersect.width() >= intersect.height()) ?
(intersect.width() / (double) width) : (intersect.height() / (double) height);
@ -106,7 +106,7 @@ feature_ptr rasterlite_featureset::get_feature(mapnik::query const& q)
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Raster extent=" << raster_extent;
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: View extent=" << q.get_bbox();
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Intersect extent=" << intersect;
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Query resolution=" << boost::get<0>(q.resolution()) << "," << boost::get<1>(q.resolution());
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Query resolution=" << std::get<0>(q.resolution()) << "," << std::get<1>(q.resolution());
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Size=" << width << " " << height;
MAPNIK_LOG_DEBUG(rasterlite) << "rasterlite_featureset: Pixel Size=" << pixel_size;

View file

@ -140,6 +140,9 @@ mapnik::layer_descriptor topojson_datasource::get_descriptor() const
mapnik::featureset_ptr topojson_datasource::features(mapnik::query const& q) const
{
std::cerr << "Resolution=" << std::get<0>(q.resolution())
<< "," << std::get<1>(q.resolution())
<< " scale_denominator=" << q.scale_denominator() << std::endl;
// if the query box intersects our world extent then query for features
mapnik::box2d<double> const& b = q.get_bbox();
if (extent_.intersects(b))
@ -157,12 +160,9 @@ mapnik::featureset_ptr topojson_datasource::features_at_point(mapnik::coord2d co
mapnik::box2d<double> query_bbox(pt, pt);
query_bbox.pad(tol);
mapnik::query q(query_bbox);
std::vector<mapnik::attribute_descriptor> const& desc = desc_.get_descriptors();
std::vector<mapnik::attribute_descriptor>::const_iterator itr = desc.begin();
std::vector<mapnik::attribute_descriptor>::const_iterator end = desc.end();
for ( ;itr!=end;++itr)
for (auto const& attr_info : desc_.get_descriptors())
{
q.add_property_name(itr->get_name());
q.add_property_name(attr_info.get_name());
}
return features(q);
}

View file

@ -119,16 +119,13 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
}
std::sort(face_segments.begin(),face_segments.end(), y_order);
std::deque<segment_t>::const_iterator itr=face_segments.begin();
std::deque<segment_t>::const_iterator end=face_segments.end();
for (; itr!=end; ++itr)
for (auto const& seg : face_segments)
{
const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(),itr->get<1>());
faces->line_to(itr->get<2>(),itr->get<3>());
faces->line_to(itr->get<2>(),itr->get<3>() + height);
faces->line_to(itr->get<0>(),itr->get<1>() + height);
faces->move_to(std::get<0>(seg),std::get<1>(seg));
faces->line_to(std::get<2>(seg),std::get<3>(seg));
faces->line_to(std::get<2>(seg),std::get<3>(seg) + height);
faces->line_to(std::get<0>(seg),std::get<1>(seg) + height);
path_type faces_path (t_,*faces,prj_trans);
ras_ptr->add_path(faces_path);
@ -136,8 +133,8 @@ void agg_renderer<T>::process(building_symbolizer const& sym,
agg::render_scanlines(*ras_ptr, sl, ren);
ras_ptr->reset();
//
frame->move_to(itr->get<0>(),itr->get<1>());
frame->line_to(itr->get<0>(),itr->get<1>()+height);
frame->move_to(std::get<0>(seg),std::get<1>(seg));
frame->line_to(std::get<0>(seg),std::get<1>(seg)+height);
}

View file

@ -388,15 +388,14 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
}
std::sort(face_segments.begin(), face_segments.end(), y_order);
std::deque<segment_t>::const_iterator itr = face_segments.begin();
std::deque<segment_t>::const_iterator end=face_segments.end();
for (; itr != end; ++itr)
for (auto const& seg : face_segments)
{
const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(), itr->get<1>());
faces->line_to(itr->get<2>(), itr->get<3>());
faces->line_to(itr->get<2>(), itr->get<3>() + height);
faces->line_to(itr->get<0>(), itr->get<1>() + height);
faces->move_to(std::get<0>(seg), std::get<1>(seg));
faces->line_to(std::get<2>(seg), std::get<3>(seg));
faces->line_to(std::get<2>(seg), std::get<3>(seg) + height);
faces->line_to(std::get<0>(seg), std::get<1>(seg) + height);
path_type faces_path(t_, *faces, prj_trans);
context_.set_color(fill.red() * 0.8 / 255.0, fill.green() * 0.8 / 255.0,
@ -404,8 +403,8 @@ void cairo_renderer_base::process(building_symbolizer const& sym,
context_.add_path(faces_path);
context_.fill();
frame->move_to(itr->get<0>(), itr->get<1>());
frame->line_to(itr->get<0>(), itr->get<1>() + height);
frame->move_to(std::get<0>(seg), std::get<1>(seg));
frame->line_to(std::get<0>(seg), std::get<1>(seg) + height);
}
geom.rewind(0);

View file

@ -54,8 +54,8 @@ bool feature_kv_iterator::equal( feature_kv_iterator const& other) const
feature_kv_iterator::value_type const& feature_kv_iterator::dereference() const
{
boost::get<0>(kv_) = itr_->first;
boost::get<1>(kv_) = f_.get(itr_->second);
std::get<0>(kv_) = itr_->first;
std::get<1>(kv_) = f_.get(itr_->second);
return kv_;
}

View file

@ -103,14 +103,13 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
y0 = y;
}
std::sort(face_segments.begin(),face_segments.end(), y_order);
std::deque<segment_t>::const_iterator itr=face_segments.begin();
for (;itr!=face_segments.end();++itr)
for ( auto const& seg : face_segments)
{
const std::unique_ptr<geometry_type> faces(new geometry_type(geometry_type::types::Polygon));
faces->move_to(itr->get<0>(),itr->get<1>());
faces->line_to(itr->get<2>(),itr->get<3>());
faces->line_to(itr->get<2>(),itr->get<3>() + height);
faces->line_to(itr->get<0>(),itr->get<1>() + height);
faces->move_to(std::get<0>(seg),std::get<1>(seg));
faces->line_to(std::get<2>(seg),std::get<3>(seg));
faces->line_to(std::get<2>(seg),std::get<3>(seg) + height);
faces->line_to(std::get<0>(seg),std::get<1>(seg) + height);
path_type faces_path (t_,*faces,prj_trans);
ras_ptr->add_path(faces_path);
@ -118,8 +117,8 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
agg::render_scanlines(*ras_ptr, sl, ren);
ras_ptr->reset();
frame->move_to(itr->get<0>(),itr->get<1>());
frame->line_to(itr->get<0>(),itr->get<1>()+height);
frame->move_to(std::get<0>(seg),std::get<1>(seg));
frame->line_to(std::get<0>(seg),std::get<1>(seg)+height);
}
geom.rewind(0);

View file

@ -33,7 +33,7 @@
namespace mapnik { namespace util {
template <typename T>
boost::tuple<unsigned,bool> detail::multi_geometry_type<T>::operator() (T const& geom) const
std::tuple<unsigned,bool> detail::multi_geometry_type<T>::operator() (T const& geom) const
{
typedef T geometry_container;
unsigned type = 0u;
@ -51,7 +51,7 @@ boost::tuple<unsigned,bool> detail::multi_geometry_type<T>::operator() (T const&
}
type = itr->type();
}
return boost::tuple<unsigned,bool>(type, collection);
return std::tuple<unsigned,bool>(type, collection);
}
template <typename OutputIterator, typename Geometry>