Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
extensiongenerator/ExtensionGenerator.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 __EXTENSION_GENERATOR__
26#define __EXTENSION_GENERATOR__
27
28#include <QString>
29#include <QJsonArray>
30#include <QDir>
32#include "TransformEngine.h"
33
51
52public:
56 ExtensionGenerator(const QString& camitkFilePath, const QString& outputDirectoryName);
57
58 virtual ~ExtensionGenerator() = default;
59
64 bool generate();
65
66private:
68 QDir outputDir;
69
71 CamiTKExtensionModel camitkExtensionModel;
72
74 QString camitkFilePath;
75
77 TransformEngine transformEngine;
78
80 bool success;
81
82 // Accumulate messages in these list, print them to std::out only at the end of generate()
83 QStringList statusMessage;
84 QStringList warningMessage;
85
89 QString fileToString(const QString& filename);
90
92 bool createOutputDirectoryIfNeeded(const QString& dirPath);
93
95 void generateActionExtension();
96
99 void generateCppHotPlugActionExtension();
100
102 void generateCppStandardUserActionExtension();
103
105 void generateCppStandardWrapperActionExtension();
106
108 void generatePythonActionExtension();
109
111 bool isCpp();
112
115 void updateExtensionModel();
116
119 void inheritFromExtension(const QString type);
120
122
123};
124
125#endif // __EXTENSION_GENERATOR__
This class manages a CamiTK Extension model (stored as a VariantDataModel).
Definition CamiTKExtensionModel.h:67
Common abstract class to generate extensions.
Definition cepgenerator/ExtensionGenerator.h:49
virtual ~ExtensionGenerator()=default
bool generate()
call all methods to generate the source code Also generate CMake files and user action classes if the...
Definition extensiongenerator/ExtensionGenerator.cpp:43
Utility class to transform strings depending on json object values.
Definition TransformEngine.h:220