File indexing completed on 2025-09-17 08:32:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP
0015 #define BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP
0016
0017 #include <cstddef>
0018
0019 #include <boost/geometry/core/coordinate_type.hpp>
0020 #include <boost/geometry/policies/robustness/segment_ratio.hpp>
0021
0022 namespace boost { namespace geometry
0023 {
0024
0025 template <typename SegmentRatio>
0026 struct fraction_type
0027 {
0028 SegmentRatio ra;
0029 SegmentRatio rb;
0030
0031 bool initialized;
0032 inline fraction_type()
0033 : initialized(false)
0034 {}
0035
0036 template <typename Info>
0037 inline void assign(Info const& info)
0038 {
0039 initialized = true;
0040 ra = info.ra;
0041 rb = info.rb;
0042 }
0043
0044 inline void assign(SegmentRatio const& a, SegmentRatio const& b)
0045 {
0046 initialized = true;
0047 ra = a;
0048 rb = b;
0049 }
0050
0051 };
0052
0053
0054
0055
0056
0057
0058 template
0059 <
0060 typename Point,
0061 typename SegmentRatio = segment_ratio<coordinate_type_t<Point>>
0062 >
0063 struct segment_intersection_points
0064 {
0065 std::size_t count;
0066
0067
0068 Point intersections[2];
0069 fraction_type<SegmentRatio> fractions[2];
0070 typedef Point point_type;
0071
0072 segment_intersection_points()
0073 : count(0)
0074 {}
0075 };
0076
0077 }}
0078
0079
0080 #endif