From 1b52d5e0bd2787a2cc8c650aa1bfa55bd3de68e6 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 11 Apr 2017 18:03:39 +0300 Subject: [PATCH] Issue #2122: Unexpected Sketcher behavior when creating Coincidence : Remove invalid external feature --- src/PartSet/PartSet_Tools.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 0976d01ce..6550c7767 100755 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -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 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())-> -- 2.39.2