Merge branch 'master' of github.com:mapnik/mapnik into split-python
This commit is contained in:
commit
ac4e4a2334
4 changed files with 24 additions and 10 deletions
|
@ -69,7 +69,7 @@ struct line_string : std::vector<point<T> >
|
|||
line_string& operator=(line_string &&) = default;
|
||||
line_string (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);}
|
||||
};
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ class MAPNIK_DECL image_view<image_null>
|
|||
public:
|
||||
using pixel_type = image_null::pixel_type;
|
||||
static const image_dtype dtype = image_null::dtype;
|
||||
|
||||
|
||||
image_view() {}
|
||||
~image_view() {};
|
||||
|
||||
|
||||
image_view(image_view<image_null> const& rhs) {}
|
||||
image_view<image_null> & operator=(image_view<image_null> const& rhs) { return *this; }
|
||||
bool operator==(image_view<image_null> const& rhs) const { return true; }
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
unsigned y() const { return 0; }
|
||||
unsigned width() 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 getRowSize() const { return 0; }
|
||||
const pixel_type* getRow(unsigned row) const { return nullptr; }
|
||||
|
|
|
@ -66,7 +66,7 @@ struct vector_markers_dispatch : util::noncopyable
|
|||
symbolizer_base const& sym,
|
||||
Detector & detector,
|
||||
double scale_factor,
|
||||
feature_impl & feature,
|
||||
feature_impl const& feature,
|
||||
attributes const& vars)
|
||||
: src_(src),
|
||||
marker_trans_(marker_trans),
|
||||
|
@ -113,7 +113,7 @@ protected:
|
|||
agg::trans_affine const& marker_trans_;
|
||||
symbolizer_base const& sym_;
|
||||
Detector & detector_;
|
||||
feature_impl & feature_;
|
||||
feature_impl const& feature_;
|
||||
attributes const& vars_;
|
||||
double scale_factor_;
|
||||
};
|
||||
|
@ -126,7 +126,7 @@ struct raster_markers_dispatch : util::noncopyable
|
|||
symbolizer_base const& sym,
|
||||
Detector & detector,
|
||||
double scale_factor,
|
||||
feature_impl & feature,
|
||||
feature_impl const& feature,
|
||||
attributes const& vars)
|
||||
: src_(src),
|
||||
marker_trans_(marker_trans),
|
||||
|
@ -152,7 +152,7 @@ struct raster_markers_dispatch : util::noncopyable
|
|||
box2d<double> bbox(0,0, src_.width(),src_.height());
|
||||
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_finder<T, label_collision_detector4> placement_finder(
|
||||
markers_placement_finder<T, Detector> placement_finder(
|
||||
placement_method, path, detector_, params);
|
||||
double x, y, angle = .0;
|
||||
while (placement_finder.get_point(x, y, angle, ignore_placement))
|
||||
|
@ -171,7 +171,7 @@ protected:
|
|||
agg::trans_affine const& marker_trans_;
|
||||
symbolizer_base const& sym_;
|
||||
Detector & detector_;
|
||||
feature_impl & feature_;
|
||||
feature_impl const& feature_;
|
||||
attributes const& vars_;
|
||||
double scale_factor_;
|
||||
};
|
||||
|
|
|
@ -284,7 +284,10 @@ struct converters_helper<Dispatcher,Current,ConverterTypes...>
|
|||
}
|
||||
|
||||
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);
|
||||
if (disp.vec_[index] == 1)
|
||||
|
@ -299,6 +302,17 @@ struct converters_helper<Dispatcher,Current,ConverterTypes...>
|
|||
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>
|
||||
|
|
Loading…
Reference in a new issue