Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
0ec56b54
Commit
0ec56b54
authored
13 years ago
by
Cyrille Valladeau
Browse files
Options
Downloads
Patches
Plain Diff
Supress mandatory/optionnal parameter distinction
parent
b97e3491
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
+31
-48
31 additions, 48 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
+3
-3
3 additions, 3 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
with
34 additions
and
51 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
+
31
−
48
View file @
0ec56b54
...
...
@@ -191,35 +191,21 @@ QWidget* QtWidgetView::CreateDoc()
void
QtWidgetView
::
SetDocParameters
(
std
::
string
&
val
)
{
const
std
::
vector
<
std
::
string
>
appKeyList
=
m_Application
->
GetParametersKeys
(
false
);
//const unsigned int nbOfParam = appKeyList.size();
itk
::
OStringStream
oss
;
// Mandatory parameters
oss
<<
"<h3>Mandatory parameters</h3>"
;
oss
<<
"<h3>Parameters</h3>"
;
oss
<<
"<ul>"
;
std
::
string
paramDocs
(
""
);
this
->
GetDocParameters
(
paramDocs
,
true
);
this
->
GetDocParameters
(
paramDocs
);
oss
<<
paramDocs
;
oss
<<
"</ul>"
;
paramDocs
=
""
;
// Optional parameters
oss
<<
"<h3>Optional parameters</h3>"
;
oss
<<
"<ul>"
;
this
->
GetDocParameters
(
paramDocs
,
false
);
oss
<<
paramDocs
;
oss
<<
"</ul>"
;
val
.
append
(
oss
.
str
());
}
void
QtWidgetView
::
GetDocParameters
(
std
::
string
&
val
,
bool
mandatory
)
void
QtWidgetView
::
GetDocParameters
(
std
::
string
&
val
)
{
itk
::
OStringStream
oss
;
const
std
::
vector
<
std
::
string
>
appKeyList
=
m_Application
->
GetParametersKeys
(
false
);
...
...
@@ -230,37 +216,34 @@ void QtWidgetView::GetDocParameters( std::string & val, bool mandatory)
{
const
std
::
string
key
(
appKeyList
[
i
]);
Parameter
::
Pointer
param
=
m_Application
->
GetParameterByKey
(
key
);
if
(
param
->
GetMandatory
()
==
mandatory
)
if
(
m_Application
->
GetParameterType
(
key
)
==
ParameterType_Group
)
{
if
(
m_Application
->
GetParameterType
(
key
)
==
ParameterType_Group
)
oss
<<
"<li><b>[group] "
<<
param
->
GetName
()
<<
": </b>"
;
if
(
std
::
string
(
param
->
GetDescription
()).
size
()
!=
0
)
{
oss
<<
"<li><b>[group] "
<<
param
->
GetName
()
<<
": </b>"
;
if
(
std
::
string
(
param
->
GetDescription
()).
size
()
!=
0
)
{
oss
<<
param
->
GetDescription
();
}
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
key
,
1
);
oss
<<
grDoc
;
oss
<<
"</li><br />"
;
oss
<<
param
->
GetDescription
();
}
else
if
(
m_Application
->
GetParameterType
(
key
)
==
ParameterType_Choice
)
{
oss
<<
"<li><b> [choice] "
<<
param
->
GetName
()
<<
": </b>"
;
if
(
std
::
string
(
param
->
GetDescription
()).
size
()
!=
0
)
{
oss
<<
param
->
GetDescription
();
}
std
::
string
grDoc
;
GetDocParameterChoice
(
grDoc
,
key
,
1
);
oss
<<
grDoc
;
oss
<<
"</li><br />"
;
}
else
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
key
);
oss
<<
grDoc
;
oss
<<
"</li><br />"
;
}
else
if
(
m_Application
->
GetParameterType
(
key
)
==
ParameterType_Choice
)
{
oss
<<
"<li><b> [choice] "
<<
param
->
GetName
()
<<
": </b>"
;
if
(
std
::
string
(
param
->
GetDescription
()).
size
()
!=
0
)
{
oss
<<
"<li><b><code>[param] "
<<
param
->
GetName
()
<<
": </code></b>"
;
oss
<<
param
->
GetDescription
()
<<
"</li>"
;
oss
<<
param
->
GetDescription
();
}
std
::
string
grDoc
;
GetDocParameterChoice
(
grDoc
,
key
);
oss
<<
grDoc
;
oss
<<
"</li><br />"
;
}
else
{
oss
<<
"<li><b><code>[param] "
<<
param
->
GetName
()
<<
": </code></b>"
;
oss
<<
param
->
GetDescription
()
<<
"</li>"
;
}
}
...
...
@@ -271,7 +254,7 @@ void QtWidgetView::GetDocParameters( std::string & val, bool mandatory)
}
void
QtWidgetView
::
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
)
void
QtWidgetView
::
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
)
{
Parameter
*
paramGr
=
m_Application
->
GetParameterByKey
(
key
);
if
(
!
dynamic_cast
<
ParameterGroup
*>
(
paramGr
))
...
...
@@ -295,7 +278,7 @@ void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string &
oss
<<
param
->
GetDescription
();
}
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
fullKey
,
level
+
1
);
GetDocParameterGroup
(
grDoc
,
fullKey
);
oss
<<
grDoc
;
oss
<<
"</li>"
;
}
...
...
@@ -307,7 +290,7 @@ void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string &
oss
<<
param
->
GetDescription
();
}
std
::
string
grDoc
;
GetDocParameterChoice
(
grDoc
,
fullKey
,
level
+
1
);
GetDocParameterChoice
(
grDoc
,
fullKey
);
oss
<<
grDoc
;
oss
<<
"</li>"
;
}
...
...
@@ -322,7 +305,7 @@ void QtWidgetView::GetDocParameterGroup( std::string & val, const std::string &
}
void
QtWidgetView
::
GetDocParameterChoice
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
)
void
QtWidgetView
::
GetDocParameterChoice
(
std
::
string
&
val
,
const
std
::
string
&
key
)
{
Parameter
*
paramCh
=
m_Application
->
GetParameterByKey
(
key
);
if
(
!
dynamic_cast
<
ChoiceParameter
*>
(
paramCh
))
...
...
@@ -346,7 +329,7 @@ void QtWidgetView::GetDocParameterChoice( std::string & val, const std::string &
oss
<<
group
->
GetDescription
();
}
GetDocParameterGroup
(
grDoc
,
fullKey
,
level
+
1
);
GetDocParameterGroup
(
grDoc
,
fullKey
);
oss
<<
grDoc
;
oss
<<
"</li>"
;
}
...
...
This diff is collapsed.
Click to expand it.
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
+
3
−
3
View file @
0ec56b54
...
...
@@ -70,13 +70,13 @@ private:
void
SetDocParameters
(
std
::
string
&
val
);
/** Get the parameter description of one parameter. */
void
GetDocParameters
(
std
::
string
&
val
,
bool
mandatory
);
void
GetDocParameters
(
std
::
string
&
val
);
/** generate the documentation associated to a group.*/
void
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
);
void
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
);
/** generate the documentation associated to a choice.*/
void
GetDocParameterChoice
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
);
void
GetDocParameterChoice
(
std
::
string
&
val
,
const
std
::
string
&
key
);
Application
::
Pointer
m_Application
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment