[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: Transform point using localToSceneTransform
From: martin.desruisseaux () geomatys ! fr (Martin Desruisseaux)
Date: 2012-07-27 22:19:09
Message-ID: 501313DD.9070209 () geomatys ! fr
[Download RAW message or body]
Hello all
Le 28/07/12 00:03, Kevin Rushforth a ?crit :
> Easy conversion between the Point and vector classes is important even
> if you don't have a common base class. Otherwise developers have to do
> a bunch of manual copying (or things like subtracting a 0 vector from
> a vector to convert it to a point).
I think that omitting converters may be safer for a similar reason than
omitting the Affine.setTranslate/setScale/setRotation methods: in many
cases, users invoked Affine.setTranslate(...) in situations where they
should really invoke Affine.translate(...); the fact that their original
Affine was the identity transform may not be as universal as they though.
I think this is similar for Point/Vector: I think that when a user
converts a point to a vector, what he really wants is to get the
distance relative to some origin. The origin may be (0,0,0) in 95% of
cases, but not always (e.g. in map projections with "false easting" and
"false northing"). Forcing a user to write "vector = point - origin"
make his code more future-proof, by making more obvious where an origin
is involved - even if it is (0,0,0) - and easier to adjust in case the
origin moved.
Martin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic