Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "Step8.h"
14 
15 #include "QmitkRenderWindow.h"
16 #include "QmitkStdMultiWidget.h"
17 
18 #include "mitkRenderingManager.h"
19 
20 #include <QHBoxLayout>
21 #include <QVBoxLayout>
22 
23 //##Documentation
24 //## @brief As Step6, but with QmitkStdMultiWidget as widget
25 Step8::Step8(int argc, char *argv[], QWidget *parent) : Step6(argc, argv, parent)
26 {
27 }
28 
30 {
31  //*************************************************************************
32  // Part I: Create windows and pass the tree to it
33  //*************************************************************************
34 
35  // Create toplevel widget with vertical layout
36  QVBoxLayout *vlayout = new QVBoxLayout(this);
37  vlayout->setMargin(0);
38  vlayout->setSpacing(2);
39 
40  // Create viewParent widget with horizontal layout
41  QWidget *viewParent = new QWidget(this);
42  vlayout->addWidget(viewParent);
43  QHBoxLayout *hlayout = new QHBoxLayout(viewParent);
44  hlayout->setMargin(0);
45 
46  //*************************************************************************
47  // Part Ia: create and initialize QmitkStdMultiWidget
48  //*************************************************************************
49  QmitkStdMultiWidget *multiWidget = new QmitkStdMultiWidget(viewParent);
50 
51  hlayout->addWidget(multiWidget);
52 
53  // Tell the multiWidget which DataStorage to render
54  multiWidget->SetDataStorage(m_DataStorage);
55 
56  // Initialize views as axial, sagittal, coronar (from
57  // top-left to bottom)
58  auto geo = m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll());
60 
61  // Initialize bottom-right view as 3D view
63 
64  // Add the displayed views to the DataStorage to see their positions in 2D and 3D
65  multiWidget->AddDisplayPlaneSubTree();
66  multiWidget->AddPlanesToDataStorage();
67  multiWidget->SetWidgetPlanesVisibility(true);
68 
69  //*************************************************************************
70  // Part II: Setup standard interaction with the mouse
71  //*************************************************************************
72 }
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:25
Definition: Step6.h:28
The &#39;QmitkStdMultiWidget&#39; is a &#39;QmitkAbstractMultiWidget&#39; that is used to display multiple render win...
static RenderingManager * GetInstance()
void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer=nullptr)
void SetupWidgets() override
Definition: Step8.cpp:29
virtual mitk::VtkPropRenderer * GetRenderer()
QmitkRenderWindow * GetRenderWindow4() const
virtual void SetDataStorage(mitk::DataStorage *dataStorage)
void SetMapperID(const MapperSlotId mapperId) override
Set the MapperSlotId to use.
mitk::StandaloneDataStorage::Pointer m_DataStorage
Definition: Step6.h:46