[vtk-developers] Java examples.

Andrew Maclean andrew.amaclean at gmail.com
Sun Dec 16 00:19:44 EST 2018


I need the help of a Java expert here. I'm not!!!

We have been getting some Java examples in the VTK Examples which is really
great. They work and run, however I have some concerns.

For example look at:
https://lorensen.github.io/VTKExamples/site/Java/GeometricObjects/Arrow/

When you run this example, a frame is created containing a content pane and
the arrow render window. Upon resizing,  the render window remains at the
bottom left-hand side of the frame. I would have expected it to resize
along with the frame.

In addition if you set up and use windowToImageFilter to write an image,
the render window jumps out of the frame to the upper left of the display.

Ok, so I thought to replace vtkPanel with vtkCanvas. Now resizing works
perfectly, except writing an image causes a crash.

I have attached the modified Arrow.java so you can run it and see the
issues. Play with commenting in/out vtkPanel and vtkCanvas.

Ideally I would like the usual resizing and scaling to work, which seems to
when vtkCanvas is used. However writing an image is problematic when either
vtkPanel or vtkCanvas is used.

I'm sure you Java experts have come across this and solved it!


Andrew

-- 
___________________________________________
Andrew J. P. Maclean

___________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20181216/14ecca64/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Arrow.java
Type: text/x-java
Size: 3411 bytes
Desc: not available
URL: <https://public.kitware.com/pipermail/vtk-developers/attachments/20181216/14ecca64/attachment.java>


More information about the vtk-developers mailing list