mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-16 20:28:09 +00:00
Added thirdparty: boost library
This commit is contained in:
+154
@@ -0,0 +1,154 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2020, 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_STRATEGIES_ENVELOPE_CARTESIAN_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_CARTESIAN_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/cartesian/envelope.hpp> // Not used, for backward compatibility
|
||||
#include <boost/geometry/strategy/cartesian/envelope_box.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/envelope_boxes.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/envelope_multipoint.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/envelope_point.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/envelope_range.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/envelope_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/envelope/services.hpp>
|
||||
#include <boost/geometry/strategies/expand/cartesian.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace envelope
|
||||
{
|
||||
|
||||
template <typename CalculationType = void>
|
||||
struct cartesian
|
||||
: strategies::expand::cartesian<CalculationType>
|
||||
{
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_point();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_multi_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_multipoint();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_box();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_segment_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_segment<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_linestring<Geometry>::value
|
||||
|| util::is_ring<Geometry>::value
|
||||
|| util::is_polygon<Geometry>::value
|
||||
> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_range();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_multi_linestring<Geometry>::value
|
||||
|| util::is_multi_polygon<Geometry>::value
|
||||
|| util::is_geometry_collection<Geometry>::value
|
||||
> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::cartesian_boxes();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
struct default_strategy<Geometry, Box, cartesian_tag>
|
||||
{
|
||||
using type = strategies::envelope::cartesian<>;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::cartesian_point>
|
||||
{
|
||||
static auto get(strategy::envelope::cartesian_point const& )
|
||||
{
|
||||
return strategies::envelope::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::cartesian_multipoint>
|
||||
{
|
||||
static auto get(strategy::envelope::cartesian_multipoint const&)
|
||||
{
|
||||
return strategies::envelope::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::cartesian_box>
|
||||
{
|
||||
static auto get(strategy::envelope::cartesian_box const& )
|
||||
{
|
||||
return strategies::envelope::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::envelope::cartesian_segment<CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::cartesian_segment<CT> const&)
|
||||
{
|
||||
return strategies::envelope::cartesian<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::envelope::cartesian<CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::cartesian<CT> const&)
|
||||
{
|
||||
return strategies::envelope::cartesian<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_CARTESIAN_HPP
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2020-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_STRATEGIES_ENVELOPE_GEOGRAPHIC_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_GEOGRAPHIC_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/geographic/envelope.hpp> // Not used, for backward compatibility
|
||||
#include <boost/geometry/strategy/geographic/envelope_range.hpp>
|
||||
#include <boost/geometry/strategy/geographic/envelope_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/envelope/spherical.hpp>
|
||||
#include <boost/geometry/strategies/expand/geographic.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace envelope
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename FormulaPolicy = strategy::andoyer,
|
||||
typename Spheroid = srs::spheroid<double>,
|
||||
typename CalculationType = void
|
||||
>
|
||||
class geographic
|
||||
: public strategies::expand::geographic<FormulaPolicy, Spheroid, CalculationType>
|
||||
{
|
||||
using base_t = strategies::expand::geographic<FormulaPolicy, Spheroid, CalculationType>;
|
||||
|
||||
public:
|
||||
geographic() = default;
|
||||
|
||||
explicit geographic(Spheroid const& spheroid)
|
||||
: base_t(spheroid)
|
||||
{}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_point();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_multi_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_multipoint();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_box();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_segment_t<Geometry> * = nullptr) const
|
||||
{
|
||||
return strategy::envelope::geographic_segment
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_linestring_t<Geometry> * = nullptr) const
|
||||
{
|
||||
return strategy::envelope::geographic_linestring
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_ring<Geometry>::value
|
||||
|| util::is_polygon<Geometry>::value
|
||||
> * = nullptr) const
|
||||
{
|
||||
return strategy::envelope::geographic_ring
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_multi_linestring<Geometry>::value
|
||||
|| util::is_multi_polygon<Geometry>::value
|
||||
|| util::is_geometry_collection<Geometry>::value
|
||||
> * = nullptr) const
|
||||
{
|
||||
return strategy::envelope::spherical_boxes();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
struct default_strategy<Geometry, Box, geographic_tag>
|
||||
{
|
||||
using type = strategies::envelope::geographic<>;
|
||||
};
|
||||
|
||||
|
||||
template <typename FP, typename S, typename CT>
|
||||
struct strategy_converter<strategy::envelope::geographic_segment<FP, S, CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::geographic_segment<FP, S, CT> const& s)
|
||||
{
|
||||
return strategies::envelope::geographic<FP, S, CT>(s.model());
|
||||
}
|
||||
};
|
||||
|
||||
template <typename FP, typename S, typename CT>
|
||||
struct strategy_converter<strategy::envelope::geographic<FP, S, CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::geographic<FP, S, CT> const& s)
|
||||
{
|
||||
return strategies::envelope::geographic<FP, S, CT>(s.model());
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_GEOGRAPHIC_HPP
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2020, 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_STRATEGIES_ENVELOPE_SERVICES_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SERVICES_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace envelope { namespace services
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename Box,
|
||||
typename CSTag = typename geometry::cs_tag<Geometry>::type
|
||||
>
|
||||
struct default_strategy
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this coordinate system.",
|
||||
Geometry, Box, CSTag);
|
||||
};
|
||||
|
||||
template <typename Strategy>
|
||||
struct strategy_converter
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Strategy.",
|
||||
Strategy);
|
||||
};
|
||||
|
||||
|
||||
}}} // namespace strategies::envelope::services
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SERVICES_HPP
|
||||
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
// Boost.Geometry
|
||||
|
||||
// Copyright (c) 2020-2022, 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_STRATEGIES_ENVELOPE_SPHERICAL_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SPHERICAL_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/spherical/envelope_box.hpp>
|
||||
#include <boost/geometry/strategy/spherical/envelope_boxes.hpp>
|
||||
#include <boost/geometry/strategy/spherical/envelope_multipoint.hpp>
|
||||
#include <boost/geometry/strategy/spherical/envelope_point.hpp>
|
||||
#include <boost/geometry/strategy/spherical/envelope_range.hpp>
|
||||
#include <boost/geometry/strategy/spherical/envelope_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/envelope/services.hpp>
|
||||
#include <boost/geometry/strategies/expand/spherical.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace envelope
|
||||
{
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <typename RadiusTypeOrSphere, typename CalculationType>
|
||||
struct spherical
|
||||
: strategies::expand::detail::spherical<RadiusTypeOrSphere, CalculationType>
|
||||
{
|
||||
spherical() = default;
|
||||
|
||||
template <typename RadiusOrSphere>
|
||||
explicit spherical(RadiusOrSphere const& radius_or_sphere)
|
||||
: strategies::expand::detail::spherical<RadiusTypeOrSphere, CalculationType>(radius_or_sphere)
|
||||
{}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_point();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_multi_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_multipoint();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_box();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_segment_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_segment<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
util::enable_if_linestring_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_linestring<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_ring<Geometry>::value
|
||||
|| util::is_polygon<Geometry>::value
|
||||
> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_ring<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
static auto envelope(Geometry const&, Box const&,
|
||||
std::enable_if_t
|
||||
<
|
||||
util::is_multi_linestring<Geometry>::value
|
||||
|| util::is_multi_polygon<Geometry>::value
|
||||
|| util::is_geometry_collection<Geometry>::value
|
||||
> * = nullptr)
|
||||
{
|
||||
return strategy::envelope::spherical_boxes();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
template <typename CalculationType = void>
|
||||
class spherical
|
||||
: public strategies::envelope::detail::spherical<void, CalculationType>
|
||||
{};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
struct default_strategy<Geometry, Box, spherical_tag>
|
||||
{
|
||||
using type = strategies::envelope::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
struct default_strategy<Geometry, Box, spherical_equatorial_tag>
|
||||
{
|
||||
using type = strategies::envelope::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Geometry, typename Box>
|
||||
struct default_strategy<Geometry, Box, spherical_polar_tag>
|
||||
{
|
||||
using type = strategies::envelope::spherical<>;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::spherical_point>
|
||||
{
|
||||
static auto get(strategy::envelope::spherical_point const& )
|
||||
{
|
||||
return strategies::envelope::spherical<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::spherical_multipoint>
|
||||
{
|
||||
static auto get(strategy::envelope::spherical_multipoint const&)
|
||||
{
|
||||
return strategies::envelope::spherical<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::envelope::spherical_box>
|
||||
{
|
||||
static auto get(strategy::envelope::spherical_box const& )
|
||||
{
|
||||
return strategies::envelope::spherical<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::envelope::spherical_segment<CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::spherical_segment<CT> const&)
|
||||
{
|
||||
return strategies::envelope::spherical<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::envelope::spherical<CT> >
|
||||
{
|
||||
static auto get(strategy::envelope::spherical<CT> const&)
|
||||
{
|
||||
return strategies::envelope::spherical<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_ENVELOPE_SPHERICAL_HPP
|
||||
Reference in New Issue
Block a user