]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1494: Filter already existing features from features list
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 23 May 2016 14:16:25 +0000 (17:16 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 23 May 2016 14:16:39 +0000 (17:16 +0300)
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp
src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h

index 26f185358b61f055b99308a5100eccb50ec69139..a340cdb3e6e9fc1bec3824cb465811c1c463a237 100644 (file)
@@ -297,7 +297,8 @@ void ParametersPlugin_WidgetParamsMgr::updateParametersFeatures()
 
 void ParametersPlugin_WidgetParamsMgr::updateFeaturesPart()
 {
-  updateItem(myFeatures, featuresItems(myParametersList));
+  QList<FeaturePtr> aFeatureList;
+  updateItem(myFeatures, featuresItems(myParametersList, aFeatureList));
 }
 
 void ParametersPlugin_WidgetParamsMgr::updateParametersPart()
@@ -309,11 +310,10 @@ void ParametersPlugin_WidgetParamsMgr::updateParametersPart()
 
 
 QList<QStringList> ParametersPlugin_WidgetParamsMgr::
-  featuresItems(const QList<FeaturePtr>& theFeatures) const
+  featuresItems(const QList<FeaturePtr>& theFeatures, QList<FeaturePtr>& theFeatureList) const
 {
   QList<QStringList> aItemsList;
   ResultParameterPtr aParam;
-  QList<FeaturePtr> aFeatures;
   foreach(FeaturePtr aParameter, theFeatures) {
     aParam = std::dynamic_pointer_cast<ModelAPI_ResultParameter>(aParameter->firstResult());
     const std::set<std::shared_ptr<ModelAPI_Attribute>>& aRefs = aParam->data()->refsToMe();
@@ -326,10 +326,10 @@ QList<QStringList> ParametersPlugin_WidgetParamsMgr::
           // Find referenced feature Recursive
           QList<FeaturePtr> aList;
           aList.append(aReferenced);
-          QList<QStringList> aItems = featuresItems(aList);
+          QList<QStringList> aItems = featuresItems(aList, theFeatureList);
           aItemsList.append(aItems);
         } else {
-          if (!aFeatures.contains(aReferenced)) {
+          if (!theFeatureList.contains(aReferenced)) {
             QStringList aValNames;
             aValNames << aReferenced->data()->name().c_str();
 
@@ -345,7 +345,7 @@ QList<QStringList> ParametersPlugin_WidgetParamsMgr::
               }
             }
             aItemsList.append(aValNames);
-            aFeatures.append(aReferenced);
+            theFeatureList.append(aReferenced);
           }
         }
       }
index 4fe132ed730dbd751b153472c6e13140000fb0e8..8e32c3767b5046418d04a098070ecb0576eba1d0 100644 (file)
@@ -127,7 +127,7 @@ private:
 
   bool checkIsValid();
 
-  QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures) const;
+  QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures, QList<FeaturePtr>& theFeatureList) const;
   QList<QStringList> parametersItems(const QList<FeaturePtr>& theFeatures) const;
 
   void updateParametersFeatures();