Boost.Geometry    Boost C++ Libraries
Public Member Functions | List of all members
boost::geometry::strategy::intersection::liang_barsky< Box, Point > Class Template Reference

Strategy: line clipping algorithm after Liang Barsky. More...

Public Member Functions

template<typename Linestring , typename OutputIterator >
void apply (Linestring &line_out, OutputIterator out) const
 
bool clip_segment (Box const &b, segment_type &s, bool &sp1_clipped, bool &sp2_clipped) const
 

Detailed Description

template<typename Box, typename Point>
class boost::geometry::strategy::intersection::liang_barsky< Box, Point >

Strategy: line clipping algorithm after Liang Barsky.

The Liang-Barsky line clipping algorithm clips a line with a clipping box. It is slightly adapted in the sense that it returns which points are clipped

Template Parameters
Binput box type of clipping box
Pinput/output point-type of segments to be clipped
Note
The algorithm is currently only implemented for 2D Cartesian points
Though it is implemented in namespace strategy, and theoretically another strategy could be used, it is not (yet) updated to the general strategy concepts, and not (yet) splitted into a file in folder strategies
Author
Barend Gehrels, and the following recourses
Examples:
c05_custom_point_pointer_example.cpp.

Member Function Documentation

template<typename Box, typename Point>
bool boost::geometry::strategy::intersection::liang_barsky< Box, Point >::clip_segment ( Box const &  b,
segment_type s,
bool &  sp1_clipped,
bool &  sp2_clipped 
) const
template<typename Box, typename Point>
template<typename Linestring , typename OutputIterator >
void boost::geometry::strategy::intersection::liang_barsky< Box, Point >::apply ( Linestring &  line_out,
OutputIterator  out 
) const

April 2, 2011

Copyright © 2007-2011 Barend Gehrels, Amsterdam, the Netherlands
Copyright © 2008-2011 Bruno Lalande, Paris, France
Copyright © 2009-2010 Mateusz Loskot, London, UK
Documentation is generated by Doxygen