Fraxinus  18.10
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
boost::shared_ptr< class TreeRepository > TreeRepositoryPtr
virtual QVariant getColor() const
boost::shared_ptr< TreeNode > TreeNodePtr
VisServicesPtr getServices() const
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
virtual QVariant getViewGroupVisibility(int index) const
virtual bool isVisibleNode() const
TreeNodeImpl(TreeRepositoryWeakPtr repo)
virtual QVariant getFont() const
virtual bool isRemovable() const
boost::weak_ptr< class TreeRepository > TreeRepositoryWeakPtr
Definition: cxTreeNode.h:30
TreeRepositoryPtr repo()
virtual bool isDefaultExpanded() const
virtual std::vector< TreeNodePtr > getVisibleChildren() const
virtual bool useColoredName() const
virtual boost::shared_ptr< QWidget > createPropertiesWidget() const
TreeRepositoryWeakPtr mRepository
boost::weak_ptr< TreeNode > TreeNodeWeakPtr
virtual void activate()
QIcon addBackgroundColorToIcon(QIcon input, QColor color) const
virtual void setViewGroupVisibility(int index, bool value)
virtual TreeNodePtr getVisibleParent() const
virtual ~TreeNodeImpl()
virtual std::vector< TreeNodePtr > getChildren() const
Namespace for all CustusX production code.