| 1 |
/* |
| 2 |
* (C) Copyright 2013 ECMWF. |
| 3 |
* |
| 4 |
* This software is licensed under the terms of the Apache Licence Version 2.0 |
| 5 |
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
| 6 |
* In applying this licence, ECMWF does not waive the privileges and immunities |
| 7 |
* granted to it by virtue of its status as an intergovernmental organisation |
| 8 |
* nor does it submit to any jurisdiction. |
| 9 |
*/ |
| 10 |
|
| 11 |
#include <string> |
| 12 |
|
| 13 |
#include "atlas/projection/Projection.h" |
| 14 |
#include "atlas/projection/detail/ProjectionFactory.h" |
| 15 |
#include "atlas/util/Config.h" |
| 16 |
|
| 17 |
#include "atlas/projection/detail/CubedSphereEquiAnglProjection.h" |
| 18 |
#include "atlas/projection/detail/CubedSphereEquiDistProjection.h" |
| 19 |
#include "atlas/projection/detail/LambertAzimuthalEqualAreaProjection.h" |
| 20 |
#include "atlas/projection/detail/LambertConformalConicProjection.h" |
| 21 |
#include "atlas/projection/detail/LonLatProjection.h" |
| 22 |
#include "atlas/projection/detail/MercatorProjection.h" |
| 23 |
#include "atlas/projection/detail/SchmidtProjection.h" |
| 24 |
#include "atlas/projection/detail/VariableResolutionProjection.h" |
| 25 |
|
| 26 |
namespace atlas { |
| 27 |
namespace projection { |
| 28 |
|
| 29 |
//---------------------------------------------------------------------------------------------------------------------- |
| 30 |
|
| 31 |
void force_link() { |
| 32 |
static struct Link { |
| 33 |
Link() { |
| 34 |
ProjectionBuilder<detail::CubedSphereEquiAnglProjection>(); |
| 35 |
ProjectionBuilder<detail::CubedSphereEquiDistProjection>(); |
| 36 |
ProjectionBuilder<detail::LonLatProjection>(); |
| 37 |
ProjectionBuilder<detail::RotatedLonLatProjection>(); |
| 38 |
ProjectionBuilder<detail::SchmidtProjection>(); |
| 39 |
ProjectionBuilder<detail::RotatedSchmidtProjection>(); |
| 40 |
ProjectionBuilder<detail::MercatorProjection>(); |
| 41 |
ProjectionBuilder<detail::RotatedMercatorProjection>(); |
| 42 |
ProjectionBuilder<detail::VariableResolutionProjection>(); |
| 43 |
ProjectionBuilder<detail::RotatedVariableResolutionProjection>(); |
| 44 |
ProjectionBuilder<detail::LambertConformalConicProjection>(); |
| 45 |
ProjectionBuilder<detail::LambertAzimuthalEqualAreaProjection>(); |
| 46 |
} |
| 47 |
} link; |
| 48 |
} |
| 49 |
|
| 50 |
//---------------------------------------------------------------------------------------------------------------------- |
| 51 |
|
| 52 |
const Projection::Implementation* ProjectionFactory::build(const std::string& builder) { |
| 53 |
return build(builder, util::NoConfig()); |
| 54 |
} |
| 55 |
|
| 56 |
const Projection::Implementation* ProjectionFactory::build(const std::string& builder, |
| 57 |
const eckit::Parametrisation& param) { |
| 58 |
force_link(); |
| 59 |
auto factory = get(builder); |
| 60 |
return factory->make(param); |
| 61 |
} |
| 62 |
|
| 63 |
//---------------------------------------------------------------------------------------------------------------------- |
| 64 |
|
| 65 |
} // namespace projection |
| 66 |
} // namespace atlas |