rename CoordTransform to view_transform to better reflect its purpose and be consistent
This commit is contained in:
parent
cc76ac4c6a
commit
de22d5900c
41 changed files with 93 additions and 97 deletions
|
@ -34,14 +34,14 @@ void render(mapnik::geometry_type & geom,
|
|||
mapnik::box2d<double> const& extent,
|
||||
std::string const& name)
|
||||
{
|
||||
using path_type = mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type>;
|
||||
using path_type = mapnik::coord_transform<mapnik::view_transform,mapnik::geometry_type>;
|
||||
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_plain>;
|
||||
using renderer = agg::renderer_scanline_aa_solid<ren_base>;
|
||||
mapnik::image_32 im(256,256);
|
||||
im.set_background(mapnik::color("white"));
|
||||
mapnik::box2d<double> padded_extent = extent;
|
||||
padded_extent.pad(10);
|
||||
mapnik::CoordTransform tr(im.width(),im.height(),padded_extent,0,0);
|
||||
mapnik::view_transform tr(im.width(),im.height(),padded_extent,0,0);
|
||||
agg::rendering_buffer buf(im.raw_data(),im.width(),im.height(), im.width() * 4);
|
||||
agg::pixfmt_rgba32_plain pixf(buf);
|
||||
ren_base renb(pixf);
|
||||
|
|
|
@ -345,7 +345,7 @@ void export_map()
|
|||
">>> m.scale_denominator()\n"
|
||||
)
|
||||
|
||||
.def("view_transform",&Map::view_transform,
|
||||
.def("view_transform",&Map::transform,
|
||||
"Return the map ViewTransform object\n"
|
||||
"which is used internally to convert between\n"
|
||||
"geographic coordinates and screen coordinates.\n"
|
||||
|
|
|
@ -27,12 +27,12 @@
|
|||
// mapnik
|
||||
#include <mapnik/ctrans.hpp>
|
||||
|
||||
using mapnik::CoordTransform;
|
||||
using mapnik::view_transform;
|
||||
|
||||
struct view_transform_pickle_suite : boost::python::pickle_suite
|
||||
{
|
||||
static boost::python::tuple
|
||||
getinitargs(const CoordTransform& c)
|
||||
getinitargs(const view_transform& c)
|
||||
{
|
||||
using namespace boost::python;
|
||||
return boost::python::make_tuple(c.width(),c.height(),c.extent());
|
||||
|
@ -41,26 +41,26 @@ struct view_transform_pickle_suite : boost::python::pickle_suite
|
|||
|
||||
namespace {
|
||||
|
||||
mapnik::coord2d forward_point(mapnik::CoordTransform const& t, mapnik::coord2d const& in)
|
||||
mapnik::coord2d forward_point(mapnik::view_transform const& t, mapnik::coord2d const& in)
|
||||
{
|
||||
mapnik::coord2d out(in);
|
||||
t.forward(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
mapnik::coord2d backward_point(mapnik::CoordTransform const& t, mapnik::coord2d const& in)
|
||||
mapnik::coord2d backward_point(mapnik::view_transform const& t, mapnik::coord2d const& in)
|
||||
{
|
||||
mapnik::coord2d out(in);
|
||||
t.backward(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
mapnik::box2d<double> forward_envelope(mapnik::CoordTransform const& t, mapnik::box2d<double> const& in)
|
||||
mapnik::box2d<double> forward_envelope(mapnik::view_transform const& t, mapnik::box2d<double> const& in)
|
||||
{
|
||||
return t.forward(in);
|
||||
}
|
||||
|
||||
mapnik::box2d<double> backward_envelope(mapnik::CoordTransform const& t, mapnik::box2d<double> const& in)
|
||||
mapnik::box2d<double> backward_envelope(mapnik::view_transform const& t, mapnik::box2d<double> const& in)
|
||||
{
|
||||
return t.backward(in);
|
||||
}
|
||||
|
@ -72,14 +72,14 @@ void export_view_transform()
|
|||
using mapnik::box2d;
|
||||
using mapnik::coord2d;
|
||||
|
||||
class_<CoordTransform>("ViewTransform",init<int,int,box2d<double> const& > (
|
||||
class_<view_transform>("ViewTransform",init<int,int,box2d<double> const& > (
|
||||
"Create a ViewTransform with a width and height as integers and extent"))
|
||||
.def_pickle(view_transform_pickle_suite())
|
||||
.def("forward", forward_point)
|
||||
.def("backward",backward_point)
|
||||
.def("forward", forward_envelope)
|
||||
.def("backward",backward_envelope)
|
||||
.def("scale_x",&CoordTransform::scale_x)
|
||||
.def("scale_y",&CoordTransform::scale_y)
|
||||
.def("scale_x",&view_transform::scale_x)
|
||||
.def("scale_y",&view_transform::scale_y)
|
||||
;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ using mapnik::box2d;
|
|||
using mapnik::coord2d;
|
||||
using mapnik::feature_ptr;
|
||||
using mapnik::geometry_ptr;
|
||||
using mapnik::CoordTransform;
|
||||
using mapnik::view_transform;
|
||||
using mapnik::projection;
|
||||
using mapnik::scale_denominator;
|
||||
using mapnik::feature_kv_iterator;
|
||||
|
@ -159,7 +159,7 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
|||
|
||||
projection map_proj(map_->srs()); // map projection
|
||||
double scale_denom = scale_denominator(map_->scale(),map_proj.is_geographic());
|
||||
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||
view_transform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||
|
||||
for (unsigned index = 0; index < map_->layer_count();++index)
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ void MapWidget::mousePressEvent(QMouseEvent* e)
|
|||
std::get<1>(*itr).to_string().c_str()));
|
||||
}
|
||||
|
||||
using path_type = mapnik::coord_transform<mapnik::CoordTransform,mapnik::geometry_type>;
|
||||
using path_type = mapnik::coord_transform<mapnik::view_transform,mapnik::geometry_type>;
|
||||
|
||||
for (unsigned i=0; i<feat->num_geometries();++i)
|
||||
{
|
||||
|
@ -264,7 +264,7 @@ void MapWidget::mouseReleaseEvent(QMouseEvent* e)
|
|||
drag_=false;
|
||||
if (map_)
|
||||
{
|
||||
CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||
view_transform t(map_->width(),map_->height(),map_->get_current_extent());
|
||||
box2d<double> box = t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
|
||||
map_->zoom_to_box(box);
|
||||
updateMap();
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <mapnik/rule.hpp> // for rule, symbolizers
|
||||
#include <mapnik/box2d.hpp> // for box2d
|
||||
#include <mapnik/color.hpp> // for color
|
||||
#include <mapnik/ctrans.hpp> // for CoordTransform
|
||||
#include <mapnik/ctrans.hpp> // for view_transform
|
||||
#include <mapnik/image_compositing.hpp> // for composite_mode_e
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/request.hpp>
|
||||
|
|
|
@ -130,7 +130,7 @@ private:
|
|||
proj_transform const* prj_trans_;
|
||||
};
|
||||
|
||||
class CoordTransform
|
||||
class view_transform
|
||||
{
|
||||
private:
|
||||
const int width_;
|
||||
|
@ -143,7 +143,7 @@ private:
|
|||
int offset_;
|
||||
public:
|
||||
|
||||
CoordTransform(int width, int height, box2d<double> const& extent,
|
||||
view_transform(int width, int height, box2d<double> const& extent,
|
||||
double offset_x = 0.0, double offset_y = 0.0)
|
||||
: width_(width),
|
||||
height_(height),
|
||||
|
@ -154,7 +154,7 @@ public:
|
|||
offset_y_(offset_y),
|
||||
offset_(0) {}
|
||||
|
||||
CoordTransform(CoordTransform const&) = default;
|
||||
view_transform(view_transform const&) = default;
|
||||
|
||||
inline int offset() const
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include <mapnik/rule.hpp> // for rule, symbolizers
|
||||
#include <mapnik/box2d.hpp> // for box2d
|
||||
#include <mapnik/color.hpp> // for color
|
||||
#include <mapnik/ctrans.hpp> // for CoordTransform
|
||||
#include <mapnik/ctrans.hpp> // for view_transform
|
||||
#include <mapnik/image_compositing.hpp> // for composite_mode_e
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/renderer_common.hpp>
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const &t,
|
||||
view_transform const &t,
|
||||
DetectorType &detector,
|
||||
box2d<double> const& query_extent);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace mapnik
|
|||
struct Featureset;
|
||||
using featureset_ptr = std::shared_ptr<Featureset>;
|
||||
class feature_type_style;
|
||||
class CoordTransform;
|
||||
class view_transform;
|
||||
class layer;
|
||||
|
||||
class MAPNIK_DECL Map : boost::equality_comparable<Map>
|
||||
|
@ -389,7 +389,7 @@ public:
|
|||
|
||||
double scale_denominator() const;
|
||||
|
||||
CoordTransform view_transform() const;
|
||||
view_transform transform() const;
|
||||
|
||||
/*!
|
||||
* @brief Query a Map layer (by layer index) for features
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <mapnik/config.hpp> // for MAPNIK_DECL
|
||||
#include <mapnik/font_engine_freetype.hpp> // for face_manager, etc
|
||||
#include <mapnik/box2d.hpp> // for box2d
|
||||
#include <mapnik/ctrans.hpp> // for CoordTransform
|
||||
#include <mapnik/ctrans.hpp> // for view_transform
|
||||
#include <mapnik/attribute.hpp>
|
||||
|
||||
// fwd declarations to speed up compile
|
||||
|
@ -41,12 +41,12 @@ namespace mapnik {
|
|||
|
||||
struct renderer_common
|
||||
{
|
||||
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
unsigned width, unsigned height, double scale_factor);
|
||||
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
renderer_common(Map const &m, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
unsigned width, unsigned height, double scale_factor,
|
||||
std::shared_ptr<label_collision_detector4> detector);
|
||||
renderer_common(request const &req, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
renderer_common(request const &req, attributes const& vars, unsigned offset_x, unsigned offset_y,
|
||||
unsigned width, unsigned height, double scale_factor);
|
||||
renderer_common(renderer_common const& other);
|
||||
|
||||
|
@ -59,15 +59,14 @@ struct renderer_common
|
|||
freetype_engine &font_engine_;
|
||||
face_manager<freetype_engine> font_manager_;
|
||||
box2d<double> query_extent_;
|
||||
CoordTransform t_;
|
||||
view_transform t_;
|
||||
std::shared_ptr<label_collision_detector4> detector_;
|
||||
|
||||
private:
|
||||
renderer_common(unsigned width, unsigned height, double scale_factor,
|
||||
attributes const& vars, CoordTransform &&t, std::shared_ptr<label_collision_detector4> detector);
|
||||
attributes const& vars, view_transform &&t, std::shared_ptr<label_collision_detector4> detector);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* MAPNIK_RENDERER_COMMON_HPP */
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
renderer_context);
|
||||
|
||||
vertex_converter<box2d<double>, vector_dispatch_type, markers_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
renderer_context);
|
||||
|
||||
vertex_converter<box2d<double>, vector_dispatch_type, markers_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
renderer_context);
|
||||
|
||||
vertex_converter<box2d<double>, raster_dispatch_type, markers_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,tr,feature,common.vars_,common.scale_factor_);
|
||||
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
namespace boost { namespace spirit { namespace traits {
|
||||
|
||||
// TODO - this needs to be made generic to any path type
|
||||
using path_type = mapnik::coord_transform<mapnik::CoordTransform, mapnik::geometry_type>;
|
||||
using path_type = mapnik::coord_transform<mapnik::view_transform, mapnik::geometry_type>;
|
||||
|
||||
template <>
|
||||
struct is_container<path_type const> : mpl::true_ {} ;
|
||||
|
|
|
@ -171,7 +171,7 @@ private:
|
|||
// 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.
|
||||
//using path_iterator_type = path_iterator<std::tuple<unsigned, geometry_type::coord_type, geometry_type::value_type>,
|
||||
// coord_transform<CoordTransform, geometry_type> >;
|
||||
// coord_transform<view_transform, geometry_type> >;
|
||||
|
||||
}}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <mapnik/rule.hpp> // for rule, symbolizers
|
||||
#include <mapnik/box2d.hpp> // for box2d
|
||||
#include <mapnik/color.hpp> // for color
|
||||
#include <mapnik/ctrans.hpp> // for CoordTransform
|
||||
#include <mapnik/ctrans.hpp> // for view_transform
|
||||
#include <mapnik/image_compositing.hpp> // for composite_mode_e
|
||||
#include <mapnik/pixel_position.hpp>
|
||||
#include <mapnik/request.hpp>
|
||||
|
|
|
@ -58,7 +58,7 @@ struct placement_finder_adapter
|
|||
|
||||
using conv_types = boost::mpl::vector<clip_line_tag , transform_tag, affine_transform_tag, simplify_tag, smooth_tag>;
|
||||
using vertex_converter_type = vertex_converter<box2d<double>, placement_finder_adapter<placement_finder> , symbolizer_base,
|
||||
CoordTransform, proj_transform, agg::trans_affine,
|
||||
view_transform, proj_transform, agg::trans_affine,
|
||||
conv_types, feature_impl>;
|
||||
|
||||
class base_symbolizer_helper
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
box2d<double> const& query_extent);
|
||||
|
||||
protected:
|
||||
|
@ -83,7 +83,7 @@ protected:
|
|||
feature_impl const& feature_;
|
||||
attributes const& vars_;
|
||||
proj_transform const& prj_trans_;
|
||||
CoordTransform const& t_;
|
||||
view_transform const& t_;
|
||||
box2d<double> dims_;
|
||||
box2d<double> const& query_extent_;
|
||||
float scale_factor_;
|
||||
|
@ -119,7 +119,7 @@ public:
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
FaceManagerT & font_manager,
|
||||
DetectorT & detector,
|
||||
box2d<double> const& query_extent,
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
FaceManagerT & font_manager,
|
||||
DetectorT & detector,
|
||||
box2d<double> const& query_extent,
|
||||
|
|
|
@ -254,7 +254,7 @@ template <typename T>
|
|||
struct converter_traits<T,mapnik::transform_tag>
|
||||
{
|
||||
using geometry_type = T;
|
||||
using conv_type = coord_transform<CoordTransform, geometry_type>;
|
||||
using conv_type = coord_transform<view_transform, geometry_type>;
|
||||
|
||||
template <typename Args>
|
||||
static void setup(geometry_type & geom, Args const& args)
|
||||
|
|
|
@ -43,7 +43,7 @@ using mapnik::query;
|
|||
using mapnik::coord2d;
|
||||
using mapnik::box2d;
|
||||
using mapnik::feature_ptr;
|
||||
using mapnik::CoordTransform;
|
||||
using mapnik::view_transform;
|
||||
using mapnik::geometry_type;
|
||||
using mapnik::datasource_exception;
|
||||
using mapnik::feature_factory;
|
||||
|
@ -116,7 +116,7 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
|
|||
#endif
|
||||
*/
|
||||
|
||||
CoordTransform t(raster_width_, raster_height_, raster_extent_, 0, 0);
|
||||
view_transform t(raster_width_, raster_height_, raster_extent_, 0, 0);
|
||||
box2d<double> intersect = raster_extent_.intersect(q.get_bbox());
|
||||
box2d<double> box = t.forward(intersect);
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ layer_descriptor raster_datasource::get_descriptor() const
|
|||
|
||||
featureset_ptr raster_datasource::features(query const& q) const
|
||||
{
|
||||
mapnik::CoordTransform t(width_, height_, extent_, 0, 0);
|
||||
mapnik::view_transform t(width_, height_, extent_, 0, 0);
|
||||
mapnik::box2d<double> intersect = extent_.intersect(q.get_bbox());
|
||||
mapnik::box2d<double> ext = t.forward(intersect);
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ feature_ptr raster_featureset<LookupPolicy>::next()
|
|||
|
||||
if (image_width > 0 && image_height > 0)
|
||||
{
|
||||
mapnik::CoordTransform t(image_width, image_height, extent_, 0, 0);
|
||||
mapnik::view_transform t(image_width, image_height, extent_, 0, 0);
|
||||
box2d<double> intersect = bbox_.intersect(curIter_->envelope());
|
||||
box2d<double> ext = t.forward(intersect);
|
||||
box2d<double> rem = policy_.transform(ext);
|
||||
|
@ -95,14 +95,11 @@ feature_ptr raster_featureset<LookupPolicy>::next()
|
|||
int end_y = static_cast<int>(std::ceil(ext.maxy()));
|
||||
|
||||
// clip to available data
|
||||
if (x_off < 0)
|
||||
x_off = 0;
|
||||
if (y_off < 0)
|
||||
y_off = 0;
|
||||
if (end_x > image_width)
|
||||
end_x = image_width;
|
||||
if (end_y > image_height)
|
||||
end_y = image_height;
|
||||
if (x_off < 0) x_off = 0;
|
||||
if (y_off < 0) y_off = 0;
|
||||
if (end_x > image_width) end_x = image_width;
|
||||
if (end_y > image_height) end_y = image_height;
|
||||
|
||||
int width = end_x - x_off;
|
||||
int height = end_y - y_off;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void agg_renderer<T0,T1>::process(building_symbolizer const& sym,
|
|||
mapnik::feature_impl & feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
using path_type = coord_transform<CoordTransform,geometry_type>;
|
||||
using path_type = coord_transform<view_transform,geometry_type>;
|
||||
using ren_base = agg::renderer_base<agg::pixfmt_rgba32_pre>;
|
||||
using renderer = agg::renderer_scanline_aa_solid<ren_base>;
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@ void agg_renderer<T0,T1>::process(line_pattern_symbolizer const& sym,
|
|||
simplify_tag,smooth_tag,
|
||||
offset_transform_tag>;
|
||||
vertex_converter<box2d<double>, rasterizer_type, line_pattern_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (clip) converter.set<clip_line_tag>(); //optional clip (default: true)
|
||||
|
|
|
@ -171,7 +171,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
set_join_caps_aa(sym, ras, feature, common_.vars_);
|
||||
|
||||
vertex_converter<box2d<double>, rasterizer_type, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
converter.set<transform_tag>(); // always transform
|
||||
|
@ -191,7 +191,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
else
|
||||
{
|
||||
vertex_converter<box2d<double>, rasterizer, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
|
|
|
@ -80,7 +80,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
if (!pat) return;
|
||||
|
||||
using clipped_geometry_type = agg::conv_clip_polygon<geometry_type>;
|
||||
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
|
||||
using path_type = coord_transform<view_transform,clipped_geometry_type>;
|
||||
|
||||
agg::rendering_buffer buf(current_buffer_->raw_data(), current_buffer_->width(),
|
||||
current_buffer_->height(), current_buffer_->width() * 4);
|
||||
|
@ -159,7 +159,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
|
||||
vertex_converter<box2d<double>, rasterizer, polygon_pattern_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)
|
||||
|
|
|
@ -51,7 +51,7 @@ void agg_renderer<T0,T1>::process(polygon_symbolizer const& sym,
|
|||
{
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
|
||||
using vertex_converter_type = vertex_converter<box2d<double>, rasterizer, polygon_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine,
|
||||
view_transform, proj_transform, agg::trans_affine,
|
||||
conv_types, feature_impl>;
|
||||
|
||||
ras_ptr->reset();
|
||||
|
|
|
@ -41,7 +41,7 @@ void cairo_renderer<T>::process(building_symbolizer const& sym,
|
|||
mapnik::feature_impl & feature,
|
||||
proj_transform const& prj_trans)
|
||||
{
|
||||
using path_type = coord_transform<CoordTransform,geometry_type>;
|
||||
using path_type = coord_transform<view_transform,geometry_type>;
|
||||
cairo_save_restore guard(context_);
|
||||
composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature, common_.vars_, src_over);
|
||||
mapnik::color fill = get<mapnik::color>(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128));
|
||||
|
|
|
@ -112,7 +112,7 @@ void cairo_renderer<T>::process(line_pattern_symbolizer const& sym,
|
|||
using rasterizer_type = line_pattern_rasterizer<cairo_context>;
|
||||
rasterizer_type ras(context_, *pattern, width, height);
|
||||
vertex_converter<box2d<double>, rasterizer_type, line_pattern_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_);
|
||||
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
|
|
|
@ -85,7 +85,7 @@ void cairo_renderer<T>::process(line_symbolizer const& sym,
|
|||
clipping_extent.pad(padding);
|
||||
}
|
||||
vertex_converter<box2d<double>, cairo_context, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
|
|
|
@ -70,7 +70,7 @@ void cairo_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
|||
if (feature.num_geometries() > 0)
|
||||
{
|
||||
using clipped_geometry_type = agg::conv_clip_polygon<geometry_type>;
|
||||
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
|
||||
using path_type = coord_transform<view_transform,clipped_geometry_type>;
|
||||
clipped_geometry_type clipped(feature.get_geometry(0));
|
||||
clipped.clip_box(clip_box.minx(), clip_box.miny(),
|
||||
clip_box.maxx(), clip_box.maxy());
|
||||
|
@ -104,7 +104,7 @@ void cairo_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
|||
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
|
||||
vertex_converter<box2d<double>, cairo_context, polygon_pattern_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clip_box, context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)
|
||||
|
|
|
@ -40,7 +40,7 @@ void cairo_renderer<T>::process(polygon_symbolizer const& sym,
|
|||
{
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
|
||||
using vertex_converter_type = vertex_converter<box2d<double>, cairo_context, polygon_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine,
|
||||
view_transform, proj_transform, agg::trans_affine,
|
||||
conv_types, feature_impl>;
|
||||
|
||||
cairo_save_restore guard(context_);
|
||||
|
|
|
@ -57,7 +57,7 @@ void grid_renderer<T>::process(building_symbolizer const& sym,
|
|||
using pixfmt_type = typename grid_renderer_base_type::pixfmt_type;
|
||||
using color_type = typename grid_renderer_base_type::pixfmt_type::color_type;
|
||||
using renderer_type = agg::renderer_scanline_bin_solid<grid_renderer_base_type>;
|
||||
using path_type = coord_transform<CoordTransform,geometry_type>;
|
||||
using path_type = coord_transform<view_transform,geometry_type>;
|
||||
agg::scanline_bin sl;
|
||||
|
||||
grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_);
|
||||
|
|
|
@ -120,7 +120,7 @@ void grid_renderer<T>::process(line_pattern_symbolizer const& sym,
|
|||
put<value_double>(line, keys::smooth, value_double(smooth));
|
||||
|
||||
vertex_converter<box2d<double>, grid_rasterizer, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
converter.set<transform_tag>(); // always transform
|
||||
|
|
|
@ -92,7 +92,7 @@ void grid_renderer<T>::process(line_symbolizer const& sym,
|
|||
}
|
||||
|
||||
vertex_converter<box2d<double>, grid_rasterizer, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
if (clip) converter.set<clip_line_tag>(); // optional clip (default: true)
|
||||
converter.set<transform_tag>(); // always transform
|
||||
|
|
|
@ -79,7 +79,7 @@ void grid_renderer<T>::process(polygon_pattern_symbolizer const& sym,
|
|||
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,smooth_tag>;
|
||||
vertex_converter<box2d<double>, grid_rasterizer, polygon_pattern_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_);
|
||||
|
||||
if (prj_trans.equal() && clip) converter.set<clip_poly_tag>(); //optional clip (default: true)
|
||||
|
|
|
@ -55,7 +55,7 @@ void grid_renderer<T>::process(polygon_symbolizer const& sym,
|
|||
using color_type = typename grid_renderer_base_type::pixfmt_type::color_type;
|
||||
using conv_types = boost::mpl::vector<clip_poly_tag,transform_tag,affine_transform_tag,simplify_tag,smooth_tag>;
|
||||
using vertex_converter_type = vertex_converter<box2d<double>, grid_rasterizer, polygon_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine,
|
||||
view_transform, proj_transform, agg::trans_affine,
|
||||
conv_types, feature_impl>;
|
||||
|
||||
ras_ptr->reset();
|
||||
|
|
|
@ -42,7 +42,7 @@ group_symbolizer_helper::group_symbolizer_helper(
|
|||
attributes const& vars,
|
||||
const proj_transform &prj_trans,
|
||||
unsigned width, unsigned height, double scale_factor,
|
||||
const CoordTransform &t, DetectorType &detector,
|
||||
const view_transform &t, DetectorType &detector,
|
||||
const box2d<double> &query_extent)
|
||||
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
|
||||
detector_(detector)
|
||||
|
@ -66,7 +66,7 @@ pixel_position_list const& group_symbolizer_helper::get()
|
|||
if (clipped_)
|
||||
{
|
||||
using clipped_geometry_type = agg::conv_clip_polyline<geometry_type>;
|
||||
using path_type = coord_transform<CoordTransform,clipped_geometry_type>;
|
||||
using path_type = coord_transform<view_transform,clipped_geometry_type>;
|
||||
|
||||
clipped_geometry_type clipped(*geom);
|
||||
clipped.clip_box(query_extent_.minx(), query_extent_.miny(),
|
||||
|
@ -76,7 +76,7 @@ pixel_position_list const& group_symbolizer_helper::get()
|
|||
}
|
||||
else
|
||||
{
|
||||
using path_type = coord_transform<CoordTransform,geometry_type>;
|
||||
using path_type = coord_transform<view_transform,geometry_type>;
|
||||
path_type path(t_, *geom, prj_trans_);
|
||||
find_line_placements(path);
|
||||
}
|
||||
|
|
|
@ -612,9 +612,9 @@ double Map::scale_denominator() const
|
|||
return mapnik::scale_denominator( scale(), map_proj.is_geographic());
|
||||
}
|
||||
|
||||
CoordTransform Map::view_transform() const
|
||||
view_transform Map::transform() const
|
||||
{
|
||||
return CoordTransform(width_,height_,current_extent_);
|
||||
return view_transform(width_,height_,current_extent_);
|
||||
}
|
||||
|
||||
featureset_ptr Map::query_point(unsigned index, double x, double y) const
|
||||
|
@ -677,7 +677,7 @@ featureset_ptr Map::query_point(unsigned index, double x, double y) const
|
|||
|
||||
featureset_ptr Map::query_map_point(unsigned index, double x, double y) const
|
||||
{
|
||||
CoordTransform tr = view_transform();
|
||||
view_transform tr = transform();
|
||||
tr.backward(&x,&y);
|
||||
return query_point(index,x,y);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace mapnik {
|
|||
|
||||
renderer_common::renderer_common(unsigned width, unsigned height, double scale_factor,
|
||||
attributes const& vars,
|
||||
CoordTransform && t,
|
||||
view_transform && t,
|
||||
std::shared_ptr<label_collision_detector4> detector)
|
||||
: width_(width),
|
||||
height_(height),
|
||||
|
@ -48,9 +48,9 @@ renderer_common::renderer_common(Map const &m, attributes const& vars, unsigned
|
|||
unsigned width, unsigned height, double scale_factor)
|
||||
: renderer_common(width, height, scale_factor,
|
||||
vars,
|
||||
CoordTransform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
|
||||
view_transform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
|
||||
std::make_shared<label_collision_detector4>(
|
||||
box2d<double>(-m.buffer_size(), -m.buffer_size(),
|
||||
box2d<double>(-m.buffer_size(), -m.buffer_size(),
|
||||
m.width() + m.buffer_size() ,m.height() + m.buffer_size())))
|
||||
{}
|
||||
|
||||
|
@ -59,7 +59,7 @@ renderer_common::renderer_common(Map const &m, attributes const& vars, unsigned
|
|||
std::shared_ptr<label_collision_detector4> detector)
|
||||
: renderer_common(width, height, scale_factor,
|
||||
vars,
|
||||
CoordTransform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
|
||||
view_transform(m.width(),m.height(),m.get_current_extent(),offset_x,offset_y),
|
||||
detector)
|
||||
{}
|
||||
|
||||
|
@ -67,9 +67,9 @@ renderer_common::renderer_common(request const &req, attributes const& vars, uns
|
|||
unsigned width, unsigned height, double scale_factor)
|
||||
: renderer_common(width, height, scale_factor,
|
||||
vars,
|
||||
CoordTransform(req.width(),req.height(),req.extent(),offset_x,offset_y),
|
||||
view_transform(req.width(),req.height(),req.extent(),offset_x,offset_y),
|
||||
std::make_shared<label_collision_detector4>(
|
||||
box2d<double>(-req.buffer_size(), -req.buffer_size(),
|
||||
box2d<double>(-req.buffer_size(), -req.buffer_size(),
|
||||
req.width() + req.buffer_size() ,req.height() + req.buffer_size())))
|
||||
{}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ bool svg_renderer<OutputIterator>::process(rule::symbolizers const& syms,
|
|||
proj_transform const& prj_trans)
|
||||
{
|
||||
// svg renderer supports processing of multiple symbolizers.
|
||||
using path_type = coord_transform<CoordTransform, geometry_type>;
|
||||
using path_type = coord_transform<view_transform, geometry_type>;
|
||||
|
||||
bool process_path = false;
|
||||
// process each symbolizer to collect its (path) information.
|
||||
|
|
|
@ -45,7 +45,7 @@ base_symbolizer_helper::base_symbolizer_helper(
|
|||
attributes const& vars,
|
||||
proj_transform const& prj_trans,
|
||||
unsigned width, unsigned height, double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
box2d<double> const& query_extent)
|
||||
: sym_(sym),
|
||||
feature_(feature),
|
||||
|
@ -177,7 +177,7 @@ text_symbolizer_helper::text_symbolizer_helper(
|
|||
attributes const& vars,
|
||||
proj_transform const& prj_trans,
|
||||
unsigned width, unsigned height, double scale_factor,
|
||||
CoordTransform const& t, FaceManagerT & font_manager,
|
||||
view_transform const& t, FaceManagerT & font_manager,
|
||||
DetectorT &detector, box2d<double> const& query_extent,
|
||||
agg::trans_affine const& affine_trans)
|
||||
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
|
||||
|
@ -270,7 +270,7 @@ text_symbolizer_helper::text_symbolizer_helper(
|
|||
attributes const& vars,
|
||||
proj_transform const& prj_trans,
|
||||
unsigned width, unsigned height, double scale_factor,
|
||||
CoordTransform const& t, FaceManagerT & font_manager,
|
||||
view_transform const& t, FaceManagerT & font_manager,
|
||||
DetectorT & detector, box2d<double> const& query_extent, agg::trans_affine const& affine_trans)
|
||||
: base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent),
|
||||
finder_(feature, vars, detector, dims_, *placement_, font_manager, scale_factor),
|
||||
|
@ -340,7 +340,7 @@ template text_symbolizer_helper::text_symbolizer_helper(
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
face_manager<freetype_engine> &font_manager,
|
||||
label_collision_detector4 &detector,
|
||||
box2d<double> const& query_extent,
|
||||
|
@ -354,7 +354,7 @@ template text_symbolizer_helper::text_symbolizer_helper(
|
|||
unsigned width,
|
||||
unsigned height,
|
||||
double scale_factor,
|
||||
CoordTransform const& t,
|
||||
view_transform const& t,
|
||||
face_manager<freetype_engine> &font_manager,
|
||||
label_collision_detector4 &detector,
|
||||
box2d<double> const& query_extent,
|
||||
|
|
|
@ -53,9 +53,9 @@ void reproject_and_scale_raster(raster & target, raster const& source,
|
|||
unsigned mesh_size,
|
||||
scaling_method_e scaling_method)
|
||||
{
|
||||
CoordTransform ts(source.data_.width(), source.data_.height(),
|
||||
view_transform ts(source.data_.width(), source.data_.height(),
|
||||
source.ext_);
|
||||
CoordTransform tt(target.data_.width(), target.data_.height(),
|
||||
view_transform tt(target.data_.width(), target.data_.height(),
|
||||
target.ext_, offset_x, offset_y);
|
||||
|
||||
unsigned mesh_nx = std::ceil(source.data_.width()/double(mesh_size) + 1);
|
||||
|
|
|
@ -56,7 +56,7 @@ boost::optional<std::string> linestring_bbox_clipping(mapnik::box2d<double> bbox
|
|||
projection dst(MAPNIK_LONGLAT_PROJ);
|
||||
proj_transform prj_trans(src,dst);
|
||||
line_symbolizer sym;
|
||||
CoordTransform t(bbox.width(),bbox.height(), bbox);
|
||||
view_transform t(bbox.width(),bbox.height(), bbox);
|
||||
mapnik::geometry_container output_paths;
|
||||
output_geometry_backend backend(output_paths, mapnik::geometry_type::types::LineString);
|
||||
|
||||
|
@ -64,7 +64,7 @@ boost::optional<std::string> linestring_bbox_clipping(mapnik::box2d<double> bbox
|
|||
mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();
|
||||
mapnik::feature_impl f(ctx,0);
|
||||
vertex_converter<box2d<double>, output_geometry_backend, line_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(bbox, backend, sym, t, prj_trans, tr, f, attributes(), 1.0);
|
||||
|
||||
converter.set<clip_line_tag>();
|
||||
|
@ -100,7 +100,7 @@ boost::optional<std::string> polygon_bbox_clipping(mapnik::box2d<double> bbox,
|
|||
projection dst(MAPNIK_LONGLAT_PROJ);
|
||||
proj_transform prj_trans(src,dst);
|
||||
polygon_symbolizer sym;
|
||||
CoordTransform t(bbox.width(),bbox.height(), bbox);
|
||||
view_transform t(bbox.width(),bbox.height(), bbox);
|
||||
mapnik::geometry_container output_paths;
|
||||
output_geometry_backend backend(output_paths, mapnik::geometry_type::types::Polygon);
|
||||
|
||||
|
@ -108,7 +108,7 @@ boost::optional<std::string> polygon_bbox_clipping(mapnik::box2d<double> bbox,
|
|||
mapnik::context_ptr ctx = std::make_shared<mapnik::context_type>();
|
||||
mapnik::feature_impl f(ctx,0);
|
||||
vertex_converter<box2d<double>, output_geometry_backend, polygon_symbolizer,
|
||||
CoordTransform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
view_transform, proj_transform, agg::trans_affine, conv_types, feature_impl>
|
||||
converter(bbox, backend, sym, t, prj_trans, tr, f, attributes(), 1.0);
|
||||
|
||||
converter.set<clip_poly_tag>();
|
||||
|
|
Loading…
Reference in a new issue