summaryrefslogtreecommitdiffstats
path: root/include/mapbox/geometry/polygon.hpp
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 14:13:07 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2018-11-02 14:13:07 +0900
commit30d24cbc67ef416672a3386b10be8fe6711c65d7 (patch)
treeecc8813e6742661e1521d6399d04cc4abc54587f /include/mapbox/geometry/polygon.hpp
parentae47635e56c4af4d816a76e5186e945768543679 (diff)
use mapbox as navigation
Diffstat (limited to 'include/mapbox/geometry/polygon.hpp')
-rw-r--r--include/mapbox/geometry/polygon.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/mapbox/geometry/polygon.hpp b/include/mapbox/geometry/polygon.hpp
new file mode 100644
index 0000000..99a66aa
--- /dev/null
+++ b/include/mapbox/geometry/polygon.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+// mapbox
+#include <mapbox/geometry/point.hpp>
+
+// stl
+#include <vector>
+
+namespace mapbox {
+namespace geometry {
+
+template <typename T, template <typename...> class Cont = std::vector>
+struct linear_ring : Cont<point<T>>
+{
+ using coordinate_type = T;
+ using point_type = point<T>;
+ using container_type = Cont<point_type>;
+ using container_type::container_type;
+};
+
+template <typename T, template <typename...> class Cont = std::vector>
+struct polygon : Cont<linear_ring<T>>
+{
+ using coordinate_type = T;
+ using linear_ring_type = linear_ring<T>;
+ using container_type = Cont<linear_ring_type>;
+ using container_type::container_type;
+};
+
+} // namespace geometry
+} // namespace mapbox