[vtkusers] help,vtk+java vtkInteractorStyleUser question
Jarek Sacha
galicjan at yahoo.com
Sun Sep 14 22:07:21 EDT 2003
xiaofeng qi wrote:
> I am using vtk and Java, now I just want to be able to custom
>interact methods , either using vtkInteractorStyleUser or the observer
>callback method.
> I donot know how to use vtkInteractorStyleUser with Java ,all the examples
>use vtkInteractorStyleUser that i had found are in C++ or Python or tcl,
>Can anyone provide me with some java examples with vtkInteractorStyleUser.
>
>
Don't know what exact interaction you are trying to implement. However,
I guess that you can easy do in Java without vtkInteractorStyleUser. You
can implement custom interaction using standard Java mouse listeners.
Take a look at source code for vtkPanel.java for examples of using
MouseListener, MouseMotionListener, and KeyListener to implement
interaction with VTK. You can use MouseAdapter, MouseMotionAdapter, or
KeyAdapter is you need to implement individual listener methods rather
than full listener interfaces.
You can also use Interactor's AddObserver method of to customize
interaction. Illustrations of that are in Java examples ImageInteractor,
BoxWidget, TransformWithBoxWidget, VolumeRenderWithBoxWidget,
AnnotatePick, and SpherePuzle. Java VTK examples are available from
http://ij-plugins.sourceforge.net/vtk-examples
BTW: I do not see use vtkInteractorStyleUser in any VTK Tcl or Python
examples. Can you point some specific example code?
Jarek
More information about the vtkusers
mailing list