[vtkusers] Issues with picking in VTK Java on Mac OS X

Kevin Milner kmilner at usc.edu
Tue Feb 14 16:11:37 EST 2017

Thanks to everyone for their help! So I finally have everything figured 
out. It turns out that Sebastien's fix (commit 
b6df993770cfcd9a69a48a2730415a992d698c5b) does indeed fix the problem 
with picking on retina displays. When I noticed a discrepancy between 
the reported click position and the JFrame size, I implemented a fix to 
what I thought was a bug, but actually defeated Sebastien's fix. So I 
can now confirm that the current git/master version works successfully 
on both retina and non-retina Macs.

One note about the fix though is that it uses the "scale" field in 
GraphicsDevice, which is accessed via Java reflection, and does not 
exist in my linux distribution. This causes an exception to be dumped to 
the console every time I click in the 3D viewer. I just commented out 
the e.printStackTrace(); at line 382 of 
vtk.rendering.vtkInteractorForwarder to remove the excessive printing. 
You should probably fix that before the next release. Other possible 
ways to detect a retina display/scale factor which might not have the 
linux issue are discussed here: 

Thanks much for the help!

On 02/10/2017 06:05 PM, Sebastien Jourdain wrote:
> Hi Kevin,
> I finally build VTK on my mac (macOS Sierra 10.12.3 - 16D32)
> I can run vtk.sample.Demo with the usual external window issue except 
> on that time the actual rendering window is half the size of the 
> actual JFrame.
> For the Jogl I get a segfault right away.
> $ java -cp 
> vtk-7.1.jar:/Users/seb/.m2/repository/org/jogamp/gluegen/gluegen-rt/2.3.2/gluegen-rt-2.3.2.jar:/Users/seb/.m2/repository/org/jogamp/jogl/jogl-all/2.3.2/jogl-all-2.3.2.jar 
> -Djava.library.path=$PWD/natives-Darwin-x86_64/ 
> vtk.sample.rendering.JoglConeRendering
> #
> # A fatal error has been detected by the Java Runtime Environment:
> #
> #  SIGSEGV (0xb) at pc=0x000000012cdaeb99, pid=51716, tid=7171
> #
> # JRE version: Java(TM) SE Runtime Environment (8.0_25-b17) (build 
> 1.8.0_25-b17)
> # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode 
> bsd-amd64 compressed oops)
> # Problematic frame:
> # C  [libawt_lwawt.dylib+0x44b99]  JNI_OnLoad+0x91
> #
> # Failed to write core dump. Core dumps have been disabled. To enable 
> core dumping, try "ulimit -c unlimited" before starting Java again
> #
> # An error report file with more information is saved as:
> # /Users/seb/Documents/code/VTK/install/hs_err_pid51716.log
> #
> # If you would like to submit a bug report, please visit:
> # http://bugreport.sun.com/bugreport/crash.jsp 
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__bugreport.sun.com_bugreport_crash.jsp&d=DwMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=Ut0P5Kplo2cIO9V0et1UBQ&m=cpXdD9Shwlw-tbBdzMG5o9U9ZIq7Zn7bL3WkZ_xxvmk&s=xF95XsSLi5_QuJhTNA_YMjO19Br-tB5i36_ifgJd0iI&e=>
> # The crash happened outside the Java Virtual Machine in native code.
> # See problematic frame for where to report the bug.
> #
> Abort trap: 6
> I don't know if the issue come from jogl or VTK with macOS Sierra.
> Anyway, wanted to let you know,
> Seb
> On Tue, Feb 7, 2017 at 7:02 AM, Sean McBride <sean at rogue-research.com 
> <mailto:sean at rogue-research.com>> wrote:
>     On Mon, 6 Feb 2017 14:10:03 -0800, Kevin Milner said:
>     >Any ideas on how to get this working on new Macs?
>     So you have 2 differences now: different OS version, different
>     screens (Retina vs not).  You should try to eliminate one.  You
>     can force a non-Retina to act like a retina with Quartz Debug:
>     <https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Testing/Testing.html
>     <https://urldefense.proofpoint.com/v2/url?u=https-3A__developer.apple.com_library_content_documentation_GraphicsAnimation_Conceptual_HighResolutionOSX_Testing_Testing.html&d=DwMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=Ut0P5Kplo2cIO9V0et1UBQ&m=cpXdD9Shwlw-tbBdzMG5o9U9ZIq7Zn7bL3WkZ_xxvmk&s=0iUBZa-RgXAC9Xhb0drglax92fWfwGGTj-Uc7CM4VQE&e=>>
>     and/or upgrade that Mac from 10.9 (which BTW doesn't get security
>     updates anymore) to something newer.
>     Cheers,
>     --
>     ____________________________________________________________
>     Sean McBride, B. Eng sean at rogue-research.com
>     <mailto:sean at rogue-research.com>
>     Rogue Research www.rogue-research.com
>     <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.rogue-2Dresearch.com&d=DwMFaQ&c=clK7kQUTWtAVEOVIgvi0NU5BOUHhpN0H8p7CSfnc_gI&r=Ut0P5Kplo2cIO9V0et1UBQ&m=cpXdD9Shwlw-tbBdzMG5o9U9ZIq7Zn7bL3WkZ_xxvmk&s=9cy936hCnvRuTo7DSMoAfRvhAa8WKZXt1uiyI9dGtws&e=>
>     Mac Software Developer              Montréal, Québec, Canada

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170214/68c54480/attachment.html>

More information about the vtkusers mailing list