boost::geometry::strategy::intersection::liang_barsky< Box, Point > Class Template Reference

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

List of all members.

## 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:

  B | input box type of clipping box
  P | input/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
  - A tutorial: http://www.skytopia.com/project/articles/compsci/clipping.html
  - a German applet (link broken): http://ls7-www.cs.uni-dortmund.de/students/projectgroups/acit/lineclip.shtml

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