[vtkusers] Transform Multiple actors with vtkBoxWidget

N.E Mackenzie-Mackay 9nem at qlink.queensu.ca
Tue Mar 30 18:02:27 EST 2004


Is it possible to transform many actors with the transformation 
obtained from a vtkBoxWidget?

Here is my problem:

	I am trying to use a box widget to transform a array of actors.

	from: 	/Examples/GUI/Tcl/TransformWithBoxWidget.tcl I know I can use 
this for multiple actors in tcl
	
	...
	vtkActor maceActor
	....
	boxWidget AddObserver InteractionEvent TransformActor
	....
	....
	vtkTransform t
	proc TransformActor {} {
	   boxWidget GetTransform t
	   maceActor SetUserTransform t
	}

	The problem is in a similar c++ implementation you implement a second 
class to implement a callback interation:
	(from cone6 example)
	
	class vtkMyCallback : public vtkCommand
	{
	public:
	  static vtkMyCallback *New()
	    { return new vtkMyCallback; }
	  virtual void Execute(vtkObject *caller, unsigned long, void*)
	    {
	      vtkTransform *t = vtkTransform::New();
	      vtkBoxWidget *widget = reinterpret_cast<vtkBoxWidget*>(caller);
	      widget->GetTransform(t);
	      widget->GetProp3D()->SetUserTransform(t);
	    }
	};

	This is fine for one actor.  You simply set the 
vtkBoxWidget->SetProp(someActor)

	What I want to be able to do is to use the transformation above to 
transform an array of actors.  I tried to pass the array in SetProp but 
could not.  I was wondering if anyone had any advice.

	My main goal really is just to find a way to manipulate a set of 
points in a scene all using the same transform.  I am using sphere 
because that is the only way I could figure out how to display a set of 
points x,y,z.   The reason is I am trying to position these points to 
return a good initial transform for ICP.  ( iterative closest point 
transform )

Thank for the help,
Neilson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2013 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040330/ca18cfcc/attachment.bin>


More information about the vtkusers mailing list