1 #include "polygon_arc_removal_proxy.hpp"
2 
3 namespace horizon {
4 
PolygonArcRemovalProxy(const Polygon & poly,unsigned int precision)5 PolygonArcRemovalProxy::PolygonArcRemovalProxy(const Polygon &poly, unsigned int precision) : parent(poly)
6 {
7     if (parent.has_arcs()) {
8         poly_arcs_removed.emplace(parent.remove_arcs(precision));
9         ppoly = &poly_arcs_removed.value();
10     }
11     else {
12         ppoly = &parent;
13     }
14 }
15 
get() const16 const Polygon &PolygonArcRemovalProxy::get() const
17 {
18     return *ppoly;
19 }
20 
had_arcs() const21 bool PolygonArcRemovalProxy::had_arcs() const
22 {
23     return ppoly != &parent;
24 }
25 
26 } // namespace horizon
27