1 // Boost.Geometry (aka GGL, Generic Geometry Library)
3 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
5 // This file was modified by Oracle on 2017.
6 // Modifications copyright (c) 2017 Oracle and/or its affiliates.
7 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
9 // Use, modification and distribution is subject to the Boost Software License,
10 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
14 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
17 #include <boost/geometry/algorithms/area.hpp>
18 #include <boost/geometry/algorithms/within.hpp>
19 #include <boost/geometry/algorithms/detail/point_on_border.hpp>
22 namespace boost { namespace geometry
26 #ifndef DOXYGEN_NO_DETAIL
27 namespace detail { namespace overlay
30 template <typename Point, typename AreaType>
31 struct ring_properties
33 typedef Point point_type;
34 typedef AreaType area_type;
38 // Filled by "select_rings"
42 // Filled by "update_ring_selection"
45 // Filled/used by "assign_rings"
47 ring_identifier parent;
48 area_type parent_area;
49 std::vector<ring_identifier> children;
51 inline ring_properties()
59 template <typename RingOrBox, typename Strategy>
60 inline ring_properties(RingOrBox const& ring_or_box, Strategy const& strategy)
65 this->area = geometry::area(ring_or_box, strategy);
66 valid = geometry::point_on_border(this->point, ring_or_box);
69 inline area_type get_area() const
71 return reversed ? -area : area;
75 }} // namespace detail::overlay
76 #endif // DOXYGEN_NO_DETAIL
79 }} // namespace boost::geometry
82 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP