[vtkusers] GTKmm + VTK

Horst horstausprag at gmx.de
Tue Oct 18 04:30:58 EDT 2016


I tested a bit more. Here is an example, where I have 1 resulting
window, but the rendering is wrong. The environment is a Ubuntu 16.04.
Any help is welcome.

Kind regards

Am 14.10.2016 um 11:53 schrieb Horst:
> Hello everybody,
> I am trying to integrate a VTK rendering into a GTKmm based window.
> The GTK widget contains a GLarea
> (https://developer.gnome.org/gtkmm/stable/classGtk_1_1GLArea.html),
> and I want to render into that context.
> The problem is, that I end up with two windows. One by GTK and one by
> VTK. I was inspired by this:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/GLUT but
> renWin->InitializeFromCurrentContext();
> is maybe not the way to go?
> In the VTK blog I read about the ExternalVTKWidget and
> vtkExternalOpenGLRenderWindow. But this still did not work
> (https://gitlab.kitware.com/vtk/vtk/blob/0b7d6de3dddbcdb5dd9267a9586d59962464819e/Rendering/External/Testing/Cxx/TestGLUTRenderWindow.cxx)
> for me.
> So my question: What is the proper way of rendering into a GTK::GLArea
> (or in general using VTK with GTK), while still get the proper event
> from VTK (pointing on a cone in the view and get the event-position).
> Or do I need to use a separate event loop instead of the one provided
> by vtkRenderWindowInteractor?
> Thanks a lot and every hint is welcome!
> Kind regards
> _______________________________________________
> 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
> Search the list archives at: http://markmail.org/search/?q=vtkusers
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161018/4d29c4d8/attachment.html>
-------------- next part --------------
cmake_minimum_required(VERSION 2.8)

list( APPEND CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")

# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3MM REQUIRED gtkmm-3.0)


find_package(VTK 6.2 REQUIRED)


add_executable(${PROJECT_NAME} src/main.cpp src/test03.cpp src/test03.h)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 198 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161018/4d29c4d8/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test03.cpp
Type: text/x-c++src
Size: 2633 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161018/4d29c4d8/attachment-0001.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test03.h
Type: text/x-chdr
Size: 1263 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161018/4d29c4d8/attachment.h>

More information about the vtkusers mailing list