Computer Assited Medical Intervention Tool Kit  version 4.0
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-2016 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 
80  CepGenerator(std::auto_ptr<cepcoreschema::Cep> domCep, QString devDirectoryName);
81 
82  ~CepGenerator();
83 
85  void process() throw (QString);
86 
87 protected:
88 
89 
91  virtual void setXmlFileName(QString xmlFileName) throw (QString);
92 
94  virtual void setDevDirectoryName(QString devDirectoryName) throw (QString);
95 
116  virtual void generateDirectoryTree() throw(QString);
117 
120  virtual void serializeManifest();
122 
124  virtual void generateGlobalCMakeLists();
125 
127  virtual void generateCopyright();
128 
130  virtual void generateReadme();
131 
133  virtual void copyFindCamiTK();
134 
136  virtual void generateActionsDirectory();
137 
139  virtual void generateApplicationsDirectory();
140 
142  virtual void generateComponentsDirectory();
143 
145  virtual void generateLibrariesDirectory();
146 
148  virtual void setLicence();
154  virtual void createActionExtensionDoms();
155 
159  virtual void createComponentExtensionDoms();
160 
164  virtual void createLibrarieDoms();
165 
166  virtual void generateExtensions();
167 
168 private:
169 
171  virtual void createDomTree() throw (QString);
172 
173 
174 
178  std::auto_ptr<cepcoreschema::Cep> domCep;
179 
181  QFileInfo xmlFileName;
182 
185 
188 
189 
191  QVector<ExtensionGenerator *> extensions;
192 
194 // QVector<ActionExtensionGenerator *> actionExtensions;
195 
197 // QVector<ComponentExtensionGenerator *> componentExtensions;
198 
199  QString licence;
200 
201 };
202 
203 #endif // CEPGENERATOR_H
QString cepDirectoryName
Subdirectory where the CEP sources will be stored (updated when generating the directory tree) ...
Definition: CepGenerator.h:187
QVector< ExtensionGenerator * > extensions
Action or Component Extensions.
Definition: CepGenerator.h:191
QString licence
Action Extensions.
Definition: CepGenerator.h:199
std::auto_ptr< cepcoreschema::Cep > domCep
XML DOM Element create by CodeSynthesis This cep instance contains all of the informations of the xml...
Definition: CepGenerator.h:178
QFileInfo xmlFileName
Where to find the original XML description of the CEP.
Definition: CepGenerator.h:181
QDir devDirectoryName
Where to store the produced files.
Definition: CepGenerator.h:184
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