Added thirdparty: boost library

This commit is contained in:
Viacheslav Demydiuk
2024-01-06 19:55:56 +02:00
parent bf49f439e1
commit bccd1e7051
15683 changed files with 3239840 additions and 0 deletions
+136
View File
@@ -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.
// 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>
#include <boost/geometry/geometries/concepts/concept_type.hpp>
namespace boost { namespace geometry { namespace concepts
{
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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_BOX_CONCEPT_HPP
+84
View File
@@ -0,0 +1,84 @@
// 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-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.
// 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 <boost/concept_check.hpp>
#include <boost/concept/requires.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>
#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
{
/*!
\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()
{
BOOST_CONCEPT_ASSERT((typename concept_type<Geometry>::type));
}
/*!
\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
<
typename geometry::detail::first_geometry_type<Geometry1>::type,
typename geometry::detail::first_geometry_type<Geometry2>::type
>();
}
}}} // namespace boost::geometry::concepts
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_CHECK_HPP
+31
View File
@@ -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
@@ -0,0 +1,104 @@
// 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-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.
// 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/concept_type.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
namespace boost { namespace geometry { namespace concepts
{
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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_LINESTRING_CONCEPT_HPP
@@ -0,0 +1,97 @@
// 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-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.
// 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/concept_type.hpp>
#include <boost/geometry/geometries/concepts/linestring_concept.hpp>
namespace boost { namespace geometry { namespace concepts
{
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, std::move(*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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_LINESTRING_CONCEPT_HPP
@@ -0,0 +1,99 @@
// 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-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.
// 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/concept_type.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
namespace boost { namespace geometry { namespace concepts
{
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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POINT_CONCEPT_HPP
@@ -0,0 +1,98 @@
// 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-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.
// 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/concept_type.hpp>
#include <boost/geometry/geometries/concepts/polygon_concept.hpp>
namespace boost { namespace geometry { namespace concepts
{
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);
// The concept should support the second version of push_back, using &&
polygon_type* poly = 0;
traits::push_back<Geometry>::apply(*mp, std::move(*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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_MULTI_POLYGON_CONCEPT_HPP
+151
View File
@@ -0,0 +1,151 @@
// 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-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.
// 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>
#include <boost/geometry/geometries/concepts/concept_type.hpp>
namespace boost { namespace geometry { namespace concepts
{
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
};
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
+151
View File
@@ -0,0 +1,151 @@
// 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-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.
// 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/concept_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
};
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
+101
View File
@@ -0,0 +1,101 @@
// 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-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.
// 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/concept_type.hpp>
#include <boost/geometry/geometries/concepts/point_concept.hpp>
namespace boost { namespace geometry { namespace concepts
{
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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_RING_CONCEPT_HPP
+135
View File
@@ -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.
// 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.
// 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/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
{
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
};
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
#endif // BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_SEGMENT_CONCEPT_HPP