X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomValidators%2FGeomValidators_ZeroOffset.cpp;h=a1e57461adf7b7379477ad9300c4fd19a6b221bc;hb=fc72d43b677baa05ae7fd317346fd8b723b799ed;hp=4a919d0c4b6afe96dc4c0fe774509a0478fb1863;hpb=8a8b9b4ba20d4758dc2ae5ade0359b8bb2772986;p=modules%2Fshaper.git diff --git a/src/GeomValidators/GeomValidators_ZeroOffset.cpp b/src/GeomValidators/GeomValidators_ZeroOffset.cpp index 4a919d0c4..a1e57461a 100644 --- a/src/GeomValidators/GeomValidators_ZeroOffset.cpp +++ b/src/GeomValidators/GeomValidators_ZeroOffset.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2023 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 @@ -12,10 +12,9 @@ // // 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 +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include @@ -31,6 +30,7 @@ #include #include #include +#include #include #include @@ -39,23 +39,27 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& const std::list& theArguments, Events_InfoMessage& theError) const { +// LCOV_EXCL_START if(theArguments.size() != 9) { - theError = "Wrong number of validator arguments in xml(expected 9)."; + theError = "Wrong number of validator arguments in xml (expected 9)."; return false; } +// LCOV_EXCL_STOP - std::list::const_iterator anIt = theArguments.begin(), aLast = theArguments.end(); + std::list::const_iterator anIt = theArguments.begin(); std::string aSelectedMethod; if(theFeature->string(*anIt)) { aSelectedMethod = theFeature->string(*anIt)->value(); } + if (aSelectedMethod == "ThroughAll") return true; anIt++; std::string aCreationMethod = *anIt; anIt++; ListOfShape aFacesList; if(theFeature->selection(*anIt)) { +// LCOV_EXCL_START AttributeSelectionPtr aFaceSelection = theFeature->selection(*anIt); ResultConstructionPtr aConstruction = std::dynamic_pointer_cast(aFaceSelection->context()); @@ -69,6 +73,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& } } } +// LCOV_EXCL_STOP } else if(theFeature->selectionList(*anIt)) { AttributeSelectionListPtr aFacesSelectionList = theFeature->selectionList(*anIt); for(int anIndex = 0; anIndex < aFacesSelectionList->size(); anIndex++) { @@ -131,6 +136,10 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& if(aToShape.get() == NULL && anAttrSel->context().get() != NULL) { aToShape = anAttrSel->context()->shape(); } + if (aToShape->isCompound()) { + GeomAPI_ShapeIterator aSIt(aToShape); + aToShape = aSIt.current(); + } } anIt++; @@ -146,6 +155,10 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& if(aFromShape.get() == NULL && anAttrSel->context().get() != NULL) { aFromShape = anAttrSel->context()->shape(); } + if (aFromShape->isCompound()) { + GeomAPI_ShapeIterator aSIt(aFromShape); + aFromShape = aSIt.current(); + } } anIt++; @@ -214,6 +227,7 @@ bool GeomValidators_ZeroOffset::isValid(const std::shared_ptr& } //================================================================================================= +// LCOV_EXCL_START bool GeomValidators_ZeroOffset::isNotObligatory(std::string theFeature, std::string theAttribute) { if(theAttribute == "from_object" || theAttribute == "to_object") { @@ -222,3 +236,4 @@ bool GeomValidators_ZeroOffset::isNotObligatory(std::string theFeature, std::str return false; } +// LCOV_EXCL_STOP