This class manages a CamiTK Extension model (stored as a VariantDataModel). More...
#include <CamiTKExtensionModel.h>
Collaboration diagram for CamiTKExtensionModel: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 | |
| void | resetModel (QString name) |
| reset the model with empty extension arrays. | |
| 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() | ) |
| void CamiTKExtensionModel::clear | ( | ) |
reset the model from scratch (the model will then be empty)
Referenced by CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter(), and load().
Here is the caller graph for this function:| VariantDataModel & CamiTKExtensionModel::getModel | ( | ) |
get access to the VariantDataModel
Referenced by CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter(), camitk::HotPlugActionExtension::declaredActionCount(), ExtensionGenerator::generate(), CamiTKExtensionModelPresenter::getExtensionName(), camitk::HotPlugActionExtension::HotPlugActionExtension(), camitk::CppHotPlugActionExtension::initActions(), CamiTKExtensionModelPresenter::isHotPlug(), CamiTKExtensionModelPresenter::isPython(), camitk::HotPlugActionExtension::newHotPlugActionExtension(), CamiTKExtensionModelPresenter::plusButtonClicked(), and camitk::HotPlugExtensionManager::registerExtension().
Here is the caller graph for this function:| bool CamiTKExtensionModel::isModified | ( | ) |
was the data model modified since last read
References VariantDataModel::isModified().
Referenced by CamiTKExtensionModelPresenter::isModified().
Here is the call graph for this function:
Here is the caller graph for this function:| bool CamiTKExtensionModel::load | ( | const QString & | filePath | ) |
read the given file and creates the corresponding configuration
References clear(), and VariantDataModel::contains().
Referenced by CamiTKExtensionModel(), CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter(), ExtensionBuilder::ExtensionBuilder(), ExtensionGenerator::ExtensionGenerator(), and camitk::HotPlugActionExtension::newHotPlugActionExtension().
Here is the call graph for this function:
Here is the caller graph for this function:| void CamiTKExtensionModel::resetModel | ( | QString | name | ) |
reset the model with empty extension arrays.
After calling this method, all the extension type arrays are empty and the licence is set to LGPL-3 CamiTK:
References VariantDataModel::insert().
Referenced by CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter().
Here is the call graph for this function:
Here is the caller graph for this function:| 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 VariantDataModel::reset(), and toJSON().
Referenced by CamiTKExtensionModelPresenter::saveExtensionFile().
Here is the call graph for this function:
Here is the caller graph for this function:| void CamiTKExtensionModel::setModel | ( | VariantDataModel & | newModel | ) |
modify the model
| QString CamiTKExtensionModel::toJSON | ( | ) |
the camitk extension data model as a JSON string
References VariantDataModel::getValue().
Referenced by CamiTKExtensionModelPresenter::CamiTKExtensionModelPresenter(), CamiTKExtensionModelPresenter::modelUpdated(), and save().
Here is the call graph for this function:
Here is the caller graph for this function: