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
d5e5adba
Commit
d5e5adba
authored
13 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add SetValue(std::string) for choice
parent
80fd1e19
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/Core/otbWrapperChoiceParameter.cxx
+20
-2
20 additions, 2 deletions
Code/Core/otbWrapperChoiceParameter.cxx
Code/Core/otbWrapperChoiceParameter.h
+4
-1
4 additions, 1 deletion
Code/Core/otbWrapperChoiceParameter.h
with
24 additions
and
3 deletions
Code/Core/otbWrapperChoiceParameter.cxx
+
20
−
2
View file @
d5e5adba
...
...
@@ -88,7 +88,6 @@ ChoiceParameter::GetNbChoices( void )
return
m_ChoiceList
.
size
();
}
/** Set any value */
void
ChoiceParameter
::
SetValue
(
unsigned
int
v
)
{
...
...
@@ -98,7 +97,26 @@ ChoiceParameter::SetValue(unsigned int v)
this
->
Modified
();
}
/** Return any value */
void
ChoiceParameter
::
SetValue
(
std
::
string
choiceKey
)
{
ChoiceList
::
iterator
it
=
m_ChoiceList
.
begin
();
unsigned
int
i
=
0
;
for
(
it
=
m_ChoiceList
.
begin
();
it
!=
m_ChoiceList
.
end
();
++
it
)
{
if
(
it
->
m_Key
==
choiceKey
)
{
m_CurrentChoice
=
i
;
this
->
Modified
();
return
;
}
++
i
;
}
itkExceptionMacro
(
<<
"Cannot find "
<<
choiceKey
);
}
unsigned
int
ChoiceParameter
::
GetValue
()
{
...
...
This diff is collapsed.
Click to expand it.
Code/Core/otbWrapperChoiceParameter.h
+
4
−
1
View file @
d5e5adba
...
...
@@ -69,9 +69,12 @@ public:
/** Get the number of available choice */
unsigned
int
GetNbChoices
(
void
);
/** Set
any
value */
/** Set
choice
value */
virtual
void
SetValue
(
unsigned
int
v
);
/** Set choice value by its key */
virtual
void
SetValue
(
std
::
string
choiceKey
);
/** Return any value */
virtual
unsigned
int
GetValue
();
...
...
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