Computer Assited Medical Intervention Tool Kit  version 4.1
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-2018 Univ. Grenoble Alpes, 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 // -- Core stuff classes
39 class InterfaceNode;
40 class Component;
41 class ExplorerItem;
42 class Explorer;
43 
58 class CAMITK_API Explorer : public Viewer {
59  Q_OBJECT
60 
61 public:
64 
66  Explorer();
67 
69  ~Explorer() override;
70 
72  static Explorer* getInstance();
74 
77  unsigned int numberOfViewedComponent() override;
80 
82  void refresh(Viewer* whoIsAsking = nullptr) override;
83 
85  QWidget* getWidget(QWidget* parent) override;
86 
88  QMenu* getMenu() override;
89 
91  virtual QWidget* getPreferenceWidget(QWidget* parent);
92 
100  void refreshInterfaceNode(Component* comp) override;
102 
103 public slots :
104 
106  void renameItem();
107 
108 private slots :
109 
111  void selectionChanged();
112 
114  void doubleClicked(QTreeWidgetItem*, int);
115 
117  void rightButtonPressed(const QPoint&);
118 
119 private:
120 
124  QMap<QTreeWidgetItem*, Component*> itemComponentMap;
125 
127  QMap<Component*, QTreeWidgetItem*> itemCompMap;
128 
130  QTreeWidgetItem* getItem(Component*);
132 
136  QTreeWidgetItem* getNewItem(QTreeWidgetItem* parent, Component*);
137 
139  QTreeWidgetItem* add(QTreeWidgetItem*, Component*);
140 
144  void add(Component* comp);
145 
147  void remove(QTreeWidgetItem*);
148 
152  void remove(Component* comp);
153 
154 
156  QTreeWidget* explorerTree;
158 
162  QMenu* explorerMenu;
163 
165  QAction* editRename;
167 };
168 
169 }
170 
171 
172 #endif
camitk::Component::isSelected
virtual bool isSelected() const
Check if this data component is selected.
Definition: sdk/libraries/core/component/Component.h:832
CAMITK_INFO
#define CAMITK_INFO(MSG)
Log for info verbosity (the second most verbose one) The msg will appear only if the user asked for I...
Definition: Log.h:256
camitk::rightButtonPressed
void rightButtonPressed()
send when the mouse right button is clicked
Log.h
Component::getName
const std::string getName() const
get the name of the component
Definition: modeling/libraries/pml/Component.h:146
camitk::Component::setVisibility
virtual void setVisibility(Viewer *, bool)
set the visibility for a viewer
Definition: sdk/libraries/core/component/Component.cpp:275
camitk::ComponentList
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:88
camitk::Component::getChildren
const ComponentList & getChildren() override
get the list of the InterfaceNode children (sub items in the hierarchy)
Definition: sdk/libraries/core/component/Component.h:843
Component
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:47
Explorer.h
camitk::Explorer::Explorer
Explorer()
Construtor.
Definition: Explorer.cpp:68
Component::setName
void setName(const std::string)
set the name of the component
Definition: modeling/libraries/pml/Component.h:149
Viewer.h
camitk::refresh
void refresh()
refresh the display
camitk::Component
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:297
Application.h
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:48
camitk
Definition: Action.cpp:36