diff --git a/Code/Core/otbWrapperApplication.cxx b/Code/Core/otbWrapperApplication.cxx index bdd9348ff1e3d684b9b96b59b75a27c7ccc8bf45..e25b772e2277ac12b6af0ec394626402a67b1e18 100644 --- a/Code/Core/otbWrapperApplication.cxx +++ b/Code/Core/otbWrapperApplication.cxx @@ -158,7 +158,11 @@ ParameterType Application::GetParameterType(std::string paramKey) const const Parameter* param = GetParameterByKey(paramKey); ParameterType type; - if (dynamic_cast<const IntParameter*>(param)) + if (dynamic_cast<const ChoiceParameter*>(param)) + { + type = ParameterType_Choice; + } + else if (dynamic_cast<const IntParameter*>(param)) { type = ParameterType_Int; } @@ -325,6 +329,18 @@ void Application::SetParameterOutputVectorData(std::string parameter, VectorData } } +std::string Application::GetParameterName(std::string parameter) +{ + Parameter* param = GetParameterByKey(parameter); + return param->GetName(); +} + +std::string Application::GetParameterDescription(std::string parameter) +{ + Parameter* param = GetParameterByKey(parameter); + return param->GetDescription(); +} + int Application::GetParameterInt(std::string parameter) { int ret = 0; diff --git a/Code/Core/otbWrapperApplication.h b/Code/Core/otbWrapperApplication.h index 6e469079dfd7865abb8aecf26c15d25df48c2aa1..e23bff45b270df99b7416eec0da75ff2b02b3e2e 100644 --- a/Code/Core/otbWrapperApplication.h +++ b/Code/Core/otbWrapperApplication.h @@ -101,6 +101,12 @@ public: * WARNING: this method may disappear from the API */ const Parameter* GetParameterByKey(std::string parameter) const; + /* Returns the description of a parameter */ + std::string GetParameterName(std::string paramKey); + + /* Returns the description of a parameter */ + std::string GetParameterDescription(std::string paramKey); + /* Enable the use of an optional parameter. Returns the previous state */ void EnableParameter(std::string paramKey); diff --git a/Code/Wrappers/SWIG/otbApplication.i b/Code/Wrappers/SWIG/otbApplication.i index dde9e6f7e860fbcb3def7bbb381571754f4dd326..4f61f03b12a907b035154957b85774298b0463f6 100644 --- a/Code/Wrappers/SWIG/otbApplication.i +++ b/Code/Wrappers/SWIG/otbApplication.i @@ -124,6 +124,8 @@ public: // Parameter* GetParameterByKey(std::string parameter); // const Parameter* GetParameterByKey(std::string parameter) const; std::list<std::string> GetParametersKeys(); + std::string GetParameterName(std::string); + std::string GetParameterDescription(std::string); void EnableParameter(std::string paramKey); void DisableParameter(std::string paramKey);