2007-09-25 20:47:12 +02:00
|
|
|
/*****************************************************************************
|
2012-02-02 02:53:35 +01:00
|
|
|
*
|
2007-09-25 20:47:12 +02:00
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
|
|
|
*
|
2011-10-23 15:04:25 +02:00
|
|
|
* Copyright (C) 2011 Artem Pavlenko
|
2007-09-25 20:47:12 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
2009-12-16 21:02:06 +01:00
|
|
|
//mapnik
|
2007-09-25 20:47:12 +02:00
|
|
|
#include <mapnik/symbolizer.hpp>
|
2013-03-14 06:32:11 +01:00
|
|
|
#include <mapnik/attribute.hpp>
|
|
|
|
#include <mapnik/feature.hpp>
|
2012-06-07 17:06:45 +02:00
|
|
|
#include <mapnik/transform_processor.hpp>
|
2007-09-25 20:47:12 +02:00
|
|
|
|
|
|
|
namespace mapnik {
|
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// START FIXME - move to its own compilation unit
|
2013-01-04 08:56:11 +01:00
|
|
|
void evaluate_transform(agg::trans_affine& tr, feature_impl const& feature,
|
2014-02-27 20:55:58 +01:00
|
|
|
transform_list_ptr const& trans_expr, double scale_factor)
|
2012-05-27 23:50:09 +02:00
|
|
|
{
|
|
|
|
if (trans_expr)
|
|
|
|
{
|
2012-09-26 15:24:26 +02:00
|
|
|
#ifdef MAPNIK_LOG
|
|
|
|
MAPNIK_LOG_DEBUG(transform) << "transform: evaluate "
|
|
|
|
<< transform_processor_type::to_string(*trans_expr);
|
|
|
|
#endif
|
2014-02-27 20:55:58 +01:00
|
|
|
transform_processor_type::evaluate(tr, feature, *trans_expr, scale_factor);
|
2012-05-27 23:50:09 +02:00
|
|
|
}
|
|
|
|
}
|
2013-11-28 07:50:15 +01:00
|
|
|
// END FIXME
|
2012-05-27 23:50:09 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// stroke
|
|
|
|
static const char * line_cap_strings[] = {
|
|
|
|
"butt",
|
|
|
|
"square",
|
|
|
|
"round",
|
|
|
|
""
|
|
|
|
};
|
2012-05-10 13:05:40 +02:00
|
|
|
|
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( line_cap_e, line_cap_strings )
|
2012-04-05 16:59:11 +02:00
|
|
|
|
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
static const char * line_join_strings[] = {
|
|
|
|
"miter",
|
|
|
|
"miter_revert",
|
|
|
|
"round",
|
|
|
|
"bevel",
|
|
|
|
""
|
|
|
|
};
|
2012-04-18 10:42:19 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( line_join_e, line_join_strings )
|
2012-04-18 10:42:19 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// point symbolizer
|
|
|
|
static const char * point_placement_strings[] = {
|
|
|
|
"centroid",
|
|
|
|
"interior",
|
|
|
|
""
|
|
|
|
};
|
2012-04-18 10:42:19 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( point_placement_e, point_placement_strings )
|
2012-04-24 12:10:54 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// line symbolizer
|
|
|
|
static const char * line_rasterizer_strings[] = {
|
|
|
|
"full",
|
|
|
|
"fast",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
IMPLEMENT_ENUM( line_rasterizer_e, line_rasterizer_strings )
|
2012-04-24 12:10:54 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// markers symbolizer
|
|
|
|
static const char * marker_placement_strings[] = {
|
|
|
|
"point",
|
|
|
|
"interior",
|
|
|
|
"line",
|
|
|
|
""
|
|
|
|
};
|
2012-08-16 16:53:38 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( marker_placement_e, marker_placement_strings )
|
2012-08-16 16:53:38 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
static const char * marker_multi_policy_strings[] = {
|
|
|
|
"each",
|
|
|
|
"whole",
|
|
|
|
"largest",
|
|
|
|
""
|
|
|
|
};
|
2012-08-14 17:04:57 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( marker_multi_policy_e, marker_multi_policy_strings )
|
2012-08-14 17:04:57 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// debug symbolizer
|
|
|
|
static const char * debug_symbolizer_mode_strings[] = {
|
|
|
|
"collision",
|
|
|
|
"vertex",
|
|
|
|
""
|
|
|
|
};
|
2012-05-07 17:08:16 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( debug_symbolizer_mode_e, debug_symbolizer_mode_strings )
|
2012-04-24 12:10:54 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// polygon pattern symbolizer
|
|
|
|
static const char * pattern_alignment_strings[] = {
|
|
|
|
"local", // feature
|
|
|
|
"global", // map
|
|
|
|
""
|
|
|
|
};
|
2012-04-05 16:59:11 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( pattern_alignment_e, pattern_alignment_strings )
|
2007-09-25 20:47:12 +02:00
|
|
|
|
2012-02-02 02:53:35 +01:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
// text
|
|
|
|
static const char * halo_rasterizer_strings[] = {
|
|
|
|
"full",
|
|
|
|
"fast",
|
|
|
|
""
|
|
|
|
};
|
2009-12-16 21:02:06 +01:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( halo_rasterizer_e, halo_rasterizer_strings )
|
2012-02-02 02:53:35 +01:00
|
|
|
|
2010-06-15 14:27:50 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
static const char * label_placement_strings[] = {
|
|
|
|
"point",
|
|
|
|
"line",
|
|
|
|
"vertex",
|
|
|
|
"interior",
|
|
|
|
""
|
|
|
|
};
|
2010-06-15 14:27:50 +02:00
|
|
|
|
2012-05-01 17:47:33 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
IMPLEMENT_ENUM( label_placement_e, label_placement_strings )
|
2012-05-01 17:47:33 +02:00
|
|
|
|
2013-11-28 07:50:15 +01:00
|
|
|
static const char * vertical_alignment_strings[] = {
|
|
|
|
"top",
|
|
|
|
"middle",
|
|
|
|
"bottom",
|
|
|
|
"auto",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_ENUM( vertical_alignment_e, vertical_alignment_strings )
|
|
|
|
|
|
|
|
static const char * horizontal_alignment_strings[] = {
|
|
|
|
"left",
|
|
|
|
"middle",
|
|
|
|
"right",
|
|
|
|
"auto",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_ENUM( horizontal_alignment_e, horizontal_alignment_strings )
|
|
|
|
|
|
|
|
static const char * justify_alignment_strings[] = {
|
|
|
|
"left",
|
|
|
|
"center", // not 'middle' in order to match CSS
|
|
|
|
"right",
|
|
|
|
"auto",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_ENUM( justify_alignment_e, justify_alignment_strings )
|
|
|
|
|
|
|
|
static const char * text_transform_strings[] = {
|
|
|
|
"none",
|
|
|
|
"uppercase",
|
|
|
|
"lowercase",
|
|
|
|
"capitalize",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_ENUM( text_transform_e, text_transform_strings )
|
|
|
|
|
|
|
|
static const char * text_upright_strings[] = {
|
|
|
|
"auto",
|
|
|
|
"left",
|
|
|
|
"right",
|
|
|
|
"left_only",
|
|
|
|
"right_only",
|
|
|
|
""
|
|
|
|
};
|
|
|
|
IMPLEMENT_ENUM(text_upright_e, text_upright_strings)
|
2012-05-01 17:47:33 +02:00
|
|
|
|
2007-09-25 20:47:12 +02:00
|
|
|
} // end of namespace mapnik
|