From: Leonardo Flórez-Valencia Date: Wed, 9 Nov 2016 22:58:45 +0000 (-0500) Subject: ... X-Git-Tag: v0.1~55 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=cpPlugins.git;a=commitdiff_plain;h=19cba47f3c180c79b04fb4db2784434bfe16d2b9 ... --- diff --git a/lib/cpPlugins/BaseObjects/Parameters.cxx b/lib/cpPlugins/BaseObjects/Parameters.cxx index b30b7d7..88a82af 100644 --- a/lib/cpPlugins/BaseObjects/Parameters.cxx +++ b/lib/cpPlugins/BaseObjects/Parameters.cxx @@ -188,6 +188,60 @@ ConfigureAsRealTypesChoices( const std::string& name ) this->ConfigureAsChoices( name, choices ); } +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +ConfigureAsIntTypesChoices( const std::string& name ) +{ + std::vector< std::string > choices; +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char + choices.push_back( "char" ); + choices.push_back( "uchar" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_char +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short + choices.push_back( "short" ); + choices.push_back( "ushort" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_short +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int + choices.push_back( "int" ); + choices.push_back( "uint" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_int +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long + choices.push_back( "long" ); + choices.push_back( "ulong" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_long +#ifdef cpPlugins_CONFIG_REAL_TYPES_float + choices.push_back( "float" ); +#endif // cpPlugins_CONFIG_REAL_TYPES_float +#ifdef cpPlugins_CONFIG_REAL_TYPES_double + choices.push_back( "double" ); +#endif // cpPlugins_CONFIG_REAL_TYPES_double + this->ConfigureAsChoices( name, choices ); +} + +// ------------------------------------------------------------------------- +void cpPlugins::BaseObjects::Parameters:: +ConfigureAsScalarTypesChoices( const std::string& name ) +{ + std::vector< std::string > choices; +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_char + choices.push_back( "char" ); + choices.push_back( "uchar" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_char +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_short + choices.push_back( "short" ); + choices.push_back( "ushort" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_short +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_int + choices.push_back( "int" ); + choices.push_back( "uint" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_int +#ifdef cpPlugins_CONFIG_INTEGER_TYPES_long + choices.push_back( "long" ); + choices.push_back( "ulong" ); +#endif // cpPlugins_CONFIG_INTEGER_TYPES_long + this->ConfigureAsChoices( name, choices ); +} + // ------------------------------------------------------------------------- std::vector< std::string > cpPlugins::BaseObjects::Parameters:: GetChoices( const std::string& name ) const diff --git a/lib/cpPlugins/BaseObjects/Parameters.h b/lib/cpPlugins/BaseObjects/Parameters.h index bd106e0..1890f23 100644 --- a/lib/cpPlugins/BaseObjects/Parameters.h +++ b/lib/cpPlugins/BaseObjects/Parameters.h @@ -153,6 +153,8 @@ namespace cpPlugins const std::string& name, const std::vector< std::string >& choices ); void ConfigureAsRealTypesChoices( const std::string& name ); + void ConfigureAsIntTypesChoices( const std::string& name ); + void ConfigureAsScalarTypesChoices( const std::string& name ); std::vector< std::string > GetChoices( const std::string& name ) const; std::string GetSelectedChoice( const std::string& name ) const; bool SetSelectedChoice(