Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryShell.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "berryShell.h"
18 
19 #include <QRect>
20 
21 namespace berry {
22 
23 Shell::Shell()
24  : extraShellListener(nullptr)
25 {
26 }
27 
28 Object::Pointer Shell::GetData(const QString& id) const
29 {
30  QHash<QString, Object::Pointer>::const_iterator iter = data.find(id);
31  if (iter == data.end()) return Object::Pointer(nullptr);
32  return iter.value();
33 }
34 
35 void Shell::SetData(const Object::Pointer& data, const QString& id)
36 {
37  this->data[id] = data;
38 }
39 
41 {
42  return extraShellListener;
43 }
44 
46 {
47  extraShellListener = l;
48 }
49 
50 void Shell::SetBounds(int x, int y, int width, int height)
51 {
52  QRect rect(x, y, width, height);
53  this->SetBounds(rect);
54 }
55 
56 }
void SetData(const Object::Pointer &data, const QString &id="")
Definition: berryShell.cpp:35
void SetExtraShellListener(IShellListener *l)
Definition: berryShell.cpp:45
Object::Pointer GetData(const QString &id="") const
Definition: berryShell.cpp:28
void SetBounds(int x, int y, int width, int height)
Definition: berryShell.cpp:50
IShellListener * GetExtraShellListener() const
Definition: berryShell.cpp:40