diff --git a/Modules/OpenViewCore/CMakeLists.txt b/Modules/OpenViewCore/CMakeLists.txt index 470dcf3e27..208ac1f9df 100644 --- a/Modules/OpenViewCore/CMakeLists.txt +++ b/Modules/OpenViewCore/CMakeLists.txt @@ -1,7 +1,7 @@ MITK_CREATE_MODULE( INCLUDE_DIRS PUBLIC include/ PRIVATE src/ - PACKAGE_DEPENDS Qt5|Core+Quick VTK|vtkGUISupportQt OpenGL + PACKAGE_DEPENDS Qt5|Core+Quick VTK|vtkGUISupportQt+vtkRenderingOpenGL2 OpenGL ) diff --git a/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.cxx b/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.cxx index d6d5ac4b1a..33d406ae31 100644 --- a/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.cxx +++ b/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.cxx @@ -1,80 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ +#include #include "vtk_glew.h" #include "vtkInternalOpenGLRenderWindow.h" #include "QVTKFramebufferObjectRenderer.h" #include vtkStandardNewMacro(vtkInternalOpenGLRenderWindow); vtkInternalOpenGLRenderWindow::~vtkInternalOpenGLRenderWindow() { this->OffScreenRendering = false; } vtkInternalOpenGLRenderWindow::vtkInternalOpenGLRenderWindow() : QtParentRenderer(0) { } void vtkInternalOpenGLRenderWindow::InternalRender() { Superclass::Render(); } void vtkInternalOpenGLRenderWindow::OpenGLEndState() { glDepthMask(GL_TRUE); } void vtkInternalOpenGLRenderWindow::OpenGLInitState() { Superclass::OpenGLInitState(); // vtkgl::UseProgram(0); TODO18922 glEnable(GL_BLEND); glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST); glDepthMask(GL_TRUE); } void vtkInternalOpenGLRenderWindow::Render() { if (this->QtParentRenderer) { this->QtParentRenderer->update(); } } void vtkInternalOpenGLRenderWindow::SetFramebufferObject(QOpenGLFramebufferObject *fbo) { this->SetFrontBuffer(GL_COLOR_ATTACHMENT0); this->SetFrontLeftBuffer(GL_COLOR_ATTACHMENT0); this->SetBackBuffer(GL_COLOR_ATTACHMENT0); this->SetBackLeftBuffer(GL_COLOR_ATTACHMENT0); QSize fboSize = fbo->size(); this->SetSize(fboSize.width(), fboSize.height()); this->NumberOfFrameBuffers = 1; this->FrameBufferObject = static_cast(fbo->handle()); this->DepthRenderBufferObject = 0; // static_cast(depthRenderBufferObject); this->TextureObjects[0] = static_cast(fbo->texture()); this->OffScreenRendering = true; this->OffScreenUseFrameBuffer = true; this->Modified(); } diff --git a/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.h b/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.h index c50769774f..bdf7b716dd 100644 --- a/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.h +++ b/Modules/OpenViewCore/src/vtkInternalOpenGLRenderWindow.h @@ -1,46 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __vtkInternalOpenGLRenderWindow_h #define __vtkInternalOpenGLRenderWindow_h #include -#include -#include class QVTKFramebufferObjectRenderer; +class QOpenGLFrameBufferObject; //! Part of Qml rendering prototype, see QmlMitkRenderWindowItem. class vtkInternalOpenGLRenderWindow : public vtkGenericOpenGLRenderWindow { public: static vtkInternalOpenGLRenderWindow* New(); vtkTypeMacro(vtkInternalOpenGLRenderWindow, vtkGenericOpenGLRenderWindow) virtual void OpenGLInitState(); virtual void Render(); void OpenGLEndState(); void InternalRender(); void SetFramebufferObject(QOpenGLFramebufferObject *fbo); QVTKFramebufferObjectRenderer *QtParentRenderer; protected: vtkInternalOpenGLRenderWindow(); ~vtkInternalOpenGLRenderWindow(); }; #endif