[vtkusers] GetVtkId returns weird values (Java wrapper)

Victor Johnsson victorjohnsson at yahoo.com
Thu Nov 29 06:56:12 EST 2012


Hello,
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.

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??

(I need the pointer of vtkObjects created in Java to pass them to native c++ functions.)

Cheers
Victor

 
----------------------------------------
package cone5;

import vtk.vtkConeSource;

public class CopyOfCone5 {
  static { 
    System.loadLibrary("vtkCommonJava"); 
    System.loadLibrary("vtkFilteringJava"); 
    System.loadLibrary("vtkIOJava"); 
    System.loadLibrary("vtkImagingJava"); 
    System.loadLibrary("vtkGraphicsJava"); 
    System.loadLibrary("vtkRenderingJava"); 
  }

  public static void main (String []args) throws Exception {
    vtkConeSource cone = new vtkConeSource();
    System.err.println("id="+cone.GetVTKId());
  }
}
----------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121129/30826080/attachment.htm>


More information about the vtkusers mailing list