[vtkusers] Getting started with Java in VTK

Luke Dodd i.like.bread at gmail.com
Tue Oct 5 17:24:38 EDT 2010


This is possible. Take a look at the vtk.vtkPanel and vtk.vtkCanvas
classes. They are awt components, you can - with some caveats put them
in a swing GUI like any other swing component.

There are methods to get the renderer - so you can add things to it,
and to paint so you can see the results. I think vtkPanel is the base
class and vtkCanvas extends this with more functionality. I'd say look
at the source of each and figure out what you need - they implement
certain interaction behaviours and forward certain awt events to vtk
interactors.

There is not much documentation for this, but the source code is not
too hard to read.

(Sorry for sending again Jonathan, but I hit reply instead of reply
all - it's good to get this on the list for others to see)

Best Regards,
Luke Dodd

On 5 October 2010 21:33, Jonathan Morra <jonmorra at gmail.com> wrote:
> I'm new to VTK and am interested in writing a very simple medical image
> viewer that can view a 3D volume at three orthogonal planes and have the
> user click around on various planes to navigate through the data.  I was
> able to get VTK compiling and examples running in Java, however I'm unsure
> how to get the native VTK windows to interact with Java swing.  Ideally, I'd
> like there to be no VTK windows, and have everything live inside of Swing
> components.  Can anyone point me to some example code or good reading to
> help getting started with this in Java?
> Thanks
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list