X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeSelectionList.cpp;h=5207a112024deb535b0e860b5e072f7b7dea05e5;hb=cb2bfff600626039e210f08de27b5229541d367a;hp=72e830852a424de3f5f87461d1b33b22f8b0e95b;hpb=96436dab4317da2fea70cf7c18635df47352e44f;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 72e830852..5207a1120 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: Model_AttributeSelectionList.cpp -// Created: 22 Oct 2014 -// Author: Mikhail PONIKAROV +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "Model_AttributeSelectionList.h" #include "Model_AttributeSelection.h" @@ -10,9 +24,12 @@ #include "Model_Events.h" #include "Model_Data.h" +#include + #include #include #include +#include #include #include #include @@ -20,6 +37,7 @@ #include #include #include +#include #include void Model_AttributeSelectionList::append( @@ -215,14 +233,15 @@ bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext, std::map > >::iterator aContext = myCash.find(theContext); if (aContext != myCash.end()) { - // iterate shapes because "isEqual" method must be called for each shape + // iterate shapes because "isSame" method must be called for each shape std::list >::iterator aShapes = aContext->second.begin(); for(; aShapes != aContext->second.end(); aShapes++) { if (!theSubShape.get()) { - if (!aShapes->get()) + if (!aShapes->get() || (*aShapes)->isSame(aContext->first->shape())) return true; } else { - if (theSubShape->isEqual(*aShapes)) + // we need to call here isSame instead of isEqual to do not check shapes orientation + if (theSubShape->isSame(*aShapes)) return true; } } @@ -235,12 +254,13 @@ bool Model_AttributeSelectionList::isInList(const ResultPtr& theContext, if (anAttr.get()) { if (anAttr->context() == theContext) { // contexts are equal, so, check that values are also std::shared_ptr aValue = anAttr->value(); - if (!aValue.get()) { - if (!theSubShape.get()) { // both are null + if (!theSubShape.get()) { + if (!aValue.get() || aValue->isSame(theContext->shape())) { // both are null return true; } } else { - if (aValue->isEqual(theSubShape)) // shapes are equal + // we need to call here isSame instead of isEqual to do not check shapes orientation + if (theSubShape->isSame(aValue)) // shapes are equal return true; } }