update boost
This commit is contained in:
@@ -24,25 +24,12 @@
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_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
|
||||
{
|
||||
@@ -129,6 +116,20 @@ public :
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, box_tag>
|
||||
{
|
||||
using type = Box<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, box_tag>
|
||||
{
|
||||
using type = ConstBox<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// 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-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -11,21 +15,19 @@
|
||||
// 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 <boost/concept_check.hpp>
|
||||
#include <boost/concept/requires.hpp>
|
||||
#include <boost/core/ignore_unused.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/variant/variant_fwd.hpp>
|
||||
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/algorithms/detail/select_geometry_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/box_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/dynamic_geometry_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/geometry_collection_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>
|
||||
@@ -35,189 +37,22 @@
|
||||
#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
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
|
||||
#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 = boost::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);
|
||||
BOOST_CONCEPT_ASSERT((typename concept_type<Geometry>::type));
|
||||
}
|
||||
|
||||
|
||||
@@ -227,18 +62,23 @@ inline void check()
|
||||
\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>();
|
||||
assert_dimension_equal
|
||||
<
|
||||
typename geometry::detail::first_geometry_type<Geometry1>::type,
|
||||
typename geometry::detail::first_geometry_type<Geometry2>::type
|
||||
>();
|
||||
}
|
||||
|
||||
|
||||
} // namespace concepts
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2021, Oracle and/or its affiliates.
|
||||
|
||||
// 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_CONCEPTS_CONCEPT_TYPE_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CONCEPT_TYPE_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
template <typename Geometry, typename Tag = typename tag<Geometry>::type>
|
||||
struct concept_type
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE("Not implemented for this Tag.", Tag);
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CONCEPT_TYPE_HPP
|
||||
@@ -0,0 +1,112 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2021, Oracle and/or its affiliates.
|
||||
|
||||
// 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_CONCEPTS_DYNAMIC_GEOMETRY_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_DYNAMIC_GEOMETRY_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
#include <boost/geometry/core/geometry_types.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/core/visit.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/box_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/concept_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/geometry_collection_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>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename Geometry, typename SubGeometry>
|
||||
struct GeometryType<Geometry, SubGeometry, dynamic_geometry_tag, false>
|
||||
: concepts::concept_type<SubGeometry>::type
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
BOOST_CONCEPT_USAGE(GeometryType)
|
||||
{
|
||||
Geometry* dg = nullptr;
|
||||
SubGeometry* sg = nullptr;
|
||||
*dg = std::move(*sg);
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
template <typename Geometry, typename SubGeometry>
|
||||
struct GeometryType<Geometry const, SubGeometry, dynamic_geometry_tag, false>
|
||||
: concepts::concept_type<SubGeometry const>::type
|
||||
{};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct DynamicGeometry
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
using sequence_t = typename traits::geometry_types<Geometry>::type;
|
||||
BOOST_CONCEPT_ASSERT((detail::GeometryTypes<Geometry, sequence_t>));
|
||||
|
||||
BOOST_CONCEPT_USAGE(DynamicGeometry)
|
||||
{
|
||||
Geometry* dg = nullptr;
|
||||
traits::visit<Geometry>::apply([](auto &&) {}, *dg);
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct ConstDynamicGeometry
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
using sequence_t = typename traits::geometry_types<Geometry>::type;
|
||||
BOOST_CONCEPT_ASSERT((detail::GeometryTypes<Geometry const, sequence_t>));
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstDynamicGeometry)
|
||||
{
|
||||
Geometry const* dg = nullptr;
|
||||
traits::visit<Geometry>::apply([](auto &&) {}, *dg);
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, dynamic_geometry_tag>
|
||||
{
|
||||
using type = DynamicGeometry<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, dynamic_geometry_tag>
|
||||
{
|
||||
using type = ConstDynamicGeometry<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_DYNAMIC_GEOMETRY_CONCEPT_HPP
|
||||
@@ -0,0 +1,157 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2021, Oracle and/or its affiliates.
|
||||
|
||||
// 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_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP
|
||||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP
|
||||
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
|
||||
#include <boost/geometry/core/geometry_types.hpp>
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
#include <boost/geometry/core/tag.hpp>
|
||||
#include <boost/geometry/core/tags.hpp>
|
||||
#include <boost/geometry/core/visit.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/box_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/concept_type.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/util/sequence.hpp>
|
||||
#include <boost/geometry/util/type_traits.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry { namespace concepts
|
||||
{
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename SubGeometry,
|
||||
typename Tag = typename tag<Geometry>::type,
|
||||
bool IsSubDynamicOrCollection = util::is_dynamic_geometry<SubGeometry>::value
|
||||
|| util::is_geometry_collection<SubGeometry>::value
|
||||
>
|
||||
struct GeometryType;
|
||||
|
||||
// Prevent recursive concept checking
|
||||
template <typename Geometry, typename SubGeometry, typename Tag>
|
||||
struct GeometryType<Geometry, SubGeometry, Tag, true> {};
|
||||
|
||||
template <typename Geometry, typename SubGeometry, typename Tag>
|
||||
struct GeometryType<Geometry const, SubGeometry, Tag, true> {};
|
||||
|
||||
|
||||
template <typename Geometry, typename SubGeometry>
|
||||
struct GeometryType<Geometry, SubGeometry, geometry_collection_tag, false>
|
||||
: concepts::concept_type<SubGeometry>::type
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
BOOST_CONCEPT_USAGE(GeometryType)
|
||||
{
|
||||
Geometry* gc = nullptr;
|
||||
SubGeometry* sg = nullptr;
|
||||
traits::emplace_back<Geometry>::apply(*gc, std::move(*sg));
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
template <typename Geometry, typename SubGeometry>
|
||||
struct GeometryType<Geometry const, SubGeometry, geometry_collection_tag, false>
|
||||
: concepts::concept_type<SubGeometry const>::type
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry, typename ...SubGeometries>
|
||||
struct GeometryTypesPack {};
|
||||
|
||||
template <typename Geometry, typename SubGeometry, typename ...SubGeometries>
|
||||
struct GeometryTypesPack<Geometry, SubGeometry, SubGeometries...>
|
||||
: GeometryTypesPack<Geometry, SubGeometries...>
|
||||
, GeometryType<Geometry, SubGeometry>
|
||||
{};
|
||||
|
||||
|
||||
template <typename Geometry, typename SubGeometriesSequence>
|
||||
struct GeometryTypes;
|
||||
|
||||
template <typename Geometry, typename ...SubGeometries>
|
||||
struct GeometryTypes<Geometry, util::type_sequence<SubGeometries...>>
|
||||
: GeometryTypesPack<Geometry, SubGeometries...>
|
||||
{};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct GeometryCollection
|
||||
: boost::ForwardRangeConcept<Geometry>
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
using sequence_t = typename traits::geometry_types<Geometry>::type;
|
||||
BOOST_CONCEPT_ASSERT( (detail::GeometryTypes<Geometry, sequence_t>) );
|
||||
|
||||
BOOST_CONCEPT_USAGE(GeometryCollection)
|
||||
{
|
||||
Geometry* gc = nullptr;
|
||||
traits::clear<Geometry>::apply(*gc);
|
||||
traits::iter_visit<Geometry>::apply([](auto &&) {}, boost::begin(*gc));
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct ConstGeometryCollection
|
||||
: boost::ForwardRangeConcept<Geometry>
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
using sequence_t = typename traits::geometry_types<Geometry>::type;
|
||||
BOOST_CONCEPT_ASSERT( (detail::GeometryTypes<Geometry const, sequence_t>) );
|
||||
|
||||
BOOST_CONCEPT_USAGE(ConstGeometryCollection)
|
||||
{
|
||||
Geometry const* gc = nullptr;
|
||||
traits::iter_visit<Geometry>::apply([](auto &&) {}, boost::begin(*gc));
|
||||
}
|
||||
#endif // DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, geometry_collection_tag>
|
||||
{
|
||||
using type = GeometryCollection<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, geometry_collection_tag>
|
||||
{
|
||||
using type = ConstGeometryCollection<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_GEOMETRY_COLLECTION_CONCEPT_HPP
|
||||
@@ -4,6 +4,10 @@
|
||||
// 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-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -18,12 +22,12 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/type_traits/remove_const.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/concept_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
|
||||
|
||||
@@ -31,45 +35,6 @@
|
||||
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
|
||||
{
|
||||
@@ -119,6 +84,20 @@ public :
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, linestring_tag>
|
||||
{
|
||||
using type = Linestring<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, linestring_tag>
|
||||
{
|
||||
using type = ConstLinestring<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -18,27 +22,15 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_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
|
||||
{
|
||||
@@ -57,7 +49,7 @@ public :
|
||||
traits::clear<Geometry>::apply(*mls);
|
||||
traits::resize<Geometry>::apply(*mls, 0);
|
||||
linestring_type* ls = 0;
|
||||
traits::push_back<Geometry>::apply(*mls, *ls);
|
||||
traits::push_back<Geometry>::apply(*mls, std::move(*ls));
|
||||
}
|
||||
#endif
|
||||
};
|
||||
@@ -85,6 +77,20 @@ public :
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, multi_linestring_tag>
|
||||
{
|
||||
using type = MultiLinestring<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, multi_linestring_tag>
|
||||
{
|
||||
using type = ConstMultiLinestring<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -18,27 +22,17 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/core/mutable_range.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_type.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
|
||||
{
|
||||
@@ -85,6 +79,20 @@ public :
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, multi_point_tag>
|
||||
{
|
||||
using type = MultiPoint<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, multi_point_tag>
|
||||
{
|
||||
using type = ConstMultiPoint<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2020-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -18,26 +22,15 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/range/metafunctions.hpp>
|
||||
#include <boost/range/value_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_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
|
||||
{
|
||||
@@ -55,8 +48,9 @@ public :
|
||||
Geometry* mp = 0;
|
||||
traits::clear<Geometry>::apply(*mp);
|
||||
traits::resize<Geometry>::apply(*mp, 0);
|
||||
// The concept should support the second version of push_back, using &&
|
||||
polygon_type* poly = 0;
|
||||
traits::push_back<Geometry>::apply(*mp, *poly);
|
||||
traits::push_back<Geometry>::apply(*mp, std::move(*poly));
|
||||
}
|
||||
#endif
|
||||
};
|
||||
@@ -85,6 +79,19 @@ public :
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, multi_polygon_tag>
|
||||
{
|
||||
using type = MultiPolygon<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, multi_polygon_tag>
|
||||
{
|
||||
using type = ConstMultiPolygon<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
// 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.
|
||||
// Modifications copyright (c) 2014, Oracle and/or its affiliates.
|
||||
// This file was modified by Oracle on 2014-2021.
|
||||
// Modifications copyright (c) 2014-2021, 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.
|
||||
@@ -28,68 +29,12 @@
|
||||
#include <boost/geometry/core/coordinate_dimension.hpp>
|
||||
#include <boost/geometry/core/coordinate_system.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_type.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 boost::mpl::int_<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
|
||||
{
|
||||
@@ -187,6 +132,20 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, point_tag>
|
||||
{
|
||||
using type = Point<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, point_tag>
|
||||
{
|
||||
using type = ConstPoint<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POINT_CONCEPT_HPP
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// 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-2021.
|
||||
// Modifications copyright (c) 2020-2021, 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.
|
||||
|
||||
@@ -14,6 +18,8 @@
|
||||
#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>
|
||||
@@ -24,6 +30,7 @@
|
||||
#include <boost/geometry/core/point_type.hpp>
|
||||
#include <boost/geometry/core/ring_type.hpp>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.hpp>
|
||||
#include <boost/geometry/geometries/concepts/ring_concept.hpp>
|
||||
|
||||
@@ -39,7 +46,7 @@ template <typename PolygonType>
|
||||
class Polygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
typedef typename boost::remove_const<PolygonType>::type polygon_type;
|
||||
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;
|
||||
@@ -90,7 +97,7 @@ class ConstPolygon
|
||||
{
|
||||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS
|
||||
|
||||
typedef typename boost::remove_const<PolygonType>::type const_polygon_type;
|
||||
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;
|
||||
@@ -125,6 +132,20 @@ public:
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, polygon_tag>
|
||||
{
|
||||
using type = Polygon<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, polygon_tag>
|
||||
{
|
||||
using type = ConstPolygon<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYGON_CONCEPT_HPP
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// 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-2021.
|
||||
// Modifications copyright (c) 2020-2021 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.
|
||||
|
||||
@@ -18,34 +22,18 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/range/concepts.hpp>
|
||||
#include <boost/type_traits/remove_const.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/concept_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
|
||||
{
|
||||
@@ -93,6 +81,20 @@ public :
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, ring_tag>
|
||||
{
|
||||
using type = Ring<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, ring_tag>
|
||||
{
|
||||
using type = ConstRing<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
|
||||
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
|
||||
|
||||
// This file was modified by Oracle on 2021.
|
||||
// Modifications copyright (c) 2021 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.
|
||||
|
||||
@@ -14,37 +18,20 @@
|
||||
#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>
|
||||
|
||||
#include <boost/geometry/geometries/concepts/concept_type.hpp>
|
||||
#include <boost/geometry/geometries/concepts/point_concept.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
|
||||
{
|
||||
@@ -129,6 +116,19 @@ public :
|
||||
};
|
||||
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry, segment_tag>
|
||||
{
|
||||
using type = Segment<Geometry>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct concept_type<Geometry const, segment_tag>
|
||||
{
|
||||
using type = ConstSegment<Geometry>;
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace boost::geometry::concepts
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user