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