Salome HOME
Arc problems fixing: 1. reentrant of the tangent arc should not fill center point...
[modules/shaper.git] / src / PartSet / PartSet_Tools.cpp
index a08190d7b5c7caef2afd22b425a72c5ba6f2c0b3..a4e44a736698eb1ede7e54b2340645a77456a739 100755 (executable)
@@ -15,6 +15,7 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Events.h>
+#include <ModelAPI_Validator.h>
 
 #include <Events_Loop.h>
 
@@ -333,10 +334,14 @@ std::shared_ptr<GeomDataAPI_Point2D> PartSet_Tools::findFirstEqualPoint(const Fe
                                     theFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
   std::list<std::shared_ptr<ModelAPI_Attribute> >::const_iterator anIt = anAttiributes.begin(),
       aLast = anAttiributes.end();
+  ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators();
+
   for (; anIt != aLast && !aFPoint; anIt++) {
     std::shared_ptr<GeomDataAPI_Point2D> aCurPoint = 
-      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
-    if (aCurPoint && (aCurPoint->pnt()->distance(thePoint) < Precision::Confusion())) {
+                                             std::dynamic_pointer_cast<GeomDataAPI_Point2D>(*anIt);
+    if (aCurPoint && aCurPoint->isInitialized() &&
+        aValidators->isCase(theFeature, aCurPoint->id()) &&
+        (aCurPoint->pnt()->distance(thePoint) < Precision::Confusion())) {
       aFPoint = aCurPoint;
       break;
     }