* create_filter moved to core lib

* modified demo/c++/rundemo.cpp to reflect the above
This commit is contained in:
Artem Pavlenko 2006-09-17 19:45:01 +00:00
parent 02d95a7ba2
commit c0fa1a6004
5 changed files with 22 additions and 23 deletions

View file

@ -28,20 +28,13 @@
#include <regex_filter.hpp>
#include <filter.hpp>
#include <filter_factory.hpp>
#include <mapnik.hpp>
using mapnik::filter;
using mapnik::filter_ptr;
using mapnik::filter_factory;
using mapnik::Feature;
namespace
{
using namespace boost::python;
filter_ptr create_filter(string const& filter_text)
{
return filter_factory<Feature>::compile(filter_text);
}
}
using mapnik::create_filter;
void export_filter()
{

View file

@ -4,17 +4,16 @@
using namespace mapnik;
// helper function
filter_ptr create_filter (std::string const& wkt)
{
filter_factory<Feature> factory;
return factory.compile(wkt);
}
int main ( int argc , char** argv)
{
if (argc != 2)
{
std::cout << "usage: ./rundemo <plugins_dir>\n";
return EXIT_SUCCESS;
}
std::cout << " running demo ... \n";
datasource_cache::instance()->register_datasources("/usr/local/lib/mapnik/input");
datasource_cache::instance()->register_datasources(argv[1]);
freetype_engine::instance()->register_font("/usr/share/fonts/bitstream-vera/Vera.ttf");
Map m(800,600);
@ -217,5 +216,5 @@ int main ( int argc , char** argv)
"- demo.png\n"
"Have a look!\n";
return 0;
return EXIT_SUCCESS;
}

View file

@ -40,8 +40,11 @@ namespace mapnik {
:abgr_(0xffffffff) {}
Color(int red,int green,int blue,int alpha=0xff)
: abgr_((alpha&0xff) << 24 | (blue&0xff) << 16 | (green&0xff) << 8 | red&0xff) {}
: abgr_((alpha&0xff) << 24 |
(blue&0xff) << 16 |
(green&0xff) << 8 |
red&0xff) {}
explicit Color(int rgba)
: abgr_(rgba) {}

View file

@ -74,11 +74,11 @@
#include "feature_layer_desc.hpp"
#include "css_color_parser.hpp"
#include "color_factory.hpp"
#include "config.hpp"
namespace mapnik
{
MAPNIK_DECL filter_ptr create_filter (std::string const& wkt);
}
#endif //MAPNIK_HPP

View file

@ -22,11 +22,15 @@
//$Id$
#include <fstream>
#include "mapnik.hpp"
namespace mapnik
{
filter_ptr create_filter (std::string const& wkt)
{
filter_factory<Feature> factory;
return factory.compile(wkt);
}
}