Skip to content
Snippets Groups Projects
Commit 3e5afd29 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

BUG: Do not clear choices if not needed mantis #1025

parent 917a8308
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
#include "otbMultiChannelExtractROI.h"
#include "otbStandardFilterWatcher.h"
#include "otbWrapperNumericalParameter.h"
#include "otbWrapperListViewParameter.h"
#include "otbWrapperTypes.h"
#include "otbWrapperElevationParametersHandler.h"
......@@ -129,15 +130,20 @@ private:
SetParameterInt("sizey", largestRegion.GetSize()[1]);
}
// Update the values of the channels to be selected
unsigned int nbComponents = inImage->GetNumberOfComponentsPerPixel();
ClearChoices("cl");
for (unsigned int idx = 0; idx < nbComponents; ++idx)
ListViewParameter *clParam = dynamic_cast<ListViewParameter*>(GetParameterByKey("cl"));
// Update the values of the channels to be selected if nbComponents is changed
if (clParam->GetNbChoices() != nbComponents)
{
std::ostringstream key, item;
key<<"cl.channel"<<idx+1;
item<<"Channel"<<idx+1;
AddChoice(key.str(), item.str());
ClearChoices("cl");
for (unsigned int idx = 0; idx < nbComponents; ++idx)
{
std::ostringstream key, item;
key<<"cl.channel"<<idx+1;
item<<"Channel"<<idx+1;
AddChoice(key.str(), item.str());
}
}
// Put the limit of the index and the size relative the image
......
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