NorMIT-nav  2023.01.05-dev+develop.0da12
An IGT application
cxTreeNodeImpl.h
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 #ifndef CXTREENODEIMPL_H
12 #define CXTREENODEIMPL_H
13 
14 #include "cxTreeNode.h"
16 #include <QVariant>
17 
18 namespace cx
19 {
20 
21 class TreeNode;
22 typedef boost::weak_ptr<TreeNode> TreeNodeWeakPtr;
23 typedef boost::shared_ptr<TreeNode> TreeNodePtr;
24 
25 
26 class TreeNodeImpl : public TreeNode
27 {
28  Q_OBJECT
29 public:
31  virtual ~TreeNodeImpl() {}
32  virtual std::vector<TreeNodePtr> getChildren() const;
33  virtual bool isVisibleNode() const;
34 
35  virtual void activate() {}
36  virtual QVariant getViewGroupVisibility(int index) const { return QVariant(); }
37  virtual void setViewGroupVisibility(int index, bool value) {}
38  virtual QVariant getColor() const { return QVariant(); }
39  virtual bool useColoredName() const { return false; }
40  virtual QVariant getFont() const { return QVariant(); }
41  virtual boost::shared_ptr<QWidget> createPropertiesWidget() const { return boost::shared_ptr<QWidget>(); }
42  virtual bool isDefaultExpanded() const { return true; }
43 
44  virtual bool isRemovable() const { return false; }
45  virtual void remove() { }
46 
47  virtual std::vector<TreeNodePtr> getVisibleChildren() const;
48  virtual TreeNodePtr getVisibleParent() const;
49 
50 protected:
53 
55  const TreeRepositoryPtr repo() const;
56 
57  QIcon addBackgroundColorToIcon(QIcon input, QColor color) const;
58 };
59 
60 } // namespace cx
61 
62 #endif // CXTREENODEIMPL_H
cx::TreeNodeImpl::mRepository
TreeRepositoryWeakPtr mRepository
Definition: cxTreeNodeImpl.h:51
cx::TreeNodeImpl::getVisibleChildren
virtual std::vector< TreeNodePtr > getVisibleChildren() const
Definition: cxTreeNodeImpl.cpp:60
cx::TreeNodeImpl
Definition: cxTreeNodeImpl.h:26
cx::TreeNodeImpl::getViewGroupVisibility
virtual QVariant getViewGroupVisibility(int index) const
Definition: cxTreeNodeImpl.h:36
cx::TreeNodeImpl::activate
virtual void activate()
Definition: cxTreeNodeImpl.h:35
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::TreeNodeImpl::createPropertiesWidget
virtual boost::shared_ptr< QWidget > createPropertiesWidget() const
Definition: cxTreeNodeImpl.h:41
cx::VisServicesPtr
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
cx::TreeNodeImpl::getChildren
virtual std::vector< TreeNodePtr > getChildren() const
Definition: cxTreeNodeImpl.cpp:28
cx::TreeNodeImpl::isRemovable
virtual bool isRemovable() const
Definition: cxTreeNodeImpl.h:44
cx::TreeNodeImpl::getVisibleParent
virtual TreeNodePtr getVisibleParent() const
Definition: cxTreeNodeImpl.cpp:74
cx::TreeNodeImpl::getFont
virtual QVariant getFont() const
Definition: cxTreeNodeImpl.h:40
cx::TreeNodeImpl::TreeNodeImpl
TreeNodeImpl(TreeRepositoryWeakPtr repo)
Definition: cxTreeNodeImpl.cpp:22
cx::TreeNodeImpl::remove
virtual void remove()
Definition: cxTreeNodeImpl.h:45
cx::TreeNode
Definition: cxTreeNode.h:34
cx::TreeNodeImpl::~TreeNodeImpl
virtual ~TreeNodeImpl()
Definition: cxTreeNodeImpl.h:31
cx::TreeNodeImpl::isVisibleNode
virtual bool isVisibleNode() const
Definition: cxTreeNodeImpl.cpp:87
cxCoordinateSystemHelpers.h
cx::TreeRepositoryPtr
boost::shared_ptr< class TreeRepository > TreeRepositoryPtr
Definition: cxTreeItemModel.h:22
cx::TreeNodeWeakPtr
boost::weak_ptr< TreeNode > TreeNodeWeakPtr
Definition: cxDataTreeNode.h:20
cx::TreeNodePtr
boost::shared_ptr< TreeNode > TreeNodePtr
Definition: cxDataTreeNode.h:22
cx::TreeNodeImpl::getServices
VisServicesPtr getServices() const
Definition: cxTreeNodeImpl.cpp:97
cx::TreeNodeImpl::addBackgroundColorToIcon
QIcon addBackgroundColorToIcon(QIcon input, QColor color) const
Definition: cxTreeNodeImpl.cpp:112
cx::TreeNodeImpl::repo
TreeRepositoryPtr repo()
Definition: cxTreeNodeImpl.cpp:102
cx::TreeNodeImpl::getColor
virtual QVariant getColor() const
Definition: cxTreeNodeImpl.h:38
cxTreeNode.h
cx::TreeNodeImpl::isDefaultExpanded
virtual bool isDefaultExpanded() const
Definition: cxTreeNodeImpl.h:42
cx::TreeNodeImpl::setViewGroupVisibility
virtual void setViewGroupVisibility(int index, bool value)
Definition: cxTreeNodeImpl.h:37
cx::TreeNodeImpl::useColoredName
virtual bool useColoredName() const
Definition: cxTreeNodeImpl.h:39
cx::TreeRepositoryWeakPtr
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30