new geometry implementation - initial barebone framework
This commit is contained in:
parent
a2dabb370d
commit
a1f7017d45
19 changed files with 550 additions and 60 deletions
|
@ -54,14 +54,15 @@ struct geometry_type_attribute
|
|||
V value(F const& f) const
|
||||
{
|
||||
mapnik::value_integer type = 0;
|
||||
for (auto const& geom : f.paths())
|
||||
{
|
||||
if (type != 0 && geom.type() != type)
|
||||
{
|
||||
return value_integer(4); // Collection
|
||||
}
|
||||
type = geom.type();
|
||||
}
|
||||
//for (auto const& geom : f.paths())
|
||||
//{
|
||||
// if (type != 0 && geom.type() != type)
|
||||
// {
|
||||
// return value_integer(4); // Collection
|
||||
// }
|
||||
// type = geom.type();
|
||||
//}
|
||||
// FIXME
|
||||
return type;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#include <mapnik/value_types.hpp>
|
||||
#include <mapnik/value.hpp>
|
||||
#include <mapnik/box2d.hpp>
|
||||
#include <mapnik/geometry.hpp>
|
||||
#include <mapnik/geometry_container.hpp>
|
||||
#include <mapnik/geometry_impl.hpp>
|
||||
//#include <mapnik/geometry_container.hpp>
|
||||
#include <mapnik/feature_kv_iterator.hpp>
|
||||
#include <mapnik/util/noncopyable.hpp>
|
||||
|
||||
|
@ -103,9 +103,8 @@ public:
|
|||
: id_(id),
|
||||
ctx_(ctx),
|
||||
data_(ctx_->mapping_.size()),
|
||||
geom_cont_(),
|
||||
raster_()
|
||||
{}
|
||||
geom_(mapnik::util::no_init()),
|
||||
raster_() {}
|
||||
|
||||
inline mapnik::value_integer id() const { return id_;}
|
||||
|
||||
|
@ -194,49 +193,19 @@ public:
|
|||
return ctx_;
|
||||
}
|
||||
|
||||
inline geometry_container const& paths() const
|
||||
inline void set_geometry(new_geometry::geometry && geom)
|
||||
{
|
||||
return geom_cont_;
|
||||
geom_ = std::move(geom);
|
||||
}
|
||||
|
||||
inline geometry_container & paths()
|
||||
inline new_geometry::geometry const& get_geometry() const
|
||||
{
|
||||
return geom_cont_;
|
||||
}
|
||||
|
||||
inline void add_geometry(geometry_type * geom)
|
||||
{
|
||||
geom_cont_.push_back(geom);
|
||||
}
|
||||
|
||||
inline std::size_t num_geometries() const
|
||||
{
|
||||
return geom_cont_.size();
|
||||
}
|
||||
|
||||
inline geometry_type const& get_geometry(std::size_t index) const
|
||||
{
|
||||
return geom_cont_[index];
|
||||
return geom_;
|
||||
}
|
||||
|
||||
inline box2d<double> envelope() const
|
||||
{
|
||||
// TODO - cache this
|
||||
box2d<double> result;
|
||||
bool first = true;
|
||||
for (auto const& geom : geom_cont_)
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
box2d<double> box = ::mapnik::envelope(geom);
|
||||
result.init(box.minx(),box.miny(),box.maxx(),box.maxy());
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.expand_to_include(::mapnik::envelope(geom));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -287,7 +256,7 @@ private:
|
|||
mapnik::value_integer id_;
|
||||
context_ptr ctx_;
|
||||
cont_type data_;
|
||||
geometry_container geom_cont_;
|
||||
new_geometry::geometry geom_;
|
||||
raster_ptr raster_;
|
||||
};
|
||||
|
||||
|
|
471
include/mapnik/geometry_impl.hpp
Normal file
471
include/mapnik/geometry_impl.hpp
Normal file
|
@ -0,0 +1,471 @@
|
|||
/*****************************************************************************
|
||||
*
|
||||
* This file is part of Mapnik (c++ mapping toolkit)
|
||||
*
|
||||
* Copyright (C) 2015 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
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <vector>
|
||||
#include <mapnik/util/variant.hpp>
|
||||
#include <mapnik/vertex.hpp>
|
||||
#include <mapnik/util/noncopyable.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
|
||||
namespace mapnik { namespace new_geometry {
|
||||
|
||||
static const std::uint8_t geometry_bits = 7;
|
||||
|
||||
enum geometry_types : std::uint8_t
|
||||
{
|
||||
Unknown = 0x00,
|
||||
Point = 0x01,
|
||||
LineString = 0x02,
|
||||
Polygon = 0x03,
|
||||
PolygonExterior = Polygon,
|
||||
PolygonInterior = Polygon | ( 1 << geometry_bits)
|
||||
};
|
||||
|
||||
struct point
|
||||
{
|
||||
point() {}
|
||||
point(double x_, double y_)
|
||||
: x(x_),y(y_) {}
|
||||
|
||||
point(point const& other)
|
||||
: x(other.x),
|
||||
y(other.y) {}
|
||||
|
||||
point(point && other) noexcept = default;
|
||||
|
||||
point & operator=(point const& other)
|
||||
{
|
||||
if (this == &other) return *this;
|
||||
point tmp(other);
|
||||
std::swap(x, tmp.x);
|
||||
std::swap(y, tmp.y);
|
||||
return *this;
|
||||
}
|
||||
double x;
|
||||
double y;
|
||||
};
|
||||
|
||||
struct bounding_box
|
||||
{
|
||||
bounding_box() {} // no-init
|
||||
bounding_box(double lox, double loy, double hix, double hiy)
|
||||
: p0(lox,loy),
|
||||
p1(hix,hiy) {}
|
||||
point p0;
|
||||
point p1;
|
||||
};
|
||||
|
||||
struct vertex_sequence
|
||||
{
|
||||
typedef std::vector<point> cont_type;
|
||||
cont_type data;
|
||||
void reserve(std::size_t size)
|
||||
{
|
||||
data.reserve(size);
|
||||
}
|
||||
};
|
||||
|
||||
struct line_string : vertex_sequence
|
||||
{
|
||||
using const_iterator_type = cont_type::const_iterator;
|
||||
using iterator_type = cont_type::iterator;
|
||||
using value_type = cont_type::value_type;
|
||||
iterator_type begin() { return data.begin(); }
|
||||
iterator_type end() { return data.end(); }
|
||||
const_iterator_type begin() const { return data.begin(); }
|
||||
const_iterator_type end() const { return data.end(); }
|
||||
line_string() = default;
|
||||
line_string (line_string && other) = default ;
|
||||
line_string& operator=(line_string &&) = default;
|
||||
line_string (line_string const& ) = default;
|
||||
line_string& operator=(line_string const&) = default;
|
||||
inline std::size_t num_points() const { return data.size(); }
|
||||
inline void clear() { data.clear();}
|
||||
inline void resize(std::size_t new_size) { data.resize(new_size);}
|
||||
inline void push_back(value_type const& val) { data.push_back(val);}
|
||||
void add_coord(double x, double y)
|
||||
{
|
||||
data.emplace_back(x,y);
|
||||
}
|
||||
};
|
||||
|
||||
struct polygon2
|
||||
{
|
||||
//polygon2(polygon const&) = delete;
|
||||
std::vector<line_string::cont_type> rings;
|
||||
|
||||
inline void add_ring(line_string && ring)
|
||||
{
|
||||
rings.emplace_back(std::move(ring.data));
|
||||
}
|
||||
|
||||
inline std::size_t num_rings() const
|
||||
{
|
||||
return rings.size();
|
||||
}
|
||||
};
|
||||
|
||||
using linear_ring = std::vector<point>;
|
||||
|
||||
struct polygon3
|
||||
{
|
||||
linear_ring exterior_ring;
|
||||
std::vector<linear_ring> interior_rings;
|
||||
|
||||
inline void set_exterior_ring(linear_ring && ring)
|
||||
{
|
||||
exterior_ring = std::move(ring);
|
||||
}
|
||||
|
||||
inline void add_hole(linear_ring && ring)
|
||||
{
|
||||
interior_rings.emplace_back(std::move(ring));
|
||||
}
|
||||
|
||||
inline std::size_t num_rings() const
|
||||
{
|
||||
return 1 + interior_rings.size();
|
||||
}
|
||||
};
|
||||
|
||||
struct multi_point : std::vector<point> {};
|
||||
struct multi_line_string : std::vector<line_string> {};
|
||||
struct multi_polygon : std::vector<polygon3> {};
|
||||
|
||||
struct polygon : vertex_sequence
|
||||
{
|
||||
typedef line_string::cont_type::const_iterator iterator_type;
|
||||
std::vector<std::tuple<std::uint32_t, std::uint32_t> > rings;
|
||||
// ring's element count. first ring exterior, subsequent rings are interior
|
||||
// rings[0] + ..+ rings[rings.size()-1] == data.size()
|
||||
polygon() = default;
|
||||
polygon (polygon && other) noexcept = default;
|
||||
inline void add_ring(line_string && ring)
|
||||
{
|
||||
std::size_t count = ring.data.size();
|
||||
if (count != 0)
|
||||
{
|
||||
std::size_t start = data.size();
|
||||
data.resize(start + ring.data.size());
|
||||
std::move_backward(ring.begin(),ring.end(), data.end());
|
||||
rings.emplace_back(start,count);
|
||||
}
|
||||
}
|
||||
|
||||
inline std::size_t num_rings() const
|
||||
{
|
||||
return rings.size();
|
||||
}
|
||||
|
||||
inline std::pair<iterator_type,iterator_type> ring(std::size_t index) const
|
||||
{
|
||||
if (index < num_rings())
|
||||
{
|
||||
std::tuple<std::uint32_t,std::uint32_t> const& ring = rings[index];
|
||||
return std::make_pair(data.begin() + std::get<0>(ring), data.begin() + std::get<0>(ring) + std::get<1>(ring));
|
||||
}
|
||||
else
|
||||
{
|
||||
return std::make_pair(data.end(),data.end());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
typedef mapnik::util::variant< point,line_string, polygon, polygon2, polygon3> geometry;
|
||||
|
||||
struct point_vertex_adapter
|
||||
{
|
||||
point_vertex_adapter(point const& pt)
|
||||
: pt_(pt),
|
||||
first_(true) {}
|
||||
|
||||
unsigned vertex(double*x, double*y) const
|
||||
{
|
||||
if (first_)
|
||||
{
|
||||
*x = pt_.x;
|
||||
*y = pt_.y;
|
||||
first_ = false;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
return mapnik::SEG_END;
|
||||
}
|
||||
|
||||
void rewind(unsigned) const
|
||||
{
|
||||
first_ = true;
|
||||
}
|
||||
point const& pt_;
|
||||
mutable bool first_;
|
||||
};
|
||||
|
||||
struct line_string_vertex_adapter
|
||||
{
|
||||
line_string_vertex_adapter(line_string const& line)
|
||||
: line_(line),
|
||||
current_index_(0),
|
||||
end_index_(line.data.size())
|
||||
{}
|
||||
|
||||
unsigned vertex(double*x, double*y) const
|
||||
{
|
||||
if (current_index_ != end_index_)
|
||||
{
|
||||
point const& coord = line_.data[current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
if (current_index_ == 1)
|
||||
{
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mapnik::SEG_LINETO;
|
||||
}
|
||||
}
|
||||
return mapnik::SEG_END;
|
||||
}
|
||||
|
||||
void rewind(unsigned) const
|
||||
{
|
||||
current_index_ = 0;
|
||||
}
|
||||
line_string const& line_;
|
||||
mutable std::size_t current_index_;
|
||||
const std::size_t end_index_;
|
||||
|
||||
};
|
||||
|
||||
struct polygon_vertex_adapter
|
||||
{
|
||||
polygon_vertex_adapter(polygon const& poly)
|
||||
: poly_(poly),
|
||||
rings_itr_(poly_.rings.begin()),
|
||||
rings_end_(poly_.rings.end()),
|
||||
current_index_(0),
|
||||
end_index_(0),
|
||||
start_loop_(false) {}
|
||||
|
||||
void rewind(unsigned) const
|
||||
{
|
||||
rings_itr_ = poly_.rings.begin();
|
||||
current_index_ = 0;
|
||||
end_index_ = 0;
|
||||
start_loop_ = false;
|
||||
}
|
||||
|
||||
unsigned vertex(double*x, double*y) const
|
||||
{
|
||||
if (current_index_ == end_index_)
|
||||
{
|
||||
if (rings_itr_ == rings_end_)
|
||||
return mapnik::SEG_END;
|
||||
current_index_ = std::get<0>(*rings_itr_);
|
||||
end_index_ = current_index_ + std::get<1>(*rings_itr_);
|
||||
++rings_itr_;
|
||||
start_loop_ = true;
|
||||
}
|
||||
point const& coord = poly_.data[current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
|
||||
if (start_loop_)
|
||||
{
|
||||
start_loop_= false;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
if (current_index_ == end_index_)
|
||||
return mapnik::SEG_CLOSE;
|
||||
return mapnik::SEG_LINETO;
|
||||
}
|
||||
private:
|
||||
polygon const& poly_;
|
||||
mutable std::vector<std::tuple<uint32_t,uint32_t> >::const_iterator rings_itr_;
|
||||
mutable std::vector<std::tuple<uint32_t,uint32_t> >::const_iterator rings_end_;
|
||||
mutable std::size_t current_index_;
|
||||
mutable std::size_t end_index_;
|
||||
mutable bool start_loop_;
|
||||
};
|
||||
|
||||
struct polygon_vertex_adapter_2
|
||||
{
|
||||
polygon_vertex_adapter_2(polygon2 const& poly)
|
||||
: poly_(poly),
|
||||
rings_itr_(0),
|
||||
rings_end_(poly_.rings.size()),
|
||||
current_index_(0),
|
||||
end_index_((rings_itr_ < rings_end_) ? poly_.rings[0].size() : 0),
|
||||
start_loop_(true) {}
|
||||
|
||||
void rewind(unsigned) const
|
||||
{
|
||||
rings_itr_ = 0;
|
||||
rings_end_ = poly_.rings.size();
|
||||
current_index_ = 0;
|
||||
end_index_ = (rings_itr_ < rings_end_) ? poly_.rings[0].size() : 0;
|
||||
start_loop_ = true;
|
||||
}
|
||||
|
||||
unsigned vertex(double*x, double*y) const
|
||||
{
|
||||
if (rings_itr_ == rings_end_)
|
||||
return mapnik::SEG_END;
|
||||
if (current_index_ < end_index_)
|
||||
{
|
||||
point const& coord = poly_.rings[rings_itr_][current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
if (start_loop_)
|
||||
{
|
||||
start_loop_= false;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
return mapnik::SEG_LINETO;
|
||||
}
|
||||
else if (++rings_itr_ != rings_end_)
|
||||
{
|
||||
current_index_ = 0;
|
||||
end_index_ = poly_.rings[rings_itr_].size();
|
||||
point const& coord = poly_.rings[rings_itr_][current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
return mapnik::SEG_END;
|
||||
}
|
||||
private:
|
||||
polygon2 const& poly_;
|
||||
mutable std::size_t rings_itr_;
|
||||
mutable std::size_t rings_end_;
|
||||
mutable std::size_t current_index_;
|
||||
mutable std::size_t end_index_;
|
||||
mutable bool start_loop_;
|
||||
};
|
||||
|
||||
struct polygon_vertex_adapter_3
|
||||
{
|
||||
polygon_vertex_adapter_3(polygon3 const& poly)
|
||||
: poly_(poly),
|
||||
rings_itr_(0),
|
||||
rings_end_(poly_.interior_rings.size() + 1),
|
||||
current_index_(0),
|
||||
end_index_((rings_itr_ < rings_end_) ? poly_.exterior_ring.size() : 0),
|
||||
start_loop_(true) {}
|
||||
|
||||
void rewind(unsigned) const
|
||||
{
|
||||
rings_itr_ = 0;
|
||||
rings_end_ = poly_.interior_rings.size() + 1;
|
||||
current_index_ = 0;
|
||||
end_index_ = (rings_itr_ < rings_end_) ? poly_.exterior_ring.size() : 0;
|
||||
start_loop_ = true;
|
||||
}
|
||||
|
||||
unsigned vertex(double*x, double*y) const
|
||||
{
|
||||
if (rings_itr_ == rings_end_)
|
||||
return mapnik::SEG_END;
|
||||
if (current_index_ < end_index_)
|
||||
{
|
||||
point const& coord = (rings_itr_ == 0) ?
|
||||
poly_.exterior_ring[current_index_++] : poly_.interior_rings[rings_itr_- 1][current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
if (start_loop_)
|
||||
{
|
||||
start_loop_= false;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
return mapnik::SEG_LINETO;
|
||||
}
|
||||
else if (++rings_itr_ != rings_end_)
|
||||
{
|
||||
current_index_ = 0;
|
||||
end_index_ = poly_.interior_rings[rings_itr_ - 1].size();
|
||||
point const& coord = poly_.interior_rings[rings_itr_ - 1][current_index_++];
|
||||
*x = coord.x;
|
||||
*y = coord.y;
|
||||
return mapnik::SEG_MOVETO;
|
||||
}
|
||||
return mapnik::SEG_END;
|
||||
}
|
||||
private:
|
||||
polygon3 const& poly_;
|
||||
mutable std::size_t rings_itr_;
|
||||
mutable std::size_t rings_end_;
|
||||
mutable std::size_t current_index_;
|
||||
mutable std::size_t end_index_;
|
||||
mutable bool start_loop_;
|
||||
};
|
||||
|
||||
//
|
||||
template <typename T>
|
||||
struct vertex_processor
|
||||
{
|
||||
using processor_type = T;
|
||||
vertex_processor(processor_type const& proc)
|
||||
: proc_(proc) {}
|
||||
|
||||
auto operator() (point const& pt) const
|
||||
-> typename std::result_of<processor_type(point_vertex_adapter const&)>::type
|
||||
{
|
||||
point_vertex_adapter va(pt);
|
||||
return proc_(va);
|
||||
}
|
||||
|
||||
auto operator() (line_string const& line)
|
||||
-> typename std::result_of<processor_type(line_string_vertex_adapter const&)>::type
|
||||
{
|
||||
line_string_vertex_adapter va(line);
|
||||
return proc_(va);
|
||||
}
|
||||
auto operator() (polygon const& poly) const
|
||||
-> typename std::result_of<processor_type(polygon_vertex_adapter const&)>::type
|
||||
{
|
||||
polygon_vertex_adapter va(poly);
|
||||
return proc_(va);
|
||||
}
|
||||
|
||||
auto operator() (polygon2 const& poly) const
|
||||
-> typename std::result_of<processor_type(polygon_vertex_adapter_2 const&)>::type
|
||||
{
|
||||
polygon_vertex_adapter_2 va(poly);
|
||||
return proc_(va);
|
||||
}
|
||||
|
||||
auto operator() (polygon3 const& poly) const
|
||||
-> typename std::result_of<processor_type(polygon_vertex_adapter_3 const&)>::type
|
||||
{
|
||||
polygon_vertex_adapter_3 va(poly);
|
||||
return proc_(va);
|
||||
}
|
||||
|
||||
processor_type const& proc_;
|
||||
};
|
||||
|
||||
}}
|
|
@ -40,12 +40,15 @@ public:
|
|||
|
||||
bool pass(feature_impl & feature)
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
vertex_adapter va(geom);
|
||||
if (label::hit_test(va, x_,y_,tol_))
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,6 +191,8 @@ void setup_transform_scaling(agg::trans_affine & tr,
|
|||
template <typename Converter>
|
||||
void apply_markers_multi(feature_impl const& feature, attributes const& vars, Converter & converter, symbolizer_base const& sym)
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
std::size_t geom_count = feature.paths().size();
|
||||
if (geom_count == 1)
|
||||
{
|
||||
|
@ -253,6 +255,7 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,6 +77,8 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
for (std::size_t i=0; i<(*pos_)->num_geometries();++i)
|
||||
{
|
||||
geometry_type const& geom = (*pos_)->get_geometry(i);
|
||||
|
@ -85,6 +87,7 @@ public:
|
|||
return *pos_++;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
++pos_;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ void render_building_symbolizer(mapnik::feature_impl &feature,
|
|||
double height,
|
||||
F1 face_func, F2 frame_func, F3 roof_func)
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
for (auto const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 2)
|
||||
|
@ -111,6 +113,7 @@ void render_building_symbolizer(mapnik::feature_impl &feature,
|
|||
roof_func(*roof);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
} // namespace mapnik
|
||||
|
|
|
@ -340,7 +340,8 @@ void render_group_symbolizer(group_symbolizer const& sym,
|
|||
}
|
||||
|
||||
// add a single point geometry at pixel origin
|
||||
sub_feature->add_geometry(origin_point(prj_trans, common));
|
||||
// FIXME
|
||||
//sub_feature->add_geometry(origin_point(prj_trans, common));
|
||||
|
||||
// get the layout for this set of properties
|
||||
for (auto const& rule : props->get_rules())
|
||||
|
|
|
@ -98,6 +98,8 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
simplify_tag, smooth_tag,
|
||||
offset_transform_tag>;
|
||||
vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_);
|
||||
// FIXME
|
||||
/*
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
{
|
||||
geometry_type::types type = feature.paths()[0].type();
|
||||
|
@ -106,6 +108,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
else if (type == geometry_type::types::LineString)
|
||||
converter.template set<clip_line_tag>();
|
||||
}
|
||||
*/
|
||||
converter.template set<transform_tag>(); //always transform
|
||||
if (std::fabs(offset) > 0.0) converter.template set<offset_transform_tag>(); // parallel offset
|
||||
converter.template set<affine_transform_tag>(); // optional affine transform
|
||||
|
@ -142,6 +145,8 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
simplify_tag, smooth_tag,
|
||||
offset_transform_tag>;
|
||||
vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_);
|
||||
// FIXME
|
||||
/*
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
{
|
||||
geometry_type::types type = feature.paths()[0].type();
|
||||
|
@ -150,6 +155,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
else if (type == geometry_type::types::LineString)
|
||||
converter.template set<clip_line_tag>();
|
||||
}
|
||||
*/
|
||||
converter.template set<transform_tag>(); //always transform
|
||||
if (std::fabs(offset) > 0.0) converter.template set<offset_transform_tag>(); // parallel offset
|
||||
converter.template set<affine_transform_tag>(); // optional affine transform
|
||||
|
@ -186,6 +192,8 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
offset_transform_tag>;
|
||||
vertex_converter_type converter(clip_box, rasterizer_dispatch, sym,common.t_,prj_trans,geom_tr,feature,common.vars_,common.scale_factor_);
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
if (clip && feature.paths().size() > 0) // optional clip (default: true)
|
||||
{
|
||||
geometry_type::types type = feature.paths()[0].type();
|
||||
|
@ -194,6 +202,7 @@ void render_markers_symbolizer(markers_symbolizer const& sym,
|
|||
else if (type == geometry_type::types::LineString)
|
||||
converter.template set<clip_line_tag>();
|
||||
}
|
||||
*/
|
||||
converter.template set<transform_tag>(); //always transform
|
||||
if (std::fabs(offset) > 0.0) converter.template set<offset_transform_tag>(); // parallel offset
|
||||
converter.template set<affine_transform_tag>(); // optional affine transform
|
||||
|
|
|
@ -63,6 +63,8 @@ void render_point_symbolizer(point_symbolizer const &sym,
|
|||
agg::trans_affine recenter_tr = recenter * tr;
|
||||
box2d<double> label_ext = bbox * recenter_tr * agg::trans_affine_scaling(common.scale_factor_);
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (std::size_t i=0; i<feature.num_geometries(); ++i)
|
||||
{
|
||||
geometry_type const& geom = feature.get_geometry(i);
|
||||
|
@ -97,6 +99,7 @@ void render_point_symbolizer(point_symbolizer const &sym,
|
|||
common.detector_->insert(label_ext);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,8 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym,
|
|||
converter.template set<affine_transform_tag>();
|
||||
if (simplify_tolerance > 0.0) converter.template set<simplify_tag>(); // optional simplify converter
|
||||
if (smooth > 0.0) converter.template set<smooth_tag>(); // optional smooth converter
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 2)
|
||||
|
@ -66,7 +67,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym,
|
|||
converter.apply(va);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
color const& fill = get<mapnik::color, keys::fill>(sym, feature, common.vars_);
|
||||
fill_func(fill, opacity);
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ void agg_renderer<T0,T1>::process(debug_symbolizer const& sym,
|
|||
}
|
||||
else if (mode == DEBUG_SYM_MODE_VERTEX)
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
for (auto const& geom : feature.paths())
|
||||
{
|
||||
double x;
|
||||
|
@ -87,6 +89,7 @@ void agg_renderer<T0,T1>::process(debug_symbolizer const& sym,
|
|||
pixmap_.setPixel(x+1,y-1,0xff0000ff);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,8 @@ void agg_renderer<T0,T1>::process(dot_symbolizer const& sym,
|
|||
ren.color(agg::rgba8_pre(fill.red(), fill.green(), fill.blue(), int(fill.alpha() * opacity)));
|
||||
agg::ellipse el(0,0,rx,ry);
|
||||
unsigned num_steps = el.num_steps();
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
double x,y,z = 0;
|
||||
|
@ -100,6 +101,7 @@ void agg_renderer<T0,T1>::process(dot_symbolizer const& sym,
|
|||
agg::render_scanlines(*ras_ptr, sl, ren);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
template void agg_renderer<image_32>::process(dot_symbolizer const&,
|
||||
|
|
|
@ -135,6 +135,8 @@ void agg_renderer<T0,T1>::process(line_pattern_symbolizer const& sym,
|
|||
converter.set<affine_transform_tag>(); // optional affine transform
|
||||
if (smooth > 0.0) converter.set<smooth_tag>(); // optional smooth converter
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 1)
|
||||
|
@ -143,6 +145,7 @@ void agg_renderer<T0,T1>::process(line_pattern_symbolizer const& sym,
|
|||
converter.apply(va);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
template void agg_renderer<image_32>::process(line_pattern_symbolizer const&,
|
||||
|
|
|
@ -178,6 +178,8 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
if (simplify_tolerance > 0.0) converter.set<simplify_tag>(); // optional simplify converter
|
||||
if (smooth > 0.0) converter.set<smooth_tag>(); // optional smooth converter
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 1)
|
||||
|
@ -186,6 +188,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
converter.apply(va);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -205,7 +208,8 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
if (has_key(sym, keys::stroke_dasharray))
|
||||
converter.set<dash_tag>();
|
||||
converter.set<stroke_tag>(); //always stroke
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for (geometry_type const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 1)
|
||||
|
@ -214,7 +218,7 @@ void agg_renderer<T0,T1>::process(line_symbolizer const& sym,
|
|||
converter.apply(va);
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
|
||||
renderer_type ren(renb);
|
||||
ren.color(agg::rgba8_pre(r, g, b, int(a * opacity)));
|
||||
|
|
|
@ -138,6 +138,8 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
{
|
||||
double x0 = 0;
|
||||
double y0 = 0;
|
||||
// FIXME
|
||||
/*
|
||||
if (feature.num_geometries() > 0)
|
||||
{
|
||||
vertex_adapter va(feature.get_geometry(0));
|
||||
|
@ -146,6 +148,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
path_type path(common_.t_,clipped,prj_trans);
|
||||
path.vertex(&x0,&y0);
|
||||
}
|
||||
*/
|
||||
offset_x = unsigned(current_buffer_->width() - x0);
|
||||
offset_y = unsigned(current_buffer_->height() - y0);
|
||||
}
|
||||
|
@ -168,6 +171,8 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
if (simplify_tolerance > 0.0) converter.set<simplify_tag>(); // optional simplify converter
|
||||
if (smooth > 0.0) converter.set<smooth_tag>(); // optional smooth converter
|
||||
|
||||
// FIXME
|
||||
/*
|
||||
for ( geometry_type const& geom : feature.paths())
|
||||
{
|
||||
if (geom.size() > 2)
|
||||
|
@ -176,6 +181,7 @@ void agg_renderer<T0,T1>::process(polygon_pattern_symbolizer const& sym,
|
|||
converter.apply(va);
|
||||
}
|
||||
}
|
||||
*/
|
||||
agg::scanline_u8 sl;
|
||||
ras_ptr->filling_rule(agg::fill_even_odd);
|
||||
agg::render_scanlines(*ras_ptr, sl, rp);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
#
|
||||
#
|
||||
|
||||
import os
|
||||
from glob import glob
|
||||
|
@ -29,7 +29,7 @@ if 'g++' in env['CXX']:
|
|||
|
||||
name = "mapnik-json"
|
||||
lib = lib_env.StaticLibrary(name, glob('./' + '*.cpp'), LIBS=[])
|
||||
target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], env.subst('${LIBPREFIX}%s${LIBSUFFIX}' % name))
|
||||
result = env.InstallAs(target=target, source=lib)
|
||||
env.Alias(target='install', source=result)
|
||||
env['create_uninstall_target'](env, target)
|
||||
#target = os.path.join(env['MAPNIK_LIB_BASE_DEST'], env.subst('${LIBPREFIX}%s${LIBSUFFIX}' % name))
|
||||
#result = env.InstallAs(target=target, source=lib)
|
||||
#env.Alias(target='install', source=result)
|
||||
#env['create_uninstall_target'](env, target)
|
||||
|
|
|
@ -46,6 +46,8 @@ struct accumulate_extent
|
|||
|
||||
void operator() (feature_ptr const& feat)
|
||||
{
|
||||
// FIXME
|
||||
/*
|
||||
auto size = feat->num_geometries();
|
||||
for (std::size_t i = 0; i < size; ++i)
|
||||
{
|
||||
|
@ -61,6 +63,7 @@ struct accumulate_extent
|
|||
ext_.expand_to_include(bbox);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
box2d<double> & ext_;
|
||||
|
|
|
@ -80,6 +80,8 @@ void base_symbolizer_helper::initialize_geometries() const
|
|||
{
|
||||
bool largest_box_only = text_props_->largest_bbox_only;
|
||||
double minimum_path_length = text_props_->minimum_path_length;
|
||||
// FIXME
|
||||
/*
|
||||
for ( auto const& geom : feature_.paths())
|
||||
{
|
||||
// don't bother with empty geometries
|
||||
|
@ -99,7 +101,7 @@ void base_symbolizer_helper::initialize_geometries() const
|
|||
// TODO - calculate length here as well
|
||||
geometries_to_process_.push_back(const_cast<geometry_type*>(&geom));
|
||||
}
|
||||
|
||||
*/
|
||||
if (largest_box_only)
|
||||
{
|
||||
geometries_to_process_.sort(largest_bbox_first());
|
||||
|
|
Loading…
Reference in a new issue