Computer Assited Medical Intervention Tool Kit  version 4.1
PropertyExplorer.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 #ifndef PROPERTYEXPLORER_H
26 #define PROPERTYEXPLORER_H
27 
28 // -- Core stuff
29 #include "Viewer.h"
30 #include "ObjectController.h"
31 #include "PropertyObject.h"
32 
33 // -- QT stuff
34 #include <qteditorfactory.h>
35 #include <QtTreePropertyBrowser>
36 #include <QtButtonPropertyBrowser>
37 #include <QtGroupBoxPropertyBrowser>
38 
39 // -- QT stuff classes
40 class QTabWidget;
41 class QPushButton;
42 class QWidget;
43 
44 namespace camitk {
45 
46 
47 class ObjectController;
48 
84  Q_OBJECT
85  Q_ENUMS(camitk::ObjectController::ViewMode) // so that it can be used in property editor
86 
87 public:
93 
95  ~PropertyExplorer() override;
96 
98  static PropertyExplorer* getInstance();
100 
103  unsigned int numberOfViewedComponent() override;
106 
108  void refresh(Viewer* whoIsAsking = nullptr) override;
109 
111  QWidget* getWidget(QWidget* parent = nullptr) override;
112 
114  QObject* getPropertyObject() override;
116 
119 
123  void selectWidget(QWidget* widget);
124 
128  void selectIndex(unsigned int index);
129 
131 
132 
133 private:
134 
137  QTabWidget* tabWidget;
138  QPushButton* revertButton;
139  QPushButton* applyButton;
140 
143 
147 
152 
157 
162  bool eventFilter(QObject* object, QEvent* event) override;
163 
167  void createProperties();
168 
170 
174  void clear();
175 
176 private slots:
177 
183  void updateTabIndexToDisplay(int index);
184 
188  void refreshAll();
189 };
190 }
191 #endif
QPushButton * applyButton
Definition: PropertyExplorer.h:139
Viewer is an abstract viewer.
Definition: Viewer.h:55
QPushButton * revertButton
Definition: PropertyExplorer.h:138
Definition: Action.cpp:36
ObjectController * theController
the widgets
Definition: PropertyExplorer.h:136
Component * currentComponent
the viewed Component
Definition: PropertyExplorer.h:142
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
This class describes a property object.
Definition: PropertyObject.h:71
Property * viewModeProperty
The CamiTK property that stands for the ObjectController view mode.
Definition: PropertyExplorer.h:156
PropertyObject * propertyObject
The property object that holds the properties of this viewer.
Definition: PropertyExplorer.h:151
QTabWidget * tabWidget
Definition: PropertyExplorer.h:137
The property explorer.
Definition: PropertyExplorer.h:83
ViewMode
The property browser can be shown in different view mode.
Definition: ObjectController.h:172
Definition: objectcontroller.h:47
The object controller class.
Definition: ObjectController.h:162
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:291