<commit_before>/*============================================================================

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.

============================================================================*/

#define SMW_INFO MITK_INFO("widget.stdmulti")

#include "QmitkStdMultiWidget.h"
#include "QmitkRenderWindowWidget.h"

// mitk core
#include <mitkCameraController.h>
#include <mitkImage.h>
#include <mitkImagePixelReadAccessor.h>
#include <mitkInteractionConst.h>
#include <mitkLine.h>
#include <mitkNodePredicateBase.h>
#include <mitkNodePredicateDataType.h>
#include <mitkNodePredicateNot.h>
#include <mitkNodePredicateProperty.h>
#include <mitkPixelTypeMultiplex.h>
#include <mitkPlaneGeometryDataMapper2D.h>
#include <mitkPointSet.h>
#include <mitkProperties.h>
#include <mitkStatusBar.h>
#include <mitkDisplayActionEventHandlerStd.h>
#include <mitkVtkLayerController.h>

// qt
#include <QList>
#include <QMouseEvent>
#include <QTimer>

// vtk
#include <vtkSmartPointer.h>

// c++
#include <iomanip>

QmitkStdMultiWidget::QmitkStdMultiWidget(QWidget *parent,
                                         Qt::WindowFlags f/* = 0*/,
                                         const QString &name/* = "stdmulti"*/)
  : QmitkAbstractMultiWidget(parent, f, name)
  , m_TimeNavigationController(nullptr)
  , m_PendingCrosshairPositionEvent(false)
{
  m_TimeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
}

QmitkStdMultiWidget::~QmitkStdMultiWidget()
{
  m_TimeNavigationController->Disconnect(GetRenderWindow1()->GetSliceNavigationController());
  m_TimeNavigationController->Disconnect(GetRenderWindow2()->GetSliceNavigationController());
  m_TimeNavigationController->Disconnect(GetRenderWindow3()->GetSliceNavigationController());
  m_TimeNavigationController->Disconnect(GetRenderWindow4()->GetSliceNavigationController());
}
<commit_msg>Remove hard-coded render window access<commit_after>/*============================================================================

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.

============================================================================*/

#define SMW_INFO MITK_INFO("widget.stdmulti")

#include "QmitkStdMultiWidget.h"
#include "QmitkRenderWindowWidget.h"

// mitk core
#include <mitkCameraController.h>
#include <mitkImage.h>
#include <mitkImagePixelReadAccessor.h>
#include <mitkInteractionConst.h>
#include <mitkLine.h>
#include <mitkNodePredicateBase.h>
#include <mitkNodePredicateDataType.h>
#include <mitkNodePredicateNot.h>
#include <mitkNodePredicateProperty.h>
#include <mitkPixelTypeMultiplex.h>
#include <mitkPlaneGeometryDataMapper2D.h>
#include <mitkPointSet.h>
#include <mitkProperties.h>
#include <mitkStatusBar.h>
#include <mitkDisplayActionEventHandlerStd.h>
#include <mitkVtkLayerController.h>

// qt
#include <QList>
#include <QMouseEvent>
#include <QTimer>

// vtk
#include <vtkSmartPointer.h>

// c++
#include <iomanip>

QmitkStdMultiWidget::QmitkStdMultiWidget(QWidget *parent,
                                         Qt::WindowFlags f/* = 0*/,
                                         const QString &name/* = "stdmulti"*/)
  : QmitkAbstractMultiWidget(parent, f, name)
  , m_TimeNavigationController(nullptr)
  , m_PendingCrosshairPositionEvent(false)
{
  m_TimeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
}

QmitkStdMultiWidget::~QmitkStdMultiWidget()
{
  auto allRenderWindows = this->GetRenderWindows();
  for (auto& renderWindow : allRenderWindows)
  {
    m_TimeNavigationController->Disconnect(renderWindow->GetSliceNavigationController());
  }
}

{'fraction_non_alphanumeric': 0.1795448862215554, 'fraction_numerical': 0.002500625156289072, 'mean_word_length': 5.90846286701209, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1205943', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1171, 'n_words': 232}