atlas
SphericalPolygon.h
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 
24 public:
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
Definition: Polygon.h:159
Definition: Polygon.h:98
bool contains(const Point2 &lonlat) const override
Point-in-partition test.
Definition: SphericalPolygon.cc:32
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Definition: SphericalPolygon.h:23