feat():initial version
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010 Alfredo Correa
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_HPP
|
||||
|
||||
|
||||
#ifdef BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED
|
||||
#error Include either "boost_array_as_point" or \
|
||||
"boost_array_as_linestring" or "boost_array_as_ring" \
|
||||
or "boost_array_as_multi_point" to adapt a boost_array
|
||||
#endif
|
||||
|
||||
#define BOOST_GEOMETRY_ADAPTED_BOOST_ARRAY_TAG_DEFINED
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/array.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
// Create class and specialization to indicate the tag
|
||||
// for normal cases and the case that the type of the c-array is arithmetic
|
||||
template <bool>
|
||||
struct boost_array_tag
|
||||
{
|
||||
typedef geometry_not_recognized_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct boost_array_tag<true>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
// Assign the point-tag, preventing arrays of points getting a point-tag
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct tag<boost::array<CoordinateType, DimensionCount> >
|
||||
: detail::boost_array_tag<std::is_arithmetic<CoordinateType>::value> {};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct coordinate_type<boost::array<CoordinateType, DimensionCount> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct dimension<boost::array<CoordinateType, DimensionCount> >
|
||||
: std::integral_constant<std::size_t, DimensionCount>
|
||||
{};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>
|
||||
struct access<boost::array<CoordinateType, DimensionCount>, Dimension>
|
||||
{
|
||||
static inline CoordinateType get(boost::array<CoordinateType, DimensionCount> const& a)
|
||||
{
|
||||
return a[Dimension];
|
||||
}
|
||||
|
||||
static inline void set(boost::array<CoordinateType, DimensionCount>& a,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
a[Dimension] = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_BOOST_ARRAY_CS(CoordinateSystem) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template <class T, std::size_t N> \
|
||||
struct coordinate_system<boost::array<T, N> > \
|
||||
{ \
|
||||
typedef CoordinateSystem type; \
|
||||
}; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ARRAY_HPP
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2011-2015 Akira Takahashi
|
||||
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2015-2020.
|
||||
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/fusion/include/is_sequence.hpp>
|
||||
#include <boost/fusion/include/size.hpp>
|
||||
#include <boost/fusion/include/tag_of.hpp>
|
||||
#include <boost/fusion/include/front.hpp>
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
#include <boost/fusion/mpl.hpp>
|
||||
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/count_if.hpp>
|
||||
#include <boost/mpl/front.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
#include <boost/mpl/size.hpp>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace fusion_adapt_detail
|
||||
{
|
||||
|
||||
template <class Sequence>
|
||||
struct all_same :
|
||||
std::integral_constant
|
||||
<
|
||||
bool,
|
||||
boost::mpl::count_if<
|
||||
Sequence,
|
||||
boost::is_same<
|
||||
typename boost::mpl::front<Sequence>::type,
|
||||
boost::mpl::_
|
||||
>
|
||||
>::value == boost::mpl::size<Sequence>::value
|
||||
>
|
||||
{};
|
||||
|
||||
template <class Sequence>
|
||||
struct is_coordinate_size
|
||||
: std::integral_constant
|
||||
<
|
||||
bool,
|
||||
(boost::fusion::result_of::size<Sequence>::value == 2
|
||||
|| boost::fusion::result_of::size<Sequence>::value == 3)
|
||||
>
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename Sequence,
|
||||
bool IsSequence = boost::fusion::traits::is_sequence<Sequence>::value
|
||||
>
|
||||
struct is_fusion_sequence
|
||||
: std::integral_constant
|
||||
<
|
||||
bool,
|
||||
(fusion_adapt_detail::is_coordinate_size<Sequence>::value
|
||||
&& fusion_adapt_detail::all_same<Sequence>::value)
|
||||
>
|
||||
{};
|
||||
|
||||
template<typename Sequence>
|
||||
struct is_fusion_sequence<Sequence, false>
|
||||
: std::false_type
|
||||
{};
|
||||
|
||||
|
||||
} // namespace fusion_adapt_detail
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
// Boost Fusion Sequence, 2D or 3D
|
||||
template <typename Sequence>
|
||||
struct coordinate_type
|
||||
<
|
||||
Sequence,
|
||||
std::enable_if_t
|
||||
<
|
||||
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename boost::mpl::front<Sequence>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename Sequence>
|
||||
struct dimension
|
||||
<
|
||||
Sequence,
|
||||
std::enable_if_t
|
||||
<
|
||||
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
|
||||
>
|
||||
> : boost::mpl::size<Sequence>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Sequence, std::size_t Dimension>
|
||||
struct access
|
||||
<
|
||||
Sequence,
|
||||
Dimension,
|
||||
std::enable_if_t
|
||||
<
|
||||
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename coordinate_type<Sequence>::type ctype;
|
||||
|
||||
static inline ctype get(Sequence const& point)
|
||||
{
|
||||
return boost::fusion::at_c<Dimension>(point);
|
||||
}
|
||||
|
||||
template <class CoordinateType>
|
||||
static inline void set(Sequence& point, CoordinateType const& value)
|
||||
{
|
||||
boost::fusion::at_c<Dimension>(point) = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Sequence>
|
||||
struct tag
|
||||
<
|
||||
Sequence,
|
||||
std::enable_if_t
|
||||
<
|
||||
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
// Convenience registration macro to bind a Fusion sequence to a CS
|
||||
#define BOOST_GEOMETRY_REGISTER_BOOST_FUSION_CS(CoordinateSystem) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template <typename Sequence> \
|
||||
struct coordinate_system \
|
||||
< \
|
||||
Sequence, \
|
||||
std::enable_if_t \
|
||||
< \
|
||||
fusion_adapt_detail::is_fusion_sequence<Sequence>::value \
|
||||
> \
|
||||
> \
|
||||
{ typedef CoordinateSystem type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_FUSION_HPP
|
||||
@@ -0,0 +1,18 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP
|
||||
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/point.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/box.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/ring.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/polygon.hpp>
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HPP
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_BOX_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_BOX_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::rectangle_data -> boost::geometry::box
|
||||
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct tag<boost::polygon::rectangle_data<CoordinateType> >
|
||||
{
|
||||
typedef box_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct point_type<boost::polygon::rectangle_data<CoordinateType> >
|
||||
{
|
||||
// Not sure what to do here. Boost.Polygon's rectangle does NOT define its
|
||||
// point_type (but uses it...)
|
||||
typedef boost::polygon::point_data<CoordinateType> type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct indexed_access
|
||||
<
|
||||
boost::polygon::rectangle_data<CoordinateType>,
|
||||
min_corner, 0
|
||||
>
|
||||
{
|
||||
typedef boost::polygon::rectangle_data<CoordinateType> box_type;
|
||||
|
||||
static inline CoordinateType get(box_type const& b)
|
||||
{
|
||||
return boost::polygon::xl(b);
|
||||
}
|
||||
|
||||
static inline void set(box_type& b, CoordinateType const& value)
|
||||
{
|
||||
boost::polygon::xl(b, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct indexed_access
|
||||
<
|
||||
boost::polygon::rectangle_data<CoordinateType>,
|
||||
min_corner, 1
|
||||
>
|
||||
{
|
||||
typedef boost::polygon::rectangle_data<CoordinateType> box_type;
|
||||
|
||||
static inline CoordinateType get(box_type const& b)
|
||||
{
|
||||
return boost::polygon::yl(b);
|
||||
}
|
||||
|
||||
static inline void set(box_type& b, CoordinateType const& value)
|
||||
{
|
||||
boost::polygon::yl(b, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct indexed_access
|
||||
<
|
||||
boost::polygon::rectangle_data<CoordinateType>,
|
||||
max_corner, 0
|
||||
>
|
||||
{
|
||||
typedef boost::polygon::rectangle_data<CoordinateType> box_type;
|
||||
|
||||
static inline CoordinateType get(box_type const& b)
|
||||
{
|
||||
return boost::polygon::xh(b);
|
||||
}
|
||||
|
||||
static inline void set(box_type& b, CoordinateType const& value)
|
||||
{
|
||||
boost::polygon::xh(b, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct indexed_access
|
||||
<
|
||||
boost::polygon::rectangle_data<CoordinateType>,
|
||||
max_corner, 1
|
||||
>
|
||||
{
|
||||
typedef boost::polygon::rectangle_data<CoordinateType> box_type;
|
||||
|
||||
static inline CoordinateType get(box_type const& b)
|
||||
{
|
||||
return boost::polygon::yh(b);
|
||||
}
|
||||
|
||||
static inline void set(box_type& b, CoordinateType const& value)
|
||||
{
|
||||
boost::polygon::yh(b, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_BOX_HPP
|
||||
@@ -0,0 +1,83 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLE_ITERATOR_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLE_ITERATOR_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
|
||||
// hole_iterator -> returning ring_proxy's instead of normal polygon_data
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace adapt { namespace bp
|
||||
{
|
||||
|
||||
|
||||
template <typename Polygon, typename RingProxy>
|
||||
class hole_iterator
|
||||
: public ::boost::iterator_facade
|
||||
<
|
||||
hole_iterator<Polygon, RingProxy>,
|
||||
RingProxy, // value type
|
||||
boost::forward_traversal_tag,
|
||||
RingProxy // reference type
|
||||
>
|
||||
{
|
||||
public :
|
||||
typedef typename boost::polygon::polygon_with_holes_traits
|
||||
<
|
||||
Polygon
|
||||
>::iterator_holes_type ith_type;
|
||||
|
||||
explicit inline hole_iterator(Polygon& polygon, ith_type const it)
|
||||
: m_polygon(polygon)
|
||||
, m_base(it)
|
||||
{
|
||||
}
|
||||
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
|
||||
inline RingProxy dereference() const
|
||||
{
|
||||
return RingProxy(m_polygon, this->m_base);
|
||||
}
|
||||
|
||||
inline void increment() { ++m_base; }
|
||||
inline void decrement() { --m_base; }
|
||||
inline void advance(difference_type n)
|
||||
{
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
++m_base;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool equal(hole_iterator<Polygon, RingProxy> const& other) const
|
||||
{
|
||||
return this->m_base == other.m_base;
|
||||
}
|
||||
|
||||
Polygon& m_polygon;
|
||||
ith_type m_base;
|
||||
};
|
||||
|
||||
|
||||
}}}}
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLE_ITERATOR_HPP
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLES_PROXY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLES_PROXY_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
|
||||
// pair{begin_holes, begin_holes} -> interior_proxy
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/hole_iterator.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace adapt { namespace bp
|
||||
{
|
||||
|
||||
|
||||
// Polygon should implement the boost::polygon::polygon_with_holes_concept
|
||||
// Specify constness in the template parameter if necessary
|
||||
template<typename Polygon>
|
||||
struct holes_proxy
|
||||
{
|
||||
typedef ring_proxy
|
||||
<
|
||||
std::conditional_t
|
||||
<
|
||||
std::is_const<Polygon>::value,
|
||||
Polygon const,
|
||||
Polygon
|
||||
>
|
||||
> proxy_type;
|
||||
typedef hole_iterator<Polygon, proxy_type> iterator_type;
|
||||
|
||||
// The next line does not work probably because coordinate_type is part of the
|
||||
// polygon_traits, but not of the polygon_with_holes_traits
|
||||
// typedef typename boost::polygon::polygon_traits<Polygon>::coordinate_type coordinate_type;
|
||||
|
||||
// So we use:
|
||||
typedef typename Polygon::coordinate_type coordinate_type;
|
||||
|
||||
inline holes_proxy(Polygon& p)
|
||||
: polygon(p)
|
||||
{}
|
||||
|
||||
inline void clear()
|
||||
{
|
||||
Polygon empty;
|
||||
// Clear the holes
|
||||
polygon.set_holes
|
||||
(
|
||||
boost::polygon::begin_holes(empty),
|
||||
boost::polygon::end_holes(empty)
|
||||
);
|
||||
}
|
||||
|
||||
inline void resize(std::size_t new_size)
|
||||
{
|
||||
std::vector<boost::polygon::polygon_data<coordinate_type> > temporary_copy
|
||||
(
|
||||
boost::polygon::begin_holes(polygon),
|
||||
boost::polygon::end_holes(polygon)
|
||||
);
|
||||
temporary_copy.resize(new_size);
|
||||
polygon.set_holes(temporary_copy.begin(), temporary_copy.end());
|
||||
}
|
||||
|
||||
template <typename Ring>
|
||||
inline void push_back(Ring const& ring)
|
||||
{
|
||||
std::vector<boost::polygon::polygon_data<coordinate_type> > temporary_copy
|
||||
(
|
||||
boost::polygon::begin_holes(polygon),
|
||||
boost::polygon::end_holes(polygon)
|
||||
);
|
||||
boost::polygon::polygon_data<coordinate_type> added;
|
||||
boost::polygon::set_points(added, ring.begin(), ring.end());
|
||||
temporary_copy.push_back(added);
|
||||
polygon.set_holes(temporary_copy.begin(), temporary_copy.end());
|
||||
}
|
||||
|
||||
|
||||
Polygon& polygon;
|
||||
};
|
||||
|
||||
|
||||
// Support holes_proxy for Boost.Range ADP
|
||||
|
||||
// Const versions
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::holes_proxy<Polygon const>::iterator_type
|
||||
range_begin(boost::geometry::adapt::bp::holes_proxy<Polygon const> const& proxy)
|
||||
{
|
||||
typename boost::geometry::adapt::bp::holes_proxy<Polygon const>::iterator_type
|
||||
begin(proxy.polygon, boost::polygon::begin_holes(proxy.polygon));
|
||||
return begin;
|
||||
}
|
||||
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::holes_proxy<Polygon const>::iterator_type
|
||||
range_end(boost::geometry::adapt::bp::holes_proxy<Polygon const> const& proxy)
|
||||
{
|
||||
typename boost::geometry::adapt::bp::holes_proxy<Polygon const>::iterator_type
|
||||
end(proxy.polygon, boost::polygon::end_holes(proxy.polygon));
|
||||
return end;
|
||||
}
|
||||
|
||||
// Mutable versions
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::holes_proxy<Polygon>::iterator_type
|
||||
range_begin(boost::geometry::adapt::bp::holes_proxy<Polygon>& proxy)
|
||||
{
|
||||
typename boost::geometry::adapt::bp::holes_proxy<Polygon>::iterator_type
|
||||
begin(proxy.polygon, boost::polygon::begin_holes(proxy.polygon));
|
||||
return begin;
|
||||
}
|
||||
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::holes_proxy<Polygon>::iterator_type
|
||||
range_end(boost::geometry::adapt::bp::holes_proxy<Polygon>& proxy)
|
||||
{
|
||||
typename boost::geometry::adapt::bp::holes_proxy<Polygon>::iterator_type
|
||||
end(proxy.polygon, boost::polygon::end_holes(proxy.polygon));
|
||||
return end;
|
||||
}
|
||||
|
||||
|
||||
}}
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename Polygon>
|
||||
struct rvalue_type<adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
typedef adapt::bp::holes_proxy<Polygon> type;
|
||||
};
|
||||
|
||||
|
||||
template <typename Polygon>
|
||||
struct clear<adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
static inline void apply(adapt::bp::holes_proxy<Polygon> proxy)
|
||||
{
|
||||
proxy.clear();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Polygon>
|
||||
struct resize<adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
static inline void apply(adapt::bp::holes_proxy<Polygon> proxy, std::size_t new_size)
|
||||
{
|
||||
proxy.resize(new_size);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Polygon>
|
||||
struct push_back<adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
template <typename Ring>
|
||||
static inline void apply(adapt::bp::holes_proxy<Polygon> proxy, Ring const& ring)
|
||||
{
|
||||
proxy.push_back(ring);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace traits
|
||||
|
||||
|
||||
}}
|
||||
|
||||
|
||||
// Specialize holes_proxy for Boost.Range
|
||||
namespace boost
|
||||
{
|
||||
template<typename Polygon>
|
||||
struct range_mutable_iterator<geometry::adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
typedef typename geometry::adapt::bp::holes_proxy<Polygon>::iterator_type type;
|
||||
};
|
||||
|
||||
template<typename Polygon>
|
||||
struct range_const_iterator<geometry::adapt::bp::holes_proxy<Polygon> >
|
||||
{
|
||||
typedef typename geometry::adapt::bp::holes_proxy<Polygon const>::iterator_type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_HOLES_PROXY_HPP
|
||||
@@ -0,0 +1,108 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::point_data -> boost::geometry::point
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct tag<boost::polygon::point_data<CoordinateType> >
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct coordinate_type<boost::polygon::point_data<CoordinateType> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct coordinate_system<boost::polygon::point_data<CoordinateType> >
|
||||
{
|
||||
typedef cs::cartesian type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct dimension<boost::polygon::point_data<CoordinateType> >
|
||||
: std::integral_constant<std::size_t, 2>
|
||||
{};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct access<boost::polygon::point_data<CoordinateType>, 0>
|
||||
{
|
||||
typedef boost::polygon::point_data<CoordinateType> point_type;
|
||||
|
||||
static inline CoordinateType get(point_type const& p)
|
||||
{
|
||||
return p.x();
|
||||
}
|
||||
|
||||
static inline void set(point_type& p, CoordinateType const& value)
|
||||
{
|
||||
p.x(value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct access<boost::polygon::point_data<CoordinateType>, 1>
|
||||
{
|
||||
typedef boost::polygon::point_data<CoordinateType> point_type;
|
||||
|
||||
static inline CoordinateType get(point_type const& p)
|
||||
{
|
||||
return p.y();
|
||||
}
|
||||
|
||||
static inline void set(point_type& p, CoordinateType const& value)
|
||||
{
|
||||
p.y(value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POINT_HPP
|
||||
@@ -0,0 +1,111 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/hole_iterator.hpp>
|
||||
#include <boost/geometry/geometries/adapted/boost_polygon/holes_proxy.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct tag<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef polygon_tag type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct ring_const_type<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef adapt::bp::ring_proxy<boost::polygon::polygon_with_holes_data<CoordinateType> const> type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct ring_mutable_type<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef adapt::bp::ring_proxy<boost::polygon::polygon_with_holes_data<CoordinateType> > type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct interior_const_type<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef adapt::bp::holes_proxy<boost::polygon::polygon_with_holes_data<CoordinateType> const> type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct interior_mutable_type<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef adapt::bp::holes_proxy<boost::polygon::polygon_with_holes_data<CoordinateType> > type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct exterior_ring<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef boost::polygon::polygon_with_holes_data<CoordinateType> polygon_type;
|
||||
typedef adapt::bp::ring_proxy<polygon_type> proxy;
|
||||
typedef adapt::bp::ring_proxy<polygon_type const> const_proxy;
|
||||
|
||||
static inline proxy get(polygon_type& p)
|
||||
{
|
||||
return proxy(p);
|
||||
}
|
||||
|
||||
static inline const_proxy get(polygon_type const& p)
|
||||
{
|
||||
return const_proxy(p);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct interior_rings<boost::polygon::polygon_with_holes_data<CoordinateType> >
|
||||
{
|
||||
typedef boost::polygon::polygon_with_holes_data<CoordinateType> polygon_type;
|
||||
typedef adapt::bp::holes_proxy<polygon_type> proxy;
|
||||
typedef adapt::bp::holes_proxy<polygon_type const> const_proxy;
|
||||
|
||||
static inline proxy get(polygon_type& p)
|
||||
{
|
||||
return proxy(p);
|
||||
}
|
||||
|
||||
static inline const_proxy get(polygon_type const& p)
|
||||
{
|
||||
return const_proxy(p);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_POLYGON_HPP
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::polygon_data -> boost::geometry::ring
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct tag<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef ring_tag type;
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct clear<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
static inline void apply(boost::polygon::polygon_data<CoordinateType>& data)
|
||||
{
|
||||
// There is no "clear" function but we can assign
|
||||
// a newly (and therefore empty) constructed polygon
|
||||
boost::polygon::assign(data, boost::polygon::polygon_data<CoordinateType>());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct push_back<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef boost::polygon::point_data<CoordinateType> point_type;
|
||||
|
||||
static inline void apply(boost::polygon::polygon_data<CoordinateType>& data,
|
||||
point_type const& point)
|
||||
{
|
||||
// Boost.Polygon's polygons are not appendable. So create a temporary vector,
|
||||
// add a record and set it to the original. Of course: this is not efficient.
|
||||
// But there seems no other way (without using a wrapper)
|
||||
std::vector<point_type> temporary_vector
|
||||
(
|
||||
boost::polygon::begin_points(data),
|
||||
boost::polygon::end_points(data)
|
||||
);
|
||||
temporary_vector.push_back(point);
|
||||
data.set(temporary_vector.begin(), temporary_vector.end());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CoordinateType>
|
||||
struct resize<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef boost::polygon::point_data<CoordinateType> point_type;
|
||||
|
||||
static inline void apply(boost::polygon::polygon_data<CoordinateType>& data,
|
||||
std::size_t new_size)
|
||||
{
|
||||
// Boost.Polygon's polygons are not resizable. So create a temporary vector,
|
||||
// resize it and set it to the original. Of course: this is not efficient.
|
||||
// But there seems no other way (without using a wrapper)
|
||||
std::vector<point_type> temporary_vector
|
||||
(
|
||||
boost::polygon::begin_points(data),
|
||||
boost::polygon::end_points(data)
|
||||
);
|
||||
temporary_vector.resize(new_size);
|
||||
data.set(temporary_vector.begin(), temporary_vector.end());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
// Adapt Boost.Polygon's polygon_data to Boost.Range
|
||||
// This just translates to
|
||||
// polygon_data.begin() and polygon_data.end()
|
||||
namespace boost
|
||||
{
|
||||
template<typename CoordinateType>
|
||||
struct range_mutable_iterator<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef typename boost::polygon::polygon_traits
|
||||
<
|
||||
boost::polygon::polygon_data<CoordinateType>
|
||||
>::iterator_type type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType>
|
||||
struct range_const_iterator<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef typename boost::polygon::polygon_traits
|
||||
<
|
||||
boost::polygon::polygon_data<CoordinateType>
|
||||
>::iterator_type type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType>
|
||||
struct range_size<boost::polygon::polygon_data<CoordinateType> >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
// Support Boost.Polygon's polygon_data for Boost.Range ADP
|
||||
namespace boost { namespace polygon
|
||||
{
|
||||
|
||||
template<typename CoordinateType>
|
||||
inline typename polygon_traits
|
||||
<
|
||||
polygon_data<CoordinateType>
|
||||
>::iterator_type range_begin(polygon_data<CoordinateType>& polygon)
|
||||
{
|
||||
return polygon.begin();
|
||||
}
|
||||
|
||||
template<typename CoordinateType>
|
||||
inline typename polygon_traits
|
||||
<
|
||||
polygon_data<CoordinateType>
|
||||
>::iterator_type range_begin(polygon_data<CoordinateType> const& polygon)
|
||||
{
|
||||
return polygon.begin();
|
||||
}
|
||||
|
||||
template<typename CoordinateType>
|
||||
inline typename polygon_traits
|
||||
<
|
||||
polygon_data<CoordinateType>
|
||||
>::iterator_type range_end(polygon_data<CoordinateType>& polygon)
|
||||
{
|
||||
return polygon.end();
|
||||
}
|
||||
|
||||
template<typename CoordinateType>
|
||||
inline typename polygon_traits
|
||||
<
|
||||
polygon_data<CoordinateType>
|
||||
>::iterator_type range_end(polygon_data<CoordinateType> const& polygon)
|
||||
{
|
||||
return polygon.end();
|
||||
}
|
||||
|
||||
template<typename CoordinateType>
|
||||
inline std::size_t range_calculate_size(polygon_data<CoordinateType> const& polygon)
|
||||
{
|
||||
return polygon.size();
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_HPP
|
||||
@@ -0,0 +1,308 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// This file was modified by Oracle on 2018.
|
||||
// Modifications copyright (c) 2018, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_PROXY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_PROXY_HPP
|
||||
|
||||
// Adapts Geometries from Boost.Polygon for usage in Boost.Geometry
|
||||
// boost::polygon::polygon_with_holes_data -> boost::geometry::polygon
|
||||
// pair{begin_points, end_points} -> ring_proxy
|
||||
|
||||
#include <boost/polygon/polygon.hpp>
|
||||
#include <boost/range/const_iterator.hpp>
|
||||
#include <boost/range/mutable_iterator.hpp>
|
||||
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace adapt { namespace bp
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <bool Mutable>
|
||||
struct modify
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct modify<true>
|
||||
{
|
||||
template <typename Ring, typename Point>
|
||||
static inline void push_back(Ring& ring, Point const& point)
|
||||
{
|
||||
// Boost.Polygon's polygons are not appendable. So create a temporary vector,
|
||||
// add a record and set it to the original. Of course: this is not efficient.
|
||||
// But there seems no other way (without using a wrapper)
|
||||
std::vector<Point> temporary_vector
|
||||
(
|
||||
boost::polygon::begin_points(ring),
|
||||
boost::polygon::end_points(ring)
|
||||
);
|
||||
temporary_vector.push_back(point);
|
||||
boost::polygon::set_points(ring, temporary_vector.begin(), temporary_vector.end());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template <>
|
||||
struct modify<false>
|
||||
{
|
||||
template <typename Ring, typename Point>
|
||||
static inline void push_back(Ring& /*ring*/, Point const& /*point*/)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Polygon should implement the boost::polygon::polygon_with_holes_concept
|
||||
// Specify constness in the template parameter if necessary
|
||||
template<typename Polygon>
|
||||
class ring_proxy
|
||||
{
|
||||
public :
|
||||
typedef typename boost::polygon::polygon_traits
|
||||
<
|
||||
typename boost::remove_const<Polygon>::type
|
||||
>::iterator_type iterator_type;
|
||||
|
||||
typedef typename boost::polygon::polygon_with_holes_traits
|
||||
<
|
||||
typename boost::remove_const<Polygon>::type
|
||||
>::iterator_holes_type hole_iterator_type;
|
||||
|
||||
static const bool is_mutable = !boost::is_const<Polygon>::type::value;
|
||||
|
||||
inline ring_proxy(Polygon& p)
|
||||
: m_polygon_pointer(&p)
|
||||
, m_do_hole(false)
|
||||
{}
|
||||
|
||||
// Constructor used from hole_iterator
|
||||
inline ring_proxy(Polygon& p, hole_iterator_type hole_it)
|
||||
: m_polygon_pointer(&p)
|
||||
, m_do_hole(true)
|
||||
, m_hole_it(hole_it)
|
||||
{}
|
||||
|
||||
// Default constructor, for mutable polygons / appending (interior) rings
|
||||
inline ring_proxy()
|
||||
: m_polygon_pointer(&m_polygon_for_default_constructor)
|
||||
, m_do_hole(false)
|
||||
{}
|
||||
|
||||
|
||||
iterator_type begin() const
|
||||
{
|
||||
return m_do_hole
|
||||
? boost::polygon::begin_points(*m_hole_it)
|
||||
: boost::polygon::begin_points(*m_polygon_pointer)
|
||||
;
|
||||
}
|
||||
|
||||
iterator_type begin()
|
||||
{
|
||||
return m_do_hole
|
||||
? boost::polygon::begin_points(*m_hole_it)
|
||||
: boost::polygon::begin_points(*m_polygon_pointer)
|
||||
;
|
||||
}
|
||||
|
||||
iterator_type end() const
|
||||
{
|
||||
return m_do_hole
|
||||
? boost::polygon::end_points(*m_hole_it)
|
||||
: boost::polygon::end_points(*m_polygon_pointer)
|
||||
;
|
||||
}
|
||||
|
||||
iterator_type end()
|
||||
{
|
||||
return m_do_hole
|
||||
? boost::polygon::end_points(*m_hole_it)
|
||||
: boost::polygon::end_points(*m_polygon_pointer)
|
||||
;
|
||||
}
|
||||
|
||||
// Mutable
|
||||
void clear()
|
||||
{
|
||||
Polygon p;
|
||||
if (m_do_hole)
|
||||
{
|
||||
// Does NOT work see comment above
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::polygon::set_points(*m_polygon_pointer,
|
||||
boost::polygon::begin_points(p),
|
||||
boost::polygon::end_points(p));
|
||||
}
|
||||
}
|
||||
|
||||
void resize(std::size_t /*new_size*/)
|
||||
{
|
||||
if (m_do_hole)
|
||||
{
|
||||
// Does NOT work see comment above
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: implement this by resizing the container
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template <typename Point>
|
||||
void push_back(Point const& point)
|
||||
{
|
||||
if (m_do_hole)
|
||||
{
|
||||
//detail::modify<is_mutable>::push_back(*m_hole_it, point);
|
||||
//std::cout << "HOLE: " << typeid(*m_hole_it).name() << std::endl;
|
||||
//std::cout << "HOLE: " << typeid(m_hole_it).name() << std::endl;
|
||||
//std::cout << "HOLE: " << typeid(hole_iterator_type).name() << std::endl;
|
||||
|
||||
// Note, ths does NOT work because hole_iterator_type is defined
|
||||
// as a const_iterator by Boost.Polygon
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
detail::modify<is_mutable>::push_back(*m_polygon_pointer, point);
|
||||
}
|
||||
}
|
||||
|
||||
private :
|
||||
Polygon* m_polygon_pointer;
|
||||
bool m_do_hole;
|
||||
hole_iterator_type m_hole_it;
|
||||
|
||||
Polygon m_polygon_for_default_constructor;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Support geometry::adapt::bp::ring_proxy for Boost.Range ADP
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::ring_proxy<Polygon>::iterator_type
|
||||
range_begin(boost::geometry::adapt::bp::ring_proxy<Polygon>& proxy)
|
||||
{
|
||||
return proxy.begin();
|
||||
}
|
||||
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::ring_proxy<Polygon const>::iterator_type
|
||||
range_begin(boost::geometry::adapt::bp::ring_proxy<Polygon const> const& proxy)
|
||||
{
|
||||
return proxy.begin();
|
||||
}
|
||||
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::ring_proxy<Polygon>::iterator_type
|
||||
range_end(boost::geometry::adapt::bp::ring_proxy<Polygon>& proxy)
|
||||
{
|
||||
return proxy.end();
|
||||
}
|
||||
|
||||
template<typename Polygon>
|
||||
inline typename boost::geometry::adapt::bp::ring_proxy<Polygon const>::iterator_type
|
||||
range_end(boost::geometry::adapt::bp::ring_proxy<Polygon const> const& proxy)
|
||||
{
|
||||
return proxy.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}} // namespace adapt::bp
|
||||
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename Polygon>
|
||||
struct tag<adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
typedef ring_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <typename Polygon>
|
||||
struct rvalue_type<adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
typedef adapt::bp::ring_proxy<Polygon> type;
|
||||
};
|
||||
|
||||
template <typename Polygon>
|
||||
struct clear<adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
static inline void apply(adapt::bp::ring_proxy<Polygon> proxy)
|
||||
{
|
||||
proxy.clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Polygon>
|
||||
struct resize<adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
static inline void apply(adapt::bp::ring_proxy<Polygon> proxy, std::size_t new_size)
|
||||
{
|
||||
proxy.resize(new_size);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Polygon>
|
||||
struct push_back<adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
static inline void apply(adapt::bp::ring_proxy<Polygon> proxy,
|
||||
typename boost::polygon::polygon_traits<Polygon>::point_type const& point)
|
||||
{
|
||||
proxy.push_back(point);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
// Specialize ring_proxy for Boost.Range
|
||||
namespace boost
|
||||
{
|
||||
template<typename Polygon>
|
||||
struct range_mutable_iterator<geometry::adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
typedef typename geometry::adapt::bp::ring_proxy<Polygon>::iterator_type type;
|
||||
};
|
||||
|
||||
template<typename Polygon>
|
||||
struct range_const_iterator<geometry::adapt::bp::ring_proxy<Polygon> >
|
||||
{
|
||||
typedef typename geometry::adapt::bp::ring_proxy<Polygon const>::iterator_type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_POLYGON_RING_PROXY_HPP
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_ADJACENT_FILTERED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_ADJACENT_FILTERED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/adjacent_filtered.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Filter, typename Geometry, bool DefaultPass>
|
||||
#if BOOST_VERSION > 104500
|
||||
struct tag<boost::adjacent_filtered_range<Filter, Geometry, DefaultPass> >
|
||||
#else
|
||||
struct tag<boost::range_detail::adjacent_filter_range<Filter, Geometry, DefaultPass> >
|
||||
#endif
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_ADJACENT_FILTERED_HPP
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_FILTERED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_FILTERED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/filtered.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Filter, typename Geometry>
|
||||
#if BOOST_VERSION > 104500
|
||||
struct tag<boost::filtered_range<Filter, Geometry> >
|
||||
#else
|
||||
struct tag<boost::range_detail::filter_range<Filter, Geometry> >
|
||||
#endif
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_FILTERED_HPP
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_REVERSED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_REVERSED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/reversed.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Geometry>
|
||||
#if BOOST_VERSION > 104500
|
||||
struct tag<boost::reversed_range<Geometry> >
|
||||
#else
|
||||
struct tag<boost::range_detail::reverse_range<Geometry> >
|
||||
#endif
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_REVERSED_HPP
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_SLICED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_SLICED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/sliced.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Geometry>
|
||||
struct tag<boost::adaptors::sliced_range<Geometry> >
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_SLICED_HPP
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_STRIDED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_STRIDED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/strided.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Geometry>
|
||||
struct tag<boost::strided_range<Geometry> >
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_STRIDED_HPP
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_UNIQUED_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_UNIQUED_HPP
|
||||
|
||||
|
||||
#include <boost/range/adaptor/uniqued.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template<typename Geometry>
|
||||
#if BOOST_VERSION > 104500
|
||||
struct tag<boost::uniqued_range<Geometry> >
|
||||
#else
|
||||
struct tag<boost::range_detail::unique_range<Geometry> >
|
||||
#endif
|
||||
{
|
||||
typedef typename geometry::tag<Geometry>::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_RANGE_UNIQUED_HPP
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2018-2020.
|
||||
// Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_TUPLE_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10>
|
||||
struct tag<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10>
|
||||
struct coordinate_type<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
|
||||
{
|
||||
typedef T1 type;
|
||||
};
|
||||
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10>
|
||||
struct dimension<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
|
||||
: std::integral_constant
|
||||
<
|
||||
std::size_t,
|
||||
boost::tuples::length
|
||||
<
|
||||
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
|
||||
>::value
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5,
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10,
|
||||
std::size_t Dimension>
|
||||
struct access
|
||||
<
|
||||
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>,
|
||||
Dimension
|
||||
>
|
||||
{
|
||||
static inline T1 get(
|
||||
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> const& point)
|
||||
{
|
||||
return point.template get<Dimension>();
|
||||
}
|
||||
|
||||
static inline void set(
|
||||
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& point,
|
||||
T1 const& value)
|
||||
{
|
||||
point.template get<Dimension>() = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
// Convenience registration macro to bind boost::tuple to a CS
|
||||
#define BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(CoordinateSystem) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, \
|
||||
typename T6, typename T7, typename T8, typename T9, typename T10> \
|
||||
struct coordinate_system<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> > \
|
||||
{ \
|
||||
typedef CoordinateSystem type; \
|
||||
}; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_TUPLE_HPP
|
||||
@@ -0,0 +1,116 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
// Create class and specialization to indicate the tag
|
||||
// for normal cases and the case that the type of the c-array is arithmetic
|
||||
template <bool>
|
||||
struct c_array_tag
|
||||
{
|
||||
typedef geometry_not_recognized_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct c_array_tag<true>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
// Assign the point-tag, preventing arrays of points getting a point-tag
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct tag<CoordinateType[DimensionCount]>
|
||||
: detail::c_array_tag<std::is_arithmetic<CoordinateType>::value> {};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct coordinate_type<CoordinateType[DimensionCount]>
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct dimension<CoordinateType[DimensionCount]>
|
||||
: std::integral_constant<std::size_t, DimensionCount>
|
||||
{};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>
|
||||
struct access<CoordinateType[DimensionCount], Dimension>
|
||||
{
|
||||
static inline CoordinateType get(CoordinateType const p[DimensionCount])
|
||||
{
|
||||
return p[Dimension];
|
||||
}
|
||||
|
||||
static inline void set(CoordinateType p[DimensionCount],
|
||||
CoordinateType const& value)
|
||||
{
|
||||
p[Dimension] = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_C_ARRAY_CS(CoordinateSystem) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template <typename T, std::size_t N> \
|
||||
struct coordinate_system<T[N]> \
|
||||
{ \
|
||||
typedef CoordinateSystem type; \
|
||||
}; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_HPP
|
||||
@@ -0,0 +1,135 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2010 Alfredo Correa
|
||||
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2016 Norbert Wenzel
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP
|
||||
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_ARRAY
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_ADAPTED_STD_ARRAY_TAG_DEFINED
|
||||
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
// Create class and specialization to indicate the tag
|
||||
// for normal cases and the case that the type of the std-array is arithmetic
|
||||
template <bool>
|
||||
struct std_array_tag
|
||||
{
|
||||
typedef geometry_not_recognized_tag type;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct std_array_tag<true>
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
// Assign the point-tag, preventing arrays of points getting a point-tag
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct tag<std::array<CoordinateType, DimensionCount> >
|
||||
: detail::std_array_tag<std::is_arithmetic<CoordinateType>::value> {};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct coordinate_type<std::array<CoordinateType, DimensionCount> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount>
|
||||
struct dimension<std::array<CoordinateType, DimensionCount> >
|
||||
: std::integral_constant<std::size_t, DimensionCount>
|
||||
{};
|
||||
|
||||
|
||||
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>
|
||||
struct access<std::array<CoordinateType, DimensionCount>, Dimension>
|
||||
{
|
||||
static inline CoordinateType get(std::array<CoordinateType, DimensionCount> const& a)
|
||||
{
|
||||
return a[Dimension];
|
||||
}
|
||||
|
||||
static inline void set(std::array<CoordinateType, DimensionCount>& a,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
a[Dimension] = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_STD_ARRAY_CS(CoordinateSystem) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template <class T, std::size_t N> \
|
||||
struct coordinate_system<std::array<T, N> > \
|
||||
{ \
|
||||
typedef CoordinateSystem type; \
|
||||
}; \
|
||||
}}}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#warning "This file requires compiler and library support for the ISO C++ 2011 standard."
|
||||
|
||||
|
||||
#endif // BOOST_NO_CXX11_HDR_ARRAY
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_PAIR_AS_SEGMENT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_PAIR_AS_SEGMENT_HPP
|
||||
|
||||
// Only possible if the std::pair is not used for iterator/pair
|
||||
// (maybe it is possible to avoid that by detecting in the other file
|
||||
// if an iterator was used in the pair)
|
||||
|
||||
#ifdef BOOST_GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
|
||||
#error Include only one headerfile to register tag for adapted std:: containers or iterator pair
|
||||
#endif
|
||||
|
||||
#define BOOST_GEOMETRY_ADAPTED_STD_RANGE_TAG_DEFINED
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
|
||||
template <typename Point>
|
||||
struct tag<std::pair<Point, Point> >
|
||||
{
|
||||
typedef segment_tag type;
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct point_type<std::pair<Point, Point> >
|
||||
{
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<std::pair<Point, Point>, 0, Dimension>
|
||||
{
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(std::pair<Point, Point> const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.first);
|
||||
}
|
||||
|
||||
static inline void set(std::pair<Point, Point>& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.first, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<std::pair<Point, Point>, 1, Dimension>
|
||||
{
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(std::pair<Point, Point> const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.second);
|
||||
}
|
||||
|
||||
static inline void set(std::pair<Point, Point>& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.second, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_PAIR_AS_SEGMENT_HPP
|
||||
255
install/boost_1_75_0/include/boost/geometry/geometries/box.hpp
Normal file
255
install/boost_1_75_0/include/boost/geometry/geometries/box.hpp
Normal file
@@ -0,0 +1,255 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_BOX_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_BOX_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/convert.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/make.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief Class box: defines a box made of two describing points
|
||||
\ingroup geometries
|
||||
\details Box is always described by a min_corner() and a max_corner() point. If another
|
||||
rectangle is used, use linear_ring or polygon.
|
||||
\note Boxes are for selections and for calculating the envelope of geometries. Not all algorithms
|
||||
are implemented for box. Boxes are also used in Spatial Indexes.
|
||||
\tparam Point point type. The box takes a point type as template parameter.
|
||||
The point type can be any point type.
|
||||
It can be 2D but can also be 3D or more dimensional.
|
||||
The box can also take a latlong point type as template parameter.
|
||||
|
||||
\qbk{[include reference/geometries/box.qbk]}
|
||||
\qbk{before.synopsis, [heading Model of]}
|
||||
\qbk{before.synopsis, [link geometry.reference.concepts.concept_box Box Concept]}
|
||||
*/
|
||||
|
||||
template<typename Point>
|
||||
class box
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
public:
|
||||
|
||||
// TODO: constexpr requires LiteralType and until C++20
|
||||
// it has to have trivial destructor which makes access
|
||||
// debugging impossible with constexpr.
|
||||
|
||||
#if !defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
/// \constructor_default_no_init
|
||||
constexpr box() = default;
|
||||
#else // defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
box()
|
||||
{
|
||||
m_created = 1;
|
||||
}
|
||||
~box()
|
||||
{
|
||||
m_created = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Constructor taking the minimum corner point and the maximum corner point
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename P = Point,
|
||||
std::enable_if_t
|
||||
<
|
||||
! std::is_copy_constructible<P>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
box(Point const& min_corner, Point const& max_corner)
|
||||
{
|
||||
geometry::convert(min_corner, m_min_corner);
|
||||
geometry::convert(max_corner, m_max_corner);
|
||||
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
m_created = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Constructor taking the minimum corner point and the maximum corner point
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename P = Point,
|
||||
std::enable_if_t
|
||||
<
|
||||
std::is_copy_constructible<P>::value,
|
||||
int
|
||||
> = 0
|
||||
>
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
box(Point const& min_corner, Point const& max_corner)
|
||||
: m_min_corner(min_corner)
|
||||
, m_max_corner(max_corner)
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
m_created = 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
Point const& min_corner() const
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
#endif
|
||||
return m_min_corner;
|
||||
}
|
||||
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
Point const& max_corner() const
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
#endif
|
||||
return m_max_corner;
|
||||
}
|
||||
|
||||
Point& min_corner()
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
#endif
|
||||
return m_min_corner;
|
||||
}
|
||||
|
||||
Point& max_corner()
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
#endif
|
||||
return m_max_corner;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Point m_min_corner;
|
||||
Point m_max_corner;
|
||||
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
int m_created;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
// Traits specializations for box above
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename Point>
|
||||
struct tag<model::box<Point> >
|
||||
{
|
||||
typedef box_tag type;
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct point_type<model::box<Point> >
|
||||
{
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::box<Point>, min_corner, Dimension>
|
||||
{
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
|
||||
static constexpr coordinate_type get(model::box<Point> const& b)
|
||||
{
|
||||
return geometry::get<Dimension>(b.min_corner());
|
||||
}
|
||||
|
||||
static void set(model::box<Point>& b, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(b.min_corner(), value);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::box<Point>, max_corner, Dimension>
|
||||
{
|
||||
typedef typename geometry::coordinate_type<Point>::type coordinate_type;
|
||||
|
||||
static constexpr coordinate_type get(model::box<Point> const& b)
|
||||
{
|
||||
return geometry::get<Dimension>(b.max_corner());
|
||||
}
|
||||
|
||||
static void set(model::box<Point>& b, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(b.max_corner(), value);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct make<model::box<Point> >
|
||||
{
|
||||
typedef model::box<Point> box_type;
|
||||
|
||||
static const bool is_specialized = true;
|
||||
|
||||
static constexpr box_type apply(Point const& min_corner, Point const& max_corner)
|
||||
{
|
||||
return box_type(min_corner, max_corner);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_BOX_HPP
|
||||
@@ -0,0 +1,135 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_BOX_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_BOX_CONCEPT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Box concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The box concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining box_tag as type
|
||||
- there must be a specialization of traits::point_type to define the
|
||||
underlying point type (even if it does not consist of points, it should define
|
||||
this type, to indicate the points it can work with)
|
||||
- there must be a specialization of traits::indexed_access, per index
|
||||
(min_corner, max_corner) and per dimension, with two functions:
|
||||
- get to get a coordinate value
|
||||
- set to set a coordinate value (this one is not checked for ConstBox)
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class Box
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
std::size_t Index,
|
||||
std::size_t Dimension,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Geometry* b = 0;
|
||||
geometry::set<Index, Dimension>(*b, geometry::get<Index, Dimension>(*b));
|
||||
dimension_checker<Index, Dimension + 1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
template <std::size_t Index, std::size_t DimensionCount>
|
||||
struct dimension_checker<Index, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(Box)
|
||||
{
|
||||
static const std::size_t n = dimension<Geometry>::type::value;
|
||||
dimension_checker<min_corner, 0, n>::apply();
|
||||
dimension_checker<max_corner, 0, n>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Box concept (const version)
|
||||
\ingroup const_concepts
|
||||
\details The ConstBox concept apply the same as the Box concept,
|
||||
but does not apply write access.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstBox
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef typename coordinate_type<Geometry>::type coordinate_type;
|
||||
|
||||
template
|
||||
<
|
||||
std::size_t Index,
|
||||
std::size_t Dimension,
|
||||
std::size_t DimensionCount
|
||||
>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
const Geometry* b = 0;
|
||||
coordinate_type coord(geometry::get<Index, Dimension>(*b));
|
||||
boost::ignore_unused(coord);
|
||||
dimension_checker<Index, Dimension + 1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
template <std::size_t Index, std::size_t DimensionCount>
|
||||
struct dimension_checker<Index, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public :
|
||||
BOOST_CONCEPT_USAGE(ConstBox)
|
||||
{
|
||||
static const std::size_t n = dimension<Geometry>::type::value;
|
||||
dimension_checker<min_corner, 0, n>::apply();
|
||||
dimension_checker<max_corner, 0, n>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_BOX_CONCEPT_HPP
|
||||
@@ -0,0 +1,257 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/concept/requires.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/variant/variant_fwd.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/box_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/linestring_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/multi_point_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/multi_linestring_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/multi_polygon_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/polygon_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/ring_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/segment_concept.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/not_implemented.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail { namespace concept_check
|
||||
{
|
||||
|
||||
template <typename Concept>
|
||||
class check
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT((Concept ));
|
||||
};
|
||||
|
||||
}} // namespace detail::concept_check
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DISPATCH
|
||||
namespace dispatch
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename GeometryTag = typename geometry::tag<Geometry>::type,
|
||||
bool IsConst = std::is_const<Geometry>::type::value
|
||||
>
|
||||
struct check : not_implemented<GeometryTag>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, point_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstPoint<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, point_tag, false>
|
||||
: detail::concept_check::check<concepts::Point<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, linestring_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstLinestring<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, linestring_tag, false>
|
||||
: detail::concept_check::check<concepts::Linestring<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, ring_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstRing<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, ring_tag, false>
|
||||
: detail::concept_check::check<concepts::Ring<Geometry> >
|
||||
{};
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, polygon_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstPolygon<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, polygon_tag, false>
|
||||
: detail::concept_check::check<concepts::Polygon<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, box_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstBox<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, box_tag, false>
|
||||
: detail::concept_check::check<concepts::Box<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, segment_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstSegment<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, segment_tag, false>
|
||||
: detail::concept_check::check<concepts::Segment<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_point_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstMultiPoint<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_point_tag, false>
|
||||
: detail::concept_check::check<concepts::MultiPoint<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_linestring_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstMultiLinestring<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_linestring_tag, false>
|
||||
: detail::concept_check::check<concepts::MultiLinestring<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_polygon_tag, true>
|
||||
: detail::concept_check::check<concepts::ConstMultiPolygon<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct check<Geometry, multi_polygon_tag, false>
|
||||
: detail::concept_check::check<concepts::MultiPolygon<Geometry> >
|
||||
{};
|
||||
|
||||
|
||||
} // namespace dispatch
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
namespace concepts
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct checker : dispatch::check<Geometry>
|
||||
{};
|
||||
|
||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
||||
struct checker<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
{};
|
||||
|
||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
||||
struct checker<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const>
|
||||
{};
|
||||
|
||||
|
||||
}
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks, in compile-time, the concept of any geometry
|
||||
\ingroup concepts
|
||||
*/
|
||||
template <typename Geometry>
|
||||
// workaround for VS2015
|
||||
#if !defined(_MSC_VER) || (_MSC_VER >= 1910)
|
||||
constexpr
|
||||
#endif
|
||||
inline void check()
|
||||
{
|
||||
detail::checker<Geometry> c;
|
||||
boost::ignore_unused(c);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks, in compile-time, the concept of two geometries, and if they
|
||||
have equal dimensions
|
||||
\ingroup concepts
|
||||
*/
|
||||
template <typename Geometry1, typename Geometry2>
|
||||
// workaround for VS2015
|
||||
#if !defined(_MSC_VER) || (_MSC_VER >= 1910)
|
||||
constexpr
|
||||
#endif
|
||||
inline void check_concepts_and_equal_dimensions()
|
||||
{
|
||||
check<Geometry1>();
|
||||
check<Geometry2>();
|
||||
assert_dimension_equal<Geometry1, Geometry2>();
|
||||
}
|
||||
|
||||
|
||||
} // namespace concepts
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
|
||||
@@ -0,0 +1,128 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Linestring concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The linestring concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining linestring_tag as type
|
||||
- it must behave like a Boost.Range
|
||||
- it must implement a std::back_insert_iterator
|
||||
- either by implementing push_back
|
||||
- or by specializing std::back_insert_iterator
|
||||
|
||||
\note to fulfill the concepts, no traits class has to be specialized to
|
||||
define the point type.
|
||||
|
||||
\par Example:
|
||||
|
||||
A custom linestring, defining the necessary specializations to fulfill to the concept.
|
||||
|
||||
Suppose that the following linestring is defined:
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip custom_linestring1
|
||||
\until };
|
||||
|
||||
It can then be adapted to the concept as following:
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip adapt custom_linestring1
|
||||
\until }}
|
||||
|
||||
\note
|
||||
- There is also the registration macro BOOST_GEOMETRY_REGISTER_LINESTRING
|
||||
- For registration of std::vector<P> (and deque, and list) it is enough to
|
||||
include the header-file geometries/adapted/std_as_linestring.hpp. That registers
|
||||
a vector as a linestring (so it cannot be registered as a linear ring then,
|
||||
in the same source code).
|
||||
|
||||
|
||||
*/
|
||||
|
||||
template <typename Geometry>
|
||||
class Linestring
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(Linestring)
|
||||
{
|
||||
Geometry* ls = 0;
|
||||
traits::clear<Geometry>::apply(*ls);
|
||||
traits::resize<Geometry>::apply(*ls, 0);
|
||||
point_type* point = 0;
|
||||
traits::push_back<Geometry>::apply(*ls, *point);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Linestring concept (const version)
|
||||
\ingroup const_concepts
|
||||
\details The ConstLinestring concept check the same as the Linestring concept,
|
||||
but does not check write access.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstLinestring
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
|
||||
//BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
// Relaxed the concept.
|
||||
BOOST_CONCEPT_ASSERT( (boost::ForwardRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstLinestring)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP
|
||||
@@ -0,0 +1,94 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/linestring_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief multi-linestring concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The multi linestring concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining multi_linestring_tag as
|
||||
type
|
||||
- it must behave like a Boost.Range
|
||||
- its range value must fulfil the Linestring concept
|
||||
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class MultiLinestring
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type linestring_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Linestring<linestring_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(MultiLinestring)
|
||||
{
|
||||
Geometry* mls = 0;
|
||||
traits::clear<Geometry>::apply(*mls);
|
||||
traits::resize<Geometry>::apply(*mls, 0);
|
||||
linestring_type* ls = 0;
|
||||
traits::push_back<Geometry>::apply(*mls, *ls);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief concept for multi-linestring (const version)
|
||||
\ingroup const_concepts
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstMultiLinestring
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type linestring_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstLinestring<linestring_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstMultiLinestring)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
|
||||
@@ -0,0 +1,95 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief MultiPoint concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The multi point concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining multi_point_tag as type
|
||||
- it must behave like a Boost.Range
|
||||
- its range value must fulfil the Point concept
|
||||
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class MultiPoint
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(MultiPoint)
|
||||
{
|
||||
Geometry* mp = 0;
|
||||
traits::clear<Geometry>::apply(*mp);
|
||||
traits::resize<Geometry>::apply(*mp, 0);
|
||||
point_type* point = 0;
|
||||
traits::push_back<Geometry>::apply(*mp, *point);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief concept for multi-point (const version)
|
||||
\ingroup const_concepts
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstMultiPoint
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstMultiPoint)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP
|
||||
@@ -0,0 +1,95 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/polygon_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief multi-polygon concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The multi polygon concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining multi_polygon_tag
|
||||
as type
|
||||
- it must behave like a Boost.Range
|
||||
- its range value must fulfil the Polygon concept
|
||||
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class MultiPolygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type polygon_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Polygon<polygon_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(MultiPolygon)
|
||||
{
|
||||
Geometry* mp = 0;
|
||||
traits::clear<Geometry>::apply(*mp);
|
||||
traits::resize<Geometry>::apply(*mp, 0);
|
||||
polygon_type* poly = 0;
|
||||
traits::push_back<Geometry>::apply(*mp, *poly);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief concept for multi-polygon (const version)
|
||||
\ingroup const_concepts
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstMultiPolygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::range_value<Geometry>::type polygon_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon<polygon_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstMultiPolygon)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
|
||||
@@ -0,0 +1,193 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
//
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POINT_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POINT_CONCEPT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief Point concept.
|
||||
\ingroup concepts
|
||||
|
||||
\par Formal definition:
|
||||
The point concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining point_tag as type
|
||||
- there must be a specialization of traits::coordinate_type defining the type
|
||||
of its coordinates
|
||||
- there must be a specialization of traits::coordinate_system defining its
|
||||
coordinate system (cartesian, spherical, etc)
|
||||
- there must be a specialization of traits::dimension defining its number
|
||||
of dimensions (2, 3, ...) (derive it conveniently
|
||||
from std::integral_constant<std::size_t, X> for X-D)
|
||||
- there must be a specialization of traits::access, per dimension,
|
||||
with two functions:
|
||||
- \b get to get a coordinate value
|
||||
- \b set to set a coordinate value (this one is not checked for ConstPoint)
|
||||
- for non-Cartesian coordinate systems, the coordinate system's units
|
||||
must either be boost::geometry::degree or boost::geometry::radian
|
||||
|
||||
|
||||
\par Example:
|
||||
|
||||
A legacy point, defining the necessary specializations to fulfil to the concept.
|
||||
|
||||
Suppose that the following point is defined:
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip legacy_point1
|
||||
\until };
|
||||
|
||||
It can then be adapted to the concept as following:
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip adapt legacy_point1
|
||||
\until }}
|
||||
|
||||
Note that it is done like above to show the system. Users will normally use the registration macro.
|
||||
|
||||
\par Example:
|
||||
|
||||
A read-only legacy point, using a macro to fulfil to the ConstPoint concept.
|
||||
It cannot be modified by the library but can be used in all algorithms where
|
||||
points are not modified.
|
||||
|
||||
The point looks like the following:
|
||||
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip legacy_point2
|
||||
\until };
|
||||
|
||||
It uses the macro as following:
|
||||
\dontinclude doxygen_5.cpp
|
||||
\skip adapt legacy_point2
|
||||
\until end adaptation
|
||||
|
||||
*/
|
||||
|
||||
template <typename Geometry>
|
||||
class Point
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
typedef typename coordinate_type<Geometry>::type ctype;
|
||||
typedef typename coordinate_system<Geometry>::type csystem;
|
||||
|
||||
// The following enum is used to fully instantiate the coordinate
|
||||
// system class; this is needed in order to check the units passed
|
||||
// to it for non-Cartesian coordinate systems.
|
||||
enum { cs_check = sizeof(csystem) };
|
||||
|
||||
enum { ccount = dimension<Geometry>::value };
|
||||
|
||||
template <typename P, std::size_t Dimension, std::size_t DimensionCount>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
P* p = 0;
|
||||
geometry::set<Dimension>(*p, geometry::get<Dimension>(*p));
|
||||
dimension_checker<P, Dimension+1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename P, std::size_t DimensionCount>
|
||||
struct dimension_checker<P, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/// BCCL macro to apply the Point concept
|
||||
BOOST_CONCEPT_USAGE(Point)
|
||||
{
|
||||
dimension_checker<Geometry, 0, ccount>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief point concept (const version).
|
||||
|
||||
\ingroup const_concepts
|
||||
|
||||
\details The ConstPoint concept apply the same as the Point concept,
|
||||
but does not apply write access.
|
||||
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstPoint
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
typedef typename coordinate_type<Geometry>::type ctype;
|
||||
typedef typename coordinate_system<Geometry>::type csystem;
|
||||
|
||||
// The following enum is used to fully instantiate the coordinate
|
||||
// system class; this is needed in order to check the units passed
|
||||
// to it for non-Cartesian coordinate systems.
|
||||
enum { cs_check = sizeof(csystem) };
|
||||
|
||||
enum { ccount = dimension<Geometry>::value };
|
||||
|
||||
template <typename P, std::size_t Dimension, std::size_t DimensionCount>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
const P* p = 0;
|
||||
ctype coord(geometry::get<Dimension>(*p));
|
||||
boost::ignore_unused(p, coord);
|
||||
dimension_checker<P, Dimension+1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename P, std::size_t DimensionCount>
|
||||
struct dimension_checker<P, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
/// BCCL macro to apply the ConstPoint concept
|
||||
BOOST_CONCEPT_USAGE(ConstPoint)
|
||||
{
|
||||
dimension_checker<Geometry, 0, ccount>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POINT_CONCEPT_HPP
|
||||
@@ -0,0 +1,136 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYGON_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYGON_CONCEPT_HPP
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/ring_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief Checks polygon concept
|
||||
\ingroup concepts
|
||||
*/
|
||||
template <typename PolygonType>
|
||||
class Polygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename std::remove_const<PolygonType>::type polygon_type;
|
||||
|
||||
typedef typename traits::ring_const_type<polygon_type>::type ring_const_type;
|
||||
typedef typename traits::ring_mutable_type<polygon_type>::type ring_mutable_type;
|
||||
typedef typename traits::interior_const_type<polygon_type>::type interior_const_type;
|
||||
typedef typename traits::interior_mutable_type<polygon_type>::type interior_mutable_type;
|
||||
|
||||
typedef typename point_type<PolygonType>::type point_type;
|
||||
typedef typename ring_type<PolygonType>::type ring_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Ring<ring_type>) );
|
||||
|
||||
//BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<interior_type>) );
|
||||
|
||||
struct checker
|
||||
{
|
||||
static inline void apply()
|
||||
{
|
||||
polygon_type* poly = 0;
|
||||
polygon_type const* cpoly = poly;
|
||||
|
||||
ring_mutable_type e = traits::exterior_ring<PolygonType>::get(*poly);
|
||||
interior_mutable_type i = traits::interior_rings<PolygonType>::get(*poly);
|
||||
ring_const_type ce = traits::exterior_ring<PolygonType>::get(*cpoly);
|
||||
interior_const_type ci = traits::interior_rings<PolygonType>::get(*cpoly);
|
||||
|
||||
boost::ignore_unused(poly, cpoly);
|
||||
boost::ignore_unused(e, i, ce, ci);
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
BOOST_CONCEPT_USAGE(Polygon)
|
||||
{
|
||||
checker::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Checks polygon concept (const version)
|
||||
\ingroup const_concepts
|
||||
*/
|
||||
template <typename PolygonType>
|
||||
class ConstPolygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
typedef typename std::remove_const<PolygonType>::type const_polygon_type;
|
||||
|
||||
typedef typename traits::ring_const_type<const_polygon_type>::type ring_const_type;
|
||||
typedef typename traits::interior_const_type<const_polygon_type>::type interior_const_type;
|
||||
|
||||
typedef typename point_type<const_polygon_type>::type point_type;
|
||||
typedef typename ring_type<const_polygon_type>::type ring_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstRing<ring_type>) );
|
||||
|
||||
////BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<interior_type>) );
|
||||
|
||||
struct checker
|
||||
{
|
||||
static inline void apply()
|
||||
{
|
||||
const_polygon_type const* cpoly = 0;
|
||||
|
||||
ring_const_type ce = traits::exterior_ring<const_polygon_type>::get(*cpoly);
|
||||
interior_const_type ci = traits::interior_rings<const_polygon_type>::get(*cpoly);
|
||||
|
||||
boost::ignore_unused(ce, ci, cpoly);
|
||||
}
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstPolygon)
|
||||
{
|
||||
checker::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYGON_CONCEPT_HPP
|
||||
@@ -0,0 +1,102 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020 Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief ring concept
|
||||
\ingroup concepts
|
||||
\par Formal definition:
|
||||
The ring concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining ring_tag as type
|
||||
- it must behave like a Boost.Range
|
||||
- there can optionally be a specialization of traits::point_order defining the
|
||||
order or orientation of its points, clockwise or counterclockwise.
|
||||
- it must implement a std::back_insert_iterator
|
||||
(This is the same as the for the concept Linestring, and described there)
|
||||
|
||||
\note to fulfill the concepts, no traits class has to be specialized to
|
||||
define the point type.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class Ring
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(Ring)
|
||||
{
|
||||
Geometry* ring = 0;
|
||||
traits::clear<Geometry>::apply(*ring);
|
||||
traits::resize<Geometry>::apply(*ring, 0);
|
||||
point_type* point = 0;
|
||||
traits::push_back<Geometry>::apply(*ring, *point);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief (linear) ring concept (const version)
|
||||
\ingroup const_concepts
|
||||
\details The ConstLinearRing concept check the same as the Geometry concept,
|
||||
but does not check write access.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstRing
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
|
||||
BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept<Geometry>) );
|
||||
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstRing)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
|
||||
@@ -0,0 +1,135 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_SEGMENT_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_SEGMENT_CONCEPT_HPP
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief Segment concept.
|
||||
\ingroup concepts
|
||||
\details Formal definition:
|
||||
The segment concept is defined as following:
|
||||
- there must be a specialization of traits::tag defining segment_tag as type
|
||||
- there must be a specialization of traits::point_type to define the
|
||||
underlying point type (even if it does not consist of points, it should define
|
||||
this type, to indicate the points it can work with)
|
||||
- there must be a specialization of traits::indexed_access, per index
|
||||
and per dimension, with two functions:
|
||||
- get to get a coordinate value
|
||||
- set to set a coordinate value (this one is not checked for ConstSegment)
|
||||
|
||||
\note The segment concept is similar to the box concept, defining another tag.
|
||||
However, the box concept assumes the index as min_corner, max_corner, while
|
||||
for the segment concept there is no assumption.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class Segment
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<point_type>) );
|
||||
|
||||
|
||||
template <size_t Index, size_t Dimension, size_t DimensionCount>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
Geometry* s = 0;
|
||||
geometry::set<Index, Dimension>(*s, geometry::get<Index, Dimension>(*s));
|
||||
dimension_checker<Index, Dimension + 1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t Index, size_t DimensionCount>
|
||||
struct dimension_checker<Index, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(Segment)
|
||||
{
|
||||
static const size_t n = dimension<point_type>::type::value;
|
||||
dimension_checker<0, 0, n>::apply();
|
||||
dimension_checker<1, 0, n>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Segment concept (const version).
|
||||
\ingroup const_concepts
|
||||
\details The ConstSegment concept verifies the same as the Segment concept,
|
||||
but does not verify write access.
|
||||
*/
|
||||
template <typename Geometry>
|
||||
class ConstSegment
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename point_type<Geometry>::type point_type;
|
||||
typedef typename coordinate_type<Geometry>::type coordinate_type;
|
||||
|
||||
BOOST_CONCEPT_ASSERT( (concepts::ConstPoint<point_type>) );
|
||||
|
||||
|
||||
template <size_t Index, size_t Dimension, size_t DimensionCount>
|
||||
struct dimension_checker
|
||||
{
|
||||
static void apply()
|
||||
{
|
||||
const Geometry* s = 0;
|
||||
coordinate_type coord(geometry::get<Index, Dimension>(*s));
|
||||
boost::ignore_unused(coord);
|
||||
dimension_checker<Index, Dimension + 1, DimensionCount>::apply();
|
||||
}
|
||||
};
|
||||
|
||||
template <size_t Index, size_t DimensionCount>
|
||||
struct dimension_checker<Index, DimensionCount, DimensionCount>
|
||||
{
|
||||
static void apply() {}
|
||||
};
|
||||
|
||||
public :
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstSegment)
|
||||
{
|
||||
static const size_t n = dimension<point_type>::type::value;
|
||||
dimension_checker<0, 0, n>::apply();
|
||||
dimension_checker<1, 0, n>::apply();
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_SEGMENT_CONCEPT_HPP
|
||||
@@ -0,0 +1,33 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_HPP
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_linestring.hpp>
|
||||
#include <boost/geometry/geometries/multi_point.hpp>
|
||||
#include <boost/geometry/geometries/multi_polygon.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/point_xyz.hpp>
|
||||
#include <boost/geometry/geometries/polygon.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
#include <boost/geometry/geometries/segment.hpp>
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_HPP
|
||||
@@ -0,0 +1,115 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2015-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/box.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
|
||||
#include <boost/geometry/algorithms/not_implemented.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace detail { namespace helper_geometries
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
typename NewCoordinateType,
|
||||
typename NewUnits,
|
||||
typename CS_Tag = typename cs_tag<Point>::type
|
||||
>
|
||||
struct helper_point
|
||||
{
|
||||
typedef model::point
|
||||
<
|
||||
NewCoordinateType,
|
||||
dimension<Point>::value,
|
||||
typename cs_tag_to_coordinate_system<NewUnits, CS_Tag>::type
|
||||
> type;
|
||||
};
|
||||
|
||||
|
||||
}} // detail::helper_geometries
|
||||
|
||||
|
||||
namespace detail_dispatch
|
||||
{
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename NewCoordinateType,
|
||||
typename NewUnits,
|
||||
typename Tag = typename tag<Geometry>::type>
|
||||
struct helper_geometry : not_implemented<Geometry>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Point, typename NewCoordinateType, typename NewUnits>
|
||||
struct helper_geometry<Point, NewCoordinateType, NewUnits, point_tag>
|
||||
{
|
||||
typedef typename detail::helper_geometries::helper_point
|
||||
<
|
||||
Point, NewCoordinateType, NewUnits
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
template <typename Box, typename NewCoordinateType, typename NewUnits>
|
||||
struct helper_geometry<Box, NewCoordinateType, NewUnits, box_tag>
|
||||
{
|
||||
typedef model::box
|
||||
<
|
||||
typename helper_geometry
|
||||
<
|
||||
typename point_type<Box>::type, NewCoordinateType, NewUnits
|
||||
>::type
|
||||
> type;
|
||||
};
|
||||
|
||||
|
||||
} // detail_dispatch
|
||||
|
||||
|
||||
// Meta-function that provides a new helper geometry of the same kind as
|
||||
// the input geometry and the same coordinate system type,
|
||||
// but with a possibly different coordinate type and coordinate system units
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename NewCoordinateType = typename coordinate_type<Geometry>::type,
|
||||
typename NewUnits = typename detail::cs_angular_units<Geometry>::type
|
||||
>
|
||||
struct helper_geometry
|
||||
{
|
||||
typedef typename detail_dispatch::helper_geometry
|
||||
<
|
||||
Geometry, NewCoordinateType, NewUnits
|
||||
>::type type;
|
||||
};
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_HELPER_GEOMETRY_HPP
|
||||
@@ -0,0 +1,50 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2018-2019 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Structure containing an infinite line.
|
||||
// It is written using "General Form", a*x + b*y + c == 0
|
||||
// Might be conceptized later. Therefore operations are implemented outside
|
||||
// the structure itself.
|
||||
template <typename Type = double>
|
||||
struct infinite_line
|
||||
{
|
||||
infinite_line()
|
||||
: a(0)
|
||||
, b(0)
|
||||
, c(0)
|
||||
, normalized(false)
|
||||
{}
|
||||
|
||||
// Horizontal: a == 0, for example y-3=0, y==3
|
||||
// Vertical: b == 0, for example x-2=0, x==2
|
||||
// Through origin: c == 0
|
||||
Type a;
|
||||
Type b;
|
||||
Type c;
|
||||
bool normalized;
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_INFINITE_LINE_HPP
|
||||
@@ -0,0 +1,125 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief A linestring (named so by OGC) is a collection (default a vector) of points.
|
||||
\ingroup geometries
|
||||
\tparam Point \tparam_point
|
||||
\tparam Container \tparam_container
|
||||
\tparam Allocator \tparam_allocator
|
||||
|
||||
\qbk{[include reference/geometries/linestring.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_linestring Linestring Concept]
|
||||
}
|
||||
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
template<typename,typename> class Container = std::vector,
|
||||
template<typename> class Allocator = std::allocator
|
||||
>
|
||||
class linestring : public Container<Point, Allocator<Point> >
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
typedef Container<Point, Allocator<Point> > base_type;
|
||||
|
||||
public :
|
||||
/// \constructor_default{linestring}
|
||||
inline linestring()
|
||||
: base_type()
|
||||
{}
|
||||
|
||||
/// \constructor_begin_end{linestring}
|
||||
template <typename Iterator>
|
||||
inline linestring(Iterator begin, Iterator end)
|
||||
: base_type(begin, end)
|
||||
{}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
/// \constructor_initializer_list{linestring}
|
||||
inline linestring(std::initializer_list<Point> l)
|
||||
: base_type(l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it should be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{linestring}
|
||||
// inline linestring & operator=(std::initializer_list<Point> l)
|
||||
// {
|
||||
// base_type::assign(l.begin(), l.end());
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
template<typename,typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct tag<model::linestring<Point, Container, Allocator> >
|
||||
{
|
||||
typedef linestring_tag type;
|
||||
};
|
||||
} // namespace traits
|
||||
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_LINESTRING_HPP
|
||||
@@ -0,0 +1,119 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/requires.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/geometries/concepts/linestring_concept.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief multi_line, a collection of linestring
|
||||
\details Multi-linestring can be used to group lines belonging to each other,
|
||||
e.g. a highway (with interruptions)
|
||||
\ingroup geometries
|
||||
|
||||
\qbk{[include reference/geometries/multi_linestring.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_multi_linestring MultiLineString Concept]
|
||||
}
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename LineString,
|
||||
template<typename, typename> class Container = std::vector,
|
||||
template<typename> class Allocator = std::allocator
|
||||
>
|
||||
class multi_linestring : public Container<LineString, Allocator<LineString> >
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Linestring<LineString>) );
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
// default constructor and base_type definitions are required only
|
||||
// if the constructor taking std::initializer_list is defined
|
||||
|
||||
typedef Container<LineString, Allocator<LineString> > base_type;
|
||||
|
||||
public:
|
||||
/// \constructor_default{multi_linestring}
|
||||
multi_linestring()
|
||||
: base_type()
|
||||
{}
|
||||
|
||||
/// \constructor_initializer_list{multi_linestring}
|
||||
inline multi_linestring(std::initializer_list<LineString> l)
|
||||
: base_type(l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it shoudl be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{multi_linestring}
|
||||
// inline multi_linestring & operator=(std::initializer_list<LineString> l)
|
||||
// {
|
||||
// base_type::assign(l.begin(), l.end());
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename LineString,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct tag< model::multi_linestring<LineString, Container, Allocator> >
|
||||
{
|
||||
typedef multi_linestring_tag type;
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_LINESTRING_HPP
|
||||
@@ -0,0 +1,123 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/requires.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
|
||||
/*!
|
||||
\brief multi_point, a collection of points
|
||||
\ingroup geometries
|
||||
\tparam Point \tparam_point
|
||||
\tparam Container \tparam_container
|
||||
\tparam Allocator \tparam_allocator
|
||||
\details Multipoint can be used to group points belonging to each other,
|
||||
e.g. a constellation, or the result set of an intersection
|
||||
|
||||
\qbk{[include reference/geometries/multi_point.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_multi_point MultiPoint Concept]
|
||||
}
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
template<typename, typename> class Container = std::vector,
|
||||
template<typename> class Allocator = std::allocator
|
||||
>
|
||||
class multi_point : public Container<Point, Allocator<Point> >
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
typedef Container<Point, Allocator<Point> > base_type;
|
||||
|
||||
public :
|
||||
/// \constructor_default{multi_point}
|
||||
inline multi_point()
|
||||
: base_type()
|
||||
{}
|
||||
|
||||
/// \constructor_begin_end{multi_point}
|
||||
template <typename Iterator>
|
||||
inline multi_point(Iterator begin, Iterator end)
|
||||
: base_type(begin, end)
|
||||
{}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
/// \constructor_initializer_list{multi_point}
|
||||
inline multi_point(std::initializer_list<Point> l)
|
||||
: base_type(l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it shoudl be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{multi_point}
|
||||
// inline multi_point & operator=(std::initializer_list<Point> l)
|
||||
// {
|
||||
// base_type::assign(l.begin(), l.end());
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct tag< model::multi_point<Point, Container, Allocator> >
|
||||
{
|
||||
typedef multi_point_tag type;
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POINT_HPP
|
||||
@@ -0,0 +1,117 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/requires.hpp>
|
||||
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/geometries/concepts/polygon_concept.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief multi_polygon, a collection of polygons
|
||||
\details Multi-polygon can be used to group polygons belonging to each other,
|
||||
e.g. Hawaii
|
||||
\ingroup geometries
|
||||
|
||||
\qbk{[include reference/geometries/multi_polygon.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_multi_polygon MultiPolygon Concept]
|
||||
}
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Polygon,
|
||||
template<typename, typename> class Container = std::vector,
|
||||
template<typename> class Allocator = std::allocator
|
||||
>
|
||||
class multi_polygon : public Container<Polygon, Allocator<Polygon> >
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Polygon<Polygon>) );
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
// default constructor and base_type definitions are required only
|
||||
// if the constructor taking std::initializer_list is defined
|
||||
|
||||
typedef Container<Polygon, Allocator<Polygon> > base_type;
|
||||
|
||||
public:
|
||||
/// \constructor_default{multi_polygon}
|
||||
multi_polygon()
|
||||
: base_type()
|
||||
{}
|
||||
|
||||
/// \constructor_initializer_list{multi_polygon}
|
||||
inline multi_polygon(std::initializer_list<Polygon> l)
|
||||
: base_type(l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it shoudl be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{multi_polygon}
|
||||
// inline multi_polygon & operator=(std::initializer_list<Polygon> l)
|
||||
// {
|
||||
// base_type::assign(l.begin(), l.end());
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Polygon,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct tag< model::multi_polygon<Polygon, Container, Allocator> >
|
||||
{
|
||||
typedef multi_polygon_tag type;
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_MULTI_POLYGON_HPP
|
||||
357
install/boost_1_75_0/include/boost/geometry/geometries/point.hpp
Normal file
357
install/boost_1_75_0/include/boost/geometry/geometries/point.hpp
Normal file
@@ -0,0 +1,357 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2014 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2014 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2014 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// This file was modified by Oracle on 2014-2020.
|
||||
// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POINT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_POINT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/make.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
#include <algorithm>
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
// Silence warning C4127: conditional expression is constant
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename Dummy, std::size_t N, std::size_t DimensionCount>
|
||||
struct is_coordinates_number_leq
|
||||
{
|
||||
static const bool value = (N <= DimensionCount);
|
||||
};
|
||||
|
||||
template <typename Dummy, std::size_t N, std::size_t DimensionCount>
|
||||
struct is_coordinates_number_eq
|
||||
{
|
||||
static const bool value = (N == DimensionCount);
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief Basic point class, having coordinates defined in a neutral way
|
||||
\details Defines a neutral point class, fulfilling the Point Concept.
|
||||
Library users can use this point class, or use their own point classes.
|
||||
This point class is used in most of the samples and tests of Boost.Geometry
|
||||
This point class is used occasionally within the library, where a temporary
|
||||
point class is necessary.
|
||||
\ingroup geometries
|
||||
\tparam CoordinateType \tparam_numeric
|
||||
\tparam DimensionCount number of coordinates, usually 2 or 3
|
||||
\tparam CoordinateSystem coordinate system, for example cs::cartesian
|
||||
|
||||
\qbk{[include reference/geometries/point.qbk]}
|
||||
\qbk{before.synopsis, [heading Model of]}
|
||||
\qbk{before.synopsis, [link geometry.reference.concepts.concept_point Point Concept]}
|
||||
|
||||
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
class point
|
||||
{
|
||||
BOOST_STATIC_ASSERT(DimensionCount > 0);
|
||||
|
||||
// The following enum is used to fully instantiate the
|
||||
// CoordinateSystem class and check the correctness of the units
|
||||
// passed for non-Cartesian coordinate systems.
|
||||
enum { cs_check = sizeof(CoordinateSystem) };
|
||||
|
||||
public:
|
||||
|
||||
// TODO: constexpr requires LiteralType and until C++20
|
||||
// it has to have trivial destructor which makes access
|
||||
// debugging impossible with constexpr.
|
||||
|
||||
#if !defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
/// \constructor_default_no_init
|
||||
constexpr point()
|
||||
// Workaround for VS2015
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1910)
|
||||
: m_values{} {}
|
||||
#else
|
||||
= default;
|
||||
#endif
|
||||
#else // defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
point()
|
||||
{
|
||||
m_created = 1;
|
||||
std::fill_n(m_values_initialized, DimensionCount, 0);
|
||||
}
|
||||
~point()
|
||||
{
|
||||
m_created = 0;
|
||||
std::fill_n(m_values_initialized, DimensionCount, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// @brief Constructor to set one value
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_leq<C, 1, DimensionCount>::value, int> = 0
|
||||
>
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
explicit point(CoordinateType const& v0)
|
||||
: m_values{v0}
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
m_created = 1;
|
||||
std::fill_n(m_values_initialized, DimensionCount, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// @brief Constructor to set two values
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_leq<C, 2, DimensionCount>::value, int> = 0
|
||||
>
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
point(CoordinateType const& v0, CoordinateType const& v1)
|
||||
: m_values{ v0, v1 }
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
m_created = 1;
|
||||
std::fill_n(m_values_initialized, DimensionCount, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// @brief Constructor to set three values
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_leq<C, 3, DimensionCount>::value, int> = 0
|
||||
>
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
point(CoordinateType const& v0, CoordinateType const& v1, CoordinateType const& v2)
|
||||
: m_values{ v0, v1, v2 }
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
m_created = 1;
|
||||
std::fill_n(m_values_initialized, DimensionCount, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// @brief Get a coordinate
|
||||
/// @tparam K coordinate to get
|
||||
/// @return the coordinate
|
||||
template <std::size_t K>
|
||||
#if ! defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
constexpr
|
||||
#endif
|
||||
CoordinateType const& get() const
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
BOOST_GEOMETRY_ASSERT(m_values_initialized[K] == 1);
|
||||
#endif
|
||||
BOOST_STATIC_ASSERT(K < DimensionCount);
|
||||
return m_values[K];
|
||||
}
|
||||
|
||||
/// @brief Set a coordinate
|
||||
/// @tparam K coordinate to set
|
||||
/// @param value value to set
|
||||
template <std::size_t K>
|
||||
void set(CoordinateType const& value)
|
||||
{
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
BOOST_GEOMETRY_ASSERT(m_created == 1);
|
||||
m_values_initialized[K] = 1;
|
||||
#endif
|
||||
BOOST_STATIC_ASSERT(K < DimensionCount);
|
||||
m_values[K] = value;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
CoordinateType m_values[DimensionCount];
|
||||
|
||||
#if defined(BOOST_GEOMETRY_ENABLE_ACCESS_DEBUGGING)
|
||||
int m_created;
|
||||
int m_values_initialized[DimensionCount];
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
// Adapt the point to the concept
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
struct tag<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
struct coordinate_type<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
struct coordinate_system<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateSystem type;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
struct dimension<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
|
||||
: std::integral_constant<std::size_t, DimensionCount>
|
||||
{};
|
||||
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem,
|
||||
std::size_t Dimension
|
||||
>
|
||||
struct access<model::point<CoordinateType, DimensionCount, CoordinateSystem>, Dimension>
|
||||
{
|
||||
static constexpr CoordinateType get(
|
||||
model::point<CoordinateType, DimensionCount, CoordinateSystem> const& p)
|
||||
{
|
||||
return p.template get<Dimension>();
|
||||
}
|
||||
|
||||
static void set(
|
||||
model::point<CoordinateType, DimensionCount, CoordinateSystem>& p,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
p.template set<Dimension>(value);
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename CoordinateType,
|
||||
std::size_t DimensionCount,
|
||||
typename CoordinateSystem
|
||||
>
|
||||
struct make<model::point<CoordinateType, DimensionCount, CoordinateSystem> >
|
||||
{
|
||||
typedef model::point<CoordinateType, DimensionCount, CoordinateSystem> point_type;
|
||||
|
||||
static const bool is_specialized = true;
|
||||
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_eq<C, 1, DimensionCount>::value, int> = 0
|
||||
>
|
||||
static constexpr point_type apply(CoordinateType const& v0)
|
||||
{
|
||||
return point_type(v0);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_eq<C, 2, DimensionCount>::value, int> = 0
|
||||
>
|
||||
static constexpr point_type apply(CoordinateType const& v0,
|
||||
CoordinateType const& v1)
|
||||
{
|
||||
return point_type(v0, v1);
|
||||
}
|
||||
|
||||
template
|
||||
<
|
||||
typename C = CoordinateType,
|
||||
std::enable_if_t<geometry::detail::is_coordinates_number_eq<C, 3, DimensionCount>::value, int> = 0
|
||||
>
|
||||
static constexpr point_type apply(CoordinateType const& v0,
|
||||
CoordinateType const& v1,
|
||||
CoordinateType const& v2)
|
||||
{
|
||||
return point_type(v0, v1, v2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_POINT_HPP
|
||||
@@ -0,0 +1,144 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POINT_XY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_POINT_XY_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model { namespace d2
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief 2D point in Cartesian coordinate system
|
||||
\tparam CoordinateType numeric type, for example, double, float, int
|
||||
\tparam CoordinateSystem coordinate system, defaults to cs::cartesian
|
||||
|
||||
\qbk{[include reference/geometries/point_xy.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_point Point Concept]
|
||||
}
|
||||
|
||||
\qbk{[include reference/geometries/point_assign_warning.qbk]}
|
||||
|
||||
*/
|
||||
template<typename CoordinateType, typename CoordinateSystem = cs::cartesian>
|
||||
class point_xy : public model::point<CoordinateType, 2, CoordinateSystem>
|
||||
{
|
||||
public:
|
||||
/// \constructor_default_no_init
|
||||
constexpr point_xy() = default;
|
||||
|
||||
/// Constructor with x/y values
|
||||
constexpr point_xy(CoordinateType const& x, CoordinateType const& y)
|
||||
: model::point<CoordinateType, 2, CoordinateSystem>(x, y)
|
||||
{}
|
||||
|
||||
/// Get x-value
|
||||
constexpr CoordinateType const& x() const
|
||||
{ return this->template get<0>(); }
|
||||
|
||||
/// Get y-value
|
||||
constexpr CoordinateType const& y() const
|
||||
{ return this->template get<1>(); }
|
||||
|
||||
/// Set x-value
|
||||
void x(CoordinateType const& v)
|
||||
{ this->template set<0>(v); }
|
||||
|
||||
/// Set y-value
|
||||
void y(CoordinateType const& v)
|
||||
{ this->template set<1>(v); }
|
||||
};
|
||||
|
||||
|
||||
}} // namespace model::d2
|
||||
|
||||
|
||||
// Adapt the point_xy to the concept
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename CoordinateType, typename CoordinateSystem>
|
||||
struct tag<model::d2::point_xy<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct coordinate_type<model::d2::point_xy<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct coordinate_system<model::d2::point_xy<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateSystem type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct dimension<model::d2::point_xy<CoordinateType, CoordinateSystem> >
|
||||
: std::integral_constant<std::size_t, 2>
|
||||
{};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem, std::size_t Dimension>
|
||||
struct access<model::d2::point_xy<CoordinateType, CoordinateSystem>, Dimension >
|
||||
{
|
||||
static constexpr CoordinateType get(
|
||||
model::d2::point_xy<CoordinateType, CoordinateSystem> const& p)
|
||||
{
|
||||
return p.template get<Dimension>();
|
||||
}
|
||||
|
||||
static void set(model::d2::point_xy<CoordinateType, CoordinateSystem>& p,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
p.template set<Dimension>(value);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct make<model::d2::point_xy<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef model::d2::point_xy<CoordinateType, CoordinateSystem> point_type;
|
||||
|
||||
static const bool is_specialized = true;
|
||||
|
||||
static constexpr point_type apply(CoordinateType const& x,
|
||||
CoordinateType const& y)
|
||||
{
|
||||
return point_type(x, y);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_POINT_XY_HPP
|
||||
@@ -0,0 +1,148 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2020 Digvijay Janartha, Hamirpur, India.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POINT_XYZ_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_POINT_XYZ_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/geometries/point.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model { namespace d3
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief 3D point in Cartesian coordinate system
|
||||
\tparam CoordinateType numeric type, for example, double, float, int
|
||||
\tparam CoordinateSystem coordinate system, defaults to cs::cartesian
|
||||
|
||||
\qbk{[include reference/geometries/point_xyz.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_point Point Concept]
|
||||
}
|
||||
|
||||
\qbk{[include reference/geometries/point_assign_warning.qbk]}
|
||||
|
||||
*/
|
||||
template<typename CoordinateType, typename CoordinateSystem = cs::cartesian>
|
||||
class point_xyz : public model::point<CoordinateType, 3, CoordinateSystem>
|
||||
{
|
||||
public:
|
||||
/// \constructor_default_no_init
|
||||
constexpr point_xyz() = default;
|
||||
|
||||
/// Constructor with x/y/z values
|
||||
constexpr point_xyz(CoordinateType const& x, CoordinateType const& y, CoordinateType const& z)
|
||||
: model::point<CoordinateType, 3, CoordinateSystem>(x, y, z)
|
||||
{}
|
||||
|
||||
/// Get x-value
|
||||
constexpr CoordinateType const& x() const
|
||||
{ return this->template get<0>(); }
|
||||
|
||||
/// Get y-value
|
||||
constexpr CoordinateType const& y() const
|
||||
{ return this->template get<1>(); }
|
||||
|
||||
/// Get z-value
|
||||
constexpr CoordinateType const& z() const
|
||||
{ return this->template get<2>(); }
|
||||
|
||||
/// Set x-value
|
||||
void x(CoordinateType const& v)
|
||||
{ this->template set<0>(v); }
|
||||
|
||||
/// Set y-value
|
||||
void y(CoordinateType const& v)
|
||||
{ this->template set<1>(v); }
|
||||
|
||||
/// Set z-value
|
||||
void z(CoordinateType const& v)
|
||||
{ this->template set<2>(v); }
|
||||
};
|
||||
|
||||
|
||||
}} // namespace model::d3
|
||||
|
||||
|
||||
// Adapt the point_xyz to the concept
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename CoordinateType, typename CoordinateSystem>
|
||||
struct tag<model::d3::point_xyz<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef point_tag type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct coordinate_type<model::d3::point_xyz<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateType type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct coordinate_system<model::d3::point_xyz<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef CoordinateSystem type;
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct dimension<model::d3::point_xyz<CoordinateType, CoordinateSystem> >
|
||||
: std::integral_constant<std::size_t, 3>
|
||||
{};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem, std::size_t Dimension>
|
||||
struct access<model::d3::point_xyz<CoordinateType, CoordinateSystem>, Dimension>
|
||||
{
|
||||
static constexpr CoordinateType get(
|
||||
model::d3::point_xyz<CoordinateType, CoordinateSystem> const& p)
|
||||
{
|
||||
return p.template get<Dimension>();
|
||||
}
|
||||
|
||||
static void set(model::d3::point_xyz<CoordinateType, CoordinateSystem>& p,
|
||||
CoordinateType const& value)
|
||||
{
|
||||
p.template set<Dimension>(value);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename CoordinateType, typename CoordinateSystem>
|
||||
struct make<model::d3::point_xyz<CoordinateType, CoordinateSystem> >
|
||||
{
|
||||
typedef model::d3::point_xyz<CoordinateType, CoordinateSystem> point_type;
|
||||
|
||||
static const bool is_specialized = true;
|
||||
|
||||
static constexpr point_type apply(CoordinateType const& x,
|
||||
CoordinateType const& y,
|
||||
CoordinateType const& z)
|
||||
{
|
||||
return point_type(x, y, z);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_POINT_XYZ_HPP
|
||||
@@ -0,0 +1,142 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2014-2020, Oracle and/or its affiliates.
|
||||
|
||||
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Licensed under the Boost Software License version 1.0.
|
||||
// http://www.boost.org/users/license.html
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POINTING_SEGMENT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_POINTING_SEGMENT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
#include <boost/core/addressof.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/assert.hpp>
|
||||
#include <boost/geometry/core/coordinate_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
// const or non-const segment type that is meant to be
|
||||
// * default constructible
|
||||
// * copy constructible
|
||||
// * assignable
|
||||
// referring_segment does not fit these requirements, hence the
|
||||
// pointing_segment class
|
||||
//
|
||||
// this class is used by the segment_iterator as its value type
|
||||
template <typename ConstOrNonConstPoint>
|
||||
class pointing_segment
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (
|
||||
typename std::conditional
|
||||
<
|
||||
std::is_const<ConstOrNonConstPoint>::value,
|
||||
concepts::Point<ConstOrNonConstPoint>,
|
||||
concepts::ConstPoint<ConstOrNonConstPoint>
|
||||
>
|
||||
) );
|
||||
|
||||
typedef ConstOrNonConstPoint point_type;
|
||||
|
||||
public:
|
||||
point_type* first;
|
||||
point_type* second;
|
||||
|
||||
inline pointing_segment()
|
||||
: first(NULL)
|
||||
, second(NULL)
|
||||
{}
|
||||
|
||||
inline pointing_segment(point_type const& p1, point_type const& p2)
|
||||
: first(boost::addressof(p1))
|
||||
, second(boost::addressof(p2))
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
// Traits specializations for segment above
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename Point>
|
||||
struct tag<model::pointing_segment<Point> >
|
||||
{
|
||||
typedef segment_tag type;
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct point_type<model::pointing_segment<Point> >
|
||||
{
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::pointing_segment<Point>, 0, Dimension>
|
||||
{
|
||||
typedef model::pointing_segment<Point> segment_type;
|
||||
typedef typename geometry::coordinate_type
|
||||
<
|
||||
segment_type
|
||||
>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(segment_type const& s)
|
||||
{
|
||||
BOOST_GEOMETRY_ASSERT( s.first != NULL );
|
||||
return geometry::get<Dimension>(*s.first);
|
||||
}
|
||||
|
||||
static inline void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
BOOST_GEOMETRY_ASSERT( s.first != NULL );
|
||||
geometry::set<Dimension>(*s.first, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::pointing_segment<Point>, 1, Dimension>
|
||||
{
|
||||
typedef model::pointing_segment<Point> segment_type;
|
||||
typedef typename geometry::coordinate_type
|
||||
<
|
||||
segment_type
|
||||
>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(segment_type const& s)
|
||||
{
|
||||
BOOST_GEOMETRY_ASSERT( s.second != NULL );
|
||||
return geometry::get<Dimension>(*s.second);
|
||||
}
|
||||
|
||||
static inline void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
BOOST_GEOMETRY_ASSERT( s.second != NULL );
|
||||
geometry::set<Dimension>(*s.second, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_POINTING_SEGMENT_HPP
|
||||
@@ -0,0 +1,367 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014-2018 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POLYGON_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_POLYGON_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
|
||||
#include <boost/geometry/core/exterior_ring.hpp>
|
||||
#include <boost/geometry/core/interior_rings.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
#include <boost/geometry/geometries/ring.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief The polygon contains an outer ring and zero or more inner rings.
|
||||
\ingroup geometries
|
||||
\tparam Point point type
|
||||
\tparam ClockWise true for clockwise direction,
|
||||
false for CounterClockWise direction
|
||||
\tparam Closed true for closed polygons (last point == first point),
|
||||
false open points
|
||||
\tparam PointList container type for points,
|
||||
for example std::vector, std::deque
|
||||
\tparam RingList container type for inner rings,
|
||||
for example std::vector, std::deque
|
||||
\tparam PointAlloc container-allocator-type, for the points
|
||||
\tparam RingAlloc container-allocator-type, for the rings
|
||||
\note The container collecting the points in the rings can be different
|
||||
from the container collecting the inner rings. They all default to vector.
|
||||
|
||||
\qbk{[include reference/geometries/polygon.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_polygon Polygon Concept]
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise = true,
|
||||
bool Closed = true,
|
||||
template<typename, typename> class PointList = std::vector,
|
||||
template<typename, typename> class RingList = std::vector,
|
||||
template<typename> class PointAlloc = std::allocator,
|
||||
template<typename> class RingAlloc = std::allocator
|
||||
>
|
||||
class polygon
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
public:
|
||||
|
||||
// Member types
|
||||
typedef Point point_type;
|
||||
typedef ring<Point, ClockWise, Closed, PointList, PointAlloc> ring_type;
|
||||
typedef RingList<ring_type , RingAlloc<ring_type > > inner_container_type;
|
||||
|
||||
inline ring_type const& outer() const { return m_outer; }
|
||||
inline inner_container_type const& inners() const { return m_inners; }
|
||||
|
||||
inline ring_type& outer() { return m_outer; }
|
||||
inline inner_container_type & inners() { return m_inners; }
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
// default constructor definition is required only
|
||||
// if the constructor taking std::initializer_list is defined
|
||||
|
||||
/// \constructor_default{polygon}
|
||||
inline polygon()
|
||||
: m_outer()
|
||||
, m_inners()
|
||||
{}
|
||||
|
||||
/// \constructor_initializer_list{polygon}
|
||||
inline polygon(std::initializer_list<ring_type> l)
|
||||
: m_outer(l.size() > 0 ? *l.begin() : ring_type())
|
||||
, m_inners(l.size() > 0 ? l.begin() + 1 : l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it shoudl be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{polygon}
|
||||
// inline polygon & operator=(std::initializer_list<ring_type> l)
|
||||
// {
|
||||
// if ( l.size() > 0 )
|
||||
// {
|
||||
// m_outer = *l.begin();
|
||||
// m_inners.assign(l.begin() + 1, l.end());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// m_outer.clear();
|
||||
// m_inners.clear();
|
||||
// }
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
|
||||
/// Utility method, clears outer and inner rings
|
||||
inline void clear()
|
||||
{
|
||||
m_outer.clear();
|
||||
m_inners.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
ring_type m_outer;
|
||||
inner_container_type m_inners;
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct tag
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList, PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef polygon_tag type;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct ring_const_type
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList, PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>::ring_type const& type;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct ring_mutable_type
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList, PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>::ring_type& type;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct interior_const_type
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>::inner_container_type const& type;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct interior_mutable_type
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef typename model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>::inner_container_type& type;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct exterior_ring
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList, PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
> polygon_type;
|
||||
|
||||
static inline typename polygon_type::ring_type& get(polygon_type& p)
|
||||
{
|
||||
return p.outer();
|
||||
}
|
||||
|
||||
static inline typename polygon_type::ring_type const& get(
|
||||
polygon_type const& p)
|
||||
{
|
||||
return p.outer();
|
||||
}
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class PointList,
|
||||
template<typename, typename> class RingList,
|
||||
template<typename> class PointAlloc,
|
||||
template<typename> class RingAlloc
|
||||
>
|
||||
struct interior_rings
|
||||
<
|
||||
model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed,
|
||||
PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
>
|
||||
>
|
||||
{
|
||||
typedef model::polygon
|
||||
<
|
||||
Point, ClockWise, Closed, PointList, RingList,
|
||||
PointAlloc, RingAlloc
|
||||
> polygon_type;
|
||||
|
||||
static inline typename polygon_type::inner_container_type& get(
|
||||
polygon_type& p)
|
||||
{
|
||||
return p.inners();
|
||||
}
|
||||
|
||||
static inline typename polygon_type::inner_container_type const& get(
|
||||
polygon_type const& p)
|
||||
{
|
||||
return p.inners();
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_POLYGON_HPP
|
||||
@@ -0,0 +1,179 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \
|
||||
template <size_t D> \
|
||||
struct indexed_access<Box, min_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) \
|
||||
{ return geometry::get<D>(b. MinCorner); } \
|
||||
static inline void set(Box& b, ct const& value) \
|
||||
{ geometry::set<D>(b. MinCorner, value); } \
|
||||
}; \
|
||||
template <size_t D> \
|
||||
struct indexed_access<Box, max_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) \
|
||||
{ return geometry::get<D>(b. MaxCorner); } \
|
||||
static inline void set(Box& b, ct const& value) \
|
||||
{ geometry::set<D>(b. MaxCorner, value); } \
|
||||
};
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \
|
||||
template <typename P, size_t D> \
|
||||
struct indexed_access<Box<P>, min_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<P>::type ct; \
|
||||
static inline ct get(Box<P> const& b) \
|
||||
{ return geometry::get<D>(b. MinCorner); } \
|
||||
static inline void set(Box<P>& b, ct const& value) \
|
||||
{ geometry::set<D>(b. MinCorner, value); } \
|
||||
}; \
|
||||
template <typename P, size_t D> \
|
||||
struct indexed_access<Box<P>, max_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<P>::type ct; \
|
||||
static inline ct get(Box<P> const& b) \
|
||||
{ return geometry::get<D>(b. MaxCorner); } \
|
||||
static inline void set(Box<P>& b, ct const& value) \
|
||||
{ geometry::set<D>(b. MaxCorner, value); } \
|
||||
};
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \
|
||||
template <> struct indexed_access<Box, min_corner, 0> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) { return b. Left; } \
|
||||
static inline void set(Box& b, ct const& value) { b. Left = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Box, min_corner, 1> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) { return b. Bottom; } \
|
||||
static inline void set(Box& b, ct const& value) { b. Bottom = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Box, max_corner, 0> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) { return b. Right; } \
|
||||
static inline void set(Box& b, ct const& value) { b. Right = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Box, max_corner, 1> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Box const& b) { return b. Top; } \
|
||||
static inline void set(Box& b, ct const& value) { b. Top = value; } \
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, PointType) \
|
||||
template<> struct tag<Box > { typedef box_tag type; }; \
|
||||
template<> struct point_type<Box > { typedef PointType type; };
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \
|
||||
template<typename P> struct tag<Box<P> > { typedef box_tag type; }; \
|
||||
template<typename P> struct point_type<Box<P> > { typedef P type; };
|
||||
|
||||
#endif // DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{box}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX, box} The
|
||||
box may contain template parameters, which must be specified then.
|
||||
\param Box \param_macro_type{Box}
|
||||
\param Point Point type on which box is based. Might be two or three-dimensional
|
||||
\param MinCorner minimum corner (should be public member or method)
|
||||
\param MaxCorner maximum corner (should be public member or method)
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_box]
|
||||
[register_box_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_BOX(Box, Point, MinCorner, MaxCorner) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS(Box, Point, MinCorner, MaxCorner) \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{box}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED, box}
|
||||
\details_macro_templated{box, point}
|
||||
\param Box \param_macro_type{Box}
|
||||
\param MinCorner minimum corner (should be public member or method)
|
||||
\param MaxCorner maximum corner (should be public member or method)
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_box_templated]
|
||||
[register_box_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_BOX_TEMPLATED(Box, MinCorner, MaxCorner) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS_TEMPLATED(Box) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_TEMPLATED(Box, MinCorner, MaxCorner) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{box}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES, box}
|
||||
\param Box \param_macro_type{Box}
|
||||
\param Point Point type reported as point_type by box. Must be two dimensional.
|
||||
Note that these box tyeps do not contain points, but they must have a
|
||||
related point_type
|
||||
\param Left Left side (must be public member or method)
|
||||
\param Bottom Bottom side (must be public member or method)
|
||||
\param Right Right side (must be public member or method)
|
||||
\param Top Top side (must be public member or method)
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_box_2d_4values]
|
||||
[register_box_2d_4values_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_BOX_2D_4VALUES(Box, Point, Left, Bottom, Right, Top) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_TRAITS(Box, Point) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_BOX_ACCESS_4VALUES(Box, Point, Left, Bottom, Right, Top) \
|
||||
}}}
|
||||
|
||||
|
||||
|
||||
// CONST versions are for boxes probably not that common. Postponed.
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_BOX_HPP
|
||||
@@ -0,0 +1,60 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_LINESTRING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_LINESTRING_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{linestring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_LINESTRING, linestring} The
|
||||
linestring may contain template parameters, which must be specified then.
|
||||
\param Linestring \param_macro_type{linestring}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_linestring]
|
||||
[register_linestring_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_LINESTRING(Linestring) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<> struct tag<Linestring> { typedef linestring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{templated linestring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED, templated linestring}
|
||||
\details_macro_templated{linestring, point}
|
||||
\param Linestring \param_macro_type{linestring (without template parameters)}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_linestring_templated]
|
||||
[register_linestring_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_LINESTRING_TEMPLATED(Linestring) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<typename P> struct tag< Linestring<P> > { typedef linestring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_LINESTRING_HPP
|
||||
@@ -0,0 +1,59 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{multi_linestring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING, multi_linestring} The
|
||||
multi_linestring may contain template parameters, which must be specified then.
|
||||
\param MultiLineString \param_macro_type{multi_linestring}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_linestring]
|
||||
[register_multi_linestring_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING(MultiLineString) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<> struct tag<MultiLineString> { typedef multi_linestring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{templated multi_linestring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING_TEMPLATED, templated multi_linestring}
|
||||
\details_macro_templated{multi_linestring, linestring}
|
||||
\param MultiLineString \param_macro_type{multi_linestring (without template parameters)}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_linestring_templated]
|
||||
[register_multi_linestring_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_LINESTRING_TEMPLATED(MultiLineString) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<typename LineString> struct tag< MultiLineString<LineString> > { typedef multi_linestring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_LINESTRING_HPP
|
||||
@@ -0,0 +1,59 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POINT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POINT_HPP
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{multi_point}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POINT, multi_point} The
|
||||
multi_point may contain template parameters, which must be specified then.
|
||||
\param MultiPoint \param_macro_type{multi_point}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_point]
|
||||
[register_multi_point_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_POINT(MultiPoint) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<> struct tag<MultiPoint> { typedef multi_point_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{templated multi_point}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED, templated multi_point}
|
||||
\details_macro_templated{multi_point, point}
|
||||
\param MultiPoint \param_macro_type{multi_point (without template parameters)}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_point_templated]
|
||||
[register_multi_point_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_POINT_TEMPLATED(MultiPoint) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<typename Point> struct tag< MultiPoint<Point> > { typedef multi_point_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POINT_HPP
|
||||
@@ -0,0 +1,59 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{multi_polygon}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POLYGON, multi_polygon} The
|
||||
multi_polygon may contain template parameters, which must be specified then.
|
||||
\param MultiPolygon \param_macro_type{multi_polygon}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_polygon]
|
||||
[register_multi_polygon_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_POLYGON(MultiPolygon) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<> struct tag<MultiPolygon> { typedef multi_polygon_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{templated multi_polygon}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_MULTI_POLYGON_TEMPLATED, templated multi_polygon}
|
||||
\details_macro_templated{multi_polygon, polygon}
|
||||
\param MultiPolygon \param_macro_type{multi_polygon (without template parameters)}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_multi_polygon_templated]
|
||||
[register_multi_polygon_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_MULTI_POLYGON_TEMPLATED(MultiPolygon) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<typename Polygon> struct tag< MultiPolygon<Polygon> > { typedef multi_polygon_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_MULTI_POLYGON_HPP
|
||||
@@ -0,0 +1,179 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_POINT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_POINT_HPP
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
// Starting point, specialize basic traits necessary to register a point
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, Dim, CoordinateType, CoordinateSystem) \
|
||||
template<> struct tag<Point> { typedef point_tag type; }; \
|
||||
template<> struct dimension<Point> : std::integral_constant<std::size_t, Dim> {}; \
|
||||
template<> struct coordinate_type<Point> { typedef CoordinateType type; }; \
|
||||
template<> struct coordinate_system<Point> { typedef CoordinateSystem type; };
|
||||
|
||||
// Specialize access class per dimension
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, Dim, CoordinateType, Get, Set) \
|
||||
template<> struct access<Point, Dim> \
|
||||
{ \
|
||||
static inline CoordinateType get(Point const& p) { return p. Get; } \
|
||||
static inline void set(Point& p, CoordinateType const& value) { p. Set = value; } \
|
||||
};
|
||||
|
||||
// Const version
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, Dim, CoordinateType, Get) \
|
||||
template<> struct access<Point, Dim> \
|
||||
{ \
|
||||
static inline CoordinateType get(Point const& p) { return p. Get; } \
|
||||
};
|
||||
|
||||
|
||||
// Getter/setter version
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, Dim, CoordinateType, Get, Set) \
|
||||
template<> struct access<Point, Dim> \
|
||||
{ \
|
||||
static inline CoordinateType get(Point const& p) \
|
||||
{ return p. Get (); } \
|
||||
static inline void set(Point& p, CoordinateType const& value) \
|
||||
{ p. Set ( value ); } \
|
||||
};
|
||||
|
||||
#endif // DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{2D point type}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D, two-dimensional point type}
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Field0 \param_macro_member{\macro_x}
|
||||
\param Field1 \param_macro_member{\macro_y}
|
||||
|
||||
\qbk{[include reference/geometries/register/point.qbk]}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_2D(Point, CoordinateType, CoordinateSystem, Field0, Field1) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, 0, CoordinateType, Field0, Field0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, 1, CoordinateType, Field1, Field1) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{3D point type}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D, three-dimensional point type}
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Field0 \param_macro_member{\macro_x}
|
||||
\param Field1 \param_macro_member{\macro_y}
|
||||
\param Field2 \param_macro_member{\macro_z}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_3D(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, 0, CoordinateType, Field0, Field0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, 1, CoordinateType, Field1, Field1) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS(Point, 2, CoordinateType, Field2, Field2) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{2D point type} \brief_macro_const
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D_CONST, two-dimensional point type}. \details_macro_const
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Field0 \param_macro_member{\macro_x}
|
||||
\param Field1 \param_macro_member{\macro_y}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_2D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, 0, CoordinateType, Field0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, 1, CoordinateType, Field1) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{3D point type} \brief_macro_const
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D_CONST, three-dimensional point type}. \details_macro_const
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Field0 \param_macro_member{\macro_x}
|
||||
\param Field1 \param_macro_member{\macro_y}
|
||||
\param Field2 \param_macro_member{\macro_z}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_3D_CONST(Point, CoordinateType, CoordinateSystem, Field0, Field1, Field2) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, 0, CoordinateType, Field0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, 1, CoordinateType, Field1) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_CONST(Point, 2, CoordinateType, Field2) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{2D point type} \brief_macro_getset
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET, two-dimensional point type}. \details_macro_getset
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Get0 \param_macro_getset{get, \macro_x}
|
||||
\param Get1 \param_macro_getset{get, \macro_y}
|
||||
\param Set0 \param_macro_getset{set, \macro_x}
|
||||
\param Set1 \param_macro_getset{set, \macro_y}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Set0, Set1) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 2, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, 0, CoordinateType, Get0, Set0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, 1, CoordinateType, Get1, Set1) \
|
||||
}}}
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{3D point type} \brief_macro_getset
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET, three-dimensional point type}. \details_macro_getset
|
||||
\param Point \param_macro_type{Point}
|
||||
\param CoordinateType \param_macro_coortype{point}
|
||||
\param CoordinateSystem \param_macro_coorsystem
|
||||
\param Get0 \param_macro_getset{get, \macro_x}
|
||||
\param Get1 \param_macro_getset{get, \macro_y}
|
||||
\param Get2 \param_macro_getset{get, \macro_z}
|
||||
\param Set0 \param_macro_getset{set, \macro_x}
|
||||
\param Set1 \param_macro_getset{set, \macro_y}
|
||||
\param Set2 \param_macro_getset{set, \macro_z}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_POINT_3D_GET_SET(Point, CoordinateType, CoordinateSystem, Get0, Get1, Get2, Set0, Set1, Set2) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_TRAITS(Point, 3, CoordinateType, CoordinateSystem) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, 0, CoordinateType, Get0, Set0) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, 1, CoordinateType, Get1, Set1) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_POINT_ACCESS_GET_SET(Point, 2, CoordinateType, Get2, Set2) \
|
||||
}}}
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_POINT_HPP
|
||||
@@ -0,0 +1,60 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_RING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_RING_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{ring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_RING, ring} The
|
||||
ring may contain template parameters, which must be specified then.
|
||||
\param Ring \param_macro_type{ring}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_ring]
|
||||
[register_ring_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_RING(Ring) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<> struct tag<Ring> { typedef ring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
/*!
|
||||
\brief \brief_macro{templated ring}
|
||||
\ingroup register
|
||||
\details \details_macro{BOOST_GEOMETRY_REGISTER_RING_TEMPLATED, templated ring}
|
||||
\details_macro_templated{ring, point}
|
||||
\param Ring \param_macro_type{ring (without template parameters)}
|
||||
|
||||
\qbk{
|
||||
[heading Example]
|
||||
[register_ring_templated]
|
||||
[register_ring_templated_output]
|
||||
}
|
||||
*/
|
||||
#define BOOST_GEOMETRY_REGISTER_RING_TEMPLATED(Ring) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
template<typename P> struct tag< Ring<P> > { typedef ring_tag type; }; \
|
||||
}}}
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_RING_HPP
|
||||
@@ -0,0 +1,129 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_SEGMENT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_SEGMENT_HPP
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS(Segment, Point, Index0, Index1) \
|
||||
template <size_t D> \
|
||||
struct indexed_access<Segment, min_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) \
|
||||
{ return geometry::get<D>(b. Index0); } \
|
||||
static inline void set(Segment& b, ct const& value) \
|
||||
{ geometry::set<D>(b. Index0, value); } \
|
||||
}; \
|
||||
template <size_t D> \
|
||||
struct indexed_access<Segment, max_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) \
|
||||
{ return geometry::get<D>(b. Index1); } \
|
||||
static inline void set(Segment& b, ct const& value) \
|
||||
{ geometry::set<D>(b. Index1, value); } \
|
||||
};
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS_TEMPLATIZED(Segment, Index0, Index1) \
|
||||
template <typename P, size_t D> \
|
||||
struct indexed_access<Segment<P>, min_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<P>::type ct; \
|
||||
static inline ct get(Segment<P> const& b) \
|
||||
{ return geometry::get<D>(b. Index0); } \
|
||||
static inline void set(Segment<P>& b, ct const& value) \
|
||||
{ geometry::set<D>(b. Index0, value); } \
|
||||
}; \
|
||||
template <typename P, size_t D> \
|
||||
struct indexed_access<Segment<P>, max_corner, D> \
|
||||
{ \
|
||||
typedef typename coordinate_type<P>::type ct; \
|
||||
static inline ct get(Segment<P> const& b) \
|
||||
{ return geometry::get<D>(b. Index1); } \
|
||||
static inline void set(Segment<P>& b, ct const& value) \
|
||||
{ geometry::set<D>(b. Index1, value); } \
|
||||
};
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS_4VALUES(Segment, Point, Left, Bottom, Right, Top) \
|
||||
template <> struct indexed_access<Segment, min_corner, 0> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) { return b. Left; } \
|
||||
static inline void set(Segment& b, ct const& value) { b. Left = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Segment, min_corner, 1> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) { return b. Bottom; } \
|
||||
static inline void set(Segment& b, ct const& value) { b. Bottom = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Segment, max_corner, 0> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) { return b. Right; } \
|
||||
static inline void set(Segment& b, ct const& value) { b. Right = value; } \
|
||||
}; \
|
||||
template <> struct indexed_access<Segment, max_corner, 1> \
|
||||
{ \
|
||||
typedef coordinate_type<Point>::type ct; \
|
||||
static inline ct get(Segment const& b) { return b. Top; } \
|
||||
static inline void set(Segment& b, ct const& value) { b. Top = value; } \
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_TRAITS(Segment, PointType) \
|
||||
template<> struct tag<Segment > { typedef segment_tag type; }; \
|
||||
template<> struct point_type<Segment > { typedef PointType type; };
|
||||
|
||||
#define BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_TRAITS_TEMPLATIZED(Segment) \
|
||||
template<typename P> struct tag<Segment<P> > { typedef segment_tag type; }; \
|
||||
template<typename P> struct point_type<Segment<P> > { typedef P type; };
|
||||
|
||||
#endif // DOXYGEN_NO_SPECIALIZATIONS
|
||||
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_SEGMENT(Segment, PointType, Index0, Index1) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_TRAITS(Segment, PointType) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS(Segment, PointType, Index0, Index1) \
|
||||
}}}
|
||||
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_SEGMENT_TEMPLATIZED(Segment, Index0, Index1) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_TRAITS_TEMPLATIZED(Segment) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS_TEMPLATIZED(Segment, Index0, Index1) \
|
||||
}}}
|
||||
|
||||
#define BOOST_GEOMETRY_REGISTER_SEGMENT_2D_4VALUES(Segment, PointType, Left, Bottom, Right, Top) \
|
||||
namespace boost { namespace geometry { namespace traits { \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_TRAITS(Segment, PointType) \
|
||||
BOOST_GEOMETRY_DETAIL_SPECIALIZE_SEGMENT_ACCESS_4VALUES(Segment, PointType, Left, Bottom, Right, Top) \
|
||||
}}}
|
||||
|
||||
|
||||
|
||||
// CONST versions are for segments probably not that common. Postponed.
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_REGISTER_SEGMENT_HPP
|
||||
181
install/boost_1_75_0/include/boost/geometry/geometries/ring.hpp
Normal file
181
install/boost_1_75_0/include/boost/geometry/geometries/ring.hpp
Normal file
@@ -0,0 +1,181 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
// Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland.
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_RING_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_RING_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
|
||||
#include <boost/geometry/core/closure.hpp>
|
||||
#include <boost/geometry/core/point_order.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
#include <initializer_list>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
/*!
|
||||
\brief A ring (aka linear ring) is a closed line which should not be selfintersecting
|
||||
\ingroup geometries
|
||||
\tparam Point point type
|
||||
\tparam ClockWise true for clockwise direction,
|
||||
false for CounterClockWise direction
|
||||
\tparam Closed true for closed polygons (last point == first point),
|
||||
false open points
|
||||
\tparam Container container type, for example std::vector, std::deque
|
||||
\tparam Allocator container-allocator-type
|
||||
|
||||
\qbk{[include reference/geometries/ring.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_ring Ring Concept]
|
||||
}
|
||||
*/
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise = true, bool Closed = true,
|
||||
template<typename, typename> class Container = std::vector,
|
||||
template<typename> class Allocator = std::allocator
|
||||
>
|
||||
class ring : public Container<Point, Allocator<Point> >
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
typedef Container<Point, Allocator<Point> > base_type;
|
||||
|
||||
public :
|
||||
/// \constructor_default{ring}
|
||||
inline ring()
|
||||
: base_type()
|
||||
{}
|
||||
|
||||
/// \constructor_begin_end{ring}
|
||||
template <typename Iterator>
|
||||
inline ring(Iterator begin, Iterator end)
|
||||
: base_type(begin, end)
|
||||
{}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST
|
||||
|
||||
/// \constructor_initializer_list{ring}
|
||||
inline ring(std::initializer_list<Point> l)
|
||||
: base_type(l.begin(), l.end())
|
||||
{}
|
||||
|
||||
// Commented out for now in order to support Boost.Assign
|
||||
// Without this assignment operator first the object should be created
|
||||
// from initializer list, then it shoudl be moved.
|
||||
//// Without this workaround in MSVC the assignment operator is ambiguous
|
||||
//#ifndef BOOST_MSVC
|
||||
// /// \assignment_initializer_list{ring}
|
||||
// inline ring & operator=(std::initializer_list<Point> l)
|
||||
// {
|
||||
// base_type::assign(l.begin(), l.end());
|
||||
// return *this;
|
||||
// }
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool ClockWise, bool Closed,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct tag<model::ring<Point, ClockWise, Closed, Container, Allocator> >
|
||||
{
|
||||
typedef ring_tag type;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool Closed,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct point_order<model::ring<Point, false, Closed, Container, Allocator> >
|
||||
{
|
||||
static const order_selector value = counterclockwise;
|
||||
};
|
||||
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool Closed,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct point_order<model::ring<Point, true, Closed, Container, Allocator> >
|
||||
{
|
||||
static const order_selector value = clockwise;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool PointOrder,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct closure<model::ring<Point, PointOrder, true, Container, Allocator> >
|
||||
{
|
||||
static const closure_selector value = closed;
|
||||
};
|
||||
|
||||
template
|
||||
<
|
||||
typename Point,
|
||||
bool PointOrder,
|
||||
template<typename, typename> class Container,
|
||||
template<typename> class Allocator
|
||||
>
|
||||
struct closure<model::ring<Point, PointOrder, false, Container, Allocator> >
|
||||
{
|
||||
static const closure_selector value = open;
|
||||
};
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_RING_HPP
|
||||
@@ -0,0 +1,241 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020.
|
||||
// Modifications copyright (c) 2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_SEGMENT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_SEGMENT_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <utility>
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/concept/assert.hpp>
|
||||
|
||||
#include <boost/geometry/core/access.hpp>
|
||||
#include <boost/geometry/core/make.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace model
|
||||
{
|
||||
|
||||
/*!
|
||||
\brief Class segment: small class containing two points
|
||||
\ingroup geometries
|
||||
\details From Wikipedia: In geometry, a line segment is a part of a line that is bounded
|
||||
by two distinct end points, and contains every point on the line between its end points.
|
||||
\note There is also a point-referring-segment, class referring_segment,
|
||||
containing point references, where points are NOT copied
|
||||
|
||||
\qbk{[include reference/geometries/segment.qbk]}
|
||||
\qbk{before.synopsis,
|
||||
[heading Model of]
|
||||
[link geometry.reference.concepts.concept_segment Segment Concept]
|
||||
}
|
||||
*/
|
||||
template<typename Point>
|
||||
class segment : public std::pair<Point, Point>
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (concepts::Point<Point>) );
|
||||
|
||||
public :
|
||||
|
||||
/// \constructor_default_no_init
|
||||
constexpr segment() = default;
|
||||
|
||||
/*!
|
||||
\brief Constructor taking the first and the second point
|
||||
*/
|
||||
constexpr segment(Point const& p1, Point const& p2)
|
||||
: std::pair<Point, Point>(p1, p2)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
/*!
|
||||
\brief Class segment: small class containing two (templatized) point references
|
||||
\ingroup geometries
|
||||
\details From Wikipedia: In geometry, a line segment is a part of a line that is bounded
|
||||
by two distinct end points, and contains every point on the line between its end points.
|
||||
\note The structure is like std::pair, and can often be used interchangeable.
|
||||
Difference is that it refers to points, does not have points.
|
||||
\note Like std::pair, points are public available.
|
||||
\note type is const or non const, so geometry::segment<P> or geometry::segment<P const>
|
||||
\note We cannot derive from std::pair<P&, P&> because of
|
||||
reference assignments.
|
||||
\tparam ConstOrNonConstPoint point type of the segment, maybe a point or a const point
|
||||
*/
|
||||
template<typename ConstOrNonConstPoint>
|
||||
class referring_segment
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT( (
|
||||
typename std::conditional
|
||||
<
|
||||
std::is_const<ConstOrNonConstPoint>::value,
|
||||
concepts::Point<ConstOrNonConstPoint>,
|
||||
concepts::ConstPoint<ConstOrNonConstPoint>
|
||||
>
|
||||
) );
|
||||
|
||||
typedef ConstOrNonConstPoint point_type;
|
||||
|
||||
public:
|
||||
|
||||
point_type& first;
|
||||
point_type& second;
|
||||
|
||||
/*!
|
||||
\brief Constructor taking the first and the second point
|
||||
*/
|
||||
inline referring_segment(point_type& p1, point_type& p2)
|
||||
: first(p1)
|
||||
, second(p2)
|
||||
{}
|
||||
};
|
||||
|
||||
|
||||
} // namespace model
|
||||
|
||||
|
||||
// Traits specializations for segment above
|
||||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
namespace traits
|
||||
{
|
||||
|
||||
template <typename Point>
|
||||
struct tag<model::segment<Point> >
|
||||
{
|
||||
typedef segment_tag type;
|
||||
};
|
||||
|
||||
template <typename Point>
|
||||
struct point_type<model::segment<Point> >
|
||||
{
|
||||
typedef Point type;
|
||||
};
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::segment<Point>, 0, Dimension>
|
||||
{
|
||||
typedef model::segment<Point> segment_type;
|
||||
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
|
||||
|
||||
static constexpr coordinate_type get(segment_type const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.first);
|
||||
}
|
||||
|
||||
static void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.first, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Point, std::size_t Dimension>
|
||||
struct indexed_access<model::segment<Point>, 1, Dimension>
|
||||
{
|
||||
typedef model::segment<Point> segment_type;
|
||||
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
|
||||
|
||||
static constexpr coordinate_type get(segment_type const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.second);
|
||||
}
|
||||
|
||||
static void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.second, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename Point>
|
||||
struct make<model::segment<Point> >
|
||||
{
|
||||
typedef model::segment<Point> segment_type;
|
||||
|
||||
static const bool is_specialized = true;
|
||||
|
||||
static constexpr segment_type apply(Point const& p1, Point const& p2)
|
||||
{
|
||||
return segment_type(p1, p2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <typename ConstOrNonConstPoint>
|
||||
struct tag<model::referring_segment<ConstOrNonConstPoint> >
|
||||
{
|
||||
typedef segment_tag type;
|
||||
};
|
||||
|
||||
template <typename ConstOrNonConstPoint>
|
||||
struct point_type<model::referring_segment<ConstOrNonConstPoint> >
|
||||
{
|
||||
typedef ConstOrNonConstPoint type;
|
||||
};
|
||||
|
||||
template <typename ConstOrNonConstPoint, std::size_t Dimension>
|
||||
struct indexed_access<model::referring_segment<ConstOrNonConstPoint>, 0, Dimension>
|
||||
{
|
||||
typedef model::referring_segment<ConstOrNonConstPoint> segment_type;
|
||||
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(segment_type const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.first);
|
||||
}
|
||||
|
||||
static inline void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.first, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <typename ConstOrNonConstPoint, std::size_t Dimension>
|
||||
struct indexed_access<model::referring_segment<ConstOrNonConstPoint>, 1, Dimension>
|
||||
{
|
||||
typedef model::referring_segment<ConstOrNonConstPoint> segment_type;
|
||||
typedef typename geometry::coordinate_type<segment_type>::type coordinate_type;
|
||||
|
||||
static inline coordinate_type get(segment_type const& s)
|
||||
{
|
||||
return geometry::get<Dimension>(s.second);
|
||||
}
|
||||
|
||||
static inline void set(segment_type& s, coordinate_type const& value)
|
||||
{
|
||||
geometry::set<Dimension>(s.second, value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace traits
|
||||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_SEGMENT_HPP
|
||||
@@ -0,0 +1,60 @@
|
||||
// Boost.Geometry (aka GGL, Generic Geometry Library)
|
||||
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2018-2020.
|
||||
// Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
|
||||
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
|
||||
|
||||
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
|
||||
// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
|
||||
|
||||
// Use, modification and distribution is subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP
|
||||
|
||||
|
||||
#include <boost/variant/variant_fwd.hpp>
|
||||
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename ...>
|
||||
struct parameter_pack_first_type {};
|
||||
|
||||
template <typename T, typename ... Ts>
|
||||
struct parameter_pack_first_type<T, Ts...>
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
|
||||
struct point_type<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
|
||||
: point_type
|
||||
<
|
||||
typename detail::parameter_pack_first_type
|
||||
<
|
||||
BOOST_VARIANT_ENUM_PARAMS(T)
|
||||
>::type
|
||||
>
|
||||
{};
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_VARIANT_GEOMETRY_HPP
|
||||
Reference in New Issue
Block a user