示例#1
0
    static inline bool apply(Segment const& segment,
                             Polygon const& polygon,
                             IntersectionStrategy const& strategy)
    {
        typedef typename geometry::ring_type<Polygon>::type ring;

        if ( !disjoint_range_segment_or_box
                 <
                     ring, closure<Polygon>::value, Segment
                 >::apply(geometry::exterior_ring(polygon), segment, strategy) )
        {
            return false;
        }

        if ( !check_interior_rings(geometry::interior_rings(polygon), segment, strategy) )
        {
            return false;
        }

        typename point_type<Segment>::type p;
        detail::assign_point_from_index<0>(segment, p);

        return !geometry::covered_by(p, polygon,
                    strategy.template get_point_in_geometry_strategy<Segment, Polygon>());
    }
示例#2
0
 static inline
 bool check_interior_rings(InteriorRings const& interior_rings,
                           Segment const& segment)
 {
     return check_interior_rings(boost::begin(interior_rings),
                                 boost::end(interior_rings),
                                 segment);
 }