Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CamiTKExtensionModel.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25#ifndef __CAMITK_EXTENSION_MODEL__
26#define __CAMITK_EXTENSION_MODEL__
27
28#include <QJsonArray>
29#include <QJsonObject>
30#include <QFile>
31
32#include <VariantDataModel.h>
33
68
69public:
71 CamiTKExtensionModel(const QString& filePath = QString());
72
74 void clear();
75
77 bool load(const QString& filePath);
78
83 bool save(const QString& filePath = QString());
84
86 bool isModified();
87
89 QString toJSON();
90
93
96
113 void resetModel(QString name);
114
115private:
117 VariantDataModel extensions;
118};
119
120#endif // __CAMITK_EXTENSION_MODEL__
This class manages a CamiTK Extension model (stored as a VariantDataModel).
Definition CamiTKExtensionModel.h:67
bool load(const QString &filePath)
read the given file and creates the corresponding configuration
Definition CamiTKExtensionModel.cpp:96
bool save(const QString &filePath=QString())
save the current config to the current filePath or given filePath and update camitkFile if needed War...
Definition CamiTKExtensionModel.cpp:165
bool isModified()
was the data model modified since last read
Definition CamiTKExtensionModel.cpp:91
void resetModel(QString name)
reset the model with empty extension arrays.
Definition CamiTKExtensionModel.cpp:74
void clear()
reset the model from scratch (the model will then be empty)
Definition CamiTKExtensionModel.cpp:44
void setModel(VariantDataModel &)
modify the model
Definition CamiTKExtensionModel.cpp:55
VariantDataModel & getModel()
get access to the VariantDataModel
Definition CamiTKExtensionModel.cpp:50
QString toJSON()
the camitk extension data model as a JSON string
Definition CamiTKExtensionModel.cpp:60
VariantDataModel encapsulates QVariant and can be used as a model for any type of QVariant supported ...
Definition VariantDataModel.h:124