Computer Assited Medical Intervention Tool Kit  version 4.0
Public Member Functions | List of all members
camitk::PropertyObject Class Reference

This class describes a property object. More...

#include <PropertyObject.h>

Inherits QObject.

Public Member Functions

virtual bool addProperty (Property *)
 Tag a new CamiTK property to this object. More...
 
virtual Q_INVOKABLE PropertygetProperty (QString name)
 Get a Property given its name. More...
 
 PropertyObject (QString name)
 Default constructor. More...
 
virtual void removeProperty (Property *)
 Remove a CamiTK property of this object. More...
 
virtual ~PropertyObject ()
 Destructor. More...
 

Private Attributes

Property management

list of CamiTK properties decorating the object

QMap< QString, Property * > propertiesMap
 

Detailed Description

This class describes a property object.

A property object is simply a QObject tagged with some CamiTK Properties The idea is to have an object which implements all the necessary methods to take advantages of the CamiTK Properties within the ObjectController

See also
ObjectController, Property

Constructor & Destructor Documentation

◆ PropertyObject()

camitk::PropertyObject::PropertyObject ( QString  name)

Default constructor.

Parameters
nameThe name of the PropertyObject instance. This one would be displayed in any SettingsDialog entries.

◆ ~PropertyObject()

camitk::PropertyObject::~PropertyObject ( )
virtual

Destructor.

References propertiesMap.

Member Function Documentation

◆ addProperty()

bool camitk::PropertyObject::addProperty ( Property prop)
virtual

Tag a new CamiTK property to this object.

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

Note
The object 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)

References camitk::Property::getInitialValue(), camitk::Property::getName(), and propertiesMap.

Referenced by camitk::Application::createProperties(), and camitk::InteractiveViewer::createProperties().

◆ getProperty()

Property * camitk::PropertyObject::getProperty ( QString  name)
virtual

Get a Property given its name.

Parameters
namethe property name
Returns
NULL if the name does not match any property name
Note
This method is necessary by the ObjectController to take advantage of the camitk properties
See also
Property, ObjectController

References propertiesMap.

◆ removeProperty()

void camitk::PropertyObject::removeProperty ( Property prop)
virtual

Remove a CamiTK property of this object.

References camitk::Property::getName().

Member Data Documentation

◆ propertiesMap

QMap<QString, Property*> camitk::PropertyObject::propertiesMap
private

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