]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1330: implementation of isInList for AttributeSelectionList
authormpv <mikhail.ponikarov@opencascade.com>
Fri, 26 Feb 2016 15:01:26 +0000 (18:01 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Fri, 26 Feb 2016 15:01:26 +0000 (18:01 +0300)
src/Model/Model_AttributeSelectionList.cpp

index a049b9123c9d5ce209c854b69b843b09035cfced..b3c39a76d6a27701657571be04880b31bf989273 100644 (file)
@@ -145,6 +145,11 @@ bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext,
                                             const std::shared_ptr<GeomAPI_Shape>& theSubShape,
                                             const bool theTemporarily)
 {
+  for(int anIndex = size() - 1; anIndex >= 0; anIndex--) {
+    AttributeSelectionPtr anAttr = value(anIndex);
+    if (anAttr->context() == theContext && anAttr->value()->isEqual(theSubShape))
+      return true;
+  }
   return false;
 }