Computer Assited Medical Intervention Tool Kit  version 5.0
ActionViewer Class Reference

ActionViewer is the viewer used to manage the actions. More...

#include <ActionViewer.h>

+ Inheritance diagram for ActionViewer:
+ Collaboration diagram for ActionViewer:

Public Member Functions

General
Q_INVOKABLE ActionViewer (QString name)
 
virtual ~ActionViewer ()
 destructor More...
 
- Public Member Functions inherited from camitk::Viewer
QStringList getComponents ()
 get the list of Component class manages by this viewer (default is set to "Component", i.e. More...
 
QString getDescription () const
 get the name of the viewer More...
 
QDockWidget * getDockWidget ()
 Get the QDockWidget* where this viewer is currently docked (or nullptr if it is not docked anywhere or if the viewer is of type EMBEDDED) More...
 
QLayout * getEmbedder ()
 Get the QLayout* where this viewer is currently embedded (or nullptr if it is not embedded anywhere or if the viewer is of type DOCKED) More...
 
virtual QPixmap getIcon ()
 get the viewer icon More...
 
virtual QMenu * getMenu ()
 get the viewer menu (returns nullptr by default, i.e. there are no default edit menu) More...
 
QString getName () const
 get the name of the viewer More...
 
virtual QObject * getPropertyObject ()
 get the viewer property object (returns nullptr by default, i.e. there are no property to edit) More...
 
virtual QToolBar * getToolBar ()
 get the viewer toolbar (returns nullptr by default, i.e. there are no default toolbar) More...
 
bool getToolBarVisibility ()
 get the current value of the toolbar visibility More...
 
ViewerType getType ()
 get the viewer layout More...
 
 Q_ENUM (ViewerType) Viewer(QString name
 default constructor More...
 
virtual void refresh (Viewer *whoIsAsking=nullptr)=0
 refresh the view (can be interesting to know which other viewer is calling this) More...
 
bool setDockWidget (QDockWidget *)
 If the viewer type is DOCKED, dock the widget inside the given dock widget (do nothing if the type is EMBEDDED or if the viewer has already been docked before) Note that once set, the dock widget cannot be modified. More...
 
bool setEmbedder (QLayout *)
 If the viewer type is EMBEDDED, embed the viewer widget in the given layout (do nothing if the type is DOCKED) Note that you can call this method any time you want to move the viewer's widget to another layout (but there is only one embedder at a time) More...
 
void setToolBarVisibility (bool)
 set the visibility of the toolbar in the main window (true by default). More...
 
void setType (ViewerType)
 set the viewer layout (the type can be changed dynamically to fit the developer's purpose) More...
 
void setVisible (bool)
 set the visibility of the viewer (show or hide its widget) More...
 
virtual ~Viewer () override
 default destructor More...
 

Inherited from Viewer

enum  UpdateReason { ActionFamilyChanged, ActionNameChanged, ActionTagChanged, ViewerRefresh }
 Enum the different fields of the action viewwer. More...
 
virtual void refresh (Viewer *whoIsAsking=nullptr) override
 refresh the view (can be interesting to know which other viewer is calling this) More...
 
virtual QWidget * getWidget () override
 get the viewer widget More...
 
virtual void setSearchPanelVisible (bool)
 show/hide the search panel (hidden by default) More...
 
void changeName ()
 Method used to change the action selected. More...
 
void changeFamily ()
 Method used to change the action family selected. More...
 
void changeTag ()
 Method used to change the tag. More...
 

Specific to the Action viewer

QWidget * myWidget
 Main action widget of the viewer. More...
 
QComboBox * familyComboBox
 Family combo box. More...
 
QComboBox * nameComboBox
 Action name combo box. More...
 
camitk::Actionaction
 Current action. More...
 
QLineEdit * tagLineEdit
 action tags line edit More...
 
QStackedWidget * actionWidgetStack
 actions stacked widget of the viewer More...
 
QFrame * searchFramePanel
 the search panel More...
 
int emptyActionWidgetIndex
 index of the empty widget, used when no action is active or when no action has been used for the currently selected components More...
 
QMap< camitk::ComponentList, camitk::Action * > widgetHistory
 this map stores the list of selected component and the corresponding stack index of their embedded action More...
 
camitk::ComponentList currentlySelected
 Used to evaluate modification of the list while execution. More...
 
virtual void updateActionWidget (camitk::Action *)
 embed an action widget in the stacked widget if needed More...
 
void updateSearchPanel (UpdateReason)
 method used to update the viewer for a given update field More...
 

Additional Inherited Members

- Public Types inherited from camitk::Viewer
enum  ViewerType { EMBEDDED, DOCKED }
 
- Signals inherited from camitk::Viewer
void selectionChanged ()
 this signal is emitted when the current selection was changed by the viewer More...
 
- Public Attributes inherited from camitk::Viewer
ViewerType type = EMBEDDED)
 this viewer's layout More...
 
- Protected Member Functions inherited from camitk::Viewer
void clearSelection ()
 clear the selection More...
 
void selectionChanged (Component *comp)
 the selection has changed to be just one comp More...
 
void selectionChanged (ComponentList &compSet)
 The selection has changed to the given ComponentList. More...
 
void setComponents (QStringList)
 set the list of component class names managed by this viewer More...
 
void setDescription (QString)
 set the viewer's description More...
 
void setIcon (QPixmap icon)
 set the default icon for the viewer extension More...
 

Detailed Description

ActionViewer is the viewer used to manage the actions.

By default all action widgets are displayed in this viewer widget (in the QStackedWidget). There is also a search panel to find an action to apply to the currently selected component. The search panel is shown by default. Use setSearchPanelVisible(false) to hide it.

Note
This is a very special viewer as it calls setComponents(...) method with an empty list. This means that this viewer is going to be notified/refreshed every time the current selected action is changed (i.e., anytime an action is triggered).

Use Application::getViewer("Action Viewer") to get the default instance of this viewer.

See also
camitk::Action

Member Enumeration Documentation

◆ UpdateReason

Enum the different fields of the action viewwer.

Enumerator
ActionFamilyChanged 
ActionNameChanged 
ActionTagChanged 
ViewerRefresh 

Constructor & Destructor Documentation

◆ ActionViewer()

ActionViewer::ActionViewer ( QString  name)

constructor

References actionWidgetStack, familyComboBox, myWidget, nameComboBox, searchFramePanel, camitk::Viewer::setComponents(), camitk::Viewer::setDescription(), and camitk::Viewer::setIcon().

+ Here is the call graph for this function:

◆ ~ActionViewer()

ActionViewer::~ActionViewer ( )
virtual

destructor

Member Function Documentation

◆ changeFamily

void ActionViewer::changeFamily ( )
protectedslot

Method used to change the action family selected.

References ActionFamilyChanged, and updateSearchPanel().

Referenced by setSearchPanelVisible().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeName

void ActionViewer::changeName ( )
protectedslot

Method used to change the action selected.

References action, ActionNameChanged, nameComboBox, and updateSearchPanel().

Referenced by setSearchPanelVisible().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeTag

void ActionViewer::changeTag ( )
protectedslot

Method used to change the tag.

References ActionTagChanged, and updateSearchPanel().

Referenced by setSearchPanelVisible().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWidget()

QWidget * ActionViewer::getWidget ( )
overridevirtual

get the viewer widget

Implements camitk::Viewer.

References actionWidgetStack, emptyActionWidgetIndex, familyComboBox, myWidget, nameComboBox, searchFramePanel, tagLineEdit, and widgetHistory.

Referenced by updateActionWidget().

+ Here is the caller graph for this function:

◆ refresh()

void ActionViewer::refresh ( Viewer whoIsAsking = nullptr)
overridevirtual

refresh the view (can be interesting to know which other viewer is calling this)

References updateActionWidget(), updateSearchPanel(), and ViewerRefresh.

+ Here is the call graph for this function:

◆ setSearchPanelVisible()

void ActionViewer::setSearchPanelVisible ( bool  visibility)
virtual

show/hide the search panel (hidden by default)

References changeFamily(), changeName(), changeTag(), familyComboBox, nameComboBox, searchFramePanel, and tagLineEdit.

Referenced by ImpMainWindow::ImpMainWindow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateActionWidget()

void ActionViewer::updateActionWidget ( camitk::Action action)
privatevirtual

embed an action widget in the stacked widget if needed

References action, ActionFamilyChanged, actionWidgetStack, familyComboBox, camitk::Action::getEmbedded(), camitk::Action::getFamily(), camitk::Action::getName(), getWidget(), camitk::Action::getWidget(), nameComboBox, updateSearchPanel(), camitk::Action::updateTargets(), and widgetHistory.

Referenced by refresh(), and updateSearchPanel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSearchPanel()

void ActionViewer::updateSearchPanel ( UpdateReason  reason)
private

method used to update the viewer for a given update field

References action, ActionFamilyChanged, ActionNameChanged, ActionTagChanged, actionWidgetStack, currentlySelected, emptyActionWidgetIndex, familyComboBox, camitk::Action::getFamily(), camitk::Action::getName(), camitk::Action::getTag(), myWidget, nameComboBox, tagLineEdit, camitk::Action::trigger(), updateActionWidget(), ViewerRefresh, and widgetHistory.

Referenced by changeFamily(), changeName(), changeTag(), refresh(), and updateActionWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ action

camitk::Action* ActionViewer::action
private

Current action.

Referenced by changeName(), updateActionWidget(), and updateSearchPanel().

◆ actionWidgetStack

QStackedWidget* ActionViewer::actionWidgetStack
private

actions stacked widget of the viewer

Referenced by ActionViewer(), getWidget(), updateActionWidget(), and updateSearchPanel().

◆ currentlySelected

camitk::ComponentList ActionViewer::currentlySelected
private

Used to evaluate modification of the list while execution.

Referenced by updateSearchPanel().

◆ emptyActionWidgetIndex

int ActionViewer::emptyActionWidgetIndex
private

index of the empty widget, used when no action is active or when no action has been used for the currently selected components

Referenced by getWidget(), and updateSearchPanel().

◆ familyComboBox

QComboBox* ActionViewer::familyComboBox
private

◆ myWidget

QWidget* ActionViewer::myWidget
private

Main action widget of the viewer.

Referenced by ActionViewer(), getWidget(), and updateSearchPanel().

◆ nameComboBox

QComboBox* ActionViewer::nameComboBox
private

◆ searchFramePanel

QFrame* ActionViewer::searchFramePanel
private

the search panel

Referenced by ActionViewer(), getWidget(), and setSearchPanelVisible().

◆ tagLineEdit

QLineEdit* ActionViewer::tagLineEdit
private

action tags line edit

Referenced by getWidget(), setSearchPanelVisible(), and updateSearchPanel().

◆ widgetHistory

QMap<camitk::ComponentList, camitk::Action*> ActionViewer::widgetHistory
private

this map stores the list of selected component and the corresponding stack index of their embedded action

Referenced by getWidget(), updateActionWidget(), and updateSearchPanel().


The documentation for this class was generated from the following files: