Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Arr_polyline_traits_2 behavior/documentation

Subject: CGAL users discussion list

List archive

[cgal-discuss] Arr_polyline_traits_2 behavior/documentation


Chronological Thread 
  • From: PBlanke <>
  • To:
  • Subject: [cgal-discuss] Arr_polyline_traits_2 behavior/documentation
  • Date: Fri, 25 May 2012 03:57:23 -0700 (PDT)

Hello,

I just came upon a strange behavior when using the Arr_polyline_traits_2
class. The class allows to construct an empty
Arr_polyline_traits_2<SegmentTraits>::Curve_2.
The class is based on Segment_2, so the attempt to use the push_back()
method to append a single point to the polyline results in a segmentation
fault in Polyline_2.h, line 97,since segments.back() is empty.

/*! Append a point to the polyline. */
void push_back (const Point_2 & p)
{
Point_2 pt = p;
Point_2 ps = segments.back().target();
segments.push_back (Segment_2 (ps, pt));
}

Since there is no function to initialize the polyline with a segment, it is
not possible to incrementally build a polyline. A simple workaround is of
course to use another point container and then call the c'tor using
iterators, but this should be reflected in the docs.

Without changing the underlying architecture, another workaround would be to
add a function that initializes the polyline with a segment.

Best regards,
Philipp

--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Arr-polyline-traits-2-behavior-documentation-tp4654268.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


  • [cgal-discuss] Arr_polyline_traits_2 behavior/documentation, PBlanke, 05/25/2012

Archive powered by MHonArc 2.6.16.

Top of Page