[vtkusers] VTK and JNI

Jeff Lee jeff at cdnorthamerica.com
Tue Feb 24 12:13:16 EST 2004


from your example, it looks like you are trying to get the vtkActor from 
c++.  this is already done for you by using the java wrappers.  the 
actor you create in java exists in c++.  i think what you want is  to be 
able to retrieve the actor's pointer in c++?  this approach is only 
valid if your bigscreen code is compiled into the same process as the 
vtk client code.  if they are in different processes, you will have to 
use sockets or rmi.  have a look at one of the vtk-generated wrapper 
files (i.e. build_dir/Rendering/vtkActorJava.cxx) to see how to retrieve 
the c++ pointer.  on a side note,  is this bigscreen device not 
supported by your window system?  or are you really trying to do 
client-server visualization?
-Jeff

Gahide Jérôme wrote:

>I think I use the wrapper when I create VTK object with java. I import vtk.*
>and I do as it shown in the Cone example.
>But when I need to show the result on a special device, I have to use C++ to
>communicate with the device. In this case, I want to get back some
>vtkInforlation.
>
>----
>vtk | --- import vtk.* --- Java  --------  send the result(vtkActor) to c++
>drivers ------- BigScreen
>----                                   |
>                                     compute a vtkActor
>
>Maybe I do not anderstand what you call the java wrapper?
>
>jérôme.
>
>----- Original Message ----- 
>From: "Jeff Lee" <jeff at cdnorthamerica.com>
>To: "Gahide Jérôme" <gahidej at libertysurf.fr>
>Cc: <vtkusers at vtk.org>
>Sent: Tuesday, February 24, 2004 5:08 PM
>Subject: Re: [vtkusers] VTK and JNI
>
>
>  
>
>>any reason you're not using the java wrappers?
>>-Jeff
>>
>>Gahide Jérôme wrote:
>>
>>    
>>
>>>Hi everybody,
>>>
>>>I have a Java application that use VTK. This appliaction create all
>>>the VTK objects we need.
>>>After the application create the object, I have to pass an vtkActor to
>>>C++ using JNI (in order to print the render on a special big screen).
>>>For now, I have learned with some tutorials JNI and in order to
>>>anderstand how to get back the C++ pointer on a vtkActor, I have
>>>looked for the header file and the cxx that make the link beetween
>>>Java and C++ but I don't find them.
>>>
>>>So the question are :
>>>- How can I get back the the C++ pointer on the vtkActor from the
>>>jobject I have, when I program with JNI.
>>>
>>>    example :
>>>    java file.
>>>    import vtk.*;
>>>    ...
>>>    private vtkActor va;
>>>    public native void getJNIvtkActor();
>>>
>>>    cxx file .
>>>    JNIEXPORT void ...(JNIEnv* env, jobject obj){
>>>
>>>        what can I do here to work with my vtkActor? and not a jobject
>>>
>>>
>>>    }
>>>
>>>- Where can I find this file (.h .cxx) where Wrapping with Java is
>>>defined. (with JNI?).
>>>
>>>Thanks a lot.
>>>Jérôme.
>>>      
>>>
>>    
>>
>
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>  
>



More information about the vtkusers mailing list