Medical Imaging Interaction Toolkit  2018.4.99-9a29ffc6
Medical Imaging Interaction Toolkit
QmitkDataNodeGlobalReinitAction.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 
14 
15 // mitk core
16 #include <mitkRenderingManager.h>
17 
18 // mitk gui common plugin
19 #include <mitkWorkbenchUtil.h>
20 
21 const QString QmitkDataNodeGlobalReinitAction::ACTION_ID = "org.mitk.gui.qt.application.globalreinitaction";
22 
23 // namespace that contains the concrete action
25 {
27  {
28  auto renderWindow = mitk::WorkbenchUtil::GetRenderWindowPart(workbenchPartSite->GetPage(), mitk::WorkbenchUtil::NONE);
29  if (nullptr == renderWindow)
30  {
31  renderWindow = mitk::WorkbenchUtil::OpenRenderWindowPart(workbenchPartSite->GetPage(), false);
32  if (nullptr == renderWindow)
33  {
34  // no render window available
35  return;
36  }
37  }
38 
40  }
41 }
42 
44  : QAction(parent)
45  , QmitkAbstractDataNodeAction(workbenchPartSite)
46 {
47  setText(tr("Global Reinit"));
48  InitializeAction();
49 }
50 
52  : QAction(parent)
53  , QmitkAbstractDataNodeAction(berry::IWorkbenchPartSite::Pointer(workbenchPartSite))
54 {
55  setText(tr("Global Reinit"));
56  InitializeAction();
57 }
58 
59 void QmitkDataNodeGlobalReinitAction::InitializeAction()
60 {
61  connect(this, &QmitkDataNodeGlobalReinitAction::triggered, this, &QmitkDataNodeGlobalReinitAction::OnActionTriggered);
62 }
63 
64 void QmitkDataNodeGlobalReinitAction::OnActionTriggered(bool /*checked*/)
65 {
67  {
68  return;
69  }
70 
72  {
73  return;
74  }
75 
77 }
itk::SmartPointer< T > Lock() const
static IRenderWindowPart * GetRenderWindowPart(berry::IWorkbenchPage::Pointer page, IRenderWindowPartStrategies strategies)
Returns the currently active mitk::IRenderWindowPart.
static IRenderWindowPart * OpenRenderWindowPart(berry::IWorkbenchPage::Pointer page, bool activatedEditor=true)
Uses &#39;GetRenderWindowPart&#39; to open the a render window part with a certain strategy: Calls &#39;GetRender...
SmartPointer< ObjectType > Lock() const
static RenderingManager * GetInstance()
bool IsExpired() const noexcept
mitk::WeakPointer< mitk::DataStorage > m_DataStorage
berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite
void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage)
virtual void InitializeViewsByBoundingObjects(const DataStorage *)
Initializes the renderwindows by the aggregated geometry of all objects that are held in the data sto...
QmitkDataNodeGlobalReinitAction(QWidget *parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite)