<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div>the short example below creates a vtkConeSource and shows its GetVtkId() result. As far as I understand, the returned id should be the memory address of the native object.</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">When I run the program several times, most of the time the id returns a value in the range of 139e12 .. 141e12 which is very weird. Only sometimes a valid pointer is returned. Why??</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color:
transparent; font-style: normal;">(I need the pointer of vtkObjects created in Java to pass them to native c++ functions.)</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Cheers</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Victor<br></div><div> </div><div>----------------------------------------</div><div>package cone5;<br><br>import vtk.vtkConeSource;<br><br>public class CopyOfCone5 {<br> static { <br> System.loadLibrary("vtkCommonJava"); <br> System.loadLibrary("vtkFilteringJava"); <br>
System.loadLibrary("vtkIOJava"); <br> System.loadLibrary("vtkImagingJava"); <br> System.loadLibrary("vtkGraphicsJava"); <br> System.loadLibrary("vtkRenderingJava"); <br> }<br><br> public static void main (String []args) throws Exception {<br> vtkConeSource cone = new vtkConeSource();<br> System.err.println("id="+cone.GetVTKId());<br> }<br>}<br>----------------------------------------<br></div></div></body></html>