Computer Assited Medical Intervention Tool Kit  version 4.1
Private Slots | Private Member Functions | Private Attributes | List of all members
camitk::PropertyExplorer Class Reference

The property explorer. More...

#include <PropertyExplorer.h>

Inherits camitk::Viewer.

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...
 
Inherited from Viewer
unsigned int numberOfViewedComponent () override
 
void refresh (Viewer *whoIsAsking=nullptr) override
 refresh the property editor More...
 
QWidget * getWidget (QWidget *parent=nullptr) 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...
 

Private Attributes

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

General

 ~PropertyExplorer () override
 constructor More...
 
static PropertyExplorergetInstance ()
 returns the unique instance of the PropertyExplorer More...
 

CamiTK Properties of this viewer

PropertyObjectpropertyObject
 The property object that holds the properties of this viewer. More...
 
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

- Signals inherited from camitk::Viewer
void selectionChanged ()
 this signal is emitted when the current selection was changed by the viewer More...
 
- Public Member Functions inherited from camitk::Viewer
virtual QMenu * getMenu ()
 get the viewer menu (returns NULL by default, i.e. there are no default edit menu) More...
 
virtual QToolBar * getToolBar ()
 get the viewer toolbar (returns NULL by default, i.e. there are no default toolbar) More...
 
virtual void refreshInterfaceNode (Component *comp)
 Update the whole tree of the representation of the Component. More...
 
 Viewer (QString name)
 default constructor More...
 
 ~Viewer () override=default
 default destructor More...
 
- Protected Member Functions inherited from camitk::Viewer
void clearSelection ()
 clear the selection More...
 
void selectionChanged (ComponentList &compSet)
 The selection has changed to the given ComponentList. More...
 
void selectionChanged (Component *comp)
 the selection has changed to be just one comp More...
 

Detailed Description

The property explorer.

The property explorer is a special container, placed generally bellow 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, ...).

propertyexplorer.png
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):

Note
When your property editor has modified something in the Component that can change the way it is viewed/rendered by one or all of the Component viewers, you have to call the Component's method refresh()...

See also ObjectController documentation for more informations and a complete example.

This viewer also manages a singleton (THE CamiTK PropertyExplorer). See getInstance() for more information. You do not have to use it, but it is convienent (and sometimes preferable) to use this instance instead of creating your own one.

See also
ObjectController

Constructor & Destructor Documentation

◆ ~PropertyExplorer()

camitk::PropertyExplorer::~PropertyExplorer ( )
overrideprivate

constructor

destructor

Member Function Documentation

◆ clear()

void camitk::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 camitk::Application::isAlive().

◆ createProperties()

void camitk::PropertyExplorer::createProperties ( )
private

Create and handle the CamiTK properties of this viewer.

References camitk::ObjectController::BUTTON, camitk::Application::getSettings(), and camitk::Property::Property().

◆ eventFilter()

bool camitk::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::Application::getSettings().

◆ getInstance()

PropertyExplorer * camitk::PropertyExplorer::getInstance ( )
staticprivate

returns the unique instance of the PropertyExplorer

◆ getPropertyObject()

QObject * camitk::PropertyExplorer::getPropertyObject ( )
overrideprivatevirtual

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

Reimplemented from camitk::Viewer.

◆ getWidget()

QWidget * camitk::PropertyExplorer::getWidget ( QWidget *  parent = nullptr)
overrideprivatevirtual

get the viewer widget.

Parameters
parentthe parent widget for the viewer widget

Implements camitk::Viewer.

References camitk::Application::getSettings().

◆ numberOfViewedComponent()

unsigned int camitk::PropertyExplorer::numberOfViewedComponent ( )
overrideprivatevirtual

returns the number of Component that are displayed by this viewer

Implements camitk::Viewer.

◆ refresh()

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

refresh the property editor

Implements camitk::Viewer.

References camitk::Application::getSelectedComponents().

◆ refreshAll

void camitk::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::Application::refresh().

◆ selectIndex()

void camitk::PropertyExplorer::selectIndex ( unsigned int  index)
private

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

◆ selectWidget()

void camitk::PropertyExplorer::selectWidget ( QWidget *  widget)
private

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.

◆ updateTabIndexToDisplay

void camitk::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 camitk::Application::getSelectedComponents().

Member Data Documentation

◆ applyButton

QPushButton* camitk::PropertyExplorer::applyButton
private

◆ currentComponent

Component* camitk::PropertyExplorer::currentComponent
private

the viewed Component

◆ propertyObject

PropertyObject* camitk::PropertyExplorer::propertyObject
private

The property object that holds the properties of this viewer.

◆ revertButton

QPushButton* camitk::PropertyExplorer::revertButton
private

◆ tabWidget

QTabWidget* camitk::PropertyExplorer::tabWidget
private

◆ theController

ObjectController* camitk::PropertyExplorer::theController
private

the widgets

◆ viewModeProperty

Property* camitk::PropertyExplorer::viewModeProperty
private

The CamiTK property that stands for the ObjectController view mode.


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