comparison DEPENDENCIES/generic/include/boost/geometry/geometries/polygon.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
1 // Boost.Geometry (aka GGL, Generic Geometry Library) 1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 2
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. 3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. 4 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. 5 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
6 // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
6 7
7 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library 8 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
8 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. 9 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
9 10
10 // Use, modification and distribution is subject to the Boost Software License, 11 // Use, modification and distribution is subject to the Boost Software License,
23 #include <boost/geometry/core/interior_rings.hpp> 24 #include <boost/geometry/core/interior_rings.hpp>
24 #include <boost/geometry/core/point_type.hpp> 25 #include <boost/geometry/core/point_type.hpp>
25 #include <boost/geometry/core/ring_type.hpp> 26 #include <boost/geometry/core/ring_type.hpp>
26 #include <boost/geometry/geometries/concepts/point_concept.hpp> 27 #include <boost/geometry/geometries/concepts/point_concept.hpp>
27 #include <boost/geometry/geometries/ring.hpp> 28 #include <boost/geometry/geometries/ring.hpp>
29
30 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST
31 #include <boost/config.hpp>
32 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
33 #include <initializer_list>
34 #endif
35 #endif
28 36
29 namespace boost { namespace geometry 37 namespace boost { namespace geometry
30 { 38 {
31 39
32 namespace model 40 namespace model
81 inline inner_container_type const& inners() const { return m_inners; } 89 inline inner_container_type const& inners() const { return m_inners; }
82 90
83 inline ring_type& outer() { return m_outer; } 91 inline ring_type& outer() { return m_outer; }
84 inline inner_container_type & inners() { return m_inners; } 92 inline inner_container_type & inners() { return m_inners; }
85 93
94 #ifdef BOOST_GEOMETRY_EXPERIMENTAL_ENABLE_INITIALIZER_LIST
95
96 /// \constructor_default{polygon}
97 inline polygon()
98 : m_outer()
99 , m_inners()
100 {}
101
102 #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
103 /// \constructor_initializer_list{polygon}
104 inline polygon(std::initializer_list<ring_type> l)
105 : m_outer(l.size() > 0 ? *l.begin() : ring_type())
106 , m_inners(l.size() > 0 ? l.begin() + 1 : l.begin(), l.end())
107 {}
108
109 // Commented out for now in order to support Boost.Assign
110 // Without this assignment operator first the object should be created
111 // from initializer list, then it shoudl be moved.
112 //// Without this workaround in MSVC the assignment operator is ambiguous
113 //#ifndef BOOST_MSVC
114 // /// \assignment_initializer_list{polygon}
115 // inline polygon & operator=(std::initializer_list<ring_type> l)
116 // {
117 // if ( l.size() > 0 )
118 // {
119 // m_outer = *l.begin();
120 // m_inners.assign(l.begin() + 1, l.end());
121 // }
122 // else
123 // {
124 // m_outer.clear();
125 // m_inners.clear();
126 // }
127 // return *this;
128 // }
129 //#endif
130
131 #endif
132 #endif
133
86 /// Utility method, clears outer and inner rings 134 /// Utility method, clears outer and inner rings
87 inline void clear() 135 inline void clear()
88 { 136 {
89 m_outer.clear(); 137 m_outer.clear();
90 m_inners.clear(); 138 m_inners.clear();