From b6414778d61d851d999521e5adfffc7cfcb94ab7 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Thu, 3 Jun 2010 12:35:02 +0000 Subject: [PATCH] + add transformation matrix --- include/mapnik/symbolizer.hpp | 11 ++++++++--- src/symbolizer.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 365fce895..459226977 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -28,20 +28,25 @@ #include #include -// stl -#include +// boost +#include namespace mapnik { +typedef boost::array transform_type; + class MAPNIK_DECL symbolizer_with_image { public: path_expression_ptr get_filename() const; void set_filename(path_expression_ptr filename); + void set_transform(transform_type const& ); + transform_type const& get_transform() const; protected: symbolizer_with_image(path_expression_ptr filename); symbolizer_with_image(symbolizer_with_image const& rhs); - path_expression_ptr image_filename_; + path_expression_ptr image_filename_; + transform_type matrix_; }; } diff --git a/src/symbolizer.cpp b/src/symbolizer.cpp index 2b4d2feb0..59cd8dba6 100644 --- a/src/symbolizer.cpp +++ b/src/symbolizer.cpp @@ -27,10 +27,20 @@ namespace mapnik { symbolizer_with_image::symbolizer_with_image(path_expression_ptr file) - : image_filename_( file ) {} + : image_filename_( file ) + +{ + matrix_[0] = 1.0; + matrix_[1] = 0.0; + matrix_[2] = 0.0; + matrix_[3] = 1.0; + matrix_[4] = 0.0; + matrix_[5] = 0.0; +} symbolizer_with_image::symbolizer_with_image( symbolizer_with_image const& rhs) - : image_filename_(rhs.image_filename_) {} + : image_filename_(rhs.image_filename_), + matrix_(rhs.matrix_) {} path_expression_ptr symbolizer_with_image::get_filename() const @@ -43,6 +53,16 @@ void symbolizer_with_image::set_filename(path_expression_ptr image_filename) image_filename_ = image_filename; } +void symbolizer_with_image::set_transform(transform_type const& matrix) +{ + matrix_ = matrix; +} + +transform_type const& symbolizer_with_image::get_transform() const +{ + return matrix_; +} + } // end of namespace mapnik