Boost.Geometry    Boost C++ Libraries
Public Member Functions | Public Attributes | List of all members
boost::geometry::model::referring_segment< ConstOrNonConstPoint > Class Template Reference

Class segment: small class containing two (templatized) point references. More...

Public Member Functions

 referring_segment (point_type &p1, point_type &p2)
 Constructor taking the first and the second point. More...
 

Public Attributes

point_type & first
 
point_type & second
 

Detailed Description

template<typename ConstOrNonConstPoint>
class boost::geometry::model::referring_segment< ConstOrNonConstPoint >

Class segment: small class containing two (templatized) point references.

From Wikipedia: In geometry, a line segment is a part of a line that is bounded by two distinct end points, and contains every point on the line between its end points.

Note
The structure is like std::pair, and can often be used interchangeable. Difference is that it refers to points, does not have points.
Like std::pair, points are public available.
type is const or non const, so geometry::segment<P> or geometry::segment<P const>
We cannot derive from std::pair<P&, P&> because of reference assignments.
Template Parameters
ConstOrNonConstPointpoint type of the segment, maybe a point or a const point

Constructor & Destructor Documentation

template<typename ConstOrNonConstPoint >
boost::geometry::model::referring_segment< ConstOrNonConstPoint >::referring_segment ( point_type &  p1,
point_type &  p2 
)

Constructor taking the first and the second point.

Member Data Documentation

template<typename ConstOrNonConstPoint >
point_type& boost::geometry::model::referring_segment< ConstOrNonConstPoint >::first
template<typename ConstOrNonConstPoint >
point_type& boost::geometry::model::referring_segment< ConstOrNonConstPoint >::second

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