// Copyright (c) 2008-2015 Barend Gehrels, Amsterdam, the Netherlands.
-// This file was modified by Oracle on 2017, 2018.
-// Modifications copyright (c) 2017-2018, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2017, 2018, 2019.
+// Modifications copyright (c) 2017-2019, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle.
// Use, modification and distribution is subject to the Boost Software License,
return result;
}
- // template class, using CRTP to implement forward/inverse
template <typename T, typename Parameters>
struct base_nzmg_ellipsoid
- : public base_t_fi<base_nzmg_ellipsoid<T, Parameters>, T, Parameters>
{
- inline base_nzmg_ellipsoid(const Parameters& par)
- : base_t_fi<base_nzmg_ellipsoid<T, Parameters>, T, Parameters>(*this, par)
- {}
-
// FORWARD(e_forward) ellipsoid
// Project coordinates from geographic (lon, lat) to cartesian (x, y)
- inline void fwd(T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
+ inline void fwd(Parameters const& par, T const& lp_lon, T lp_lat, T& xy_x, T& xy_y) const
{
static const T rad_to_sec5 = nzmg::rad_to_sec5<T>();
const T * C;
int i;
- lp_lat = (lp_lat - this->m_par.phi0) * rad_to_sec5;
+ lp_lat = (lp_lat - par.phi0) * rad_to_sec5;
for (p.r = *(C = tpsi<T>() + (i = Ntpsi)); i ; --i)
p.r = *--C + lp_lat * p.r;
p.r *= lp_lat;
// INVERSE(e_inverse) ellipsoid
// Project coordinates from cartesian (x, y) to geographic (lon, lat)
- inline void inv(T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
+ inline void inv(Parameters const& par, T const& xy_x, T const& xy_y, T& lp_lon, T& lp_lat) const
{
static const T sec5_to_rad = nzmg::sec5_to_rad<T>();
lp_lon = p.i;
for (lp_lat = *(C = tphi<T>() + (i = Ntphi)); i ; --i)
lp_lat = *--C + p.r * lp_lat;
- lp_lat = this->m_par.phi0 + p.r * lp_lat * sec5_to_rad;
+ lp_lat = par.phi0 + p.r * lp_lat * sec5_to_rad;
} else
lp_lon = lp_lat = HUGE_VAL;
}
struct nzmg_ellipsoid : public detail::nzmg::base_nzmg_ellipsoid<T, Parameters>
{
template <typename Params>
- inline nzmg_ellipsoid(Params const& , Parameters const& par)
- : detail::nzmg::base_nzmg_ellipsoid<T, Parameters>(par)
+ inline nzmg_ellipsoid(Params const& , Parameters & par)
{
- detail::nzmg::setup_nzmg(this->m_par);
+ detail::nzmg::setup_nzmg(par);
}
};
{
// Static projection
- BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION(srs::spar::proj_nzmg, nzmg_ellipsoid, nzmg_ellipsoid)
+ BOOST_GEOMETRY_PROJECTIONS_DETAIL_STATIC_PROJECTION_FI(srs::spar::proj_nzmg, nzmg_ellipsoid)
// Factory entry(s)
BOOST_GEOMETRY_PROJECTIONS_DETAIL_FACTORY_ENTRY_FI(nzmg_entry, nzmg_ellipsoid)