[vtkusers] Re: automatic update of objects generating a vtkAbstractTransform

David Gobbi dgobbi at irus.rri.on.ca
Wed Mar 21 11:44:00 EST 2001


On 21 Mar 2001, Alexandre Guimond wrote:

> On Tue, 20 Mar 2001 20:24:15 -0500 (EST)
> David Gobbi <dgobbi at irus.rri.on.ca> writes:
> 
> > Hi Alexandre,
> > 
> > There is an automatic update mechanism for vtkAbstractTransform.
> > Any time you call transform->TransformPoint() or any similar
> > method, the Update() method of the transform is automatically called.
> 
> Hi David.  Thx for the reply.  I had noticed this update mechanism
> with vtkAbstractTransform.  I guess I didn't make myself clear
> enough, or I'm not getting the process right.  What I meant is that
> calling the transform::Update() function doesn't update the object
> that generated the transform.  [...]

Ah, I understand.  No, a transform does not have a 'source.'  I'll
have to think about this... it might be worthwhile to make 
vtkAbstractTransform a subclass of vtkDataObject, but I'm reluctant to
do this because most of the methods/attributes of vtkDataObject
are irrelevant to transforms.  On the other hand, the concept of
'UpdateExtent' does make sense for nonlinear transformations.  Hmm.

My suggestion is that, for now, you add GetSource()/SetSource() methods
to vtkAbstractTransform.h and add this patch to vtkAbstractTransform.cxx:

//----------------------------------------------------------------------------
void vtkAbstractTransform::Update()
{
  // locking is require to ensure that the class is thread-safe
  this->UpdateMutex->Lock();

! if (this->Source != NULL)
!   {
!   this->Source->Update();
!   } 

and then ensure that when 'Update' is called on your Registration class,
the transformation is updated.

If this sort of thing works for you, I'll add this mechanism to the
repository.

 - David





More information about the vtkusers mailing list