OpenWalnut  1.5.0dev
WQtBranchTreeItem.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WQTBRANCHTREEITEM_H
26 #define WQTBRANCHTREEITEM_H
27 
28 #include <memory>
29 
30 #include <QProgressBar>
31 #include <QTreeWidgetItem>
32 #include <QtCore/QTimer>
33 
34 #include "WQtTreeItem.h"
35 #include "core/graphicsEngine/WROI.h"
36 #include "core/kernel/WRMBranch.h"
37 
38 class WQtRoiTreeItem;
39 
40 /**
41  * This class represents a ROI branch in the tree widget
42  */
44 {
45 public:
46  /**
47  * default constructor
48  *
49  * \param parent
50  * \param branch
51  */
52  explicit WQtBranchTreeItem( QTreeWidgetItem * parent, std::shared_ptr< WRMBranch > branch );
53 
54  /**
55  * destructor
56  */
57  virtual ~WQtBranchTreeItem();
58 
59  /**
60  * Add a ROI to the tree view.
61  * \param roi The new ROI.
62  *
63  * \return Pointer to the new ROI tree item.
64  */
65  WQtRoiTreeItem* addRoiItem( osg::ref_ptr< WROI > );
66 
67  /**
68  * getter
69  * \return the branch representation object
70  */
71  std::shared_ptr< WRMBranch > getBranch();
72 
73  /**
74  * Create a representation widget for this item.
75  *
76  * \return the widget.
77  */
78  QWidget* getWidget() const;
79 
80  /**
81  * Update internal Roi Manager sorting using the sorting of the children of this tree item.
82  */
84 protected:
85 private:
86  std::shared_ptr< WRMBranch > m_branch; //!< ROI
87 
88  /**
89  * Widget representing the item.
90  */
91  QWidget* m_itemWidget;
92 };
93 
94 #endif // WQTBRANCHTREEITEM_H
This class represents a ROI branch in the tree widget.
WQtBranchTreeItem(QTreeWidgetItem *parent, std::shared_ptr< WRMBranch > branch)
default constructor
WQtRoiTreeItem * addRoiItem(osg::ref_ptr< WROI >)
Add a ROI to the tree view.
std::shared_ptr< WRMBranch > m_branch
ROI.
std::shared_ptr< WRMBranch > getBranch()
getter
QWidget * getWidget() const
Create a representation widget for this item.
virtual ~WQtBranchTreeItem()
destructor
void updateRoiManagerSorting()
Update internal Roi Manager sorting using the sorting of the children of this tree item.
QWidget * m_itemWidget
Widget representing the item.
A tree widget item to represent a ROI in the control panel.