This class manages a CamiTK Extension model (stored as a VariantDataModel). More...
#include <CamiTKExtensionModel.h>
Public Member Functions | |
| CamiTKExtensionModel (const QString &filePath=QString()) | |
| constructor | |
| void | clear () |
| reset the model from scratch (the model will then be empty) | |
| VariantDataModel & | getModel () |
| get access to the VariantDataModel | |
| bool | isModified () |
| was the data model modified since last read | |
| bool | load (const QString &filePath) |
| read the given file and creates the corresponding configuration | |
| bool | save (const QString &filePath=QString()) |
| save the current config to the current filePath or given filePath and update camitkFile if needed Warning it does overwrite the previous content of filePath | |
| void | setModel (VariantDataModel &) |
| modify the model | |
| QString | toJSON () |
| the camitk extension data model as a JSON string | |
This class manages a CamiTK Extension model (stored as a VariantDataModel).
It can load/save the model to CamiTK extension file (JSON)
Role:
The expected JSON file must follow the following format:
Instead the actions array (or as well as, at the same level), you may add a components, viewers, libraries and applications arrays.
| CamiTKExtensionModel::CamiTKExtensionModel | ( | const QString & | filePath = QString() | ) |
constructor
References load().
| void CamiTKExtensionModel::clear | ( | ) |
reset the model from scratch (the model will then be empty)
Referenced by load().
| VariantDataModel & CamiTKExtensionModel::getModel | ( | ) |
get access to the VariantDataModel
Referenced by camitk::HotPlugActionExtension::declaredActionCount(), camitk::HotPlugActionExtension::HotPlugActionExtension(), camitk::CppHotPlugActionExtension::initActions(), camitk::HotPlugActionExtension::newHotPlugActionExtension(), and camitk::HotPlugExtensionManager::registerExtension().
| bool CamiTKExtensionModel::isModified | ( | ) |
was the data model modified since last read
| bool CamiTKExtensionModel::load | ( | const QString & | filePath | ) |
read the given file and creates the corresponding configuration
References clear().
Referenced by CamiTKExtensionModel(), and camitk::HotPlugActionExtension::newHotPlugActionExtension().
| bool CamiTKExtensionModel::save | ( | const QString & | filePath = QString() | ) |
save the current config to the current filePath or given filePath and update camitkFile if needed Warning it does overwrite the previous content of filePath
References toJSON().
| void CamiTKExtensionModel::setModel | ( | VariantDataModel & | newModel | ) |
modify the model
| QString CamiTKExtensionModel::toJSON | ( | ) |
the camitk extension data model as a JSON string
Referenced by save().