Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
695 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/***************************************************************************** | ||
* | ||
* This file is part of Mapnik (c++ mapping toolkit) | ||
* | ||
* Copyright (C) 2012 Artem Pavlenko | ||
* | ||
* 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 | ||
* | ||
*****************************************************************************/ | ||
#ifndef FORMATING_BASE_HPP | ||
#define FORMATING_BASE_HPP | ||
|
||
// mapnik | ||
#include <mapnik/feature.hpp> | ||
#include <mapnik/expression.hpp> | ||
|
||
// stl | ||
#include <set> | ||
|
||
// boost | ||
#include <boost/property_tree/ptree.hpp> | ||
|
||
namespace mapnik { | ||
|
||
typedef std::set<expression_ptr> expression_set; | ||
class processed_text; | ||
struct char_properties; | ||
|
||
namespace formating { | ||
|
||
class node; | ||
typedef boost::shared_ptr<node> node_ptr; | ||
|
||
class node | ||
{ | ||
public: | ||
virtual ~node() {} | ||
virtual void to_xml(boost::property_tree::ptree &xml) const; | ||
static node_ptr from_xml(boost::property_tree::ptree const& xml); | ||
virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const = 0; | ||
virtual void add_expressions(expression_set &output) const; | ||
}; | ||
} //ns formating | ||
} //ns mapnik | ||
#endif // FORMATING_BASE_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/***************************************************************************** | ||
* | ||
* This file is part of Mapnik (c++ mapping toolkit) | ||
* | ||
* Copyright (C) 2012 Artem Pavlenko | ||
* | ||
* 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 | ||
* | ||
*****************************************************************************/ | ||
|
||
#ifndef FORMAT_HPP | ||
#define FORMAT_HPP | ||
|
||
#include <mapnik/formating/base.hpp> | ||
#include <mapnik/text_properties.hpp> | ||
|
||
namespace mapnik { | ||
namespace formating { | ||
class format_node: public node { | ||
public: | ||
void to_xml(boost::property_tree::ptree &xml) const; | ||
static node_ptr from_xml(boost::property_tree::ptree const& xml); | ||
virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const; | ||
virtual void add_expressions(expression_set &output) const; | ||
|
||
void set_child(node_ptr child); | ||
node_ptr get_child() const; | ||
|
||
boost::optional<std::string> face_name; | ||
boost::optional<unsigned> text_size; | ||
boost::optional<unsigned> character_spacing; | ||
boost::optional<unsigned> line_spacing; | ||
boost::optional<double> text_opacity; | ||
boost::optional<bool> wrap_before; | ||
boost::optional<unsigned> wrap_char; | ||
boost::optional<text_transform_e> text_transform; | ||
boost::optional<color> fill; | ||
boost::optional<color> halo_fill; | ||
boost::optional<double> halo_radius; | ||
|
||
private: | ||
node_ptr child_; | ||
}; | ||
} //ns formating | ||
} //ns mapnik | ||
|
||
#endif // FORMAT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/***************************************************************************** | ||
* | ||
* This file is part of Mapnik (c++ mapping toolkit) | ||
* | ||
* Copyright (C) 2012 Artem Pavlenko | ||
* | ||
* 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 | ||
* | ||
*****************************************************************************/ | ||
#ifndef LIST_HPP | ||
#define LIST_HPP | ||
|
||
#include <mapnik/formating/base.hpp> | ||
|
||
namespace mapnik { | ||
namespace formating { | ||
class list_node: public node { | ||
public: | ||
list_node() : node(), children_() {} | ||
virtual void to_xml(boost::property_tree::ptree &xml) const; | ||
virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const; | ||
virtual void add_expressions(expression_set &output) const; | ||
|
||
void push_back(node_ptr n); | ||
void set_children(std::vector<node_ptr> const& children); | ||
std::vector<node_ptr> const& get_children() const; | ||
void clear(); | ||
private: | ||
std::vector<node_ptr> children_; | ||
}; | ||
} //ns formating | ||
} //ns mapnik | ||
|
||
#endif // LIST_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/***************************************************************************** | ||
* | ||
* This file is part of Mapnik (c++ mapping toolkit) | ||
* | ||
* Copyright (C) 2012 Artem Pavlenko | ||
* | ||
* 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 | ||
* | ||
*****************************************************************************/ | ||
#ifndef TEXT_HPP | ||
#define TEXT_HPP | ||
|
||
#include <mapnik/formating/base.hpp> | ||
|
||
namespace mapnik { | ||
namespace formating { | ||
class text_node: public node { | ||
public: | ||
text_node(expression_ptr text): node(), text_(text) {} | ||
text_node(std::string text): node(), text_(parse_expression(text)) {} | ||
void to_xml(boost::property_tree::ptree &xml) const; | ||
static node_ptr from_xml(boost::property_tree::ptree const& xml); | ||
virtual void apply(char_properties const& p, Feature const& feature, processed_text &output) const; | ||
virtual void add_expressions(expression_set &output) const; | ||
|
||
void set_text(expression_ptr text); | ||
expression_ptr get_text() const; | ||
private: | ||
expression_ptr text_; | ||
}; | ||
} //ns formating | ||
} //ns mapnik | ||
|
||
#endif // TEXT_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.