From: Artem Zhidkov Date: Mon, 8 Jun 2020 07:24:25 +0000 (+0300) Subject: Issue #19187: B-Splines - Crash with specific scenario X-Git-Tag: V9_5_0rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=4112a0eac034d7240db481600aacbfb07dcc20cc;p=modules%2Fshaper.git Issue #19187: B-Splines - Crash with specific scenario Fix the regression related to the previous change. Improve the validator of the Tangent constraint. --- diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index f3543bc29..9feba7df8 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -231,9 +231,6 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute std::set aCoincidences = SketchPlugin_Tools::findCoincidentConstraints(aRefFea); for (std::set::iterator anIt = aCoincidences.begin(); anIt != aCoincidences.end() && !isValid; ++anIt) { - if ((*anIt)->getKind() == SketchPlugin_ConstraintCoincidenceInternal::ID()) - continue; // skip internal constraints - std::set aCoinc; if (isApplicableCoincidence(*anIt, SketchPlugin_Constraint::ENTITY_A())) SketchPlugin_Tools::findCoincidences(*anIt, SketchPlugin_Constraint::ENTITY_B(), @@ -242,7 +239,13 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute SketchPlugin_Tools::findCoincidences(*anIt, SketchPlugin_Constraint::ENTITY_A(), aCoinc, true); - isValid = aCoinc.find(aOtherFea) != aCoinc.end(); + std::set::iterator aFoundCoinc = aCoinc.find(aOtherFea); + if (aFoundCoinc != aCoinc.end()) { + // do not take into account internal constraints + AttributeReferencePtr aParent = + (*aFoundCoinc)->reference(SketchPlugin_SketchEntity::PARENT_ID()); + isValid = !aParent || !aParent->isInitialized() || aParent->value() != aRefFea; + } } }