[vtkusers] Java vs. Qt
Thiébault Benoît
dev at artenum.com
Thu Oct 28 05:58:30 EDT 2010
Hi Oka,
As Sébastien said, you can use VTK with Java on any platform, as far as you have compiled VTK with Java wrapping on this platform.
We use VTK with Java for some years now in most of our applications (cf. Cassandra http://dev.artenum.com/projects/cassandra/ for instance) and it works very well.
As said in another post (http://www.vtk.org/pipermail/vtkusers/2010-October/112609.html), the vtkPanel is based on AWT Canvas. This can cause some problems (such as JMenus being drawn below the vtkPanel), but works generally well. By the way, I am sure that an improved Java vtkPanel would be a great asset for the community :-).
To simplify the use of VTK in Java projects, we are currently working on providing compiled versions of VTK on our Maven repository for the most common platforms.
At http://maven.artenum.com/webapp/browserepo.html in the "libs-releases-local" repository, there is a "vtk" directory where you can access useful files for using VTK with Java.
The "vtk" directory has two sub-folders:
- vtk: contains, for some recent versions of VTK, the JAR file that is needed to compile your Java-based VTK application
- vtk-native: contains, for the most common platforms, the shared libraries (and only the shared libs) that will be loaded at runtime by your Java application using VTK (you have to indicate the path of those libs by exporting an environment variable, such as LD_LIBRARY_PATH under Linux, DYLD_LIBRARY_PATH under OSX and PATH under Windows).
There are still some platforms missing for some versions, but we are trying to keep this repository up to date and will add the missing ones as soon as we can. If anyone wants to contribute, help is very welcome!
The main advantage of this Maven repository is that if you use Maven in your Java project, you can simply include a dependency on VTK by:
1) Adding Artenum public repository to your Maven repositories
<repository>
<id>Artenum</id>
<name>Artenum public repository</name>
<url>http://maven.artenum.com/repo/</url>
</repository>
2) Adding a dependency on VTK
<dependency>
<groupId>vtk</groupId>
<artifactId>vtk</artifactId>
<version>5.6.1</version>
</dependency>
Maven will automatically do the rest for you and download the correct JAR.
We are also currently trying to build OSGi bundles for VTK in order to be able to use VTK in an OSGi application or an Eclipse RCP application, but it's still a work in progress and we have not succeeded yet, as you can see from our other posts on the forum.
Hope this helps,
Benoît
Le 28 oct. 2010 à 02:38, Sebastien Jourdain a écrit :
> I'm saying that you can easily use the VTK objects inside Java code
> thanks to the VTK java wrapping.
> If your C++ classes are Java wrapped, no you can simply use them.
> Otherwise, I don't know what you planned to do with them in Java ?
>
> Seb
>
> On Wed, Oct 27, 2010 at 8:11 PM, czbebe <oka at bpe.es.osaka-u.ac.jp> wrote:
>>
>> Dear Seb,
>>
>> Thank you for your reply.
>> You said we must write VTK code by Java ?
>> Java supports full VTK libraries ?
>> We have many C++ codes for VTK using QVTK.
>> Must we rewrite these codes by Java if we swicth
>> from Qt to Java ?
>>
>> Best regards,
>>
>> Oka
>> --
>> View this message in context: http://vtk.1045678.n5.nabble.com/Java-vs-Qt-tp3238301p3239744.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
>
More information about the vtkusers
mailing list