Computer Assited Medical Intervention Tool Kit  version 4.0
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-2016 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 ACTIONVIEWER_H
27 #define ACTIONVIEWER_H
28 
29 #include <QWidget>
30 #include <QComboBox>
31 #include <QLabel>
32 #include <QVBoxLayout>
33 #include <QPushButton>
34 #include <QStackedWidget>
35 #include <QCompleter>
36 #include <QLineEdit>
37 
38 #include "Viewer.h"
39 #include "Action.h"
40 #include "Component.h"
41 
42 namespace camitk {
57 class CAMITK_API ActionViewer : public Viewer {
58  Q_OBJECT
59 
60 public:
63  ActionViewer();
66 
68  virtual ~ActionViewer();
69 
71  static ActionViewer * getInstance();
73 
75 
76  virtual unsigned int numberOfViewedComponent() {
78  return 0;
79  };
80 
82  virtual void refresh(Viewer *whoIsAsking = NULL);
83 
85  virtual QWidget * getWidget(QWidget * parent = NULL);
87 
89 
90  void embedActionWidget(Action *);
92 
94  void setSearchPanelVisible(bool);
96 
98  // TODO CAMITK_DEPRECATED. This section list all the methods marked as deprecated. They are to be removed in CamiTK 4.0
102  static ActionViewer * getActionViewer();
104 
105 protected slots :
107  void changeName();
108 
110  void changeFamily();
111 
113  void changeTag();
114 
115 private:
117  enum UpdateReason {ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh};
118 
120  void updateActionViewer(UpdateReason);
121 
123  QWidget * myWidget;
124 
126  QComboBox * familyComboBox;
127 
129  QComboBox * nameComboBox;
130 
133 
135  QLineEdit *tagLineEdit;
136 
138  QStackedWidget *actionWidgetStack;
139 
142 
145 
147  QMap<ComponentList, Action*> widgetHistory;
148 };
149 }
150 
151 #endif // ACTIONVIEWER_H
QComboBox * familyComboBox
Family combo box.
Definition: ActionViewer.h:126
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 viewer.
Definition: Viewer.h:55
QFrame * searchFramePanel
the search panel
Definition: ActionViewer.h:141
Definition: Action.cpp:40
#define CAMITK_API
Definition: CamiTKAPI.h:49
QWidget * myWidget
Main action widget of the viewer.
Definition: ActionViewer.h:123
QLineEdit * tagLineEdit
action tags line edit
Definition: ActionViewer.h:135
ActionViewer is the viewer used to manage the actions.
Definition: ActionViewer.h:57
QComboBox * nameComboBox
Action name combo box.
Definition: ActionViewer.h:129
int emptyActionWidgetIndex
index of the empty widget, used when no action is active or when no action has been used for the curr...
Definition: ActionViewer.h:144
Action * action
Current action.
Definition: ActionViewer.h:132
QMap< ComponentList, Action * > widgetHistory
this map stores the list of selected component and the corresponding stack index of their embedded ac...
Definition: ActionViewer.h:147
QStackedWidget * actionWidgetStack
actions stacked widget of the viewer
Definition: ActionViewer.h:138
UpdateReason
Enum the different fields of the action viewwer.
Definition: ActionViewer.h:117