Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
QmitkSelectableGLWidget.cpp
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 
18 #include "QmitkRenderWindow.h"
19 
20 #include <QWheelEvent>
21 
23  : QWidget(parent), m_Ui(new Ui::QmitkSelectableGLWidget)
24 {
25  m_Ui->setupUi(this);
26  QLayout *hlayout;
27  hlayout = m_Ui->hboxLayout;
28  hlayout->setMargin(3);
29 
30  QString rendererName("Renderer::");
31  rendererName += objectName();
32 
33  // create Renderer
36 
37  // create widget
38  QString composedName("QSGLWt::");
39  if (!objectName().isEmpty())
40  composedName += objectName();
41  else
42  composedName += "QmitkGLWidget";
43  /*
44  * here is the place to define QT-Flags to enable and disable certain OpenGL elements, like StencilBuffer, RGBA and so
45  * on.
46  * See QGLFormat for futher informations
47  * QGL::AlphaChannel: Enable Alpha in Framebuffer
48  * QGL::Rgba enable use of rgba rather than color_index
49  * QGL::StencilBuffer for use of stencilbuffer in OpenGL
50  */
51  m_RenderWindow = new QmitkRenderWindow(this, composedName, m_Renderer);
52 
53  hlayout->addWidget(m_RenderWindow);
54 }
55 
57 {
58  delete m_Ui;
59 }
60 
62 {
63  return m_Renderer.GetPointer();
64 }
65 
67 {
68  return m_RenderWindow;
69 }
70 
72 {
74  return;
75 
77 
78  if (stepper->GetSteps() <= 1)
79  {
81  }
82 
83  if (e->orientation() * e->delta() > 0)
84  {
85  stepper->Next();
86  }
87  else
88  {
89  stepper->Previous();
90  }
91 }
92 
94 {
96 }
97 
99 {
101 }
102 
104 {
105  return m_RenderWindow->GetController();
106 }
virtual mitk::CameraRotationController * GetCameraRotationController()
mitk::VtkPropRenderer * GetRenderer()
mitk::Stepper * GetSlice()
Get the Stepper through the slices.
QmitkRenderWindow * m_RenderWindow
mitk::CameraRotationController * GetCameraRotationController() const
Baseclass for renderer slice-/camera-control.
Controls the selection of the slice the associated BaseRenderer will display.
virtual unsigned int GetSteps() const
void wheelEvent(QWheelEvent *e) override
virtual void Previous()
static RenderingManager * GetInstance()
MITK implementation of the QVTKWidget.
mitk::BaseController * GetController() const
QmitkSelectableGLWidget(QWidget *parent=0)
mitk::SliceNavigationController * GetSliceNavigationController() const
QmitkRenderWindow * GetRenderWindow() const
Helper class to step through a list.
Definition: mitkStepper.h:51
static Pointer New(const char *_arga, vtkRenderWindow *_argb, mitk::RenderingManager *_argc)
virtual mitk::SliceNavigationController * GetSliceNavigationController()
mitk::Stepper * GetTime()
Get the Stepper through the time.
mitk::VtkPropRenderer::Pointer m_Renderer
virtual void Next()
virtual mitk::BaseController * GetController()