]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2122: Unexpected Sketcher behavior when creating Coincidence : Remove invalid...
authornds <nds@opencascade.com>
Tue, 11 Apr 2017 15:03:39 +0000 (18:03 +0300)
committernds <nds@opencascade.com>
Tue, 11 Apr 2017 15:04:02 +0000 (18:04 +0300)
src/PartSet/PartSet_Tools.cpp

index 0976d01ced0d523ec3a576ff3bc7ee4a8d714fbe..6550c77672bd2fea6af3d998fe59e09a844e5a8c 100755 (executable)
@@ -16,6 +16,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Events.h>
 #include <ModelAPI_Validator.h>
+#include <ModelAPI_Tools.h>
 
 #include <ModuleBase_IViewWindow.h>
 
@@ -422,6 +423,22 @@ ResultPtr PartSet_Tools::createFixedObjectByExternal(const TopoDS_Shape& theShap
         //if (!theTemporary) {
           aMyFeature->execute();
 
+        // issue #2125: Naming problem: two edges in Naming for one circle on solid
+        // this is result of boolean and seamedge
+        if (aAdaptor.GetType() == GeomAbs_Circle) {
+          ModelAPI_ValidatorsFactory* aFactory = ModelAPI_Session::get()->validators();
+          if (!aFactory->validate(aMyFeature)) {
+            anAttr->setValue(ResultPtr(), GeomShapePtr());
+            std::set<FeaturePtr> aFeatures;
+            aFeatures.insert(aMyFeature);
+            ModelAPI_Tools::removeFeaturesAndReferences(aFeatures);
+            Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_CREATED));
+            Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_DELETED));
+
+            return ResultPtr();
+          }
+        }
+
         //  // fix this edge
         //  FeaturePtr aFix = theSketch->addFeature(SketchPlugin_ConstraintRigid::ID());
         //  aFix->data()->refattr(SketchPlugin_Constraint::ENTITY_A())->