Computer Assisted Medical Intervention Tool Kit  version 5.2
ParameterGenerator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 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 PARAMETERGENERATOR_H
26 #define PARAMETERGENERATOR_H
27 
28 #if defined(_WIN32) && !defined(__MINGW32__) // MSVC only
29 #pragma warning( disable : 4290 )
30 #endif // MSVC only
31 
32 
33 // includes from Qt
34 #include <QString>
35 #include <QMap>
36 
37 namespace cepcoreschema {
38 class Parameter;
39 }
40 
49 public:
50  typedef enum {
51  INT,
62  UNKNOWN
64 
65  ParameterGenerator(cepcoreschema::Parameter& domParameter);
66 
67  QString getDefaultValue() const;
68  QString getName() const;
70  QString getCppName() const;
71  QString getType() const;
72  bool isEditable() const;
73  bool needsAdditionalInclude() const;
74  QString getAdditionalInclude() const;
75  QString getQVariantConversion() const;
76  QString getPropertyQVariant() const;
77  QString getToString() const;
78  QString getDescription() const;
79  QString getUnit() const;
80 
81  static QString getTypeDefaultValue(QString typeName);
82 
83 private:
84  bool editable;
85  QString name;
86  QString defaultValue;
88  QString description;
89  QString unit;
90 
91  static QMap<ParameterGenerator::ParameterTypeGenerator, QString>& getTypeNames();
92  static QMap<ParameterGenerator::ParameterTypeGenerator, QString>& getDefaultValues();
93 
94  static void initNamesAndValues();
95 };
96 
97 #endif
Generate parameters.
Definition: ParameterGenerator.h:48
bool isEditable() const
Definition: ParameterGenerator.cpp:121
QString getPropertyQVariant() const
Definition: ParameterGenerator.cpp:186
QString getAdditionalInclude() const
Definition: ParameterGenerator.cpp:140
QString getQVariantConversion() const
Definition: ParameterGenerator.cpp:168
ParameterTypeGenerator
Definition: ParameterGenerator.h:50
@ UNKNOWN
Definition: ParameterGenerator.h:62
@ QTIME
Definition: ParameterGenerator.h:56
@ QVECTOR4D
Definition: ParameterGenerator.h:61
@ QCOLOR
Definition: ParameterGenerator.h:57
@ DOUBLE
Definition: ParameterGenerator.h:52
@ BOOLEAN
Definition: ParameterGenerator.h:53
@ QSTRING
Definition: ParameterGenerator.h:54
@ INT
Definition: ParameterGenerator.h:51
@ QPOINTF
Definition: ParameterGenerator.h:59
@ QVECTOR3D
Definition: ParameterGenerator.h:60
@ QDATE
Definition: ParameterGenerator.h:55
@ QPOINT
Definition: ParameterGenerator.h:58
QString getToString() const
Definition: ParameterGenerator.cpp:202
ParameterGenerator(cepcoreschema::Parameter &domParameter)
Definition: ParameterGenerator.cpp:43
QString getUnit() const
Definition: ParameterGenerator.cpp:348
QString getType() const
Definition: ParameterGenerator.cpp:117
QString getDefaultValue() const
Definition: ParameterGenerator.cpp:109
QString getCppName() const
create a name that can be used as C++ variable name (remove all white space)
Definition: ParameterGenerator.cpp:149
QString getDescription() const
Definition: ParameterGenerator.cpp:344
bool needsAdditionalInclude() const
Definition: ParameterGenerator.cpp:125
static QString getTypeDefaultValue(QString typeName)
Definition: ParameterGenerator.cpp:299
QString getName() const
Definition: ParameterGenerator.cpp:113
Definition: ActionExtensionGenerator.h:36