create path_expression.hpp and leverage to simplify and speed up compiles

This commit is contained in:
Dane Springmeyer 2013-01-03 20:00:23 -08:00
parent bf649176ae
commit 618e43af06
11 changed files with 80 additions and 13 deletions

View file

@ -34,7 +34,8 @@
// mapnik
#include <mapnik/shield_symbolizer.hpp>
#include <mapnik/image_util.hpp>
#include <mapnik/path_expression_grammar.hpp>
#include <mapnik/parse_path.hpp>
#include <mapnik/path_expression.hpp>
#include "mapnik_svg.hpp"
using mapnik::color;

View file

@ -24,9 +24,25 @@
#define MAPNIK_ATTRIBUTE_COLLECTOR_HPP
// mapnik
#include <mapnik/rule.hpp>
#include <mapnik/transform_processor.hpp>
#include <mapnik/noncopyable.hpp>
#include <mapnik/attribute.hpp>
#include <mapnik/building_symbolizer.hpp>
#include <mapnik/line_symbolizer.hpp>
#include <mapnik/line_pattern_symbolizer.hpp>
#include <mapnik/polygon_symbolizer.hpp>
#include <mapnik/polygon_pattern_symbolizer.hpp>
#include <mapnik/point_symbolizer.hpp>
#include <mapnik/raster_symbolizer.hpp>
#include <mapnik/shield_symbolizer.hpp>
#include <mapnik/text_symbolizer.hpp>
#include <mapnik/markers_symbolizer.hpp>
#include <mapnik/expression.hpp> // for expression_ptr, etc
#include <mapnik/expression_node.hpp>
#include <mapnik/parse_path.hpp> // for path_processor_type
#include <mapnik/path_expression.hpp> // for path_expression_ptr
#include <mapnik/text_placements/base.hpp> // for text_placements
#include <mapnik/transform_expression.hpp>
// boost
#include <boost/variant.hpp>

View file

@ -24,7 +24,6 @@
#define MAPNIK_CTRANS_HPP
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/box2d.hpp>
#include <mapnik/vertex.hpp>
#include <mapnik/proj_transform.hpp>

View file

@ -25,6 +25,7 @@
// mapnik
#include <mapnik/value.hpp>
#include <mapnik/unicode.hpp>
#include <mapnik/expression_node.hpp>
// boost

View file

@ -24,7 +24,7 @@
#define MAPNIK_FEATURE_STYLE_PROCESSOR_HPP
// mapnik
#include <mapnik/memory_datasource.hpp>
#include <mapnik/datasource.hpp> // for featureset_ptr
// stl
#include <set>

View file

@ -28,6 +28,7 @@
#include <mapnik/attribute.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/value.hpp>
#include <mapnik/path_expression.hpp>
#include <mapnik/path_expression_grammar.hpp>
// boost
@ -41,8 +42,6 @@
namespace mapnik {
typedef boost::shared_ptr<path_expression> path_expression_ptr;
MAPNIK_DECL path_expression_ptr parse_path(std::string const & str);
MAPNIK_DECL path_expression_ptr parse_path(std::string const & str,
path_expression_grammar<std::string::const_iterator> const& g);
@ -140,7 +139,7 @@ struct path_processor
}
};
typedef mapnik::path_processor<Feature> path_processor_type;
typedef mapnik::path_processor<feature_impl> path_processor_type;
}

View file

@ -0,0 +1,45 @@
/*****************************************************************************
*
* This file is part of Mapnik (c++ mapping toolkit)
*
* Copyright (C) 2011 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 MAPNIK_PATH_EXPRESSION_HPP
#define MAPNIK_PATH_EXPRESSION_HPP
// boost
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
// stl
#include <string>
#include <vector>
namespace mapnik
{
struct attribute;
typedef boost::variant<std::string, attribute> path_component;
typedef std::vector<path_component> path_expression;
typedef boost::shared_ptr<path_expression> path_expression_ptr;
}
#endif // MAPNIK_PATH_EXPRESSION_HPP

View file

@ -24,7 +24,6 @@
#define MAPNIK_SVG_RENDERER_AGG_HPP
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/svg/svg_path_attributes.hpp>
#include <mapnik/gradient.hpp>
#include <mapnik/box2d.hpp>

View file

@ -25,7 +25,7 @@
// mapnik
#include <mapnik/config.hpp>
#include <mapnik/parse_path.hpp>
#include <mapnik/path_expression.hpp>
#include <mapnik/image_compositing.hpp>
#include <mapnik/transform_expression.hpp>
#include <mapnik/simplify.hpp>
@ -39,10 +39,11 @@ namespace mapnik
typedef transform_list_ptr transform_type;
MAPNIK_DECL void evaluate_transform(agg::trans_affine& tr, Feature const& feature,
transform_type const& trans_expr);
class Map;
class feature_impl;
MAPNIK_DECL void evaluate_transform(agg::trans_affine& tr, feature_impl const& feature,
transform_type const& trans_expr);
class MAPNIK_DECL symbolizer_base
{
@ -79,7 +80,7 @@ public:
void set_filename(path_expression_ptr const& filename);
void set_opacity(float opacity);
float get_opacity() const;
void set_image_transform(transform_type const& tr);
void set_image_transform(transform_type const& tr);
transform_type const& get_image_transform() const;
std::string get_image_transform_string() const;
protected:

View file

@ -21,10 +21,14 @@
*****************************************************************************/
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/parse_path.hpp>
#include <mapnik/symbolizer_helpers.hpp>
#include <mapnik/label_collision_detector.hpp>
#include <mapnik/placement_finder.hpp>
#include <mapnik/geom_util.hpp>
#include <mapnik/parse_path.hpp>
// agg
#include "agg_conv_clip_polyline.h"

View file

@ -20,6 +20,8 @@
*
*****************************************************************************/
// mapnik
#include <mapnik/debug.hpp>
#include <mapnik/feature.hpp>
#include <mapnik/text_properties.hpp>
#include <mapnik/processed_text.hpp>
#include <mapnik/ptree_helpers.hpp>