mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-17 20:58:11 +00:00
Added thirdparty: boost library
This commit is contained in:
+103
@@ -0,0 +1,103 @@
|
||||
// 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_EXPAND_CARTESIAN_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/cartesian/expand_box.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/expand_point.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/expand_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/expand/services.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
namespace strategies { namespace expand
|
||||
{
|
||||
|
||||
|
||||
template <typename CalculationType = void>
|
||||
struct cartesian
|
||||
: strategies::detail::cartesian_base
|
||||
{
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::cartesian_point();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::cartesian_box();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_segment_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::cartesian_segment();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
struct default_strategy<Box, Geometry, cartesian_tag>
|
||||
{
|
||||
using type = strategies::expand::cartesian<>;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::expand::cartesian_point>
|
||||
{
|
||||
static auto get(strategy::expand::cartesian_point const& )
|
||||
{
|
||||
return strategies::expand::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::expand::cartesian_box>
|
||||
{
|
||||
static auto get(strategy::expand::cartesian_box const& )
|
||||
{
|
||||
return strategies::expand::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::expand::cartesian_segment>
|
||||
{
|
||||
static auto get(strategy::expand::cartesian_segment const&)
|
||||
{
|
||||
return strategies::expand::cartesian<>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_CARTESIAN_HPP
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// 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_EXPAND_GEOGRAPHIC_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_EXPAND_GEOGRAPHIC_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/geographic/expand_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/expand/spherical.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace expand
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename FormulaPolicy = strategy::andoyer,
|
||||
typename Spheroid = srs::spheroid<double>,
|
||||
typename CalculationType = void
|
||||
>
|
||||
class geographic
|
||||
: public strategies::detail::geographic_base<Spheroid>
|
||||
{
|
||||
using base_t = strategies::detail::geographic_base<Spheroid>;
|
||||
|
||||
public:
|
||||
geographic() = default;
|
||||
|
||||
explicit geographic(Spheroid const& spheroid)
|
||||
: base_t(spheroid)
|
||||
{}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::spherical_point();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::spherical_box();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_segment_t<Geometry> * = nullptr) const
|
||||
{
|
||||
return strategy::expand::geographic_segment
|
||||
<
|
||||
FormulaPolicy, Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
struct default_strategy<Box, Geometry, geographic_tag>
|
||||
{
|
||||
using type = strategies::expand::geographic<>;
|
||||
};
|
||||
|
||||
|
||||
template <typename FP, typename S, typename CT>
|
||||
struct strategy_converter<strategy::expand::geographic_segment<FP, S, CT> >
|
||||
{
|
||||
static auto get(strategy::expand::geographic_segment<FP, S, CT> const& s)
|
||||
{
|
||||
return strategies::expand::geographic<FP, S, CT>(s.model());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_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_EXPAND_SERVICES_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_EXPAND_SERVICES_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace expand { namespace services
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Box,
|
||||
typename Geometry,
|
||||
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::expand::services
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_SERVICES_HPP
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
// 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_EXPAND_SPHERICAL_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP
|
||||
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
#include <boost/geometry/strategy/spherical/expand_box.hpp>
|
||||
#include <boost/geometry/strategy/spherical/expand_point.hpp>
|
||||
#include <boost/geometry/strategy/spherical/expand_segment.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
#include <boost/geometry/strategies/expand/services.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
namespace strategies { namespace expand
|
||||
{
|
||||
|
||||
|
||||
#ifndef DOXYGEN_NO_DETAIL
|
||||
namespace detail
|
||||
{
|
||||
|
||||
|
||||
template <typename RadiusTypeOrSphere, typename CalculationType>
|
||||
struct spherical
|
||||
: strategies::detail::spherical_base<RadiusTypeOrSphere>
|
||||
{
|
||||
spherical() = default;
|
||||
|
||||
template <typename RadiusOrSphere>
|
||||
explicit spherical(RadiusOrSphere const& radius_or_sphere)
|
||||
: strategies::detail::spherical_base<RadiusTypeOrSphere>(radius_or_sphere)
|
||||
{}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_point_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::spherical_point();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_box_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::spherical_box();
|
||||
}
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
static auto expand(Box const&, Geometry const&,
|
||||
typename util::enable_if_segment_t<Geometry> * = nullptr)
|
||||
{
|
||||
return strategy::expand::spherical_segment<CalculationType>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
#endif // DOXYGEN_NO_DETAIL
|
||||
|
||||
|
||||
template <typename CalculationType = void>
|
||||
class spherical
|
||||
: public strategies::expand::detail::spherical<void, CalculationType>
|
||||
{};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
struct default_strategy<Box, Geometry, spherical_tag>
|
||||
{
|
||||
using type = strategies::expand::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
struct default_strategy<Box, Geometry, spherical_equatorial_tag>
|
||||
{
|
||||
using type = strategies::expand::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Box, typename Geometry>
|
||||
struct default_strategy<Box, Geometry, spherical_polar_tag>
|
||||
{
|
||||
using type = strategies::expand::spherical<>;
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::expand::spherical_point>
|
||||
{
|
||||
static auto get(strategy::expand::spherical_point const& )
|
||||
{
|
||||
return strategies::expand::spherical<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct strategy_converter<strategy::expand::spherical_box>
|
||||
{
|
||||
static auto get(strategy::expand::spherical_box const& )
|
||||
{
|
||||
return strategies::expand::spherical<>();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::expand::spherical_segment<CT> >
|
||||
{
|
||||
static auto get(strategy::expand::spherical_segment<CT> const&)
|
||||
{
|
||||
return strategies::expand::spherical<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::envelope
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_EXPAND_SPHERICAL_HPP
|
||||
Reference in New Issue
Block a user