NorMIT-nav  22.09
An IGT application
cxViewGroupTreeNode.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 "cxViewGroupTreeNode.h"
12 #include "cxTreeRepository.h"
13 #include "cxLogger.h"
14 #include "cxTrackingService.h"
15 #include "cxVisServices.h"
16 #include <QIcon>
17 #include <QFont>
18 #include <QLabel>
19 #include "cxDoubleProperty.h"
21 #include "cxViewService.h"
22 
23 namespace cx
24 {
25 
26 
28  TreeNodeImpl(repo), mGroupIndex(groupIndex)
29 {
30 
31 }
32 
34 {
35  return QString("view_%1").arg(mGroupIndex);
36 }
37 
39 {
40  return QString("View %1").arg(mGroupIndex);
41 }
42 
44 {
45  if (this->repo()->getMode()=="flat")
46  return this->repo()->getNodeForGroup("view");
47  return TreeNodePtr();
48 }
49 
51 {
52 // this->getServices()->view()->set... need a method for setting active view group
53 }
54 
56 {
57  return "view";
58 }
59 
61 {
62  return QIcon(":icons/open_icon_library/eye.png.png");
63 }
64 
66 {
67  return QColor("blue");
68 }
69 
71 {
72  return QVariant();
73 }
74 
75 boost::shared_ptr<QWidget> ViewGroupTreeNode::createPropertiesWidget() const
76 {
77  return boost::shared_ptr<QWidget>(new ViewGroupPropertiesWidget(mGroupIndex,
78  this->getServices(),
79  NULL));
80 }
81 
82 
83 } // namespace cx
84 
cxLogger.h
cx::TreeNodeImpl
Definition: cxTreeNodeImpl.h:26
cx::ViewGroupTreeNode::getFont
virtual QVariant getFont() const
Definition: cxViewGroupTreeNode.cpp:70
cxTreeRepository.h
cx::ViewGroupTreeNode::getParent
virtual TreeNodePtr getParent() const
Definition: cxViewGroupTreeNode.cpp:43
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::ViewGroupTreeNode::ViewGroupTreeNode
ViewGroupTreeNode(TreeRepositoryWeakPtr repo, int groupIndex)
Definition: cxViewGroupTreeNode.cpp:27
cxDoubleProperty.h
cx::ViewGroupTreeNode::getColor
virtual QVariant getColor() const
Definition: cxViewGroupTreeNode.cpp:65
cxViewGroupTreeNode.h
cx::ViewGroupTreeNode::getName
virtual QString getName() const
Definition: cxViewGroupTreeNode.cpp:38
cx::ViewGroupTreeNode::createPropertiesWidget
virtual boost::shared_ptr< QWidget > createPropertiesWidget() const
Definition: cxViewGroupTreeNode.cpp:75
cxViewService.h
cx::ViewGroupTreeNode::getIcon
virtual QIcon getIcon() const
Definition: cxViewGroupTreeNode.cpp:60
cx::TreeNodePtr
boost::shared_ptr< TreeNode > TreeNodePtr
Definition: cxDataTreeNode.h:22
cx::TreeNodeImpl::getServices
VisServicesPtr getServices() const
Definition: cxTreeNodeImpl.cpp:97
cx::TreeNodeImpl::repo
TreeRepositoryPtr repo()
Definition: cxTreeNodeImpl.cpp:102
cxViewGroupPropertiesWidget.h
cx::ViewGroupTreeNode::activate
virtual void activate()
Definition: cxViewGroupTreeNode.cpp:50
cx::ViewGroupTreeNode::getUid
virtual QString getUid() const
Definition: cxViewGroupTreeNode.cpp:33
cxTrackingService.h
cx::TreeRepositoryWeakPtr
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30
cx::ViewGroupPropertiesWidget
Definition: cxViewGroupPropertiesWidget.h:30
cx::ViewGroupTreeNode::getType
virtual QString getType() const
Definition: cxViewGroupTreeNode.cpp:55
cxVisServices.h