From 34bba72fdff39dcede8e8bae1a5a7f8e67e8b14b Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 22 Apr 2016 12:39:25 +0300 Subject: [PATCH] Issue #1428: Find referenced feature by parameters recursive --- .../ParametersPlugin_WidgetParamsMgr.cpp | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index 508303bba..81a06e84f 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -269,21 +269,29 @@ QList ParametersPlugin_WidgetParamsMgr:: std::shared_ptr aAttr = (*aIt); FeaturePtr aReferenced = std::dynamic_pointer_cast(aAttr->owner()); if (aReferenced.get()) { - QStringList aValNames; - aValNames << aReferenced->data()->name().c_str(); - - AttributeDoublePtr aDouble = std::dynamic_pointer_cast(aAttr); - if (aDouble.get()) { - aValNames << aDouble->text().c_str(); - aValNames << QString::number(aDouble->value()); + if (aReferenced->getKind() == ParametersPlugin_Parameter::ID()) { + // Find referenced feature Recursive + QList aList; + aList.append(aReferenced); + QList aItems = featuresItems(aList); + aItemsList.append(aItems); } else { - AttributeIntegerPtr aInt = std::dynamic_pointer_cast(aAttr); - if (aInt.get()) { - aValNames << aInt->text().c_str(); - aValNames << QString::number(aInt->value()); + QStringList aValNames; + aValNames << aReferenced->data()->name().c_str(); + + AttributeDoublePtr aDouble = std::dynamic_pointer_cast(aAttr); + if (aDouble.get()) { + aValNames << aDouble->text().c_str(); + aValNames << QString::number(aDouble->value()); + } else { + AttributeIntegerPtr aInt = std::dynamic_pointer_cast(aAttr); + if (aInt.get()) { + aValNames << aInt->text().c_str(); + aValNames << QString::number(aInt->value()); + } } + aItemsList.append(aValNames); } - aItemsList.append(aValNames); } } } -- 2.39.2