BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
The ParameterTreeBuilder namespace contains helper functions to create container with ParameterItems. More...
Functions | |
void | createParameterTree (JobItem *jobItem) |
QString | domainNameToParameterName (const QString &domainName, const SessionItem *source) |
Converts domain name to parameterItem name. More... | |
QVector< QPair< QString, QString > > | parameterDictionary (const SessionItem *source) |
Correspondance of parameter name to translated name for all properties found in source in its children. More... | |
QString | parameterNameToDomainName (const QString &parName, const SessionItem *source) |
Converts parameter name to domain name. More... | |
SessionItem * | parameterNameToLinkedItem (const QString &parName, const SessionItem *source) |
Converts parameter item name to the corresponding item in the tree below the source. More... | |
QStringList | parameterTreeNames (const SessionItem *source) |
Creates list with parameter names of source item. More... | |
void | populateParameterContainer (SessionItem *container, const SessionItem *source) |
Populates ParameterContainer with ParameterItem's corresponding to all properties found in a source item. More... | |
QStringList | translatedParameterTreeNames (const SessionItem *source) |
Creates domain translated list of parameter names for source item. More... | |
void | visitParameterContainer (SessionItem *container, std::function< void(ParameterItem *)> fun) |
Visit all ParameterItem in container and execute user function. More... | |
The ParameterTreeBuilder namespace contains helper functions to create container with ParameterItems.
The ParameterItem appears in RealTimeView and provides real time tuning of MultiLayerItem and InstrumentItem.
void ParameterTreeUtils::createParameterTree | ( | JobItem * | jobItem | ) |
Definition at line 56 of file ParameterTreeUtils.cpp.
References SessionItem::getItem(), SessionModel::insertItem(), SessionItem::model(), populateParameterContainer(), JobItem::T_INSTRUMENT, JobItem::T_MATERIAL_CONTAINER, JobItem::T_PARAMETER_TREE, and JobItem::T_SAMPLE.
Referenced by JobModel::addJob().
QString ParameterTreeUtils::domainNameToParameterName | ( | const QString & | domainName, |
const SessionItem * | source | ||
) |
Converts domain name to parameterItem name.
Parameter name should belong to item or one of its children.
Definition at line 168 of file ParameterTreeUtils.cpp.
References parameterDictionary().
Referenced by ParticleDistributionItem::translateParameterNameToGUI().
QVector< QPair< QString, QString > > ParameterTreeUtils::parameterDictionary | ( | const SessionItem * | source | ) |
Correspondance of parameter name to translated name for all properties found in source in its children.
Definition at line 137 of file ParameterTreeUtils.cpp.
References ASSERT, SessionItem::displayName(), ModelPath::getItemFromPath(), SessionItem::getItemValue(), FitParameterHelper::getParameterItemPath(), SessionModel::insertItem(), ModelPath::itemPathTranslation(), ParameterItem::P_LINK, SessionItem::parent(), populateParameterContainer(), and visitParameterContainer().
Referenced by domainNameToParameterName(), parameterNameToDomainName(), parameterTreeNames(), and translatedParameterTreeNames().
QString ParameterTreeUtils::parameterNameToDomainName | ( | const QString & | parName, |
const SessionItem * | source | ||
) |
Converts parameter name to domain name.
Parameter name should belong to item or one of its children.
Definition at line 183 of file ParameterTreeUtils.cpp.
References parameterDictionary().
Referenced by ParticleDistributionItem::domainLinkedParameters(), and ParticleDistributionItem::domainMainParameter().
SessionItem * ParameterTreeUtils::parameterNameToLinkedItem | ( | const QString & | parName, |
const SessionItem * | source | ||
) |
Converts parameter item name to the corresponding item in the tree below the source.
Definition at line 195 of file ParameterTreeUtils.cpp.
References SessionItem::displayName(), ModelPath::getItemFromPath(), SessionItem::getItemValue(), FitParameterHelper::getParameterItemPath(), SessionModel::insertItem(), ParameterItem::P_LINK, populateParameterContainer(), and visitParameterContainer().
QStringList ParameterTreeUtils::parameterTreeNames | ( | const SessionItem * | source | ) |
Creates list with parameter names of source item.
Definition at line 112 of file ParameterTreeUtils.cpp.
References parameterDictionary().
Referenced by ParticleDistributionItem::childParameterNames().
void ParameterTreeUtils::populateParameterContainer | ( | SessionItem * | container, |
const SessionItem * | source | ||
) |
Populates ParameterContainer with ParameterItem's corresponding to all properties found in a source item.
Definition at line 78 of file ParameterTreeUtils.cpp.
References SessionModel::insertItem(), SessionItem::model(), and SessionItem::modelType().
Referenced by createParameterTree(), parameterDictionary(), and parameterNameToLinkedItem().
QStringList ParameterTreeUtils::translatedParameterTreeNames | ( | const SessionItem * | source | ) |
Creates domain translated list of parameter names for source item.
Definition at line 124 of file ParameterTreeUtils.cpp.
References parameterDictionary().
void ParameterTreeUtils::visitParameterContainer | ( | SessionItem * | container, |
std::function< void(ParameterItem *)> | fun | ||
) |
Visit all ParameterItem in container and execute user function.
Definition at line 91 of file ParameterTreeUtils.cpp.
References SessionItem::getItems(), and SessionItem::modelType().
Referenced by parameterDictionary(), and parameterNameToLinkedItem().