1 // Boost.Geometry (aka GGL, Generic Geometry Library) 2 3 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands. 4 5 // This file was modified by Oracle on 2015, 2016. 6 // Modifications copyright (c) 2015-2016 Oracle and/or its affiliates. 7 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle 8 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) 12 13 #ifndef BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP 14 #define BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP 15 16 #if defined(HAVE_MATRIX_AS_STRING) 17 #include <string> 18 #endif 19 20 #include <cstddef> 21 22 23 24 namespace boost { namespace geometry 25 { 26 27 template <typename SegmentRatio> 28 struct fraction_type 29 { 30 SegmentRatio robust_ra; // TODO this can be renamed now to "ra" 31 SegmentRatio robust_rb; 32 33 bool initialized; fraction_typeboost::geometry::fraction_type34 inline fraction_type() 35 : initialized(false) 36 {} 37 38 template <typename Info> assignboost::geometry::fraction_type39 inline void assign(Info const& info) 40 { 41 initialized = true; 42 robust_ra = info.robust_ra; 43 robust_rb = info.robust_rb; 44 } 45 assignboost::geometry::fraction_type46 inline void assign(SegmentRatio const& a, SegmentRatio const& b) 47 { 48 initialized = true; 49 robust_ra = a; 50 robust_rb = b; 51 } 52 53 }; 54 55 // 56 /*! 57 \brief return-type for segment-intersection 58 \note Set in intersection_points.hpp, from segment_intersection_info 59 */ 60 template <typename Point, typename SegmentRatio> 61 struct segment_intersection_points 62 { 63 std::size_t count; // The number of intersection points 64 65 // TODO: combine intersections and fractions in one struct 66 Point intersections[2]; 67 fraction_type<SegmentRatio> fractions[2]; 68 typedef Point point_type; 69 segment_intersection_pointsboost::geometry::segment_intersection_points70 segment_intersection_points() 71 : count(0) 72 {} 73 }; 74 75 }} // namespace boost::geometry 76 77 78 #endif // BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP 79