Fraxinus  16.5.0-fx-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cxViewServiceTreeNode.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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 #include "cxViewServiceTreeNode.h"
33 
34 #include "cxTreeRepository.h"
35 #include "cxLogger.h"
36 #include "cxTrackingService.h"
37 #include "cxVisServices.h"
38 #include <QIcon>
39 #include <QFont>
40 #include <QLabel>
41 #include "cxToolPropertiesWidget.h"
43 
44 namespace cx
45 {
46 
47 
49  GroupTreeNode(repo, "view")
50 {
51 
52 }
53 
54 //QString ViewServiceTreeNode::getUid() const
55 //{
56 // return mTool->getUid();
57 //}
58 
59 //QString ViewServiceTreeNode::getName() const
60 //{
61 // return mTool->getName();
62 //}
63 
64 //TreeNodePtr ViewServiceTreeNode::getParent() const
65 //{
66 // if (this->repo()->getMode()=="flat")
67 // return this->repo()->getNodeForGroup("tool");
68 
69 // if (mTool->hasType(Tool::TOOL_REFERENCE))
70 // return this->repo()->getNode(CoordinateSystem(csPATIENTREF).toString());
72 // ToolPtr ref = this->getServices()->tracking()->getReferenceTool();
73 // if (ref)
74 // return this->repo()->getNode(ref->getUid());
75 // return TreeNodePtr();
76 //}
77 
78 //void ViewServiceTreeNode::activate()
79 //{
80 // this->getServices()->tracking()->setActiveTool(mTool->getUid());
81 //}
82 
83 //QString ViewServiceTreeNode::getType() const
84 //{
85 // return "tool";
86 //}
87 
88 //QIcon ViewServiceTreeNode::getIcon() const
89 //{
90 // if (mTool->hasType(Tool::TOOL_US_PROBE))
91 // return QIcon(":icons/tool_us_probe.png");
92 // if (mTool->hasType(Tool::TOOL_POINTER))
93 // return QIcon(":icons/tool_pointer.png");
94 // if (mTool->hasType(Tool::TOOL_REFERENCE))
95 // return QIcon(":icons/tool_reference.png");
96 // if (mTool->hasType(Tool::TOOL_MANUAL))
97 // return QIcon(":icons/tool_manual.png");
98 // return QIcon(":icons/tool_pointer.png");
99 //}
100 
101 //QVariant ViewServiceTreeNode::getColor() const
102 //{
103 // if (!mTool->isInitialized())
104 // return QColor("darkgray");
105 // if (mTool->getVisible())
106 // return QColor("green");
107 // else
108 // return QColor("red");
109 
110 // CX_LOG_CHANNEL_DEBUG("CA") << "tool " << mTool->getName() << ": init=" << mTool->isInitialized() << ", v=" << mTool->getVisible();
111 //}
112 
113 //QVariant ViewServiceTreeNode::getFont() const
114 //{
115 // if (this->getServices()->tracking()->getActiveTool()==mTool)
116 // {
117 // QFont font;
118 // font.setBold(true);
119 // return font;
120 // }
121 // return QVariant();
122 //}
123 
124 //QWidget* ViewServiceTreeNode::createPropertiesWidget() const
125 //{
126 // StringPropertySelectToolPtr selector = StringPropertySelectTool::New(this->getServices()->tracking());
127 // selector->setValue(mTool->getUid());
128 // return new ToolPropertiesWidget(selector,
129 // this->getServices()->tracking(),
130 // this->getServices()->spaceProvider(),
131 // NULL);
132 
135 //}
136 
137 
138 } // namespace cx
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:51
ViewServiceTreeNode(TreeRepositoryWeakPtr repo)