]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomValidators/GeomValidators_NotSelfIntersected.cpp
Salome HOME
updated copyright message
[modules/shaper.git] / src / GeomValidators / GeomValidators_NotSelfIntersected.cpp
index dc83cd1966bd8bc5c898e1e10d944fe88391b2a8..ac6ce686baba46972bf0a5d2eb57c215e25ed4af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // 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<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "GeomValidators_NotSelfIntersected.h"
 #include <Events_InfoMessage.h>
 
 #include <ModelAPI_AttributeSelection.h>
-#include <ModelAPI_AttributeSelectionList.h>>
+#include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_Feature.h>
 
 bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                                 const std::list<std::string>& theArguments,
                                                 Events_InfoMessage& theError) const
 {
+// LCOV_EXCL_START
   if (theArguments.empty()) {
     theError = "Error: empty selection.";
     return false;
   }
+// LCOV_EXCL_STOP
 
   for (std::list<std::string>::const_iterator anIt = theArguments.cbegin();
        anIt != theArguments.cend();
@@ -44,8 +45,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
     std::string anArgument = *anIt;
     AttributePtr anAttribute = theFeature->attribute(anArgument);
     if (!anAttribute.get()) {
+// LCOV_EXCL_START
       theError = std::string("Error: Feature does not contain attribute: ") + anArgument;
       return false;
+// LCOV_EXCL_STOP
     }
     if (anAttribute->attributeType() == ModelAPI_AttributeSelectionList::typeId()) {
       AttributeSelectionListPtr anAttrSelectionList =
@@ -53,8 +56,10 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
       for (int anIndex = 0; anIndex < anAttrSelectionList->size(); ++anIndex) {
         AttributeSelectionPtr anAttrSelection = anAttrSelectionList->value(anIndex);
         if (!anAttrSelection.get()) {
+// LCOV_EXCL_START
           theError = "Error: Empty attribute selection.";
           return false;
+// LCOV_EXCL_STOP
         }
         ResultPtr aContext = anAttrSelection->context();
         if (!aContext.get()) {
@@ -74,23 +79,27 @@ bool GeomValidators_NotSelfIntersected::isValid(const std::shared_ptr<ModelAPI_F
           return false;
         }
 
-        if (aShape->isSelfIntersected(4)) {
+        /* optimization if (aShape->isSelfIntersected(4)) {
           theError = "Error: One of selected shapes are self-intersected.";
           return false;
-        }
+        }*/
       }
     } else {
+// LCOV_EXCL_START
       theError = std::string("Error: validator does not support attribute with type: ")
         + anAttribute->attributeType();
       return false;
+// LCOV_EXCL_STOP
     }
   }
 
   return true;
 }
 
+// LCOV_EXCL_START
 bool GeomValidators_NotSelfIntersected::isNotObligatory(std::string /*theFeature*/,
                                                         std::string /*theAttribute*/)
 {
   return false;
 }
+// LCOV_EXCL_STOP