CustusX  2023.01.05-dev+develop.0da12
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 
boost::shared_ptr< TreeNode > TreeNodePtr
virtual TreeNodePtr getParent() const
VisServicesPtr getServices() const
ViewGroupTreeNode(TreeRepositoryWeakPtr repo, int groupIndex)
virtual QVariant getFont() const
virtual boost::shared_ptr< QWidget > createPropertiesWidget() const
virtual QString getUid() const
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30
TreeRepositoryPtr repo()
virtual QVariant getColor() const
virtual QString getType() const
virtual QString getName() const
virtual QIcon getIcon() const
Namespace for all CustusX production code.