40 #include <boost/algorithm/string.hpp>
55 std::vector<std::string>
58 std::vector<std::string> parameters;
60 ParameterListType::iterator pit;
64 parameters.push_back( param->
GetKey() );
66 if (recursive && dynamic_cast<ParameterGroup*>(param))
70 for (std::vector<std::string>::const_iterator it = subparams.begin();
71 it != subparams.end(); ++it)
73 parameters.push_back( std::string(paramAsGroup->
GetKey()) +
"." + *it );
76 else if (recursive && dynamic_cast<ChoiceParameter*>(param))
81 for (std::vector<std::string>::const_iterator it = subparams.begin();
82 it != subparams.end(); ++it)
84 parameters.push_back( std::string(paramAsChoice->
GetKey()) +
"." + *it );
98 std::vector<std::string> splittedKey = pKey.
Split();
100 if( splittedKey.size() > 1 )
105 std::string parentkey = pKey.
GetRoot();
112 if (comboboxParentAsChoice)
114 comboboxParentAsChoice->
AddChoice(lastkey, paramName);
116 else if (listBoxParentAsChoice)
118 listBoxParentAsChoice->
AddChoice(lastkey, paramName);
122 itkExceptionMacro(<<parentkey <<
" is not a choice");
127 itkExceptionMacro(<<
"No choice parameter key given");
137 std::vector<std::string> splittedKey = pKey.
Split();
139 std::string parentkey;
142 if (splittedKey.size() > 1)
155 if (listBoxParentAsChoice)
161 itkExceptionMacro(<<parentkey <<
" is not a ListView");
169 std::vector<int> selectedItems;
172 std::vector<std::string> splittedKey = pKey.
Split();
174 std::string parentkey;
177 if (splittedKey.size() > 1)
190 if (listBoxParentAsChoice)
196 itkExceptionMacro(<<parentkey <<
" is not a ListView");
199 return selectedItems;
209 std::vector<std::string> splittedKey = pKey.
Split();
214 std::string parentkey;
217 if (splittedKey.size() > 1)
342 itkExceptionMacro(<<
"Parameter type not supported for " << paramKey);
345 newParam->SetKey(lastkey);
346 newParam->SetName(paramName);
352 if (splittedKey.size() > 1)
354 newParam->SetRoot(parentParam);
355 parentParam->AddChild(newParam);
362 itkExceptionMacro(<<
"Cannot add " << lastkey <<
" to parameter " << parentkey);
383 std::vector<std::string> splittedName = pName.
Split();
390 ParameterListType::iterator it;
394 if (param->GetKey() == parentName)
403 itkExceptionMacro(<<
"Could not find parameter " << name)
407 if (splittedName.size() > 1)
414 std::ostringstream childNameOss;
415 std::vector<std::string>::const_iterator it = splittedName.begin() + 1;
416 while(it != splittedName.end())
420 if (it != splittedName.end())
425 std::string childName = childNameOss.str();
440 if (splittedName.size() > 2)
442 if (associatedParam.
IsNull())
444 itkExceptionMacro(<<
"Choice " << splittedName[1] <<
"in "
445 << splittedName[0] <<
" has no key named "
450 std::ostringstream childNameOss;
451 std::vector<std::string>::const_iterator it = splittedName.begin() + 2;
452 while(it != splittedName.end())
456 if (it != splittedName.end())
461 std::string childName = childNameOss.str();
462 return associatedParam->GetParameterByKey(childName);
467 itkExceptionMacro(<<
"No parameter with key " << name);