Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Explorer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK 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 version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 
27 #ifndef EXPLORER_H
28 #define EXPLORER_H
29 
30 // -- Core stuff
31 #include "Viewer.h"
32 
33 // -- QT stuff
34 #include <QTreeWidget>
35 #include <QTreeWidgetItem>
36 
37 namespace camitk
38 {
39 // -- Core stuff classes
40 class InterfaceNode;
41 class Component;
42 class ExplorerItem;
43 class Explorer;
44 
59 class CAMITK_API Explorer : public Viewer {
60  Q_OBJECT
61 
62 public:
65 
67  Explorer();
68 
70  ~Explorer();
71 
73  static Explorer* getInstance();
75 
78  virtual unsigned int numberOfViewedComponent();
81 
83  virtual void refresh(Viewer *whoIsAsking=NULL);
84 
86  virtual QWidget * getWidget(QWidget * parent);
87 
89  virtual QMenu * getMenu();
90 
92  virtual QWidget* getPreferenceWidget(QWidget * parent);
93 
101  virtual void refreshInterfaceNode(Component * comp);
103 
104 public slots :
105 
107  void renameItem();
108 
109 private slots :
110 
112  void selectionChanged();
113 
115  void doubleClicked(QTreeWidgetItem *, int);
116 
118  void rightButtonPressed(const QPoint &);
119 
120 private:
121 
125  QMap<QTreeWidgetItem*, Component *> itemComponentMap;
126 
128  QMap<Component*, QTreeWidgetItem*> itemCompMap;
129 
131  QTreeWidgetItem* getItem(Component *);
133 
137  QTreeWidgetItem* getNewItem(QTreeWidgetItem* parent, Component *);
138 
140  QTreeWidgetItem* add(QTreeWidgetItem*, Component *);
141 
145  void add(Component * comp);
146 
148  void remove(QTreeWidgetItem*);
149 
153  void remove(Component *comp);
154 
155 
157  QTreeWidget *explorerTree;
159 
163  QMenu* explorerMenu;
164 
166  QAction * editRename;
168 };
169 
170 }
171 
172 
173 #endif
Viewer is an abstract viewer.
Definition: Viewer.h:55
QMap< Component *, QTreeWidgetItem * > itemCompMap
the map to get the QTreeWidgetItem corresponding to a parentComp
Definition: Explorer.h:128
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:292
Explorer window, display the list of all data currently opened in the application.
Definition: Explorer.h:59
#define CAMITK_API
Definition: CamiTKAPI.h:49
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
QMap< QTreeWidgetItem *, Component * > itemComponentMap
Definition: Explorer.h:125
QMenu * explorerMenu
Definition: Explorer.h:163
QAction * editRename
the possible action
Definition: Explorer.h:166
QTreeWidget * explorerTree
the list view
Definition: Explorer.h:157