Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, 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,
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
ParameterGenerator::type
ParameterTypeGenerator type
Definition: ParameterGenerator.h:87
ParameterGenerator::getPropertyQVariant
QString getPropertyQVariant() const
Definition: ParameterGenerator.cpp:186
ParameterGenerator::getDescription
QString getDescription() const
Definition: ParameterGenerator.cpp:344
ParameterGenerator::getTypeNames
static QMap< ParameterGenerator::ParameterTypeGenerator, QString > & getTypeNames()
Definition: ParameterGenerator.cpp:287
ParameterGenerator::QCOLOR
@ QCOLOR
Definition: ParameterGenerator.h:57
ParameterGenerator::ParameterTypeGenerator
ParameterTypeGenerator
Definition: ParameterGenerator.h:50
ParameterGenerator::QSTRING
@ QSTRING
Definition: ParameterGenerator.h:54
ParameterGenerator::QVECTOR4D
@ QVECTOR4D
Definition: ParameterGenerator.h:61
ParameterGenerator::name
QString name
Definition: ParameterGenerator.h:85
ParameterGenerator::UNKNOWN
@ UNKNOWN
Definition: ParameterGenerator.h:62
ParameterGenerator::QTIME
@ QTIME
Definition: ParameterGenerator.h:56
ParameterGenerator::getName
QString getName() const
Definition: ParameterGenerator.cpp:113
ParameterGenerator::editable
bool editable
Definition: ParameterGenerator.h:84
ParameterGenerator::ParameterGenerator
ParameterGenerator(cepcoreschema::Parameter &domParameter)
Definition: ParameterGenerator.cpp:43
ParameterGenerator::getUnit
QString getUnit() const
Definition: ParameterGenerator.cpp:348
ParameterGenerator::initNamesAndValues
static void initNamesAndValues()
Definition: ParameterGenerator.cpp:241
ParameterGenerator::getDefaultValue
QString getDefaultValue() const
Definition: ParameterGenerator.cpp:109
ParameterGenerator::getAdditionalInclude
QString getAdditionalInclude() const
Definition: ParameterGenerator.cpp:140
ParameterGenerator::getToString
QString getToString() const
Definition: ParameterGenerator.cpp:202
ParameterGenerator::QDATE
@ QDATE
Definition: ParameterGenerator.h:55
ParameterGenerator::getDefaultValues
static QMap< ParameterGenerator::ParameterTypeGenerator, QString > & getDefaultValues()
Definition: ParameterGenerator.cpp:293
ParameterGenerator::getQVariantConversion
QString getQVariantConversion() const
Definition: ParameterGenerator.cpp:168
ParameterGenerator::needsAdditionalInclude
bool needsAdditionalInclude() const
Definition: ParameterGenerator.cpp:125
ParameterGenerator::description
QString description
Definition: ParameterGenerator.h:88
ParameterGenerator::INT
@ INT
Definition: ParameterGenerator.h:51
ParameterGenerator::getTypeDefaultValue
static QString getTypeDefaultValue(QString typeName)
Definition: ParameterGenerator.cpp:299
ParameterGenerator
Generate parameters.
Definition: ParameterGenerator.h:48
description
const char * description
Definition: applications/cepgenerator/main.cpp:38
ParameterGenerator::getCppName
QString getCppName() const
create a name that can be used as C++ variable name (remove all white space)
Definition: ParameterGenerator.cpp:149
ParameterGenerator::getType
QString getType() const
Definition: ParameterGenerator.cpp:117
ParameterGenerator::isEditable
bool isEditable() const
Definition: ParameterGenerator.cpp:121
ParameterGenerator::unit
QString unit
Definition: ParameterGenerator.h:89
ParameterGenerator::QPOINTF
@ QPOINTF
Definition: ParameterGenerator.h:59
ParameterGenerator::defaultValue
QString defaultValue
Definition: ParameterGenerator.h:86
isInitialized
static bool isInitialized
Definition: ParameterGenerator.cpp:41
ParameterGenerator::QPOINT
@ QPOINT
Definition: ParameterGenerator.h:58
ParameterGenerator::QVECTOR3D
@ QVECTOR3D
Definition: ParameterGenerator.h:60
cepcoreschema
Definition: ActionExtensionGenerator.h:36
ParameterGenerator.h
ParameterGenerator::BOOLEAN
@ BOOLEAN
Definition: ParameterGenerator.h:53
ParameterGenerator::DOUBLE
@ DOUBLE
Definition: ParameterGenerator.h:52