The traits class Arr_polyline_traits_2<SegmentTraits> is a model of the ArrangementTraits_2 concept. It handles piecewise linear curves, commonly referred to as polylines. Each polyline is a chain of segments, where each two neighboring segments in the chain share a common endpoint. The traits class exploits the functionality of the SegmentTraits templateparameter to handle the segments that comprise the polyline curves.
The class instantiated for the template parameter SegmentTraits must be a model of the ArrangementTraits_2 concept that handles line segments (e.g., Arr_segment_traits_2<Kernel> or Arr_non_caching_segment_cached_traits_2<Kernel>, where the first alternative is recommended).
The number type used by the injected segment traits should support exact rational arithmetic (that is, the number type should support the arithmetic operations $$+, $$, $$ × and $$ ÷ that should be carried out without loss of precision), in order to avoid robustness problems, although other inexact number types could be used at the user's own risk.
#include <CGAL/Arr_polyline_traits_2.h>
The Curve_2 class nested within the polyline traits is used to represent general continuous piecewiselinear curves (a polyline can be selfintersecting) and support their construction from any range of points.
The copy and default constructor as well as the assignment operator are provided for polyline curves. In addition, an operator<< for the curves is defined for standard output streams, and an operator>> for the curves is defined for standard input streams.
 
default constructor that constructs an empty polyline.
 
 
 
constructs a polyline defined by the given range of points
[first, last) (the valuetype of InputIterator must be
SegmentTraits::Point_2.
If the range contains $$(n + 1) points labeled $$(p_{0},p_{1},...,p_{n}),
the generated polyline consists of $$n segments, where the $$kth segment
is defined by the endpoints $$[p_{k1},p_{k}]. The first point in the
range is considered as the source point of the polyline while the last
point is considered as its target.


 returns the number of points that comprise the polyline. Note that if there are $$n points in the polyline, it is comprised of $$(n  1) segments.  

 returns an iterator pointing at the source point of the polyline.  

 returns an iterator pointing after the end of the polyline.  

 returns an iterator pointing at the target point of the polyline.  

 returns an iterator pointing before the beginning of the polyline.  

 returns the number of line segments comprising the polyline (equivalent to pi.points()  1).  
 

returns the $$kth segment of the polyline.
 

 return a bounding box of the polyline pi. 

 adds a new point to the polyline, which becomes the new target point of pi. 

 resets the polyline. 
The X_monotone_curve_2 class nested within the polyline traits is used to represent $$xmonotone piecewise linear curves. It inherits from the Curve_2 type. It has a default constructor and a constructor from a range of points, just like the Curve_2 class. However, there is precondition that the point range define an $$xmonotone polyline.
The points that define the $$xmonotone polyline are always stored in an ascending lexicographical $$xyorder, so their order may be reversed with respect to the input sequence. Also note that the $$xmonotonicity ensures that an $$xmonotone polyline is never selfintersecting (thus, a selfintersecting polyline will be subdivided to several interiordisjoint $$xmonotone subcurves).