Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
PersistenceManager.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
26#ifndef PERSISTENCE_MANAGER_H
27#define PERSISTENCE_MANAGER_H
28
29#include <QString>
30template<class T> class QList;
31class QVariant;
32class QObject;
33class QUuid;
34class QDir;
35
36namespace camitk {
37
38class Component;
39class CamiTKFile;
40
41class PersistenceManager {
42
43public:
44
50 static bool saveWorkspace(QString filepath);
51
58 static bool loadWorkspace(QString filepath);
59
88 static void updateVariantValueWhilePreservingType(QVariant& variant, QVariant& newValue, QString name = "");
89
97 static QVariant fromProperties(const QObject*);
98
106 static void loadProperties(QObject*, QVariant);
107
116 static QUuid getUuidFromProperties(const QObject*);
117
128 static bool setUuidInProperties(QObject*, QUuid);
129
130protected:
131
140 static QVariant fromComponents(QList<Component*>, QDir rootPath);
141
145 static bool loadComponents(QVariant, QDir rootPath);
146
166 static QString variantToString(const QVariant& variant);
167
181 static QVariant stringToVariant(QString value);
182};
183
184} // namespace
185
186#endif //PERSISTENCE_MANAGER_H
187
A component is something that composed something and could also be a part of something.
Definition modeling/libraries/pml/Component.h:48
Definition PersistenceManager.h:30
Definition Action.cpp:40