move geometry_adapters.hpp to geometry/boost_geometry_adapters.hpp
This commit is contained in:
parent
b24ade9a1c
commit
caa03d78bd
14 changed files with 31 additions and 31 deletions
|
@ -10,7 +10,7 @@
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/vertex_adapters.hpp>
|
#include <mapnik/vertex_adapters.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/geometry_envelope.hpp>
|
#include <mapnik/geometry_envelope.hpp>
|
||||||
#include <mapnik/geometry_correct.hpp>
|
#include <mapnik/geometry_correct.hpp>
|
||||||
#include <mapnik/geometry_is_empty.hpp>
|
#include <mapnik/geometry_is_empty.hpp>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define MAPNIK_GEOMETRY_CENTROID_HPP
|
#define MAPNIK_GEOMETRY_CENTROID_HPP
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <boost/geometry/algorithms/centroid.hpp>
|
#include <boost/geometry/algorithms/centroid.hpp>
|
||||||
#include <mapnik/geometry_is_empty.hpp>
|
#include <mapnik/geometry_is_empty.hpp>
|
||||||
#include <mapnik/geometry_remove_empty.hpp>
|
#include <mapnik/geometry_remove_empty.hpp>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define MAPNIK_GEOMETRY_CORRECT_HPP
|
#define MAPNIK_GEOMETRY_CORRECT_HPP
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/util/variant.hpp>
|
#include <mapnik/util/variant.hpp>
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#if BOOST_VERSION >= 105600
|
#if BOOST_VERSION >= 105600
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <boost/geometry/algorithms/is_simple.hpp>
|
#include <boost/geometry/algorithms/is_simple.hpp>
|
||||||
|
|
||||||
namespace mapnik { namespace geometry {
|
namespace mapnik { namespace geometry {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#if BOOST_VERSION >= 105800
|
#if BOOST_VERSION >= 105800
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <boost/geometry/algorithms/is_valid.hpp>
|
#include <boost/geometry/algorithms/is_valid.hpp>
|
||||||
#include <boost/geometry/algorithms/validity_failure_type.hpp>
|
#include <boost/geometry/algorithms/validity_failure_type.hpp>
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ struct geometry_is_valid
|
||||||
struct geometry_is_valid_reason
|
struct geometry_is_valid_reason
|
||||||
{
|
{
|
||||||
using result_type = bool;
|
using result_type = bool;
|
||||||
|
|
||||||
boost::geometry::validity_failure_type & failure_;
|
boost::geometry::validity_failure_type & failure_;
|
||||||
|
|
||||||
geometry_is_valid_reason(boost::geometry::validity_failure_type & failure):
|
geometry_is_valid_reason(boost::geometry::validity_failure_type & failure):
|
||||||
|
@ -170,7 +170,7 @@ struct geometry_is_valid_reason
|
||||||
struct geometry_is_valid_string
|
struct geometry_is_valid_string
|
||||||
{
|
{
|
||||||
using result_type = bool;
|
using result_type = bool;
|
||||||
|
|
||||||
std::string & message_;
|
std::string & message_;
|
||||||
|
|
||||||
geometry_is_valid_string(std::string & message):
|
geometry_is_valid_string(std::string & message):
|
||||||
|
@ -257,7 +257,7 @@ inline bool is_valid(T const& geom, boost::geometry::validity_failure_type & fai
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool is_valid(mapnik::geometry::geometry<T> const& geom,
|
inline bool is_valid(mapnik::geometry::geometry<T> const& geom,
|
||||||
boost::geometry::validity_failure_type & failure)
|
boost::geometry::validity_failure_type & failure)
|
||||||
{
|
{
|
||||||
return util::apply_visitor(detail::geometry_is_valid_reason(failure), geom);
|
return util::apply_visitor(detail::geometry_is_valid_reason(failure), geom);
|
||||||
|
@ -270,7 +270,7 @@ inline bool is_valid(T const& geom, std::string & message)
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool is_valid(mapnik::geometry::geometry<T> const& geom,
|
inline bool is_valid(mapnik::geometry::geometry<T> const& geom,
|
||||||
std::string & message)
|
std::string & message)
|
||||||
{
|
{
|
||||||
return util::apply_visitor(detail::geometry_is_valid_string(message), geom);
|
return util::apply_visitor(detail::geometry_is_valid_string(message), geom);
|
||||||
|
|
|
@ -23,20 +23,20 @@
|
||||||
#ifndef MAPNIK_GEOMETRY_STRATEGY_HPP
|
#ifndef MAPNIK_GEOMETRY_STRATEGY_HPP
|
||||||
#define MAPNIK_GEOMETRY_STRATEGY_HPP
|
#define MAPNIK_GEOMETRY_STRATEGY_HPP
|
||||||
|
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/util/rounding_cast.hpp>
|
#include <mapnik/util/rounding_cast.hpp>
|
||||||
|
|
||||||
namespace mapnik {
|
namespace mapnik {
|
||||||
namespace geometry {
|
namespace geometry {
|
||||||
|
|
||||||
namespace helper
|
namespace helper
|
||||||
{
|
{
|
||||||
template <std::size_t... Ts>
|
template <std::size_t... Ts>
|
||||||
struct index {};
|
struct index {};
|
||||||
|
|
||||||
template <std::size_t N, std::size_t... Ts>
|
template <std::size_t N, std::size_t... Ts>
|
||||||
struct gen_seq : gen_seq<N - 1, N - 1, Ts...> {};
|
struct gen_seq : gen_seq<N - 1, N - 1, Ts...> {};
|
||||||
|
|
||||||
template <std::size_t... Ts>
|
template <std::size_t... Ts>
|
||||||
struct gen_seq<0, Ts...> : index<Ts...> {};
|
struct gen_seq<0, Ts...> : index<Ts...> {};
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ struct strategy_group
|
||||||
|
|
||||||
template <typename P1, typename P2, typename T, typename ...Args>
|
template <typename P1, typename P2, typename T, typename ...Args>
|
||||||
inline P2 execute(P1 const& p, bool & status, T const& strat, Args const& ... args) const
|
inline P2 execute(P1 const& p, bool & status, T const& strat, Args const& ... args) const
|
||||||
{
|
{
|
||||||
return execute<P1,P2>(strat.template execute<P1,P1>(p, status), status, args...);
|
return execute<P1,P2>(strat.template execute<P1,P1>(p, status), status, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ struct strategy_group
|
||||||
{
|
{
|
||||||
return strat.template execute<P1,P2>(p, status);
|
return strat.template execute<P1,P2>(p, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::tuple<Strategies const& ...> ops_;
|
std::tuple<Strategies const& ...> ops_;
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ private:
|
||||||
|
|
||||||
|
|
||||||
// The difference between this strategy group and the previous is that the conversion from P1 to P2 happens
|
// The difference between this strategy group and the previous is that the conversion from P1 to P2 happens
|
||||||
// in the first strategy rather then the last strategy.
|
// in the first strategy rather then the last strategy.
|
||||||
template <typename... Strategies>
|
template <typename... Strategies>
|
||||||
struct strategy_group_first
|
struct strategy_group_first
|
||||||
{
|
{
|
||||||
|
@ -116,13 +116,13 @@ struct strategy_group_first
|
||||||
|
|
||||||
template <typename P1, typename P2, typename T, typename ...Args>
|
template <typename P1, typename P2, typename T, typename ...Args>
|
||||||
inline P2 execute_first(P1 const& p, bool & status, T const& strat, Args const& ... args) const
|
inline P2 execute_first(P1 const& p, bool & status, T const& strat, Args const& ... args) const
|
||||||
{
|
{
|
||||||
return execute<P2>(strat.template execute<P1,P2>(p, status), status, args...);
|
return execute<P2>(strat.template execute<P1,P2>(p, status), status, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P2, typename T, typename ...Args>
|
template <typename P2, typename T, typename ...Args>
|
||||||
inline P2 execute(P2 const& p, bool & status, T const& strat, Args const& ... args) const
|
inline P2 execute(P2 const& p, bool & status, T const& strat, Args const& ... args) const
|
||||||
{
|
{
|
||||||
return execute<P2>(strat.template execute<P2,P2>(p, status), status, args...);
|
return execute<P2>(strat.template execute<P2,P2>(p, status), status, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,13 +131,13 @@ struct strategy_group_first
|
||||||
{
|
{
|
||||||
return strat.template execute<P2,P2>(p, status);
|
return strat.template execute<P2,P2>(p, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P2>
|
template <typename P2>
|
||||||
inline P2 execute(P2 const& p, bool & status) const
|
inline P2 execute(P2 const& p, bool & status) const
|
||||||
{
|
{
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::tuple<Strategies const& ...> ops_;
|
std::tuple<Strategies const& ...> ops_;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ struct scale_strategy
|
||||||
template <typename P1, typename P2>
|
template <typename P1, typename P2>
|
||||||
inline bool apply(P1 const & p1, P2 & p2) const
|
inline bool apply(P1 const & p1, P2 & p2) const
|
||||||
{
|
{
|
||||||
|
|
||||||
using p2_type = typename boost::geometry::coordinate_type<P2>::type;
|
using p2_type = typename boost::geometry::coordinate_type<P2>::type;
|
||||||
double x = (boost::geometry::get<0>(p1) * scale_) + offset_;
|
double x = (boost::geometry::get<0>(p1) * scale_) + offset_;
|
||||||
double y = (boost::geometry::get<1>(p1) * scale_) + offset_;
|
double y = (boost::geometry::get<1>(p1) * scale_) + offset_;
|
||||||
|
@ -159,7 +159,7 @@ struct scale_strategy
|
||||||
boost::geometry::set<1>(p2, static_cast<p2_type>(y));
|
boost::geometry::set<1>(p2, static_cast<p2_type>(y));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P1, typename P2>
|
template <typename P1, typename P2>
|
||||||
inline P2 execute(P1 const& p1, bool & status) const
|
inline P2 execute(P1 const& p1, bool & status) const
|
||||||
{
|
{
|
||||||
|
@ -181,7 +181,7 @@ struct scale_rounding_strategy
|
||||||
template <typename P1, typename P2>
|
template <typename P1, typename P2>
|
||||||
inline bool apply(P1 const & p1, P2 & p2) const
|
inline bool apply(P1 const & p1, P2 & p2) const
|
||||||
{
|
{
|
||||||
|
|
||||||
using p2_type = typename boost::geometry::coordinate_type<P2>::type;
|
using p2_type = typename boost::geometry::coordinate_type<P2>::type;
|
||||||
double x = (boost::geometry::get<0>(p1) * scale_) + offset_;
|
double x = (boost::geometry::get<0>(p1) * scale_) + offset_;
|
||||||
double y = (boost::geometry::get<1>(p1) * scale_) + offset_;
|
double y = (boost::geometry::get<1>(p1) * scale_) + offset_;
|
||||||
|
@ -189,7 +189,7 @@ struct scale_rounding_strategy
|
||||||
boost::geometry::set<1>(p2, static_cast<p2_type>(std::round(y)));
|
boost::geometry::set<1>(p2, static_cast<p2_type>(std::round(y)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename P1, typename P2>
|
template <typename P1, typename P2>
|
||||||
inline P2 execute(P1 const& p1, bool & status) const
|
inline P2 execute(P1 const& p1, bool & status) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#define MAPNIK_GEOMETRY_TRANSFORM_HPP
|
#define MAPNIK_GEOMETRY_TRANSFORM_HPP
|
||||||
|
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <boost/geometry/algorithms/transform.hpp>
|
#include <boost/geometry/algorithms/transform.hpp>
|
||||||
|
|
||||||
namespace mapnik { namespace geometry { namespace detail {
|
namespace mapnik { namespace geometry { namespace detail {
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
BOOST_FUSION_ADAPT_STRUCT(
|
BOOST_FUSION_ADAPT_STRUCT(
|
||||||
mapnik::topojson::coordinate,
|
mapnik::topojson::coordinate,
|
||||||
(double, x)
|
(double, x)
|
||||||
(double, y)
|
(double, y)
|
||||||
)
|
)
|
||||||
|
|
||||||
BOOST_FUSION_ADAPT_STRUCT(
|
BOOST_FUSION_ADAPT_STRUCT(
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/json/topology.hpp>
|
#include <mapnik/json/topology.hpp>
|
||||||
#include <mapnik/feature_factory.hpp>
|
#include <mapnik/feature_factory.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/geometry_correct.hpp>
|
#include <mapnik/geometry_correct.hpp>
|
||||||
|
|
||||||
namespace mapnik { namespace topojson {
|
namespace mapnik { namespace topojson {
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
#include <mapnik/boolean.hpp>
|
#include <mapnik/boolean.hpp>
|
||||||
#include <mapnik/util/trim.hpp>
|
#include <mapnik/util/trim.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/util/geometry_to_ds_type.hpp>
|
#include <mapnik/util/geometry_to_ds_type.hpp>
|
||||||
#include <mapnik/value_types.hpp>
|
#include <mapnik/value_types.hpp>
|
||||||
#include <mapnik/util/fs.hpp>
|
#include <mapnik/util/fs.hpp>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
#include <mapnik/util/file_io.hpp>
|
#include <mapnik/util/file_io.hpp>
|
||||||
#include <mapnik/util/geometry_to_ds_type.hpp>
|
#include <mapnik/util/geometry_to_ds_type.hpp>
|
||||||
#include <mapnik/make_unique.hpp>
|
#include <mapnik/make_unique.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/json/feature_collection_grammar.hpp>
|
#include <mapnik/json/feature_collection_grammar.hpp>
|
||||||
#include <mapnik/json/extract_bounding_box_grammar_impl.hpp>
|
#include <mapnik/json/extract_bounding_box_grammar_impl.hpp>
|
||||||
#include <mapnik/util/fs.hpp>
|
#include <mapnik/util/fs.hpp>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <mapnik/unicode.hpp>
|
#include <mapnik/unicode.hpp>
|
||||||
#include <mapnik/value_types.hpp>
|
#include <mapnik/value_types.hpp>
|
||||||
#include <mapnik/box2d.hpp>
|
#include <mapnik/box2d.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/json/topojson_grammar.hpp>
|
#include <mapnik/json/topojson_grammar.hpp>
|
||||||
#include <mapnik/json/topojson_utils.hpp>
|
#include <mapnik/json/topojson_utils.hpp>
|
||||||
#include <mapnik/util/variant.hpp>
|
#include <mapnik/util/variant.hpp>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// mapnik
|
// mapnik
|
||||||
#include <mapnik/wkb.hpp>
|
#include <mapnik/wkb.hpp>
|
||||||
#include <mapnik/geometry.hpp>
|
#include <mapnik/geometry.hpp>
|
||||||
#include <mapnik/geometry_adapters.hpp>
|
#include <mapnik/geometry/boost_geometry_adapters.hpp>
|
||||||
#include <mapnik/geometry_is_empty.hpp>
|
#include <mapnik/geometry_is_empty.hpp>
|
||||||
#include <mapnik/util/geometry_to_wkt.hpp>
|
#include <mapnik/util/geometry_to_wkt.hpp>
|
||||||
// bool
|
// bool
|
||||||
|
|
Loading…
Reference in a new issue