Hi Gerrit,

"G33K" <[EMAIL PROTECTED]> wrote on 11/24/2008 01:26:42 PM:

> Hi, I'm trying to manually set the transform on a GraphicsNode to change
> its location. However, the bounds don't seem to change. Am I doing
> something wrong?

   No, but you don't understand what the bounds are.

> GraphicsNode gNode = ...
> gNode.getBounds();
> gNode.setTransform(myTransform);
> gNode.getBounds(); // yields the same bounds as previous call

    Right because the bounds of a node are calculated in it's 
local coordinate system.  When you set it's transform you change
the mapping of it's local coordinate system to other coordinate
systems, but you don't change it's size/location within it's local
coordinate system.

    I think you want to use getTransformedBounds (probably
with the global transform of the parent of the node). Assuming
what you really want is the bounds of the graphics node in the
'global coordinate system'.

> The GVT tree is offline and doesn't get rendered in any way. Maybe
> that's why I'm missing some important recalculation call. How can I
> manually force invalidation of cached bounds values? In
> AbstractGraphicsNode.setTransform() only the parent's cache is
> invalidated, and since the invalidateGeometryCache() method is
> protected, I can't call it directly on the desired GraphicsNode.

Reply via email to