2006-03-31 10:32:02 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* This file is part of Mapnik (c++ mapping toolkit)
|
2006-02-25 11:03:30 +00:00
|
|
|
*
|
2006-03-31 10:32:02 +00:00
|
|
|
* Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
|
2006-02-25 11:03:30 +00:00
|
|
|
*
|
2006-03-31 10:32:02 +00: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,
|
2006-02-25 11:03:30 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2006-03-31 10:32:02 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2006-02-25 11:03:30 +00:00
|
|
|
*
|
2006-03-31 10:32:02 +00:00
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2006-02-25 11:03:30 +00:00
|
|
|
//$Id$
|
|
|
|
|
|
|
|
#include <boost/python.hpp>
|
2006-10-04 11:22:18 +00:00
|
|
|
|
|
|
|
#include <mapnik/text_symbolizer.hpp>
|
2006-02-25 11:03:30 +00:00
|
|
|
|
|
|
|
void export_text_symbolizer()
|
|
|
|
{
|
|
|
|
using namespace boost::python;
|
2006-09-11 09:48:27 +00:00
|
|
|
|
|
|
|
using mapnik::text_symbolizer;
|
|
|
|
using mapnik::Color;
|
|
|
|
|
2007-09-25 18:47:12 +00:00
|
|
|
enum_<mapnik::label_placement_enum>("label_placement")
|
|
|
|
.value("LINE_PLACEMENT",mapnik::LINE_PLACEMENT)
|
|
|
|
.value("POINT_PLACEMENT",mapnik::POINT_PLACEMENT)
|
2006-10-17 14:12:53 +00:00
|
|
|
;
|
2006-10-27 17:29:39 +00:00
|
|
|
|
2006-02-25 11:03:30 +00:00
|
|
|
class_<text_symbolizer>("TextSymbolizer",
|
2006-10-19 17:11:45 +00:00
|
|
|
init<std::string const&,std::string const&, unsigned,Color const&>())
|
2006-03-22 00:11:01 +00:00
|
|
|
.add_property("halo_fill",make_function(
|
2006-09-11 09:48:27 +00:00
|
|
|
&text_symbolizer::get_halo_fill,
|
|
|
|
return_value_policy<copy_const_reference>()),
|
2006-03-22 00:11:01 +00:00
|
|
|
&text_symbolizer::set_halo_fill)
|
2006-11-04 10:38:24 +00:00
|
|
|
.add_property("halo_radius",
|
|
|
|
&text_symbolizer::get_halo_radius,
|
|
|
|
&text_symbolizer::set_halo_radius)
|
2006-10-27 17:29:39 +00:00
|
|
|
.add_property("wrap_width",
|
|
|
|
&text_symbolizer::get_wrap_width,
|
|
|
|
&text_symbolizer::set_wrap_width)
|
|
|
|
.add_property("text_ratio",
|
|
|
|
&text_symbolizer::get_text_ratio,
|
|
|
|
&text_symbolizer::set_text_ratio)
|
2006-11-01 23:17:05 +00:00
|
|
|
.add_property("label_spacing",
|
|
|
|
&text_symbolizer::get_label_spacing,
|
|
|
|
&text_symbolizer::set_label_spacing)
|
2006-11-29 12:27:29 +00:00
|
|
|
.add_property("label_position_tolerance",
|
|
|
|
&text_symbolizer::get_label_position_tolerance,
|
|
|
|
&text_symbolizer::set_label_position_tolerance)
|
|
|
|
.add_property("force_odd_labels",
|
|
|
|
&text_symbolizer::get_force_odd_labels,
|
|
|
|
&text_symbolizer::set_force_odd_labels)
|
2006-11-04 10:38:24 +00:00
|
|
|
.add_property("max_char_angle_delta",
|
|
|
|
&text_symbolizer::get_max_char_angle_delta,
|
|
|
|
&text_symbolizer::set_max_char_angle_delta)
|
2006-11-17 14:07:41 +00:00
|
|
|
.add_property("avoid_edges",
|
|
|
|
&text_symbolizer::get_avoid_edges,
|
|
|
|
&text_symbolizer::set_avoid_edges)
|
2007-07-02 13:39:08 +00:00
|
|
|
.add_property("minimum_distance",
|
|
|
|
&text_symbolizer::get_minimum_distance,
|
|
|
|
&text_symbolizer::set_minimum_distance)
|
2007-01-29 22:29:06 +00:00
|
|
|
|
2007-02-05 11:53:00 +00:00
|
|
|
.add_property("label_placement",
|
2007-01-29 22:29:06 +00:00
|
|
|
&text_symbolizer::get_label_placement,
|
|
|
|
&text_symbolizer::set_label_placement,
|
|
|
|
"Set/get the placement of the label")
|
2006-02-25 11:03:30 +00:00
|
|
|
;
|
|
|
|
}
|