Boost logo

Geometry :

Subject: Re: [geometry] nsphere concept
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2013-05-26 19:30:36


Hi,

Adam Wulkiewicz wrote:
>
> I have some thoughts about the nsphere that I'd like to share. For now I
> think of two changes:
>
<snip>
>
> template <
> typename Point,
> typename Radius = coordinate_type<Point>::type
> class ball;
>
<snip>
>
> get<centre, I>(sph)
> get<radius, I>(sph)
>

To show you what I'm talking about I've implemented it and added to
extensions/ball (I've given it ID 95, don't know if it's ok).

Indexes names are slightly different and of course may be changed. For
now it's like this:

bg::get<bg::center_point, 0>(b);
bg::get<bg::center_point, 1>(b);
bg::get<bg::radius_value, 0>(b);

There is one problem though. get() and set() assume that the type of
returned value is always coordinate_type. So radius type will be
converted if it's different.

What is the reason of this? Would it be reasonable to use some type
defined in

core_dispatch::indexed_access

e.g.

core_dispatch::indexed_access<G, I, D>::value_type

?

Regards,
Adam


Geometry list run by mateusz at loskot.net