X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_Different.cpp;h=ec0146a114fb110e559749da0c18d1b8caec8206;hb=380f01e1fce1a012267d604a1190d04bf4659447;hp=8c324f40b70ec2ce2c9d2a8560cc340f7a8e0535;hpb=d34842c50d5f335cca443c78910c16c54139c7d0;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_Different.cpp b/src/GeomValidators/GeomValidators_Different.cpp index 8c324f40b..ec0146a11 100644 --- a/src/GeomValidators/GeomValidators_Different.cpp +++ b/src/GeomValidators/GeomValidators_Different.cpp @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomValidators_Different.cpp -// Created: 08 July 2015 -// Author: Sergey POKHODENKO +// Copyright (C) 2014-2020 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 @@ -33,7 +46,7 @@ bool isEqual(const AttributePoint2DPtr& theLeft, const AttributePoint2DPtr& theR bool isEqualAttributes(const AttributePtr& theLeft, const AttributePtr& theRight) { - if (theLeft->attributeType() == GeomDataAPI_Point2D::typeId() && + if (theLeft->attributeType() == GeomDataAPI_Point2D::typeId() && theRight->attributeType() == GeomDataAPI_Point2D::typeId()) return isEqual(std::dynamic_pointer_cast(theLeft), std::dynamic_pointer_cast(theRight)); @@ -60,8 +73,8 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& Events_InfoMessage& theError) const { std::map > anAttributesMap; - // For all attributes referred by theArguments - // sort it using attributeType() and store into anAttributesMap + // For all attributes referred by theArguments + // sort it using attributeType() and store into anAttributesMap std::list::const_iterator anArgumentIt = theArguments.begin(); for (; anArgumentIt != theArguments.end(); ++anArgumentIt) { AttributePtr anAttribute = theFeature->attribute(*anArgumentIt); @@ -69,7 +82,8 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& } // Search differences inside each attribute list - std::map >::const_iterator anAttributesMapIt = anAttributesMap.begin(); + std::map >::const_iterator + anAttributesMapIt = anAttributesMap.begin(); for (; anAttributesMapIt != anAttributesMap.end(); ++anAttributesMapIt) { const std::list& anAttributes = anAttributesMapIt->second; // for the list of attributes check that all elements are unique @@ -81,11 +95,12 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& std::list::const_iterator aFindIt = std::find_if(aNextIt, anAttributes.end(), IsEqual(*anAttributeIt)); if (aFindIt != anAttributes.end()) { - theError = "Attributes " + (*anAttributeIt)->id() + " and " + (*aFindIt)->id() + " are equal." ; + theError = "Attributes " + (*anAttributeIt)->id() + " and " + + (*aFindIt)->id() + " are equal." ; return false; } ++anAttributeIt; - ++aNextIt; + ++aNextIt; } } } @@ -93,7 +108,9 @@ bool GeomValidators_Different::isValid(const std::shared_ptr& return true; } +// LCOV_EXCL_START bool GeomValidators_Different::isNotObligatory(std::string theFeature, std::string theAttribute) { return true; } +// LCOV_EXCL_STOP