Skip to content
Snippets Groups Projects
Commit fdedcea1 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

Merge branch 'mvd-november-sprint' into develop

parents 2a9713a0 ebdf33cd
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ private:
// Doc example parameter settings
SetDocExampleParameterValue("il", "verySmallFSATSW_r.tif verySmallFSATSW_nir.tif verySmallFSATSW.tif");
SetDocExampleParameterValue("out", "apTvUtBandMathOutput.tif");
SetDocExampleParameterValue("exp", "\"cos(im1b1) > cos(im2b1) ? im3b1 : im3b2 \"");
SetDocExampleParameterValue("exp", "\"cos(im1b1) > cos(im2b1) ? im3b1 : im3b2\"");
}
void DoUpdateParameters() ITK_OVERRIDE
......
......@@ -25,7 +25,7 @@ namespace otb
namespace Wrapper
{
#define otbDocHtmlTitleMacro( value ) \
#define otbDocHtmlTitleMacro( value ) \
oss << "</style></head><body style=\" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;\"><p align=\"center\" style=\" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:x-large; font-weight:600;\"><span style=\" font-size:x-large;\">"; \
oss << value; \
oss << "</span></p>";
......@@ -40,29 +40,36 @@ namespace Wrapper
oss << value; \
oss << "</span></p>";
#define otbDocHtmlBodyMacro( value ) \
#define otbDocHtmlBodyMacro( value ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">"; \
oss << value; \
oss << "</p>";
#define otbDocHtmlBodyCodeMacro( value ) \
#define otbDocHtmlBodyCodeMacro( value ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Courier New, courier';\">"; \
oss << value; \
oss << "</p>";
#define otbDocHtmlParamMacro( type, param, showKey ) \
#define otbDocHtmlParamMacro( type, param, fullKey, showKey ) \
oss << "<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-family:'Courier New, courier'; font-weight:600;\"; >"; \
oss << "["<<type<<"] "<< param->GetName(); \
oss << param->GetName(); \
if( showKey == true && !std::string(param->GetKey()).empty() ) \
{ \
oss << " (-"<< param->GetKey()<<")"; \
} \
if (fullKey != "") \
{ \
oss << " ("<< fullKey<< "." << param->GetKey() << ")"; \
} \
else \
{ \
oss << " ("<< param->GetKey()<<")"; \
} \
} \
oss << ": </span>"; \
if( std::string(param->GetDescription()).size()!=0 ) \
{ \
oss << param->GetDescription(); \
} \
oss << "</p>";
if( std::string(param->GetDescription()).size()!=0 ) \
{ \
oss << param->GetDescription(); \
} \
oss << "</p>";
ApplicationHtmlDocGenerator::ApplicationHtmlDocGenerator()
......@@ -141,7 +148,7 @@ ApplicationHtmlDocGenerator::GenerateDoc( const Application::Pointer app, std::s
val = oss.str();
// Replace "\n" string with <br/>
// Replace "\n" string with <br/>
itksys::SystemTools::ReplaceString( val, "\n", "<br/>");
}
......@@ -175,38 +182,38 @@ void ApplicationHtmlDocGenerator::GetDocParameters( const Application::Pointer a
}
else
{
for( unsigned int i=0; i<nbOfParam; i++ )
{
const std::string key(appKeyList[i]);
Parameter::Pointer param = app->GetParameterByKey( key );
if( app->GetParameterType(key) == ParameterType_Group)
{
oss << "<li>";
otbDocHtmlParamMacro( "group", param, showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, key, showKey );
oss<<grDoc;
oss<<"</li><br />";
}
else if( app->GetParameterType(key) == ParameterType_Choice )
{
oss << "<li>";
otbDocHtmlParamMacro( "choice", param, showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterChoice(app, grDoc, key, showKey);
oss<<grDoc;
oss<<"</li><br />";
}
else
{
oss << "<li>";
otbDocHtmlParamMacro("param", param, showKey );
oss << "</li>";
}
}
for( unsigned int i=0; i<nbOfParam; i++ )
{
const std::string key(appKeyList[i]);
Parameter::Pointer param = app->GetParameterByKey( key );
if( app->GetParameterType(key) == ParameterType_Group)
{
oss << "<li>";
otbDocHtmlParamMacro( "group", param, "", showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, key, showKey );
oss<<grDoc;
oss<<"</li><br />";
}
else if( app->GetParameterType(key) == ParameterType_Choice )
{
oss << "<li>";
otbDocHtmlParamMacro( "choice", param, "", showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterChoice(app, grDoc, key, showKey);
oss<<grDoc;
oss<<"</li><br />";
}
else
{
oss << "<li>";
otbDocHtmlParamMacro("param", param, "", showKey );
oss << "</li>";
}
}
}
val = oss.str();
val = oss.str();
}
void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Pointer app, std::string & val, const std::string & key, const bool showKey )
......@@ -230,7 +237,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
if( app->GetParameterType(fullKey) == ParameterType_Group)
{
oss<<"<li>";
otbDocHtmlParamMacro( "group", param, showKey );
otbDocHtmlParamMacro( "group", param, "", showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, fullKey, showKey );
oss<<grDoc;
......@@ -239,7 +246,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
else if( app->GetParameterType(fullKey) == ParameterType_Choice )
{
oss<<"<li>";
otbDocHtmlParamMacro( "choice", param, showKey );
otbDocHtmlParamMacro( "choice", param, key, showKey );
std::string grDoc;
ApplicationHtmlDocGenerator::GetDocParameterChoice(app, grDoc, fullKey, showKey );
oss<<grDoc;
......@@ -248,7 +255,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterGroup( const Application::Point
else
{
oss << "<li>";
otbDocHtmlParamMacro( "param", param, showKey );
otbDocHtmlParamMacro( "param", param, key, showKey );
oss <<"</li>";
}
}
......@@ -277,7 +284,7 @@ void ApplicationHtmlDocGenerator::GetDocParameterChoice( const Application::Poin
std::string grDoc;
oss << "<li>";
otbDocHtmlParamMacro( "group", group, showKey );
otbDocHtmlParamMacro( "group", group, "", showKey );
ApplicationHtmlDocGenerator::GetDocParameterGroup( app, grDoc, fullKey, showKey );
oss<<grDoc;
oss<<"</li>";
......@@ -287,5 +294,5 @@ void ApplicationHtmlDocGenerator::GetDocParameterChoice( const Application::Poin
}
}
}
}
......@@ -40,7 +40,8 @@ ChoiceParameter::AddChoice( std::string choicekey, std::string choiceName )
choice.m_AssociatedParameter = ParameterGroup::New();
choice.m_AssociatedParameter->SetName(choiceName);
choice.m_AssociatedParameter->SetRoot(this);
choice.m_AssociatedParameter->SetKey(choicekey);
m_ChoiceList.push_back(choice);
// check if the new choice matches the m_CurrentChoice : if so the group should be active.
......
......@@ -160,7 +160,7 @@ QWidget* QtWidgetView::CreateDoc()
QTextDocument * doc = new QTextDocument();
std::string docContain;
ApplicationHtmlDocGenerator::GenerateDoc( m_Application, docContain);
ApplicationHtmlDocGenerator::GenerateDoc( m_Application, docContain, true);
doc->setHtml(docContain.c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment