File indexing completed on 2025-12-15 09:50:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
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
0039 Point point;
0040 area_type area;
0041
0042
0043 bool reversed;
0044
0045
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 }}
0076 #endif
0077
0078
0079 }}
0080
0081
0082 #endif