Boost logo

Geometry :

Subject: [geometry] About the Linestring Concept
From: Samuel Debionne (samuel.debionne_at_[hidden])
Date: 2015-03-04 09:59:27


Hello all,

I'm a bit confused about the Concept that my (adapted) linestring model
must satisfy.

It seems that Mutable Linestring and Const Linestring are two different
concepts.

The online doc says :

- there must be a specialization of traits::tag defining linestring_tag
as type
- it must behave like a Boost.Range Random Access Range
- The type defined by the metafunction range_value<...>::type must
fulfill the Point Concept

So far, I'm all good with range_iterator<point *> where point fulfill
the Point Concept.

Then in the doc of code that checks the Linestring concept
(linestring_concept.hpp) is written :

- it must implement a std::back_insert_iterator
    - either by implementing push_back
    - or by specializing std::back_insert_iterator

In the code of Linestring<> itself :

  traits::clear<Geometry>::apply(*ls);
  traits::resize<Geometry>::apply(*ls, 0);

Does that means that a (mutable) Linestring is not longer a Range but
rather a Container ? To me a Mutable Range (and so a mutable Linestring)
is a range that has its value mutable but the range itself cannot be
modified.

IMHO, most of the algorithms would be happy with a Range of Points (but
clear). Could you please clarify this to me ?

Samuel


Geometry list run by mateusz at loskot.net