Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
berryShell.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 "berryShell.h"
14 
15 #include <QRect>
16 
17 namespace berry {
18 
20  : extraShellListener(nullptr)
21 {
22 }
23 
24 Object::Pointer Shell::GetData(const QString& id) const
25 {
26  QHash<QString, Object::Pointer>::const_iterator iter = data.find(id);
27  if (iter == data.end()) return Object::Pointer(nullptr);
28  return iter.value();
29 }
30 
31 void Shell::SetData(const Object::Pointer& data, const QString& id)
32 {
33  this->data[id] = data;
34 }
35 
37 {
38  return extraShellListener;
39 }
40 
42 {
43  extraShellListener = l;
44 }
45 
46 void Shell::SetBounds(int x, int y, int width, int height)
47 {
48  QRect rect(x, y, width, height);
49  this->SetBounds(rect);
50 }
51 
52 }
void SetData(const Object::Pointer &data, const QString &id="")
Definition: berryShell.cpp:31
Implements transparent reference counting.
IShellListener * GetExtraShellListener() const
Definition: berryShell.cpp:36
void SetExtraShellListener(IShellListener *l)
Definition: berryShell.cpp:41
Object::Pointer GetData(const QString &id="") const
Definition: berryShell.cpp:24
void SetBounds(int x, int y, int width, int height)
Definition: berryShell.cpp:46