Boost logo

Geometry :

Subject: [geometry] nsphere and views names
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-06-20 13:17:21


Currently I'm playing with the nsphere and possible use of this class as
the Indexable. For this purpose I've added implementations of some BG
algorithms. I hope that this is ok.

I've also added a helpful view which can be used to see sphere as center
point. This allows to perform some operations on center, e.g. check the
distance between the center and some point. With this view we musn't
write painful specializations in some cases.

I've called it center_view because it may be used to 'see' some Geometry
as it's center. It might be used also for ellipses, boxes, etc.

But I've seen that names of views existing in BG are taken from the
names of the Geometries and always are used to treat some Geometry as a
set of points. E.g. box_view allows to get corners of the box (probably
only 2d?).

So my question is: are views meant only for this point-like view? Is
this why they're called like if there were only one view per Geometry?

Or could we have different views for the same Geometry allowing to
'treat' this Geometry somehow differently? Then I suppose names should
correspond to how the Geometry is seen?

If yes, then box_view would be a good name for a view which allows to
see Geometries as a Box, e.g. to see Point as a Box. I doubt if this
particular view would be needed, but other one might be.

E.g. in OpenStreetMap there are WAYs which are vectors of points and
describe LineStrings or Rings (it the first point is repeated at the
end). We could e.g. have linestring_view which allows to see a vector as
a Linestring and ring_view which allows to see vector as a Ring. And
those names could also be used for other points-containers/Geometries
(those classes could be Derived from some specialized implementations)

Those names colide with the currently used, defined in boost::geometry

What do you think about those 'new' views? If you like it, should they
reside in some new namespace?


Geometry list run by mateusz at