Computer Assisted Medical Intervention Tool Kit  version 5.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-2023 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
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#include "PropertyExplorerAPI.h"
29
30// -- Core stuff
31#include <Viewer.h>
32#include <ObjectController.h>
33#include <PropertyObject.h>
34
35// -- QT stuff
36#include <QtTreePropertyBrowser>
37#include <QtButtonPropertyBrowser>
38#include <QtGroupBoxPropertyBrowser>
39
40// -- QT stuff classes
41class QTabWidget;
42class QPushButton;
43class QWidget;
44
45namespace camitk {
47}
48
82 Q_OBJECT
83 Q_ENUMS(camitk::ObjectController::ViewMode); // so that it can be used in property editor
84
85public:
90 Q_INVOKABLE PropertyExplorer(QString name);
91
93 ~PropertyExplorer() override;
95
100 void refresh(camitk::Viewer* whoIsAsking = nullptr) override;
101
103 QWidget* getWidget() override;
104
106 QObject* getPropertyObject() override;
108
111
115 void selectWidget(QWidget* widget);
116
120 void selectIndex(unsigned int index);
121
123
124
125private:
126
128 camitk::ObjectController* theController;
129 QTabWidget* tabWidget;
130 QPushButton* revertButton;
131 QPushButton* applyButton;
132
134 camitk::Component* currentComponent;
135
140
143 camitk::PropertyObject* propertyObject;
144
148 camitk::Property* viewModeProperty;
149
154 bool eventFilter(QObject* object, QEvent* event) override;
155
159 void createProperties();
160
162
166 void clear();
167
168private slots:
169
175 void updateTabIndexToDisplay(int index);
176
180 void refreshAll();
181};
182
183#endif
#define PROPERTYEXPLORER_API
Definition: PropertyExplorerAPI.h:54
Definition: objectcontroller.h:47
The property explorer.
Definition: PropertyExplorer.h:81
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:302
The object controller class.
Definition: ObjectController.h:162
ViewMode
The property browser can be shown in different view mode.
Definition: ObjectController.h:171
This class describes a property object.
Definition: PropertyObject.h:71
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:280
Viewer is an abstract class that is the base class for all viewers.
Definition: Viewer.h:180
virtual QWidget * getWidget()=0
get the viewer widget.
virtual void refresh(Viewer *whoIsAsking=nullptr)=0
refresh the view (can be interesting to know which other viewer is calling this)
virtual QObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition: Viewer.h:240
Definition: Action.cpp:35