| 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 |
#pragma once |
| 12 |
|
| 13 |
#include <string> |
| 14 |
|
| 15 |
#include "atlas/domain/Domain.h" |
| 16 |
#include "atlas/library/config.h" |
| 17 |
#include "atlas/projection/Jacobian.h" |
| 18 |
#include "atlas/projection/detail/ProjectionImpl.h" |
| 19 |
#include "atlas/util/ObjectHandle.h" |
| 20 |
|
| 21 |
//--------------------------------------------------------------------------------------------------------------------- |
| 22 |
|
| 23 |
// Forward declarations |
| 24 |
namespace eckit { |
| 25 |
class Parametrisation; |
| 26 |
class Hash; |
| 27 |
namespace geometry { |
| 28 |
class Point2; |
| 29 |
} |
| 30 |
} // namespace eckit |
| 31 |
|
| 32 |
//--------------------------------------------------------------------------------------------------------------------- |
| 33 |
|
| 34 |
namespace atlas { |
| 35 |
|
| 36 |
class PointLonLat; |
| 37 |
class PointXY; |
| 38 |
using Point2 = eckit::geometry::Point2; |
| 39 |
|
| 40 |
//--------------------------------------------------------------------------------------------------------------------- |
| 41 |
namespace util { |
| 42 |
class Config; |
| 43 |
} |
| 44 |
namespace projection { |
| 45 |
namespace detail { |
| 46 |
class ProjectionImpl; |
| 47 |
} |
| 48 |
} // namespace projection |
| 49 |
|
| 50 |
class Projection : DOXYGEN_HIDE(public util::ObjectHandle<projection::detail::ProjectionImpl>) { |
| 51 |
public: |
| 52 |
using Spec = util::Config; |
| 53 |
using Jacobian = projection::Jacobian; |
| 54 |
|
| 55 |
public: |
| 56 |
using Handle::Handle; |
| 57 |
Projection(); |
| 58 |
Projection(const eckit::Parametrisation&); |
| 59 |
Projection(const std::string& type, const eckit::Parametrisation&); |
| 60 |
|
| 61 |
operator bool() const; |
| 62 |
|
| 63 |
void xy2lonlat(double crd[]) const; |
| 64 |
void xy2lonlat(Point2&) const; |
| 65 |
void lonlat2xy(double crd[]) const; |
| 66 |
void lonlat2xy(Point2&) const; |
| 67 |
|
| 68 |
Jacobian jacobian(const PointLonLat&) const; |
| 69 |
|
| 70 |
PointLonLat lonlat(const PointXY&) const; |
| 71 |
PointXY xy(const PointLonLat&) const; |
| 72 |
|
| 73 |
bool strictlyRegional() const; |
| 74 |
RectangularLonLatDomain lonlatBoundingBox(const Domain&) const; |
| 75 |
|
| 76 |
Spec spec() const; |
| 77 |
|
| 78 |
std::string units() const; |
| 79 |
|
| 80 |
std::string type() const; |
| 81 |
|
| 82 |
void hash(eckit::Hash&) const; |
| 83 |
}; |
| 84 |
|
| 85 |
//--------------------------------------------------------------------------------------------------------------------- |
| 86 |
|
| 87 |
} // namespace atlas |