Swing based VTK Panel (supports transparency and fullscreen mode).
Webpage: http://miho.github.com/JVTK
The Java binding of VTK only provides heavyweight AWT based UI components. This has been done due to performance issues when accessing the native render data from Java. In some cases however, it is necessary to use real Swing components (lightweight). This allows for component layers (components can be rendered on top of the VTK component), transparency and many other features.
This project addresses the performance issue with custom color and sample model which allow for direct image conversion. This is relatively efficient for small component sizes (up to 800x600). In addition to that a fullscreen mode has been implemented to gain full render performance.
- VTK 5.10
- C++ Compiler, CMake (see VTK documentation for details)
- Java 1.6
- Netbeans 7.1 (optional)
- Build VTK with the following options:
BUILD_SHARED_LIBS=ON
BUILD_TESTING=OFF
VTK_WRAP_JAVA=ON
CMAKE_BUILD_TYPE=Release
-
Copy the content of
$VTKBUILD/bin
toJVTK/natives
($VTKBUILD
is the location of the VTK build folder) -
Open the
JVTK
project with NetBeans and compile (necessary preferences are already defined)
- Open the
JVTK
project with NetBeans and run it. - Press the
Increase Alpha
andDecrease Alpha
buttons to change transparency - Double-Click to enter fullscreen mode
- Double-Click again or press
ESC
to leave fullscreen mode
NOTE In fullscreen mode rendering is done with maximum performance as native rendering is used.