Computer Assited Medical Intervention Tool Kit  version 5.0
PropertyExplorer Class Reference

The property explorer. More...

#include <PropertyExplorer.h>

+ Inheritance diagram for PropertyExplorer:
+ Collaboration diagram for PropertyExplorer:

Public Member Functions

General
Q_INVOKABLE PropertyExplorer (QString name)
 
 ~PropertyExplorer () override
 destructor More...
 
Inherited from Viewer
void refresh (camitk::Viewer *whoIsAsking=nullptr) override
 
QWidget * getWidget () override
 get the viewer widget. More...
 
QObject * getPropertyObject () override
 add a property to change the ObjectController representation at run-time (user choice) More...
 
Tab selection management
void selectWidget (QWidget *widget)
 Select the tab containing the given widget in the PropertyExplorer. More...
 
void selectIndex (unsigned int index)
 Select the tab of the given index in the PropertyExplorer. 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 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...
 
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...
 

Private Slots

void refreshAll ()
 Refresh all the application when a property has changed, the best is to refresh the viewer to avoid multiple refresh in component or action codes. More...
 
void updateTabIndexToDisplay (int index)
 Update the PropertyExplorer tab index to display for the currently selected component This method is used by the PropertyExplorer to tell for each component which tab has been selected for display. More...
 

Private Member Functions

void clear ()
 clear all the additional widgets, reset currentComponent (and update its visibility). More...
 
 Q_ENUMS (camitk::ObjectController::ViewMode)
 

Private Attributes

QPushButton * applyButton
 
camitk::ComponentcurrentComponent
 the viewed Component More...
 
QPushButton * revertButton
 
QTabWidget * tabWidget
 
camitk::ObjectControllertheController
 the widgets More...
 

CamiTK Properties of this viewer

camitk::PropertyObjectpropertyObject
 The property object that holds the properties of this viewer. More...
 
camitk::PropertyviewModeProperty
 The CamiTK property that stands for the ObjectController view mode. More...
 
bool eventFilter (QObject *object, QEvent *event) override
 Event filter of this class instance to watch its properties instances. More...
 
void createProperties ()
 Create and handle the CamiTK properties of this viewer. 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

The property explorer.

The property explorer is a special container, placed generally below the explorer. It has a default tab (property editor) and can include any number of other tabs (where you can, of course, have any kind of widgets you want: slider, labels, text, ...).

It manages the camitk::InterfaceProperty facet of components.

The property explorer viewer.

The property editor is a "magic" widget (aka as "poOOowerful" widget) that use QObject derived class and build a property editor UI. It is presented as a list (automatically build from your QObject derived class Q_PROPERTY or added CamiTK properties):

  • first column is the property name,
  • second column is the editing widgets (where the user can interactively change the property value).

See also ObjectController documentation for more informations and a complete example of the property editor

If this viewer extension is loaded, the default instance of this viewer can be accessed directly by Application::getViewer("Property Explorer").

See also
camitk::Property
camitk::InterfaceProperty
camitk::Viewer

Constructor & Destructor Documentation

◆ PropertyExplorer()

PropertyExplorer::PropertyExplorer ( QString  name)

constructor

References applyButton, createProperties(), currentComponent, revertButton, camitk::Viewer::setDescription(), camitk::Viewer::setIcon(), tabWidget, and theController.

+ Here is the call graph for this function:

◆ ~PropertyExplorer()

PropertyExplorer::~PropertyExplorer ( )
override

destructor

References clear(), and propertyObject.

+ Here is the call graph for this function:

Member Function Documentation

◆ clear()

void PropertyExplorer::clear ( )
private

clear all the additional widgets, reset currentComponent (and update its visibility).

Note
this method does not delete the different widgets that were included in the tabs, the Component should do it.

References currentComponent, camitk::Viewer::getName(), camitk::Component::setVisibility(), and tabWidget.

Referenced by refresh(), and ~PropertyExplorer().

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

◆ createProperties()

void PropertyExplorer::createProperties ( )
private

Create and handle the CamiTK properties of this viewer.

References camitk::PropertyObject::addProperty(), propertyObject, camitk::Property::setAttribute(), camitk::Property::setEnumTypeName(), and viewModeProperty.

Referenced by PropertyExplorer().

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

◆ eventFilter()

bool PropertyExplorer::eventFilter ( QObject *  object,
QEvent *  event 
)
overrideprivate

Event filter of this class instance to watch its properties instances.

Each time a property has dynamically changed, this method is called.

References camitk::Property::getName(), propertyObject, camitk::ObjectController::setViewMode(), theController, and viewModeProperty.

+ Here is the call graph for this function:

◆ getPropertyObject()

QObject * PropertyExplorer::getPropertyObject ( )
overridevirtual

add a property to change the ObjectController representation at run-time (user choice)

Reimplemented from camitk::Viewer.

References propertyObject.

◆ getWidget()

QWidget * PropertyExplorer::getWidget ( )
overridevirtual

get the viewer widget.

Implements camitk::Viewer.

References applyButton, camitk::Property::getName(), propertyObject, refreshAll(), revertButton, tabWidget, theController, updateTabIndexToDisplay(), and viewModeProperty.

+ Here is the call graph for this function:

◆ Q_ENUMS()

PropertyExplorer::Q_ENUMS ( camitk::ObjectController::ViewMode  )
private

◆ refresh()

void PropertyExplorer::refresh ( camitk::Viewer whoIsAsking = nullptr)
overridevirtual

◆ refreshAll

void PropertyExplorer::refreshAll ( )
privateslot

Refresh all the application when a property has changed, the best is to refresh the viewer to avoid multiple refresh in component or action codes.

References camitk::refresh().

Referenced by getWidget().

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

◆ selectIndex()

void PropertyExplorer::selectIndex ( unsigned int  index)

Select the tab of the given index in the PropertyExplorer.

Parameters
indexthe index of the tab to display.
Note
0 <= index < currentComponent->getNumberOfPropertyWidget() else nothing is done

References tabWidget.

Referenced by refresh().

+ Here is the caller graph for this function:

◆ selectWidget()

void PropertyExplorer::selectWidget ( QWidget *  widget)

Select the tab containing the given widget in the PropertyExplorer.

Parameters
widgetthe PropertyExplorer's widget of the tab to select.
Note
the widget must have been previously added to the PropertyExplorer.

References tabWidget.

◆ updateTabIndexToDisplay

void PropertyExplorer::updateTabIndexToDisplay ( int  index)
privateslot

Update the PropertyExplorer tab index to display for the currently selected component This method is used by the PropertyExplorer to tell for each component which tab has been selected for display.

Parameters
indexThe index of the PropertyExplorer tab to display for the currently selected component.

References currentComponent, and camitk::Component::setIndexOfPropertyExplorerTab().

Referenced by getWidget().

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

Member Data Documentation

◆ applyButton

QPushButton* PropertyExplorer::applyButton
private

◆ currentComponent

camitk::Component* PropertyExplorer::currentComponent
private

◆ propertyObject

camitk::PropertyObject* PropertyExplorer::propertyObject
private

The property object that holds the properties of this viewer.

Referenced by createProperties(), eventFilter(), getPropertyObject(), getWidget(), and ~PropertyExplorer().

◆ revertButton

QPushButton* PropertyExplorer::revertButton
private

◆ tabWidget

QTabWidget* PropertyExplorer::tabWidget
private

◆ theController

camitk::ObjectController* PropertyExplorer::theController
private

the widgets

Referenced by eventFilter(), getWidget(), PropertyExplorer(), and refresh().

◆ viewModeProperty

camitk::Property* PropertyExplorer::viewModeProperty
private

The CamiTK property that stands for the ObjectController view mode.

Referenced by createProperties(), eventFilter(), and getWidget().


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