Debian Codegraph @

src/atlas/util/SphericalPolygon.h

raw
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 <vector>
14
15 #include "atlas/util/Polygon.h"
16
17 namespace atlas {
18 namespace util {
19
20 class PartitionPolygon;
21 //------------------------------------------------------------------------------------------------------
22
23 class SphericalPolygon : public PolygonCoordinates {
24 public:
25 SphericalPolygon(const PartitionPolygon&);
26
27 SphericalPolygon(const std::vector<PointLonLat>& points);
28
29 /*
30 * Point-in-polygon test based on winding number
31 * @note reference <a
32 * href="http://geomalgorithms.com/a03-_inclusion.html">Inclusion of a Point
33 * in a Polygon</a>
34 * @param[in] P given point in (lon,lat) coordinates
35 * @return if point is in polygon
36 */
37 bool contains(const Point2& lonlat) const override;
38 };
39
40 //------------------------------------------------------------------------------------------------------
41
42 } // namespace util
43 } // namespace atlas