[vtkusers] more on Picking in vtk with Java

Ross Manges mangesr at cctcorp.com
Mon Oct 8 15:27:39 EDT 2001


Hi,

I'm trying to do picking in java, and according to the man pages I need 
to use the following API call to specify which function to be called 
after the picking is performed.  However, I'm not sure how to convert 
this to java.

void vtkAbstractPicker::SetEndPickMethod ( void(* f)(void *),

void * arg )

 

Specify function to be called after all picking operations have been 
performed.



 I ran javadoc on the ".java" files in the vtk jar and noticed that this 
method is modified in java to be:

public void SetEndPickMethod(java.lang.Object id0,
                             java.lang.String id1)

I tried passing an object as the first argument, and the name of the 
function in the object as a string as the second argument, but I got a 
null-pointer exception.  Can anyone help?  Thanks!

--Ross

p.s. - here's my code fragment:

    public static void main (String [] args)
    {
        rossSphere gui = new rossSphere();
        gui.picker.SetEndPickMethod(gui, "annotatePick");
        ...
    }

...where rossSphere is the name of the class where I have the function 
annotatePick() defined.  
Thanks!!!





More information about the vtkusers mailing list