Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:32:21

0001 // Boost.Geometry (aka GGL, Generic Geometry Library)
0002 
0003 // Copyright (c) 2007-2015 Barend Gehrels, Amsterdam, the Netherlands.
0004 
0005 // This file was modified by Oracle on 2015-2024.
0006 // Modifications copyright (c) 2015-2024 Oracle and/or its affiliates.
0007 // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle
0008 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0009 
0010 // Use, modification and distribution is subject to the Boost Software License,
0011 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0012 // http://www.boost.org/LICENSE_1_0.txt)
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 \brief return-type for segment-intersection
0056 \note Set in intersection_points.hpp, from segment_intersection_info
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; // The number of intersection points
0066 
0067     // TODO: combine intersections and fractions in one struct
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 }} // namespace boost::geometry
0078 
0079 
0080 #endif // BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP