[Insight-users] SpatialObject and MTimes

Gavin Baker gavinb+xtk at cs.mu.OZ.AU
Wed May 25 02:30:39 EDT 2005


Hi Jim,

On Mon, May 23, 2005 at 08:28:26AM -0400, Miller, James V (Research) wrote:
> Gavin,
> 
> It looks like the SetObjectTo*Transform() methods are not calling
> Modified().  So this is one fix that can be done.

Yes, I had overlooked that.  But since the GetObjectTo*Transform()
methods return a smart pointer, there is actually no need to call the
SetObjectTo*Transform() after modifying the transform since it is
modifying the object's actual transform in situ.

> Would this fix your use case?  Or do you need the modified time
> to reflect a modification of the transform as opposed to simply
> a swap of transforms?

Only if I added an effectively redundant call to SetObjectTo*Transform()
once it calls Modified().

It's the difference between this (with my suggestion):

  ellipse->GetObjectToParentTransform()->Compose(xform);
  ellipse->ComputeObjectToWorldTransform();

and this (with the extra Set*):

  TransformType::Pointer t = ellipse->GetObjectToParentTransform();
  t->Compose(xform);
  ellipse->SetObjectToParentTransform(t);
  ellipse->ComputeObjectToWorldTransform();


All of the methods that mutate the composite's tree structure call
this->Modified(), which of course makes sense.  And the bounding box
is already taken into account for an object's MTime also.  But
modifying the transforms can potentially change the bounding box, so I
think it makes sense semantically that an object's MTime is a
reflection of its transforms also.

Does that make sense?

  :: Gavin

-- 
Gavin Baker                                      Complex Systems Group
http://www.cs.mu.oz.au/~gavinb             The University of Melbourne


More information about the Insight-users mailing list