From 4a8b7a6301e4b093c99329d0a16fbee6c535f312 Mon Sep 17 00:00:00 2001 From: wanglu Date: Mon, 25 Mar 2019 09:42:49 +0800 Subject: This is a application for display turn by run navigation information. Change-Id: I0866a7d9ffa347c0935b4d00259ad1a74cd00d6e Signed-off-by: wanglu --- include/mapbox/geometry/geometry.hpp | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/mapbox/geometry/geometry.hpp (limited to 'include/mapbox/geometry/geometry.hpp') diff --git a/include/mapbox/geometry/geometry.hpp b/include/mapbox/geometry/geometry.hpp new file mode 100644 index 0000000..a3970bf --- /dev/null +++ b/include/mapbox/geometry/geometry.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include +#include +#include +#include + +#include + +// stl +#include + +namespace mapbox { +namespace geometry { + +template class Cont = std::vector> +struct geometry_collection; + +template +using geometry_base = mapbox::util::variant, + line_string, + polygon, + multi_point, + multi_line_string, + multi_polygon, + geometry_collection>; + +template +struct geometry : geometry_base +{ + using coordinate_type = T; + using geometry_base::geometry_base; + + /* + * The default constructor would create a point geometry with default-constructed coordinates; + * i.e. (0, 0). Since this is not particularly useful, and could hide bugs, it is disabled. + */ + geometry() = delete; +}; + +template class Cont> +struct geometry_collection : Cont> +{ + using coordinate_type = T; + using geometry_type = geometry; + using container_type = Cont; + using container_type::container_type; +}; + +} // namespace geometry +} // namespace mapbox -- cgit 1.2.3-korg