diff --git a/Documentation/Doxygen/3-DeveloperManual/Starting/GettingToKnow/Tutorial/Step08.dox b/Documentation/Doxygen/3-DeveloperManual/Starting/GettingToKnow/Tutorial/Step08.dox index f5e9f8a3a3..d4de241f01 100644 --- a/Documentation/Doxygen/3-DeveloperManual/Starting/GettingToKnow/Tutorial/Step08.dox +++ b/Documentation/Doxygen/3-DeveloperManual/Starting/GettingToKnow/Tutorial/Step08.dox @@ -1,25 +1,25 @@ /** \page Step08Page MITK Tutorial - Step 8: Use QmitkStdMultiWidget as widget \li \ref Step8.cpp "Step8.cpp"\n \li \ref Step8.h "Step8.h"\n \li \ref Step8main.cpp "Step8main.cpp"\n \li Path to files used in this step: \n http://mitk.org/download/tutorial-data/Pic3D.nrrd (image) In this step a QmitkStdMultiWidget is used. It offers four views of the data. From top left to bottom left the views are initialized as axial, sagittal and coronar. The bottom right view is initialized as 3D view. \image html step8_result.png Step8 inherits from Step6. The method SetupWidgets() is changed: A QmitkStdMultiWidget is used instead of one QmitkRenderWindow and two instances of QmitkSliceWidget. \dontinclude Step8.cpp \skipline Part Ia - \until SetWidgetPlanesVisibility + \until levelWindowWidget->SetDataStorage(m_DataStorage); \ref Step07Page "[Previous step]" \ref Step09Page "[Next step]" */ diff --git a/Examples/Tutorial/Step8/Step8.cpp b/Examples/Tutorial/Step8/Step8.cpp index 86f1c18571..696ba0b9c7 100644 --- a/Examples/Tutorial/Step8/Step8.cpp +++ b/Examples/Tutorial/Step8/Step8.cpp @@ -1,75 +1,77 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "Step8.h" +#include "QmitkLevelWindowWidget.h" #include "QmitkRenderWindow.h" #include "QmitkStdMultiWidget.h" #include "mitkRenderingManager.h" #include #include //##Documentation //## @brief As Step6, but with QmitkStdMultiWidget as widget Step8::Step8(int argc, char *argv[], QWidget *parent) : Step6(argc, argv, parent) { } void Step8::SetupWidgets() { //************************************************************************* // Part I: Create windows and pass the tree to it //************************************************************************* // Create toplevel widget with vertical layout QVBoxLayout *vlayout = new QVBoxLayout(this); vlayout->setMargin(0); vlayout->setSpacing(2); // Create viewParent widget with horizontal layout QWidget *viewParent = new QWidget(this); vlayout->addWidget(viewParent); QHBoxLayout *hlayout = new QHBoxLayout(viewParent); hlayout->setMargin(0); //************************************************************************* // Part Ia: create and initialize QmitkStdMultiWidget //************************************************************************* QmitkStdMultiWidget *multiWidget = new QmitkStdMultiWidget(viewParent); hlayout->addWidget(multiWidget); // Tell the multiWidget which DataStorage to render multiWidget->SetDataStorage(m_DataStorage); - // Initialize views as axial, sagittal, coronar (from - // top-left to bottom) - auto geo = m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll()); - mitk::RenderingManager::GetInstance()->InitializeViews(geo); - - // Initialize bottom-right view as 3D view - multiWidget->GetRenderWindow4()->GetRenderer()->SetMapperID(mitk::BaseRenderer::Standard3D); + // Initialize the multiWidget with the render windows + multiWidget->InitializeMultiWidget(); // Add the displayed views to the DataStorage to see their positions in 2D and 3D - multiWidget->AddDisplayPlaneSubTree(); multiWidget->AddPlanesToDataStorage(); multiWidget->SetWidgetPlanesVisibility(true); //************************************************************************* - // Part II: Setup standard interaction with the mouse + // Part Ib: create and initialize LevelWindowWidget //************************************************************************* + QmitkLevelWindowWidget *levelWindowWidget = new QmitkLevelWindowWidget(viewParent); + + hlayout->addWidget(levelWindowWidget); + + // Tell the levelWindowWidget which DataStorage to access + levelWindowWidget->SetDataStorage(m_DataStorage); + } /** \example Step8.cpp */