From: Johan E. <jbc...@sw...> - 2013-11-13 16:45:03
|
On 13-11-2013 16:50, Krzysztof Kosiński wrote: > 2013/11/12 Johan Engelen <jbc...@sw...>: >> As far as I can see now, all (current) Curve types *are* closed under >> translations. I think we should enforce this for Curve. I.e., each Curve >> must implement >> virtual Curve &operator+=(Point const &); > I think the method should be: > virtual Curve &operator*=(Translate const &t) { > *this *= Affine(t); > return *this; > } > > Rationale: > 1. It's not immediately obvious what adding a point to a curve means. > For instance, for BezierCurve it might plausibly mean adding a control > point. Ok, that makes sense. > 2. For curves that don't implement the specialization, we just > multiply by a generic affine. This is not possible. Because curves are not closed under Affine transform, there is no operator*=(Affine). If you want to transform a Curve, you have to call Curve* Curve::transformed(Affine const&) I'll clean up the work and commit my changes, so you can see. Cheers, Johan |