Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:36:50

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-2021.
0006 // Modifications copyright (c) 2015-2021 Oracle and/or its affiliates.
0007 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0008 
0009 // Use, modification and distribution is subject to the Boost Software License,
0010 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0011 // http://www.boost.org/LICENSE_1_0.txt)
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; // TODO this can be renamed now to "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 \brief return-type for segment-intersection
0055 \note Set in intersection_points.hpp, from segment_intersection_info
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; // The number of intersection points
0065 
0066     // TODO: combine intersections and fractions in one struct
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 }} // namespace boost::geometry
0077 
0078 
0079 #endif // BOOST_GEOMETRY_STRATEGIES_INTERSECTION_RESULT_HPP