Commit 9aa93534 authored by Victor Poughon's avatar Victor Poughon
Browse files

ENH: clarify ListView parameters documentation

parent cb168a3c
......@@ -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():
return "String"
else:
return "String List"
if app.GetParameterType(param) == otbApplication.ParameterType_Group:
return "Group"
if app.GetParameterType(param) == otbApplication.ParameterType_InputProcessXML:
......
......@@ -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();
......
......@@ -380,6 +380,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(std::string parameter);
/* Set an output image value
*
* Can be called for types :
......
......@@ -1416,6 +1416,22 @@ void Application::SetListViewSingleSelectionMode(std::string parameter, bool sta
}
bool Application::GetListViewSingleSelectionMode(std::string parameter)
{
Parameter* param = GetParameterByKey(parameter);
ListViewParameter* paramListView = dynamic_cast<ListViewParameter*>(param);
if (paramListView)
{
return paramListView->GetSingleSelection();
}
else
{
itkExceptionMacro(<<parameter << " parameter can't be casted to ListView");
return false;
}
}
void Application::SetParameterOutputImage(std::string parameter, FloatVectorImageType* value)
{
......
......@@ -261,6 +261,8 @@ public:
std::vector<std::string> GetParameterStringList(std::string parameter);
std::string GetParameterAsString(std::string paramKey);
bool GetListViewSingleSelectionMode(std::string paramKey);
ImageBaseType * GetParameterOutputImage(std::string parameter);
void SetParameterInputImage(std::string parameter, ImageBaseType * inputImage);
ImageBaseType * GetParameterComplexOutputImage(std::string parameter);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment