![]() |
Computer Assited Medical Intervention Tool Kit
|
Explorer window, display the list of all data currently opened in the application. More...
#include <Explorer.h>
Public Slots | |
void | renameItem () |
slot called by the explorer menu when the user wants to rename the currently selected Component |
Public Member Functions | |
General | |
Explorer () | |
Construtor. | |
~Explorer () | |
Destructor. | |
Inherited from Viewer | |
virtual unsigned int | numberOfViewedComponent () |
virtual void | refresh (Viewer *whoIsAsking=NULL) |
refresh the explorer (can be interesting to know which other viewer is calling this) | |
virtual QWidget * | getWidget (QWidget *parent) |
get the explorer widget (QTreeWidget). | |
virtual QMenu * | getMenu () |
get the explorer menu | |
virtual QWidget * | getPreferenceWidget (QWidget *parent) |
get the explorer preference widget (widget where all preferences can be modified). | |
virtual void | refreshInterfaceNode (Component *comp) |
Update the interface node representation of a given Component, (creates a new sub-item for all the new sub items and delete all the sub-item which are not sub items any more). | |
![]() | |
virtual QObject * | getPropertyObject () |
get the viewer property object (returns NULL by default, i.e. there are no property to edit) | |
virtual QToolBar * | getToolBar () |
get the viewer toolbar (returns NULL by default, i.e. there are no default toolbar) | |
Viewer (QString name) | |
default constructor | |
virtual | ~Viewer () |
default destructor |
Private Slots | |
void | doubleClicked (QTreeWidgetItem *, int) |
slot called when an item was double clicked | |
void | rightButtonPressed (const QPoint &) |
slot called on right button click | |
void | selectionChanged () |
slot called whenever the selection changed in the explorer |
Private Attributes | |
Menu | |
the QMenu for the explorer | |
QMenu * | explorerMenu |
QAction * | editRename |
the possible action |
QTreeWidgetItem/InterfaceNode map | |
QMap< QTreeWidgetItem *, Component * > | itemComponentMap |
QMap< Component *, QTreeWidgetItem * > | itemCompMap |
the map to get the QTreeWidgetItem corresponding to a parentComp | |
QTreeWidgetItem * | getItem (Component *) |
Return the QTreeWidgetItem of a given Component (return NULL if not found) |
QTreeWidget and QTreeWidgetItem management | |
instanciate a new QTreeWidgetItem using names and properties from the InterfaceNode, and using parent | |
QTreeWidget * | explorerTree |
the list view | |
QTreeWidgetItem * | getNewItem (QTreeWidgetItem *parent, Component *) |
QTreeWidgetItem * | add (QTreeWidgetItem *, Component *) |
recursively add the Component in the tree explorer and return the QTreeWidgetItem of the InterfaceNode | |
void | add (Component *comp) |
Add the given Component to the explorer (at top level) and automatically create children Component items. | |
void | remove (QTreeWidgetItem *) |
remove a given item from the explorer (return its index in the parent item list) | |
void | remove (Component *comp) |
Remove the Component (its Component and its sub-item) from the explorer list (if present). |
Additional Inherited Members | |
![]() | |
void | selectionChanged () |
this signal is emitted when the current selection was changed by the viewer | |
![]() | |
void | clearSelection () |
clear the selection | |
void | selectionChanged (ComponentList &compSet) |
The selection has changed to the given ComponentList. | |
void | selectionChanged (Component *comp) |
the selection has changed to be just one comp |
Explorer window, display the list of all data currently opened in the application.
All objects are displayed in a QListView widget and can be selected (single/multiple selection is available).
camitk::Explorer::Explorer | ( | ) |
Construtor.
References explorerMenu, and explorerTree.
camitk::Explorer::~Explorer | ( | ) |
Destructor.
References explorerMenu, and explorerTree.
|
private |
recursively add the Component in the tree explorer and return the QTreeWidgetItem of the InterfaceNode
References camitk::Component::getChildren(), getNewItem(), itemComponentMap, and camitk::Component::setVisibility().
Referenced by add(), refresh(), and refreshInterfaceNode().
|
private |
Add the given Component to the explorer (at top level) and automatically create children Component items.
comp | The Component to add in the tree view. |
References add(), explorerTree, camitk::Component::getParent(), and itemCompMap.
|
privateslot |
slot called when an item was double clicked
References camitk::Component::doubleClicked(), itemComponentMap, refreshInterfaceNode(), and selectionChanged().
Referenced by getWidget().
|
private |
Return the QTreeWidgetItem of a given Component (return NULL if not found)
References itemComponentMap.
Referenced by refresh(), and refreshInterfaceNode().
|
virtual |
get the explorer menu
Reimplemented from camitk::Viewer.
References editRename, explorerMenu, camitk::Application::getSelectedComponents(), and renameItem().
|
private |
References camitk::Component::getChildren(), camitk::Component::getIcon(), camitk::Component::getName(), and camitk::Component::inItalic().
Referenced by add().
|
virtual |
get the explorer preference widget (widget where all preferences can be modified).
parent | the parent widget for the preference widget |
|
virtual |
get the explorer widget (QTreeWidget).
parent | the parent widget for the viewer widget |
Implements camitk::Viewer.
References doubleClicked(), explorerTree, rightButtonPressed(), and selectionChanged().
Referenced by ImpMainWindow::resetWindows().
|
virtual |
returns the number of Component that are displayed by this viewer
Implements camitk::Viewer.
References itemComponentMap.
|
virtual |
refresh the explorer (can be interesting to know which other viewer is calling this)
Implements camitk::Viewer.
References add(), editRename, explorerMenu, explorerTree, getItem(), camitk::Application::getSelectedComponents(), camitk::Application::getTopLevelComponents(), camitk::Component::isSelected(), itemCompMap, and itemComponentMap.
Referenced by selectionChanged().
|
virtual |
Update the interface node representation of a given Component, (creates a new sub-item for all the new sub items and delete all the sub-item which are not sub items any more).
Call this method when the Component has created a new sub-item or when it has removed one of its sub items. If the component was not displayed in the explorer, this method does nothing.
comp | The InterfaceNode provider to update list. |
Reimplemented from camitk::Viewer.
References add(), explorerTree, and getItem().
Referenced by doubleClicked(), and renameItem().
|
private |
remove a given item from the explorer (return its index in the parent item list)
References camitk::Application::isAlive(), and itemComponentMap.
|
private |
Remove the Component (its Component and its sub-item) from the explorer list (if present).
The Component itself is of course not deleted here.
References explorerTree, and itemCompMap.
|
slot |
slot called by the explorer menu when the user wants to rename the currently selected Component
References explorerTree, camitk::Component::getName(), itemComponentMap, camitk::Component::refresh(), refreshInterfaceNode(), and camitk::Component::setName().
Referenced by getMenu().
|
privateslot |
slot called on right button click
References explorerTree, camitk::Component::getActionAndPopupMenu(), and itemComponentMap.
Referenced by getWidget().
|
privateslot |
slot called whenever the selection changed in the explorer
References camitk::Application::clearSelectedComponents(), explorerTree, itemComponentMap, and refresh().
Referenced by doubleClicked(), and getWidget().
|
private |
|
private |
Referenced by Explorer(), getMenu(), refresh(), and ~Explorer().
|
private |
the list view
Referenced by add(), Explorer(), getWidget(), refresh(), refreshInterfaceNode(), remove(), renameItem(), rightButtonPressed(), selectionChanged(), and ~Explorer().
|
private |
|
private |
Referenced by add(), doubleClicked(), getItem(), numberOfViewedComponent(), refresh(), remove(), renameItem(), rightButtonPressed(), and selectionChanged().