NorMIT-nav  2023.01.05-dev+develop.0da12
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 
cx::GroupTreeNode::getIcon
virtual QIcon getIcon() const
Definition: cxGroupTreeNode.cpp:57
cx::GroupTreeNode::getName
virtual QString getName() const
Definition: cxGroupTreeNode.cpp:33
cxLogger.h
cx::TreeNodeImpl
Definition: cxTreeNodeImpl.h:26
cxTreeRepository.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::GroupTreeNode::getType
virtual QString getType() const
Definition: cxGroupTreeNode.cpp:38
cx::GroupTreeNode::getUid
virtual QString getUid() const
Definition: cxGroupTreeNode.cpp:28
cx::TreeNodeImpl::isVisibleNode
virtual bool isVisibleNode() const
Definition: cxTreeNodeImpl.cpp:87
cx::TreeNodePtr
boost::shared_ptr< TreeNode > TreeNodePtr
Definition: cxDataTreeNode.h:22
cx::GroupTreeNode::GroupTreeNode
GroupTreeNode(TreeRepositoryWeakPtr repo, QString typeName)
Definition: cxGroupTreeNode.cpp:21
cx::TreeNodeImpl::repo
TreeRepositoryPtr repo()
Definition: cxTreeNodeImpl.cpp:102
cx::GroupTreeNode::isVisibleNode
virtual bool isVisibleNode() const
Definition: cxGroupTreeNode.cpp:43
cxGroupTreeNode.h
cx::GroupTreeNode::getParent
virtual TreeNodePtr getParent() const
Definition: cxGroupTreeNode.cpp:50
cx::TreeRepositoryWeakPtr
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30