Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QVTKInternalOpenglRenderWindow.cxx
Go to the documentation of this file.
1 /*===================================================================
2 
3  The Medical Imaging Interaction Toolkit (MITK)
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics.
7  All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without
10  even the implied warranty of MERCHANTABILITY or FITNESS FOR
11  A PARTICULAR PURPOSE.
12 
13  See LICENSE.txt or http://www.mitk.org for details.
14 
15  ===================================================================*/
16 
19 
20 #include <vtkgl.h>
21 #include <vtkObjectFactory.h>
22 
24 
26 {
27  this->OffScreenRendering = false;
28 }
29 
32 {
33 }
34 
36 {
37  Superclass::Render();
38 }
39 
41 {
42  glDepthMask(GL_TRUE);
43 }
44 
45 void vtkInternalOpenGLRenderWindow::OpenGLInitState()
46 {
47  Superclass::OpenGLInitState();
48  vtkgl::UseProgram(0);
49 
50  glEnable(GL_BLEND);
51  glHint(GL_CLIP_VOLUME_CLIPPING_HINT_EXT, GL_FASTEST);
52  glDepthMask(GL_TRUE);
53 }
54 
56 {
57  if (this->QtParentRenderer)
58  {
59  this->QtParentRenderer->update();
60  }
61 }
62 
63 void vtkInternalOpenGLRenderWindow::SetFramebufferObject(QOpenGLFramebufferObject *fbo)
64 {
65  this->SetFrontBuffer(vtkgl::COLOR_ATTACHMENT0);
66  this->SetFrontRightBuffer(vtkgl::COLOR_ATTACHMENT0);
67  this->SetBackLeftBuffer(vtkgl::COLOR_ATTACHMENT0);
68  this->SetBackRightBuffer(vtkgl::COLOR_ATTACHMENT0);
69 
70  QSize fboSize = fbo->size();
71  this->SetSize(fboSize.width(), fboSize.height());
72 
73  this->NumberOfFrameBuffers = 1;
74  this->FrameBufferObject = static_cast<unsigned int>(fbo->handle());
75  this->DepthRenderBufferObject = 0; // static_cast<unsigned int>(depthRenderBufferObject);
76  this->TextureObjects[0] = static_cast<unsigned int>(fbo->texture());
77  this->OffScreenRendering = true;
78  this->OffScreenUseFrameBuffer = true;
79 
80  this->Modified();
81 }
QVTKFramebufferObjectRenderer * QtParentRenderer
vtkStandardNewMacro(vtkInternalOpenGLRenderWindow)
void SetFramebufferObject(QOpenGLFramebufferObject *fbo)