diff --git a/Applications/RadiometricIndices/otbRadiometricVegetationIndices.cxx b/Applications/RadiometricIndices/otbRadiometricVegetationIndices.cxx index 921952c86ad399dc60587238de26b99d164fe5f1..ec770201736f1ee988371b515561d7709b33d89e 100644 --- a/Applications/RadiometricIndices/otbRadiometricVegetationIndices.cxx +++ b/Applications/RadiometricIndices/otbRadiometricVegetationIndices.cxx @@ -109,12 +109,16 @@ private: SetParameterDescription("out", "Radiometric indices output image"); AddParameter(ParameterType_Group, "channels", "Channels selection"); + SetParameterDescription("channels", "Channels selection"); AddParameter(ParameterType_Int, "channels.red", "Red Channel"); + SetParameterDescription("channels.red", "Red channel index"); SetParameterInt("channels.red", 3); AddParameter(ParameterType_Int, "channels.nir", "NIR Channel"); + SetParameterDescription("channels.nir", "NIR channel index"); SetParameterInt("channels.nir", 4); AddParameter(ParameterType_Group, "index", "Indices selection"); + SetParameterDescription("index", "List of available radiometric indices"); AddParameter(ParameterType_Empty, "index.ndvi", "NDVI"); MandatoryOff("index.ndvi"); SetParameterDescription("index.ndvi", "Normalized Difference Vegetation Index"); diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx index f54786e8261f9f2cf977a06a6846d1b5493a4922..6248bfecd1e7256fd58e233813fca1283e8a6ca5 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx @@ -187,19 +187,17 @@ void QtWidgetView::SetDocParameters( std::string & val ) // Check if mandatory parameter are present and have value if( param->GetMandatory() == true ) { - if( m_Application->GetParameterType(appKeyList[i]) != ParameterType_Group && param->IsRoot() ) + if( m_Application->GetParameterType(appKeyList[i]) != ParameterType_Group ) { oss << "<i>" << param->GetName() << ":</i><br />"; oss << param->GetDescription()<< "<br />"; oss << "<br />"; } - else if( m_Application->GetParameterType(appKeyList[i]) == ParameterType_Group ) + else { - oss << param->GetName()<<"<br />"; - oss << param->GetDescription()<<"<br />"; - oss << "Parameters:<<br />"; + oss << "<b><i>=== "<<param->GetName()<<"</i></b> ("<<param->GetDescription()<<")<br />"; std::string grDoc; - GetDocParameterGroup( grDoc, appKeyList[i]); + GetDocParameterGroup( grDoc, appKeyList[i], 1); oss<<grDoc; } } @@ -215,7 +213,7 @@ void QtWidgetView::SetDocParameters( std::string & val ) // Check if mandatory parameter are present and have value if( param->GetMandatory() == false ) { - if( m_Application->GetParameterType(appKeyList[i]) != ParameterType_Group && param->IsRoot() ) + if( m_Application->GetParameterType(appKeyList[i]) ) { oss << "<i>" << param->GetName() << ":</i><br />"; oss << param->GetDescription()<< "<br />"; @@ -223,11 +221,11 @@ void QtWidgetView::SetDocParameters( std::string & val ) found = true; } - else if( m_Application->GetParameterType(appKeyList[i]) == ParameterType_Group ) + else { - oss << "<b><i>"<<param->GetName()<<"</b></i> ("<<param->GetDescription()<<"):<br />"; + oss << "<b><i>=== "<<param->GetName()<<"</i></b> ("<<param->GetDescription()<<"):<br />"; std::string grDoc; - GetDocParameterGroup( grDoc, appKeyList[i]); + GetDocParameterGroup( grDoc, appKeyList[i], 1); oss<<grDoc; found = true; @@ -241,8 +239,19 @@ void QtWidgetView::SetDocParameters( std::string & val ) val.append(oss.str()); } -void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string & key ) +void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string & key, int level ) { + std::string spaces0, equal0; + for(unsigned int i=0; i<level; i++) + { + spaces0.append("   "); + equal0.append("==="); + } + std::string spaces1(space0); + spaces1.append("   "); + std::string equal1(equal0); + equal1.append("==="); + Parameter * paramGr = m_Application->GetParameterByKey( key ); if( !dynamic_cast<ParameterGroup *>(paramGr) ) { @@ -261,11 +270,11 @@ void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string & { oss << "<i>" << param->GetName()<< ":</i><br />"; oss << param->GetDescription()<<"<br>"; - //oss << "<br />"; + oss << "<br />"; } else { - oss << "<b><i>"<<param->GetName()<<"</b></i> ("<<param->GetDescription()<<"):<br />"; + oss << "<b><i>"<<param->GetName()<<"</i></b> ("<<param->GetDescription()<<")<br />"; std::string grDoc; GetDocParameterGroup( grDoc, fullKey); oss<<grDoc; diff --git a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h index 5342e0d4293b259ff43c8fccdccbdb6ac16e8f8f..a84986c394d974c21e43f787f5df0550735e12c3 100644 --- a/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h +++ b/Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h @@ -66,7 +66,7 @@ private: void SetDocParameters( std::string & val ); /** generate the documentation associated to a group.*/ - void GetDocParameterGroup( std::string & val, const std::string & key); + void GetDocParameterGroup( std::string & val, const std::string & key, int level); Application::Pointer m_Application;