[vtkusers] vtkImagePlaneWidget callback question

dean.inglis at camris.ca dean.inglis at camris.ca
Fri Jun 30 14:15:24 EDT 2006


Hi zl2k,

have a look at 

ProbeWithSplineWidget.tcl

in VTK/Examples/Gui/Tcl

you can add an observer to the InteractionEvent of the widget.
In this example the slider drives the widget, but you could also
set things up so that the widget drives the slider position.
The widget doesn't have an axis that is "picked", it is the
underlying actor of one of the widget's internal pipelines that is picked:

vtkPlaneSource->vtkPolyDataMapper->vtkActor

You can certainly set the widget to traverse along one of the 
orthonormal axes with the SetPlaneOrientation method(s).
If you want the plane normal, you can retreive it with
GetNormal to figure out which axis it is aligned with or
to calculate 3D angles etc.  To position the widget from 
a set of angles, I believe you could do this by setting
the plane of the widget directly with
SetOrigin, SetPoint1, SetPoint2

HTH,
Dean


hi, all
Here is what I am trying to do: when I am interacting with the
vtkImagePlaneWidget, I am monitoring the changing of the slice index
along x, y, or z. I noticed the ipw itself can display the (x,y,z) on
the widget with a picker but I need to read the value to drive the
slider whenever the callback is envoked. I also need to know which
axis is picked. Can someone give me some guide on how to implement it
(or maybe there is some short cut)?
I'll also mornitor the rotation angles along x, y and z and read this
data out to drive the dialers to show the angles. When I turn around
the dialers the ipw should rotate accordingly.
zl2k





More information about the vtkusers mailing list