[vtkusers] GUI integration

egk865 at yahoo.com egk865 at yahoo.com
Thu Aug 5 21:43:41 EDT 2010


Hi Nicolas,

I have noticed some flickering issues on Windows XP during resize though
I'm not sure of the cause. Linux and Mac seemed to be fine for me. See the
thread started here: http://www.vtk.org/pipermail/vtkusers/2010-June/109872.html

I've never tried displaying in Java from within C++ as you suggest, though
it might work since the Java wrappers are just a very thin layer on top of
C++. You would need to test. This is assuming you avoid the AWT classes.
If however, you want to use the AWT classes then it might be a lot more
difficult since I believe you need to deal with other things like
threading issues. You would probably want to learn more about the AWT
Native Interface.

Best,
Eli

--- On Wed, 8/4/10, nclemeur <nclemeur at gmail.com> wrote:

> From: nclemeur <nclemeur at gmail.com>
> Subject: Re: [vtkusers] GUI integration
> To: vtkusers at vtk.org
> Date: Wednesday, August 4, 2010, 7:36 AM
> 
> Hello Eli,
> 
> Thank you very much for your post. I was hoping for someone
> to step in and
> reassure me that Java was a workable solution, and you did
> it. That's great.
> I did not think about the java web start, but it is true
> that it is nice
> advantage too... I'll have a look at the classes you
> mentionned. I have
> already playing a bit with that solution and it is indeed
> quite straight
> forward to setup and use. I still have some stuff I need to
> explore:
> 
> - Anyone notice some flickering on the JFrame resize (this
> is on the simple
> cone example).
> 
> - Can I add vtk objects from the C++ layer and display it
> in Java by sending
> a reference to the vtkRenderer(Window) to the C++ layer?
> Obviously, I would
> need then to manage the memory of these objects my-self. I
> am thinking of
> doing it this way to keep a maximum of my vtk programming
> in C++:
>  1. so that I can easily switch to another GUI layer in
> case of problems 
>  2. because I have anyway to interact with an existing C++
> library that
> contain most of the data to draw the vtk objects.
> 
> 
> Again, thank you very much for your post, I really
> appreciate it.
> 
> Cheers
> 
> Nicolas
> 
> 
> 
> Bugzilla from egk865 at yahoo.com
> wrote:
> > 
> > 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
> >> 
> > 
> > 
> >       
> > _______________________________________________
> > 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
> > 
> > 
> 
> -- 
> View this message in context: http://vtk.1045678.n5.nabble.com/GUI-integration-tp2260958p2263953.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