# Build an desktop application using vtk

**URL:** https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542
**Category:** Support
**Created:** [May 21, 2022, 8:30pm UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542 "2022-05-21T20:30:52Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![FrancoisW](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/cdc98d/32.png) [@FrancoisW](https://discourse.vtk.org/u/FrancoisW)
#### Post date: [May 21, 2022, 8:30pm UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/1 "2022-05-21T20:30:52Z")

</div>

Hi,

I’m going to create an application for windows and macOS. I want to use the vtk library to visualize some data in this application. I’m not sure which framework to use to create my GUI. Can anybody tell me what will be the easiest way to do it?

I know pretty much java, but I haven’t understood how to call from java the vtk functions and classes…  
Activiz seems to be a good option in C# but I can’t find how much does it cost ?

Last question, does someone kown a good tutorial or explanation to help me in my adventure?

Thanks,

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [May 21, 2022, 10:21pm UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/2 "2022-05-21T22:21:30Z")

</div>

I’d recommend Qt myself. VTK does support wrapping in Java, but I’m not familiar with it myself. @Sebastien_Jourdain @toddy

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [May 22, 2022, 12:34am UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/3 "2022-05-22T00:34:37Z")

</div>

Hi @FrancoisW  
You haven’t said if your application is to be open source or commercial.

If you go down the C++ route, using QT for commercial purposes requires a license but Paraview provides an example of how to do it. Otherwise you can use wxWidgets and find your own way. Also setting **VTK\_MODULE\_ENABLE\_VTK\_GUISupportMFC=ON** in cmake generates a _vtkMFCWindow_ class in the source, which shows how to wrap _vtkWin32OpenGLRenderWindow_.

AFAIK Activiz licenses cost €500 to €1000 per annum and Activiz doesn’t handle string conversion to/from UTF-8 for VTK, so you’re stuck with ANSI text only.

If you’re already familiar with Java that might be your best bet. You can build VTK with **VTK\_WRAP\_JAVA=ON** and study some of the examples.  
[https://vtk.org/Wiki/VTK/Java\_Wrapping](https://vtk.org/Wiki/VTK/Java_Wrapping)

You have to create/compile the VTK jar manually on Windows. [VTK 9 and Java- vtk.jar not automatically generated. Also location of wrapper dlls - #19 by toddy](https://discourse.vtk.org/t/vtk-9-and-java-vtk-jar-not-automatically-generated-also-location-of-wrapper-dlls/3354/19)

FYI [Fixed VTK Java Wrappers on macOS](https://discourse.vtk.org/t/fixed-vtk-java-wrappers-on-macos/7467)

---

<div class="post-metadata">

### Author: ![FrancoisW](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/cdc98d/32.png) [@FrancoisW](https://discourse.vtk.org/u/FrancoisW)
#### Post date: [May 22, 2022, 7:42pm UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/4 "2022-05-22T19:42:18Z")

</div>

Hi @toddy,

First, thanks for your very usefull answer.  
My application won’t be open source, I’m not sure I’ll chose QT.  
I’ve seen I can “find my own way” using wxWidget, but I find the “look and feel” of this framework a litte bit outdated.

Before asking this question, I was almost convinced to use Java. Your answer conforts me in my opinion. But generate the .jar on my own scares me a litte.  
With your links, I’ll try to generate the vtk.jar, and see if I can do what I’d like to do.  
Thanks again!

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [May 22, 2022, 11:31pm UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/5 "2022-05-22T23:31:15Z")

</div>

Another option could be to use a web front-end using something like [trame](https://kitware.github.io/trame/). But at the end, it depends on what you are comfortable with and what is your plan in term of deployment and futures opportunities.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [May 23, 2022, 5:02am UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/6 "2022-05-23T05:02:07Z")

</div>

> [@toddy](#):
>
> If you go down the C++ route, using QT for commercial purposes requires a license but Paraview provides an example of how to do it.

Commercial Qt license is actually not required.

Qt can be obtained under an [LGPL](https://doc.qt.io/qt-6/lgpl.html) or a commercial license. The Qt company is encouraging (sometimes borderline bullying) users to purchase commercial license, but this is unnecessary for most companies. You can build a closed source commercial application using Qt’s LGPL license.

Requirements to fulfill if you use the LGPL license:

- You must make publicly available all changes that you make to Qt itself. Since you just _use_ Qt, you would normally never need to modify Qt and so there is nothing to disclose.
- You must use Qt as a shared library (instead of statically linking it to your application). There are very rare occasions when linking mode makes significant practical difference and shared library is often the preferred linking option anyway, so it is generally very easy to fulfill this requirement.
- There are a [very few optional Qt components that is distributed using commercial or GPL license](https://doc.qt.io/qt-5/qtmodules.html#gpl-licensed-addons) (charts, virtual keyboard, etc.). They are such niche features that it is highly unlikely that you would need to use them.
- Allow users to replace Qt shared libraries. This is not an issue for desktop applications, because the files are stored on the user’s computer. On embedded systems, you need to let the user access Qt shared libraries.
- Qt company recently made long-term support releases only available for commercial Qt licensees. This is just an inconvenience: if you run into any Qt bug that bothers your users then you need to upgrade to the latest Qt version, or you need to backport the fix manually to your Qt version.

Avoiding these slight inconveniences would probably worth $10 or so per developer per month for most companies, but the Qt company charges an exorbitant $300 per developer per month for a commercial license. Therefore, many (probably most) software development companies go with the LGPL license instead.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [May 23, 2022, 5:04am UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/7 "2022-05-23T05:04:08Z")

</div>

Good to know. I thought **Qt** was GPL or commercial.

---

<div class="post-metadata">

### Author: ![DStranz](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@DStranz](https://discourse.vtk.org/u/DStranz)
#### Post date: [August 17, 2022, 12:15am UTC](https://discourse.vtk.org/t/build-an-desktop-application-using-vtk/8542/8 "2022-08-17T00:15:24Z")

</div>

> [@lassoan](#):
>
> the Qt company charges an exorbitant $300 per developer per month for a commercial license.

Its even worse than that. You must re-up your subscription for as long as you sell the product, whether you are continuing development on it or not. So, despite paying for years for a commercial license because I believe in Qt, the new commercial model was the last straw. I won’t have my products held hostage in perpetuity when the LGPL option exists. Even so, a commercial license for Qt 5.x is perpetual; the subscription basically got LTS and pre-built binaries.
