File: mapnik_polygon_symbolizer.cpp

package info (click to toggle)
mapnik 2.2.0%2Bds1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,288 kB
  • ctags: 18,382
  • sloc: cpp: 115,128; python: 9,298; xml: 5,692; ansic: 3,726; makefile: 160; sh: 159; lisp: 13
file content (76 lines) | stat: -rw-r--r-- 3,186 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*****************************************************************************
 *
 * This file is part of Mapnik (c++ mapping toolkit)
 *
 * Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon
 *
 * 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
 *
 *****************************************************************************/

#include <boost/python.hpp>
#include <mapnik/polygon_symbolizer.hpp>
#include <mapnik/symbolizer_hash.hpp>

using namespace mapnik;
using mapnik::polygon_symbolizer;
using mapnik::color;

std::size_t polygon_symbolizer_hash(polygon_symbolizer const& sym)
{
    return symbolizer_hash::value(sym);
}

void export_polygon_symbolizer()
{
    using namespace boost::python;

    class_<polygon_symbolizer>("PolygonSymbolizer",
                               init<>("Default PolygonSymbolizer - solid fill grey"))
        .def(init<color const&>("TODO"))
        .add_property("fill",make_function
                      (&polygon_symbolizer::get_fill,
                       return_value_policy<copy_const_reference>()),
                      &polygon_symbolizer::set_fill)
        .add_property("fill_opacity",
                      &polygon_symbolizer::get_opacity,
                      &polygon_symbolizer::set_opacity)
        .add_property("gamma",
                      &polygon_symbolizer::get_gamma,
                      &polygon_symbolizer::set_gamma)
        .add_property("gamma_method",
                      &polygon_symbolizer::get_gamma_method,
                      &polygon_symbolizer::set_gamma_method,
                      "gamma correction method")
        .add_property("comp_op",
                      &polygon_symbolizer::comp_op,
                      &polygon_symbolizer::set_comp_op,
                      "Set/get the polygon comp-op")
        .add_property("clip",
                      &polygon_symbolizer::clip,
                      &polygon_symbolizer::set_clip,
                      "Set/get the polygon geometry's clipping status")
        .add_property("smooth",
                      &polygon_symbolizer::smooth,
                      &polygon_symbolizer::set_smooth,
                      "Set/get the polygon geometry's smooth value")
        .add_property("simplify_tolerance",
                      &polygon_symbolizer::simplify_tolerance,
                      &polygon_symbolizer::set_simplify_tolerance,
                      "simplfication tolerance measure")
        .def("__hash__", polygon_symbolizer_hash)
        ;

}