Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
camitk::InterfaceProperty Class Referenceabstract

This class describes what are the methods to implement in order to manage dynamic properties. More...

#include <InterfaceProperty.h>

+ Inheritance diagram for camitk::InterfaceProperty:
+ Collaboration diagram for camitk::InterfaceProperty:

Public Member Functions

virtual bool addProperty (Property *)=0
 Add a new CamiTK property to the component.
 
virtual QStringList getHierarchy () const =0
 Get the inheritance hierachy of this Component instance as a list of QString.
 
virtual unsigned int getIndexOfPropertyExplorerTab ()=0
 Get the index of the tab in the PropertyExplorer to select for display.
 
virtual unsigned int getNumberOfPropertyWidget ()=0
 get the number of alternative property widgets
 
virtual Q_INVOKABLE camitk::PropertygetProperty (QString name)=0
 Get a Property given its name.
 
virtual const QObject * getPropertyObject () const =0
 
virtual QObject * getPropertyObject ()=0
 get the property object that could be understood by PropertyEditor.
 
virtual QVariant getPropertyValue (const QString &name) const =0
 get the property QVariant (same as property(const char*)) but check if it exists first.
 
virtual QWidget * getPropertyWidgetAt (unsigned int i)=0
 get the ith alternative property widget override this method and use the method setObjectName of QWidget if you want alternative widgets
 
virtual bool isInstanceOf (QString className) const =0
 Assert that a Component instance really inherits from a given className.
 
virtual void propertyValueChanged (QString name)=0
 This method is called when a dynamic property value has been modified.
 
virtual void setIndexOfPropertyExplorerTab (unsigned int index)=0
 Set the index of the tab in the PropertyExplorer to select for display.
 
virtual bool setPropertyValue (const QString &name, QVariant newValue)=0
 set the property QVariant value (same as setProperty(const char*, newValue)) but check if it exists first.
 
 ~InterfaceProperty ()=default
 empty virtual destructor, to avoid memory leak
 

Detailed Description

This class describes what are the methods to implement in order to manage dynamic properties.

InterfaceProperty is one of the interfaces implemented by the Component class.

Constructor & Destructor Documentation

◆ ~InterfaceProperty()

camitk::InterfaceProperty::~InterfaceProperty ( )
default

empty virtual destructor, to avoid memory leak

Member Function Documentation

◆ addProperty()

virtual bool camitk::InterfaceProperty::addProperty ( Property )
pure virtual

Add a new CamiTK property to the component.

If the property already exist, it will just change its value.

Note
The component takes ownership of the Property instance.
Returns
false if the Qt Meta Object property was added by this method (otherwise the property was already defined and true is returned if it was successfully updated)

Implemented in camitk::Component, and camitk::SimplisticComponent.

◆ getHierarchy()

virtual QStringList camitk::InterfaceProperty::getHierarchy ( ) const
pure virtual

Get the inheritance hierachy of this Component instance as a list of QString.

Implemented in camitk::Component.

◆ getIndexOfPropertyExplorerTab()

virtual unsigned int camitk::InterfaceProperty::getIndexOfPropertyExplorerTab ( )
pure virtual

Get the index of the tab in the PropertyExplorer to select for display.

The PropertyExplorer may feature several tabs of widget. This method allows one to get the selected tab to display in a given context.

Returns
the index to select in the tab of the PropertyExplorer.

Implemented in camitk::Component.

◆ getNumberOfPropertyWidget()

virtual unsigned int camitk::InterfaceProperty::getNumberOfPropertyWidget ( )
pure virtual

get the number of alternative property widgets

See also
PropertyExplorer

Implemented in camitk::Component, camitk::ImageComponent, and camitk::MeshComponent.

◆ getProperty()

virtual Q_INVOKABLE camitk::Property * camitk::InterfaceProperty::getProperty ( QString  name)
pure virtual

Get a Property given its name.

Parameters
namethe property name
Returns
nullptr if the name does not match any property name
See also
Property

Implemented in camitk::Component.

◆ getPropertyObject() [1/2]

virtual const QObject * camitk::InterfaceProperty::getPropertyObject ( ) const
pure virtual

Implemented in camitk::Component.

◆ getPropertyObject() [2/2]

virtual QObject * camitk::InterfaceProperty::getPropertyObject ( )
pure virtual

get the property object that could be understood by PropertyEditor.

Returns this as any Component instance can manage its list of dynamic properties (and Component inherits from InterfaceProperty aka QObject). You can also have a separate class to manage your Component properties. In this case, just override this method and return the corresponding instance.

See also
PropertyExplorer
ObjectController

Implemented in camitk::Component.

◆ getPropertyValue()

virtual QVariant camitk::InterfaceProperty::getPropertyValue ( const QString &  name) const
pure virtual

get the property QVariant (same as property(const char*)) but check if it exists first.

If the property was not declared using addProperty, this methods prints an error message and returns an invalid QVariant

Implemented in camitk::Component.

◆ getPropertyWidgetAt()

virtual QWidget * camitk::InterfaceProperty::getPropertyWidgetAt ( unsigned int  i)
pure virtual

get the ith alternative property widget override this method and use the method setObjectName of QWidget if you want alternative widgets

See also
PropertyExplorer

Implemented in camitk::ImageComponent, camitk::MeshComponent, and camitk::Component.

◆ isInstanceOf()

virtual bool camitk::InterfaceProperty::isInstanceOf ( QString  className) const
pure virtual

Assert that a Component instance really inherits from a given className.

Parameters
classNamethe name of the class to compare to

Implemented in camitk::Component.

◆ propertyValueChanged()

virtual void camitk::InterfaceProperty::propertyValueChanged ( QString  name)
pure virtual

This method is called when a dynamic property value has been modified.

If you override this method, do not forget to call the superclass method for the properties not managed locally in order to properly manage all inherited dynamic properties. This method is called when a dynamic property has been updated.

Use getPropertyValue(name) to get the current (updated) value of the dynamic property.

Parameters
namethe name of the dynamic property

Implemented in PMLComponent, VtkMeshComponent, camitk::Component, camitk::ArbitrarySingleImageComponent, and camitk::ImageComponent.

◆ setIndexOfPropertyExplorerTab()

virtual void camitk::InterfaceProperty::setIndexOfPropertyExplorerTab ( unsigned int  index)
pure virtual

Set the index of the tab in the PropertyExplorer to select for display.

The PropertyExplorer may feature several tabs of widget. This method allows one to select the tab to display in a given context.

Parameters
indexthe index to select in the tab of the PropertyExplorer.

Implemented in camitk::Component.

◆ setPropertyValue()

virtual bool camitk::InterfaceProperty::setPropertyValue ( const QString &  name,
QVariant  newValue 
)
pure virtual

set the property QVariant value (same as setProperty(const char*, newValue)) but check if it exists first.

If the property was not declared using addProperty, this methods prints an error message and returns false

Implemented in camitk::Component.


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