Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:50:18

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2017-2022.
0006 // Modifications copyright (c) 2017-2022 Oracle and/or its affiliates.
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
0012 
0013 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
0014 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP
0015 
0016 
0017 #include <boost/geometry/algorithms/area.hpp>
0018 #include <boost/geometry/algorithms/detail/point_on_border.hpp>
0019 #include <boost/geometry/algorithms/detail/within/implementation.hpp>
0020 
0021 
0022 namespace boost { namespace geometry
0023 {
0024 
0025 
0026 #ifndef DOXYGEN_NO_DETAIL
0027 namespace detail { namespace overlay
0028 {
0029 
0030 template <typename Point, typename AreaType>
0031 struct ring_properties
0032 {
0033     using point_type = Point;
0034     using area_type = AreaType;
0035 
0036     bool valid;
0037 
0038     // Filled by "select_rings"
0039     Point point;
0040     area_type area;
0041 
0042     // Filled by "update_ring_selection"
0043     bool reversed;
0044 
0045     // Filled/used by "assign_rings"
0046     bool discarded;
0047     ring_identifier parent;
0048     area_type parent_area;
0049     std::vector<ring_identifier> children;
0050 
0051     inline ring_properties()
0052         : valid(false)
0053         , area(area_type())
0054         , reversed(false)
0055         , discarded(false)
0056         , parent_area(-1)
0057     {}
0058 
0059     template <typename RingOrBox, typename Strategy>
0060     inline ring_properties(RingOrBox const& ring_or_box, Strategy const& strategy)
0061         : reversed(false)
0062         , discarded(false)
0063         , parent_area(-1)
0064     {
0065         this->area = geometry::area(ring_or_box, strategy);
0066         valid = geometry::point_on_border(this->point, ring_or_box);
0067     }
0068 
0069     inline area_type get_area() const
0070     {
0071         return reversed ? -area : area;
0072     }
0073 };
0074 
0075 }} // namespace detail::overlay
0076 #endif // DOXYGEN_NO_DETAIL
0077 
0078 
0079 }} // namespace boost::geometry
0080 
0081 
0082 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_RING_PROPERTIES_HPP