<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19258"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">Hi,</FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><?xml:namespace prefix = o ns =
"urn:schemas-microsoft-com:office:office" /><o:p><FONT size=3
face="Times New Roman"> </FONT></o:p></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">I’m currently facing an issue using VTK with
java.</FONT></P>
<P style="MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT size=3
face="Times New Roman"> </FONT></o:p></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">Actually, I’m trying to integrate a C++ library into my
software. This library is PCL (Point Cloud Library), which offer some
interesting features concerning triangulation and registration. Here is below
how my application is designed:</FONT></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT
size=3 face="Times New Roman"> </P>
<P align=center><FONT size=2 face=Arial><IMG border=0 hspace=0 alt=""
align=baseline src="cid:249390515@16082012-0AFC" width=379
height=233></FONT></FONT></o:p></P>
<P style="TEXT-ALIGN: center; MARGIN: 0in 0in 0pt" class=MsoNormal
align=center><FONT size=3 face="Times New Roman"></FONT></P>
<P style="TEXT-ALIGN: center; MARGIN: 0in 0in 0pt" class=MsoNormal
align=center><o:p><FONT size=3 face="Times New Roman"> </FONT></o:p></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">Kitware already provide the JNI interface for VTK, but
PCL does not. What I would like to do is to be able to request PCL to perform a
triangulation on the vtkPolyData I instanciated into my java code.</FONT></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT
size=3 face="Times New Roman"> </FONT></o:p></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">Therefore, I started to create the PCL JNI interface by
creating a simple method on the java side:</FONT></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT
size=3 face="Times New Roman"> </FONT></o:p></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">public</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
</SPAN><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">native</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
</SPAN><B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: #7f0055; FONT-SIZE: 10pt">int</SPAN></B><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt">
nativePCL_triangulation(vtkPolyData inputCloud);<o:p></o:p></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"><o:p> </o:p></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="COLOR: black"><FONT size=3><FONT face="Times New Roman">Then after having
generated the header file, I need to implement the C++ code of the
interface:<o:p></o:p></FONT></FONT></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="COLOR: black"><o:p><FONT size=3
face="Times New Roman"> </FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; COLOR: blue; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas">#include</SPAN><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas">
<SPAN style="COLOR: #a31515"><vtkPolyData.h><o:p></o:p></SPAN></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
style="COLOR: black"><o:p><FONT size=3
face="Times New Roman"></FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas">JNIEXPORT
jint JNICALL nativePCL_triangulation(JNIEnv * env, jobject obj, jobject
polyDataJava)<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas">{<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas"><SPAN
style="mso-tab-count: 1"> </SPAN><SPAN
style="COLOR: green">//vtkPolyData* vp =
dynamic_cast<vtkPolyData*>(polyDataJava);<o:p></o:p></SPAN></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas"><SPAN
style="mso-tab-count: 1"> </SPAN><SPAN
style="COLOR: blue">return</SPAN> 0;<o:p></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"
class=MsoNormal><SPAN
style="FONT-FAMILY: Consolas; FONT-SIZE: 9.5pt; mso-bidi-font-family: Consolas">}<o:p></o:p></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><o:p><FONT
size=3 face="Times New Roman"> </FONT></o:p></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman">And here is my issue : How can I retrieve the pointer on
the polyData I instanciated into my java code? </FONT></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT
face="Times New Roman"><FONT size=3>To be clear, I would like to access the C++
object instanciated by VTK from the C++ part of the interface I want to
implement (the best would be a stuff like a dynamic_cast as in the comment
above…).<SPAN class=383091614-16082012> I have absolutely no idea how to achieve
that.</SPAN></FONT></FONT></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><FONT size=3
face="Times New Roman"></FONT> </P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
class=383091614-16082012><FONT size=3 face="Times New Roman">Thanks
much,</FONT></SPAN></P>
<P style="TEXT-ALIGN: justify; MARGIN: 0in 0in 0pt" class=MsoNormal><SPAN
class=383091614-16082012><FONT size=3 face="Times New Roman">Gilles
Monnier</FONT></SPAN></FONT></P></DIV><br clear=all> This message and attachment(s) are intended solely for use by the addressee and may contain information that is privileged, confidential or otherwise exempt from disclosure under applicable law.
If you are not the intended recipient or agent thereof responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify the sender immediately by telephone and with a 'reply' message.
Thank you for your co-operation.
</BODY></HTML>