1
// Generic Geometry Library
3
// Copyright Barend Gehrels 1995-2009, Geodan Holding B.V. Amsterdam, the Netherlands.
4
// Copyright Bruno Lalande 2008, 2009
5
// Use, modification and distribution is subject to the Boost Software License,
6
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7
// http://www.boost.org/LICENSE_1_0.txt)
9
#ifndef GGL_ALGORITHMS_OVERLAPS_HPP
10
#define GGL_ALGORITHMS_OVERLAPS_HPP
12
#include <ggl/core/access.hpp>
15
\defgroup overlap overlap detection
16
\par Source descriptions:
17
- Egenhofer: Two objects overlap if they have common interior faces and the bounding faces have common parts
18
with the opposite interior faces.
20
\note Implemented in scratch the Generic Geometry library. Will be reworked internally to support more geometries
21
but function call will stay as it is now.
22
\see http://docs.codehaus.org/display/GEOTDOC/02+Geometry+Relationships#02GeometryRelationships-Overlaps
23
where is stated that "inside" is not an "overlap", this is probably true and should then be implemented as such.
31
\brief Determines overlap between two geometries
32
\details parameters are now boxes but in the future will be geometries
34
\return true if there is overlap
37
inline bool overlaps(const B& b1, const B& b2)
40
get<max_corner, 0>(b1) <= get<min_corner, 0>(b2) ||
41
get<min_corner, 0>(b1) >= get<max_corner, 0>(b2) ||
42
get<max_corner, 1>(b1) <= get<min_corner, 1>(b2) ||
43
get<min_corner, 1>(b1) >= get<max_corner, 1>(b2)
50
#endif // GGL_ALGORITHMS_OVERLAPS_HPP