[vtkusers] GUI integration

egk865 at yahoo.com egk865 at yahoo.com
Tue Aug 3 21:51:01 EDT 2010


Hi Nicolas,

I have been using the Java wrappers on a project for almost a year now
and I think they're great. I personally think VTK is the best 3D
graphics library available for the Java platform.

Any memory problems seem to have been solved with the 5.6
release. I have been able to run long running batch programs for days
without memory leaks. A new class (see vtkJavaGarbageCollector.java
within Wrapping/Java/vtk) was written to provide automatic garbage
collection of VTK objects, though sometimes I've found that I needed
to explicitly call Delete on some objects to ensure they got deleted
(haven't yet investigated why). I don't think it's any more work now
dealing with memory management in Java than it would be in C++.

For GUI programs, an AWT widget is provided which can be integrated
with swing programs. See vtkPanel.java, vtkCanvas.java, and
vtkRenderWindowPanel.java within Wrapping/Java/vtk. (I usually use
vtkRenderWindowPanel since that contains the most functionality. It's
missing mousewheel support however, but that can easily be added). See
also
http://java.sun.com/developer/technicalArticles/GUI/mixing_components/index.html
for useful information about mixing heavyweight and lightweight
components. I've found though that crashes often occurred if things
weren't done properly, especially related to picking. Such crashes can
be difficult to debug since often the entire virtual machine crashes
without leaving any stack trace. I've found reading through the code
in these 3 classes very helpful in understanding how best to use them.

Another advantage I've found in using Java is that I was able to
easily distribute my application by making use of Java Web Start. This
made it easy to provide updates to users on mac, windows and linux
platforms (which I needed to support). Making a new release usually
meant simply updating a single jar file on the server, and users on
all 3 platforms would instantly get the new version. The jar files
containing the native VTK libraries would usually never needed to be
touched, unless I needed to update VTK.

Eli


--- On Mon, 8/2/10, nclemeur <nclemeur at gmail.com> wrote:

> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Date: Monday, August 2, 2010, 6:58 AM
> 
> 
> 
> > I know you said you're familiar with Java and
> wxWidgets, but another
> > possibility is Qt with c++. There are a few examples
> to get you going
> > here:
> > 
> 
> Yes, thank you for the hint. It looks like the Qt options
> is quite popular.
> But it is not really an option for me. I would really
> appreciate some
> comments from people using the java and/or python wrapping
> (or maybe from
> people that I have stopped used these wrapper?). Are these
> wrappers working
> well enough for a relatively simple useage? Anything to
> stay away from? Any
> good reason to choose python rather than java (other than
> language
> preferences) or even C++ with wxWidgets?
> 
> I am pretty sure there would be quite a lot of people
> interested by this
> topic, so please don't hesitate to comment, even if is
> simply to say "it is
> (not) working".
> 
> Cheers
> 
> Nicolas
> 
> -- 
> View this message in context: http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2261598.html
> Sent from the VTK - Users mailing list archive at
> Nabble.com.
> _______________________________________________
> 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