Computer Assited Medical Intervention Tool Kit  version 4.1
Viewer.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 #ifndef VIEWER_H
27 #define VIEWER_H
28 
29 // -- Core stuff
30 #include "CamiTKAPI.h"
31 
32 // -- QT stuff
33 #include <QObject>
34 
35 // -- QT stuff classes
36 class QToolBar;
37 class QMenu;
38 
39 namespace camitk {
40 class Component;
41 
55 class CAMITK_API Viewer : public QObject {
56  Q_OBJECT
57 
58 public:
60  Viewer(QString name);
61 
63  ~Viewer() override = default;
64 
66  virtual unsigned int numberOfViewedComponent() = 0;
67 
69  virtual void refresh(Viewer* whoIsAsking = nullptr) = 0;
70 
72  virtual QWidget* getWidget(QWidget* parent = nullptr) = 0;
73 
75  virtual QObject* getPropertyObject() {
76  return nullptr;
77  };
78 
80  virtual QMenu* getMenu() {
81  return nullptr;
82  };
83 
85  virtual QToolBar* getToolBar() {
86  return nullptr;
87  };
88 
91  virtual void refreshInterfaceNode(Component* comp) {};
92 
93 signals:
94 
96  void selectionChanged();
97 
98 protected:
99 
104  void selectionChanged(ComponentList& compSet);
105 
107  void selectionChanged(Component* comp);
108 
110  void clearSelection();
111 
112 };
113 
114 }
115 
116 #endif // VIEWER_H
virtual void refreshInterfaceNode(Component *comp)
Update the whole tree of the representation of the Component.
Definition: Viewer.h:91
Viewer is an abstract viewer.
Definition: Viewer.h:55
virtual QToolBar * getToolBar()
get the viewer toolbar (returns NULL by default, i.e. there are no default toolbar) ...
Definition: Viewer.h:85
Definition: Action.cpp:36
virtual QObject * getPropertyObject()
get the viewer property object (returns NULL by default, i.e. there are no property to edit) ...
Definition: Viewer.h:75
virtual QMenu * getMenu()
get the viewer menu (returns NULL by default, i.e. there are no default edit menu) ...
Definition: Viewer.h:80
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:298
#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
QList< Component * > ComponentList
A list of Component.
Definition: CamiTKAPI.h:89