Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::geometry::model::referring_segment< ConstOrNonConstPoint > Class Template Reference

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

#include <segment.hpp>

Public Member Functions

 referring_segment (point_type &p1, point_type &p2)
 

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 
)
inline

Member Data Documentation

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

The documentation for this class was generated from the following file: