Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
ActionViewer.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, 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
26#ifndef ACTIONVIEWER_H
27#define ACTIONVIEWER_H
28
29#include "ActionViewerAPI.h"
30
31#include <Viewer.h>
32#include <Action.h>
33#include <Component.h>
34
35#include <QWidget>
36#include <QComboBox>
37#include <QLabel>
38#include <QVBoxLayout>
39#include <QPushButton>
40#include <QStackedWidget>
41#include <QCompleter>
42#include <QLineEdit>
43
44namespace camitk {
45class PropertyObject;
46}
47
68 Q_OBJECT
69
70public:
75 Q_INVOKABLE ActionViewer(QString name);
76
78 virtual ~ActionViewer();
79
81
82
83 virtual void refresh(Viewer* whoIsAsking = nullptr) override;
84
86 virtual QWidget* getWidget() override;
87
90
92 QMenu* getMenu() override;
94
96 void setSearchPanelVisible(bool);
98
99protected slots :
101 void changeName();
102
104 void changeFamily();
105
107 void changeTag();
108
109private:
111 enum UpdateReason {ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh};
112
114
115
116 virtual void updateActionWidget(camitk::Action*);
117
119 void updateSearchPanel(UpdateReason);
120
122 QWidget* myWidget;
123
125 QComboBox* familyComboBox;
126
128 QComboBox* nameComboBox;
129
132
134 QLineEdit* tagLineEdit;
135
137 QStackedWidget* actionWidgetStack;
138
140 QFrame* searchFramePanel;
141
143 QMenu* myMenu;
144
146 int emptyActionWidgetIndex;
147
149 QMap<camitk::ComponentList, camitk::Action*> widgetHistory;
150
152 camitk::ComponentList currentlySelected;
153
154
160 camitk::PropertyObject* propertyObject;
161
168 bool eventFilter(QObject* object, QEvent* event) override;
169
171};
172
173#endif // ACTIONVIEWER_H
#define ACTIONVIEWER_API
Definition ActionViewerAPI.h:53
ActionViewer is the viewer used to manage the actions.
Definition ActionViewer.h:67
Action class is an abstract class that enables you to build a action (generally an algorithm that wor...
Definition Action.h:215
This class describes a property object.
Definition PropertyObject.h:72
Viewer is an abstract class that is the base class for all viewers.
Definition Viewer.h:182
virtual PropertyObject * getPropertyObject()
get the viewer property object (returns nullptr by default, i.e. there are no property to edit)
Definition Viewer.h:261
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 QMenu * getMenu()
get the viewer menu (returns nullptr by default, i.e. there are no default edit menu)
Definition Viewer.h:266
Definition action.py:1
Definition Action.cpp:40