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
4e5013bb
Commit
4e5013bb
authored
13 years ago
by
Cyrille Valladeau
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Qt view refactoring
parent
832cf19e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
+48
-53
48 additions, 53 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
+3
-0
3 additions, 0 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
with
51 additions
and
53 deletions
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.cxx
+
48
−
53
View file @
4e5013bb
...
...
@@ -172,7 +172,7 @@ QWidget* QtWidgetView::CreateDoc()
void
QtWidgetView
::
SetDocParameters
(
std
::
string
&
val
)
{
const
std
::
vector
<
std
::
string
>
appKeyList
=
m_Application
->
GetParametersKeys
(
false
);
//true );
const
std
::
vector
<
std
::
string
>
appKeyList
=
m_Application
->
GetParametersKeys
(
false
);
const
unsigned
int
nbOfParam
=
appKeyList
.
size
();
itk
::
OStringStream
oss
;
...
...
@@ -180,65 +180,60 @@ void QtWidgetView::SetDocParameters( std::string & val )
// Mandatory parameters
oss
<<
"<h4>Mandatory parameters</h4>"
;
for
(
unsigned
int
i
=
0
;
i
<
nbOfParam
;
i
++
)
{
Parameter
::
Pointer
param
=
m_Application
->
GetParameterByKey
(
appKeyList
[
i
]
);
// Check if mandatory parameter are present and have value
if
(
param
->
GetMandatory
()
==
true
)
{
if
(
m_Application
->
GetParameterType
(
appKeyList
[
i
])
!=
ParameterType_Group
)
{
oss
<<
"<i>"
<<
param
->
GetName
()
<<
":</i><br />"
;
oss
<<
param
->
GetDescription
()
<<
"<br />"
;
oss
<<
"<br />"
;
}
else
{
oss
<<
"<b><i>=== "
<<
param
->
GetName
()
<<
"</i></b> ("
<<
param
->
GetDescription
()
<<
")<br />"
;
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
appKeyList
[
i
],
1
);
oss
<<
grDoc
;
}
}
}
std
::
string
paramDocs
(
""
);
this
->
GetDocParameters
(
paramDocs
,
true
);
oss
<<
paramDocs
;
paramDocs
=
""
;
// Optional parameters
oss
<<
"<h4>Optional parameters</h4>"
;
oss
<<
"<body><li>"
;
bool
found
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
nbOfParam
;
i
++
)
{
Parameter
::
Pointer
param
=
m_Application
->
GetParameterByKey
(
appKeyList
[
i
]
);
// Check if mandatory parameter are present and have value
if
(
param
->
GetMandatory
()
==
false
)
{
if
(
m_Application
->
GetParameterType
(
appKeyList
[
i
])
)
{
oss
<<
"<i>"
<<
param
->
GetName
()
<<
":</i><br />"
;
oss
<<
param
->
GetDescription
()
<<
"<br />"
;
oss
<<
"<br />"
;
found
=
true
;
}
else
{
oss
<<
"<b><i>=== "
<<
param
->
GetName
()
<<
"</i></b> ("
<<
param
->
GetDescription
()
<<
"):<br />"
;
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
appKeyList
[
i
],
1
);
oss
<<
grDoc
;
found
=
true
;
}
}
}
if
(
!
found
)
oss
<<
"None"
;
this
->
GetDocParameters
(
paramDocs
,
false
);
oss
<<
paramDocs
;
val
.
append
(
oss
.
str
());
}
void
QtWidgetView
::
GetDocParameters
(
std
::
string
&
val
,
bool
mandatory
)
{
itk
::
OStringStream
oss
;
const
std
::
vector
<
std
::
string
>
appKeyList
=
m_Application
->
GetParametersKeys
(
false
);
const
unsigned
int
nbOfParam
=
appKeyList
.
size
();
std
::
string
paramDocs
(
""
);
for
(
unsigned
int
i
=
0
;
i
<
nbOfParam
;
i
++
)
{
const
std
::
string
key
(
appKeyList
[
i
]);
Parameter
::
Pointer
param
=
m_Application
->
GetParameterByKey
(
key
);
if
(
param
->
GetMandatory
()
==
mandatory
)
{
if
(
m_Application
->
GetParameterType
(
key
)
!=
ParameterType_Group
)
{
oss
<<
"<i>"
<<
param
->
GetName
()
<<
":</i><br />"
;
oss
<<
param
->
GetDescription
()
<<
"<br />"
;
oss
<<
"<br />"
;
}
else
{
oss
<<
"<b><i>=== "
<<
param
->
GetName
()
<<
"</i></b> ("
<<
param
->
GetDescription
()
<<
"):<br />"
;
std
::
string
grDoc
;
GetDocParameterGroup
(
grDoc
,
key
,
1
);
oss
<<
grDoc
;
}
}
}
if
(
oss
.
str
()
==
""
)
oss
<<
"None"
;
val
=
oss
.
str
();
}
void
QtWidgetView
::
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
)
{
std
::
string
spaces
,
equals
;
...
...
This diff is collapsed.
Click to expand it.
Code/Wrappers/QtWidget/otbWrapperQtWidgetView.h
+
3
−
0
View file @
4e5013bb
...
...
@@ -65,6 +65,9 @@ private:
/** Add the parameter description in the flux of the documentation tab. */
void
SetDocParameters
(
std
::
string
&
val
);
/** Get the parameter description of one parameter. */
void
GetDocParameters
(
std
::
string
&
val
,
bool
mandatory
);
/** generate the documentation associated to a group.*/
void
GetDocParameterGroup
(
std
::
string
&
val
,
const
std
::
string
&
key
,
int
level
);
...
...
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