Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
Step8.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 
17 #include "Step8.h"
18 
19 #include "QmitkStdMultiWidget.h"
20 
21 #include "mitkRenderingManager.h"
22 
23 #include <QHBoxLayout>
24 #include <QVBoxLayout>
25 
26 //##Documentation
27 //## @brief As Step6, but with QmitkStdMultiWidget as widget
28 Step8::Step8(int argc, char *argv[], QWidget *parent) : Step6(argc, argv, parent)
29 {
30 }
31 
33 {
34  //*************************************************************************
35  // Part I: Create windows and pass the tree to it
36  //*************************************************************************
37 
38  // Create toplevel widget with vertical layout
39  QVBoxLayout *vlayout = new QVBoxLayout(this);
40  vlayout->setMargin(0);
41  vlayout->setSpacing(2);
42 
43  // Create viewParent widget with horizontal layout
44  QWidget *viewParent = new QWidget(this);
45  vlayout->addWidget(viewParent);
46  QHBoxLayout *hlayout = new QHBoxLayout(viewParent);
47  hlayout->setMargin(0);
48 
49  //*************************************************************************
50  // Part Ia: create and initialize QmitkStdMultiWidget
51  //*************************************************************************
52  QmitkStdMultiWidget *multiWidget = new QmitkStdMultiWidget(viewParent);
53 
54  hlayout->addWidget(multiWidget);
55 
56  // Tell the multiWidget which DataStorage to render
57  multiWidget->SetDataStorage(m_DataStorage);
58 
59  // Initialize views as axial, sagittal, coronar (from
60  // top-left to bottom)
61  mitk::TimeGeometry::Pointer geo = m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll());
63 
64  // Initialize bottom-right view as 3D view
66 
67  // Enable standard handler for levelwindow-slider
68  multiWidget->EnableStandardLevelWindow();
69 
70  // Add the displayed views to the DataStorage to see their positions in 2D and 3D
71  multiWidget->AddDisplayPlaneSubTree();
72  multiWidget->AddPlanesToDataStorage();
73  multiWidget->SetWidgetPlanesVisibility(true);
74 
75  //*************************************************************************
76  // Part II: Setup standard interaction with the mouse
77  //*************************************************************************
78 }
virtual bool InitializeViews(const BaseGeometry *geometry, RequestType type=REQUEST_UPDATE_ALL, bool preserveRoughOrientationInWorldSpace=false)
Step8(int argc, char *argv[], QWidget *parent=nullptr)
As Step6, but with QmitkStdMultiWidget as widget.
Definition: Step8.cpp:28
Definition: Step6.h:32
static RenderingManager * GetInstance()
QmitkRenderWindow * GetRenderWindow4() const
virtual void SetupWidgets() override
Definition: Step8.cpp:32
virtual mitk::VtkPropRenderer * GetRenderer()
void SetDataStorage(mitk::DataStorage *ds)
void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer=NULL)
virtual void SetMapperID(const MapperSlotId mapperId) override
Set the MapperSlotId to use.
mitk::StandaloneDataStorage::Pointer m_DataStorage
Definition: Step6.h:50