Computer Assited Medical Intervention Tool Kit  version 4.1
CepGenerator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
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 CEPGENERATOR_H
27 #define CEPGENERATOR_H
28 
29 // includes from STL (for Linux) for std::auto_ptr
30 #include <memory>
31 
32 // includes from Qt
33 #include <QDir>
34 #include <QString>
35 #include <QFileInfo>
36 #include <QVector>
37 
38 // Hide warning for Exception + declspec(nothrow)
39 #if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
40 #pragma warning( disable : 4290 )
41 #endif // MSVC only
42 
43 // Dependency from cepcoreschema
44 // Declaration here to avoid declaration in dependant projects.
45 namespace cepcoreschema {
46 class Cep;
47 }
48 
49 class ExtensionGenerator;
50 
62 class CepGenerator {
63 public :
64 
72  CepGenerator(QString xmlFilename, QString devDirectoryName);
73 
82  CepGenerator(std::unique_ptr<cepcoreschema::Cep> domCep, QString devDirectoryName);
83 
87  CepGenerator();
88 
89  ~CepGenerator();
90 
92  void process();
93 
95  virtual void setXmlFileName(QString xmlFileName);
96 
98  virtual void createDomTree();
99 
101  virtual void setDevDirectoryName(QString devDirectoryName);
102 
104  virtual void serializeManifest(QString fileName = "");
105 
106 protected:
107 
128  virtual void generateDirectoryTree();
129 
132  virtual void generateGlobalCMakeLists();
134 
136  virtual void generateCopyright();
137 
139  virtual void generateReadme();
140 
142  virtual void copyFindCamiTK();
143 
145  virtual void generateActionsDirectory();
146 
148  virtual void generateApplicationsDirectory();
149 
151  virtual void generateComponentsDirectory();
152 
154  virtual void generateLibrariesDirectory();
155 
157  virtual void setLicence();
163  virtual void createActionExtensionDoms();
164 
168  virtual void createComponentExtensionDoms();
169 
173  virtual void createLibrarieDoms();
174 
175  virtual void generateExtensions();
176 
177 private:
181  std::unique_ptr<cepcoreschema::Cep> domCep;
182 
184  QFileInfo xmlFileName;
185 
188 
191 
193  QVector<ExtensionGenerator*> extensions;
194 
196  QString licence;
197 
198 };
199 
200 #endif // CEPGENERATOR_H
QVector< ExtensionGenerator * > extensions
Action or Component Extensions.
Definition: CepGenerator.h:193
QString cepDirectoryName
Subdirectory where the CEP sources will be stored (updated when generating the directory tree) ...
Definition: CepGenerator.h:190
QString licence
overall licence of the CEP
Definition: CepGenerator.h:196
QFileInfo xmlFileName
Where to find the original XML description of the CEP.
Definition: CepGenerator.h:184
QDir devDirectoryName
Where to store the produced files.
Definition: CepGenerator.h:187
Definition: ActionExtensionGenerator.h:36
Common abstract class to generate extensions.
Definition: ExtensionGenerator.h:49
This class contains the entry points to generate CEP.
Definition: CepGenerator.h:62
std::unique_ptr< cepcoreschema::Cep > domCep
XML DOM Element create by CodeSynthesis This cep instance contains all of the informations of the xml...
Definition: CepGenerator.h:181