Boost logo

Geometry :

Subject: Re: [geometry] Concept for CalculationType
From: Andrew Hundt (athundt_at_[hidden])
Date: 2014-05-27 16:33:11


On Tue, May 27, 2014 at 3:55 PM, Barend Gehrels <barend_at_[hidden]> wrote:

> Hi Andrew,
>
> Andrew Hundt wrote On 27-5-2014 21:42:
>
>> Is there a concept for CalculationType? It is used in
>> matrix_transformers.hpp, but I couldn't find a concept definition.
>>
>
> There is indeed no concept defined, maybe we should do that indeed.
>

Yeah, I think a concept would be helpful there.

 I'm trying to create a 2d rotate_translate_transformer which rotates a
>> geometry in place then translates it to a specified location, so I'm trying
>> to modify the implementations in matrix_transformers.hpp.
>>
>> I'm considering having it take a point and an angle rather than
>> x,y,angle. For comparison, the translate_transformer takes an x and y. Does
>> this seem advisable?
>>
>
> I see - this is a bit arbitrary. A point (x,y) is usually a point, while
> translate is over a vector, therefore x(-diff),y(-diff). But indeed, of
> course, it can also be represented as a point.

It did seem a bit arbitrary, which is why I asked. Is there an existing
vector concept I could use?

> Would it be best to make the point a separate template parameter from
>> CalculationType?
>>
>> If I didn't use a point, should there be one CalculationType template
>> parameter for x,y,angle, or should x,y be one type and angle an additional
>> type?
>>
>
> Usually the angle is of a different type than x,y. Because angle is in
> radians, always a FP type, and x,y might be (but not necessarily) an
> integer type. So if it is a general implementation, and apparently it is, I
> would advi[s]e that.

 Ok, thanks.



Geometry list run by mateusz at loskot.net