Merge branch 'master' of github.com:mapnik/mapnik into split-python

This commit is contained in:
Dane Springmeyer 2015-04-25 00:32:38 +02:00
commit ac4e4a2334
4 changed files with 24 additions and 10 deletions

View file

@ -69,7 +69,7 @@ struct line_string : std::vector<point<T> >
line_string& operator=(line_string &&) = default; line_string& operator=(line_string &&) = default;
line_string (line_string const& ) = default; line_string (line_string const& ) = default;
line_string& operator=(line_string const&) = default; line_string& operator=(line_string const&) = default;
inline std::size_t num_points() const { return std::vector<point<T>>::template size(); } inline std::size_t num_points() const { return std::vector<point<T>>::size(); }
inline void add_coord(T x, T y) { std::vector<point<T>>::template emplace_back(x,y);} inline void add_coord(T x, T y) { std::vector<point<T>>::template emplace_back(x,y);}
}; };

View file

@ -49,7 +49,7 @@ public:
unsigned y() const { return 0; } unsigned y() const { return 0; }
unsigned width() const { return 0; } unsigned width() const { return 0; }
unsigned height() const { return 0; } unsigned height() const { return 0; }
const pixel_type operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get from a null image view"); } pixel_type operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get from a null image view"); }
unsigned getSize() const { return 0; } unsigned getSize() const { return 0; }
unsigned getRowSize() const { return 0; } unsigned getRowSize() const { return 0; }
const pixel_type* getRow(unsigned row) const { return nullptr; } const pixel_type* getRow(unsigned row) const { return nullptr; }

View file

@ -66,7 +66,7 @@ struct vector_markers_dispatch : util::noncopyable
symbolizer_base const& sym, symbolizer_base const& sym,
Detector & detector, Detector & detector,
double scale_factor, double scale_factor,
feature_impl & feature, feature_impl const& feature,
attributes const& vars) attributes const& vars)
: src_(src), : src_(src),
marker_trans_(marker_trans), marker_trans_(marker_trans),
@ -113,7 +113,7 @@ protected:
agg::trans_affine const& marker_trans_; agg::trans_affine const& marker_trans_;
symbolizer_base const& sym_; symbolizer_base const& sym_;
Detector & detector_; Detector & detector_;
feature_impl & feature_; feature_impl const& feature_;
attributes const& vars_; attributes const& vars_;
double scale_factor_; double scale_factor_;
}; };
@ -126,7 +126,7 @@ struct raster_markers_dispatch : util::noncopyable
symbolizer_base const& sym, symbolizer_base const& sym,
Detector & detector, Detector & detector,
double scale_factor, double scale_factor,
feature_impl & feature, feature_impl const& feature,
attributes const& vars) attributes const& vars)
: src_(src), : src_(src),
marker_trans_(marker_trans), marker_trans_(marker_trans),
@ -152,7 +152,7 @@ struct raster_markers_dispatch : util::noncopyable
box2d<double> bbox(0,0, src_.width(),src_.height()); box2d<double> bbox(0,0, src_.width(),src_.height());
direction_enum direction = get<direction_enum, keys::direction>(sym_, feature_, vars_); direction_enum direction = get<direction_enum, keys::direction>(sym_, feature_, vars_);
markers_placement_params params { bbox, marker_trans_, spacing * scale_factor_, max_error, allow_overlap, avoid_edges, direction }; markers_placement_params params { bbox, marker_trans_, spacing * scale_factor_, max_error, allow_overlap, avoid_edges, direction };
markers_placement_finder<T, label_collision_detector4> placement_finder( markers_placement_finder<T, Detector> placement_finder(
placement_method, path, detector_, params); placement_method, path, detector_, params);
double x, y, angle = .0; double x, y, angle = .0;
while (placement_finder.get_point(x, y, angle, ignore_placement)) while (placement_finder.get_point(x, y, angle, ignore_placement))
@ -171,7 +171,7 @@ protected:
agg::trans_affine const& marker_trans_; agg::trans_affine const& marker_trans_;
symbolizer_base const& sym_; symbolizer_base const& sym_;
Detector & detector_; Detector & detector_;
feature_impl & feature_; feature_impl const& feature_;
attributes const& vars_; attributes const& vars_;
double scale_factor_; double scale_factor_;
}; };

View file

@ -284,7 +284,10 @@ struct converters_helper<Dispatcher,Current,ConverterTypes...>
} }
template <typename Geometry, typename Processor> template <typename Geometry, typename Processor>
static void forward(Dispatcher & disp, Geometry & geom, Processor & proc) static void forward(Dispatcher & disp, Geometry & geom, Processor & proc,
typename std::enable_if<!std::is_same
<typename detail::converter_traits<Geometry,Current>::conv_type,
transform_path_adapter<view_transform, Geometry> >::value >::type* = 0)
{ {
constexpr std::size_t index = sizeof...(ConverterTypes); constexpr std::size_t index = sizeof...(ConverterTypes);
if (disp.vec_[index] == 1) if (disp.vec_[index] == 1)
@ -299,6 +302,17 @@ struct converters_helper<Dispatcher,Current,ConverterTypes...>
converters_helper<Dispatcher,ConverterTypes...>::forward(disp, geom, proc); converters_helper<Dispatcher,ConverterTypes...>::forward(disp, geom, proc);
} }
} }
template <typename Geometry, typename Processor>
static void forward(Dispatcher & disp, Geometry & geom, Processor & proc,
typename std::enable_if<std::is_same
<typename detail::converter_traits<Geometry,Current>::conv_type,
transform_path_adapter<view_transform, Geometry> >::value >::type* = 0)
{
using conv_type = typename detail::converter_traits<Geometry,Current>::conv_type;
conv_type conv(geom);
detail::converter_traits<conv_type,Current>::setup(conv,disp.args_);
converters_helper<Dispatcher, ConverterTypes...>::forward(disp, conv, proc);
}
}; };
template <typename Dispatcher> template <typename Dispatcher>