mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-17 04:38:10 +00:00
Added thirdparty: boost library
This commit is contained in:
+72
@@ -0,0 +1,72 @@
|
||||
// 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_STRATEGIES_AREA_CARTESIAN_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/strategy/cartesian/area.hpp>
|
||||
#include <boost/geometry/strategy/cartesian/area_box.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/area/services.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace area
|
||||
{
|
||||
|
||||
template <typename CalculationType = void>
|
||||
struct cartesian : strategies::detail::cartesian_base
|
||||
{
|
||||
template <typename Geometry>
|
||||
static auto area(Geometry const&,
|
||||
std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr)
|
||||
{
|
||||
return strategy::area::cartesian<CalculationType>();
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
static auto area(Geometry const&,
|
||||
std::enable_if_t<util::is_box<Geometry>::value> * = nullptr)
|
||||
{
|
||||
return strategy::area::cartesian_box<CalculationType>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry>
|
||||
struct default_strategy<Geometry, cartesian_tag>
|
||||
{
|
||||
using type = strategies::area::cartesian<>;
|
||||
};
|
||||
|
||||
|
||||
template <typename CT>
|
||||
struct strategy_converter<strategy::area::cartesian<CT> >
|
||||
{
|
||||
static auto get(strategy::area::cartesian<CT> const&)
|
||||
{
|
||||
return strategies::area::cartesian<CT>();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::area
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_AREA_CARTESIAN_HPP
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
// 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_AREA_GEOGRAPHIC_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_AREA_GEOGRAPHIC_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/strategy/geographic/area.hpp>
|
||||
#include <boost/geometry/strategy/geographic/area_box.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/area/services.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace area
|
||||
{
|
||||
|
||||
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 Geometry>
|
||||
auto area(Geometry const&,
|
||||
std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr) const
|
||||
{
|
||||
return strategy::area::geographic
|
||||
<
|
||||
FormulaPolicy,
|
||||
strategy::default_order<FormulaPolicy>::value,
|
||||
Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
auto area(Geometry const&,
|
||||
std::enable_if_t<util::is_box<Geometry>::value> * = nullptr) const
|
||||
{
|
||||
return strategy::area::geographic_box
|
||||
<
|
||||
Spheroid, CalculationType
|
||||
>(base_t::m_spheroid);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry>
|
||||
struct default_strategy<Geometry, geographic_tag>
|
||||
{
|
||||
using type = strategies::area::geographic<>;
|
||||
};
|
||||
|
||||
|
||||
template <typename FP, std::size_t SO, typename S, typename CT>
|
||||
struct strategy_converter<strategy::area::geographic<FP, SO, S, CT> >
|
||||
{
|
||||
struct altered_strategy
|
||||
: strategies::area::geographic<FP, S, CT>
|
||||
{
|
||||
explicit altered_strategy(S const& spheroid)
|
||||
: strategies::area::geographic<FP, S, CT>(spheroid)
|
||||
{}
|
||||
|
||||
using strategies::area::geographic<FP, S, CT>::area;
|
||||
|
||||
template <typename Geometry>
|
||||
auto area(Geometry const&,
|
||||
std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr) const
|
||||
{
|
||||
return strategy::area::geographic<FP, SO, S, CT>(this->m_spheroid);
|
||||
}
|
||||
};
|
||||
|
||||
static auto get(strategy::area::geographic<FP, SO, S, CT> const& strategy)
|
||||
{
|
||||
return altered_strategy(strategy.model());
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::area
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_AREA_GEOGRAPHIC_HPP
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
// 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_AREA_SERVICES_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_AREA_SERVICES_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/core/cs.hpp>
|
||||
#include <boost/geometry/core/static_assert.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
|
||||
namespace strategies { namespace area {
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename Geometry,
|
||||
typename CSTag = typename geometry::cs_tag<Geometry>::type
|
||||
>
|
||||
struct default_strategy
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Geometry's coordinate system.",
|
||||
Geometry, CSTag);
|
||||
};
|
||||
|
||||
template <typename Strategy>
|
||||
struct strategy_converter
|
||||
{
|
||||
BOOST_GEOMETRY_STATIC_ASSERT_FALSE(
|
||||
"Not implemented for this Strategy.",
|
||||
Strategy);
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::area
|
||||
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_AREA_SERVICES_HPP
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// 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_AREA_SPHERICAL_HPP
|
||||
#define BOOST_GEOMETRY_STRATEGIES_AREA_SPHERICAL_HPP
|
||||
|
||||
|
||||
#include <boost/geometry/strategy/spherical/area.hpp>
|
||||
#include <boost/geometry/strategy/spherical/area_box.hpp>
|
||||
|
||||
#include <boost/geometry/strategies/area/services.hpp>
|
||||
#include <boost/geometry/strategies/detail.hpp>
|
||||
|
||||
|
||||
namespace boost { namespace geometry
|
||||
{
|
||||
|
||||
namespace strategies { namespace area
|
||||
{
|
||||
|
||||
template
|
||||
<
|
||||
typename RadiusTypeOrSphere = double,
|
||||
typename CalculationType = void
|
||||
>
|
||||
class spherical
|
||||
: public strategies::detail::spherical_base<RadiusTypeOrSphere>
|
||||
{
|
||||
using base_t = strategies::detail::spherical_base<RadiusTypeOrSphere>;
|
||||
|
||||
public:
|
||||
spherical()
|
||||
: base_t()
|
||||
{}
|
||||
|
||||
template <typename RadiusOrSphere>
|
||||
explicit spherical(RadiusOrSphere const& radius_or_sphere)
|
||||
: base_t(radius_or_sphere)
|
||||
{}
|
||||
|
||||
template <typename Geometry>
|
||||
auto area(Geometry const&,
|
||||
std::enable_if_t<! util::is_box<Geometry>::value> * = nullptr) const
|
||||
{
|
||||
return strategy::area::spherical
|
||||
<
|
||||
typename base_t::radius_type, CalculationType
|
||||
>(base_t::m_radius);
|
||||
}
|
||||
|
||||
template <typename Geometry>
|
||||
auto area(Geometry const&,
|
||||
std::enable_if_t<util::is_box<Geometry>::value> * = nullptr) const
|
||||
{
|
||||
return strategy::area::spherical_box
|
||||
<
|
||||
typename base_t::radius_type, CalculationType
|
||||
>(base_t::m_radius);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
namespace services
|
||||
{
|
||||
|
||||
template <typename Geometry>
|
||||
struct default_strategy<Geometry, spherical_tag>
|
||||
{
|
||||
using type = strategies::area::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct default_strategy<Geometry, spherical_equatorial_tag>
|
||||
{
|
||||
using type = strategies::area::spherical<>;
|
||||
};
|
||||
|
||||
template <typename Geometry>
|
||||
struct default_strategy<Geometry, spherical_polar_tag>
|
||||
{
|
||||
using type = strategies::area::spherical<>;
|
||||
};
|
||||
|
||||
|
||||
template <typename R, typename CT>
|
||||
struct strategy_converter<strategy::area::spherical<R, CT> >
|
||||
{
|
||||
static auto get(strategy::area::spherical<R, CT> const& strategy)
|
||||
{
|
||||
return strategies::area::spherical<R, CT>(strategy.model());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace services
|
||||
|
||||
}} // namespace strategies::area
|
||||
|
||||
}} // namespace boost::geometry
|
||||
|
||||
#endif // BOOST_GEOMETRY_STRATEGIES_AREA_SPHERICAL_HPP
|
||||
Reference in New Issue
Block a user