Fraxinus  18.10
An IGT application
cxGroupTreeNode.cpp
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #include "cxGroupTreeNode.h"
12 
13 #include "cxLogger.h"
14 #include "cxTreeRepository.h"
15 #include <QIcon>
16 
17 namespace cx
18 {
19 
20 
22  TreeNodeImpl(repo),
23  mTypeName(typeName)
24 {
25 
26 }
27 
28 QString GroupTreeNode::getUid() const
29 {
30  return QString("group_%1").arg(mTypeName);
31 }
32 
33 QString GroupTreeNode::getName() const
34 {
35  return QString("%1 group").arg(mTypeName);
36 }
37 
38 QString GroupTreeNode::getType() const
39 {
40  return "group";
41 }
42 
44 {
45  if (this->repo()->getMode()!="flat")
46  return false;
48 }
49 
51 {
52  if (this->repo()->getMode()!="flat")
53  return TreeNodePtr();
54  return this->repo()->getTopNode();
55 }
56 
58 {
59  return QIcon(":icons/open_icon_library/document-open-7.png");
60 }
61 
62 
63 
64 } // namespace cx
65 
boost::shared_ptr< TreeNode > TreeNodePtr
virtual QString getUid() const
virtual TreeNodePtr getParent() const
virtual QString getType() const
virtual bool isVisibleNode() const
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30
TreeRepositoryPtr repo()
virtual QIcon getIcon() const
virtual QString getName() const
virtual bool isVisibleNode() const
GroupTreeNode(TreeRepositoryWeakPtr repo, QString typeName)
Namespace for all CustusX production code.