diff --git a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py index 7f0606992f8e5c461a1b53d6f1e4460f88141125..2d894a7ba97e611a58a78d1102bbd437ce596f2f 100755 --- a/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py +++ b/Documentation/Cookbook/Scripts/otbGenerateWrappersRstDoc.py @@ -133,7 +133,10 @@ def GenerateParameterType(app,param): if app.GetParameterType(param) == otbApplication.ParameterType_InputFilenameList : return "Input File name list" if app.GetParameterType(param) == otbApplication.ParameterType_ListView: - return "List" + if app.GetListViewSingleSelectionMode(param): + return "String" + else: + return "String List" if app.GetParameterType(param) == otbApplication.ParameterType_Group: return "Group" if app.GetParameterType(param) == otbApplication.ParameterType_InputProcessXML: diff --git a/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx b/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx index bd7f51f59c48f7d28cd9d1928b85bbfbef754d51..751cba5c08ad7c1b8f590d69fc256fd16ae3f5c9 100644 --- a/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx +++ b/Modules/Applications/AppClassification/app/otbPolygonClassStatistics.cxx @@ -121,7 +121,7 @@ private: // Doc example parameter settings SetDocExampleParameterValue("in", "support_image.tif"); SetDocExampleParameterValue("vec", "variousVectors.sqlite"); - SetDocExampleParameterValue("field", "label"); + SetDocExampleParameterValue("field", "CLASS"); SetDocExampleParameterValue("out","polygonStat.xml"); SetOfficialDocLink(); diff --git a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h index 92c4fed306daa0c796be5bb64dfdfa47168a9860..37646aaeaa421dc0b680fcde8db8e77418af8feb 100644 --- a/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h +++ b/Modules/Wrappers/ApplicationEngine/include/otbWrapperApplication.h @@ -384,6 +384,14 @@ public: */ void SetListViewSingleSelectionMode(std::string parameter, bool status); + /** + * True if the parameter is a list view and is in single selection mode + * + * Can be called for types: + * \li ParameterType_ListView + */ + bool GetListViewSingleSelectionMode(const std::string& parameter); + /* Set an output image value * * Can be called for types : diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 46635f7954c0fe78586d113e16755e2d540f8cbe..9f820a3e8f6382dc267c72f1d1b52e85ab911e9c 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -1422,6 +1422,21 @@ void Application::SetListViewSingleSelectionMode(std::string parameter, bool sta } +bool Application::GetListViewSingleSelectionMode(const std::string& parameter) +{ + Parameter* param = GetParameterByKey(parameter); + + ListViewParameter* paramListView = dynamic_cast(param); + if (paramListView) + { + return paramListView->GetSingleSelection(); + } + else + { + itkExceptionMacro(< GetParameterStringList(std::string parameter); std::string GetParameterAsString(std::string paramKey); + bool GetListViewSingleSelectionMode(const std::string& paramKey); + ImageBaseType * GetParameterOutputImage(std::string parameter); void SetParameterInputImage(std::string parameter, ImageBaseType * inputImage); ImageBaseType * GetParameterComplexOutputImage(std::string parameter);