Computer Assisted Medical Intervention Tool Kit  version 5.1
 
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-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
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
64 Q_OBJECT
65
66public:
71 Q_INVOKABLE ActionViewer(QString name);
72
74 virtual ~ActionViewer();
75
77
78
79 virtual void refresh(Viewer* whoIsAsking = nullptr) override;
80
82 virtual QWidget* getWidget() override;
84
86 virtual void setSearchPanelVisible(bool);
88
89protected slots :
91 void changeName();
92
94 void changeFamily();
95
97 void changeTag();
98
99private:
101 enum UpdateReason {ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh};
102
104
105
106 virtual void updateActionWidget(camitk::Action*);
107
109 void updateSearchPanel(UpdateReason);
110
112 QWidget* myWidget;
113
115 QComboBox* familyComboBox;
116
118 QComboBox* nameComboBox;
119
121 camitk::Action* action;
122
124 QLineEdit* tagLineEdit;
125
127 QStackedWidget* actionWidgetStack;
128
130 QFrame* searchFramePanel;
131
133 int emptyActionWidgetIndex;
134
136 QMap<camitk::ComponentList, camitk::Action*> widgetHistory;
137
139 camitk::ComponentList currentlySelected;
140};
141
142
143#endif // ACTIONVIEWER_H
#define ACTIONVIEWER_API
Definition ActionViewerAPI.h:54
ActionViewer is the viewer used to manage the actions.
Definition ActionViewer.h:63
Action class is an abstract class that enables you to build a action (generally on a component).
Definition Action.h:208
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.
QList< Component * > ComponentList
A list of Component.
Definition CamiTKAPI.h:127
void refresh()
refresh the display