From: nds Date: Tue, 11 Apr 2017 15:03:39 +0000 (+0300) Subject: Issue #2122: Unexpected Sketcher behavior when creating Coincidence : Remove invalid... X-Git-Tag: V_2.7.0~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1b52d5e0bd2787a2cc8c650aa1bfa55bd3de68e6;p=modules%2Fshaper.git Issue #2122: Unexpected Sketcher behavior when creating Coincidence : Remove invalid external feature --- 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())->