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