+ add transformation matrix

This commit is contained in:
Artem Pavlenko 2010-06-03 12:35:02 +00:00
parent 816ebd2017
commit b6414778d6
2 changed files with 30 additions and 5 deletions

View file

@ -28,20 +28,25 @@
#include <mapnik/config.hpp>
#include <mapnik/path_expression_grammar.hpp>
// stl
#include <string>
// boost
#include <boost/array.hpp>
namespace mapnik
{
typedef boost::array<double,6> 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_;
};
}

View file

@ -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