From: azv Date: Mon, 9 Sep 2019 13:38:40 +0000 (+0300) Subject: Correct validators for tangent/transversal arcs. X-Git-Tag: V9_4_0a2~4^2~123 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=df83ddafb2a272a9613191bee8cb0abef7a727b9;p=modules%2Fshaper.git Correct validators for tangent/transversal arcs. --- diff --git a/src/SketchPlugin/SketchPlugin_Validators.cpp b/src/SketchPlugin/SketchPlugin_Validators.cpp index fb9be5197..4ec13cbc7 100644 --- a/src/SketchPlugin/SketchPlugin_Validators.cpp +++ b/src/SketchPlugin/SketchPlugin_Validators.cpp @@ -800,6 +800,11 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri theError.arg(theAttribute->attributeType()); return false; } + FeaturePtr anOwner = std::dynamic_pointer_cast(theAttribute->owner()); + AttributeStringPtr anArcTypeAttr = anOwner->string(SketchPlugin_MacroArc::ARC_TYPE()); + if (anArcTypeAttr && anArcTypeAttr->value() != SketchPlugin_MacroArc::ARC_TYPE_BY_TANGENT_EDGE()) + return true; // not applicable for non-tangent arcs + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttr = aRefAttr->attr(); if (!anAttr) { @@ -847,6 +852,11 @@ bool SketchPlugin_ArcTransversalPointValidator::isValid( theError.arg(theAttribute->attributeType()); return false; } + FeaturePtr anOwner = std::dynamic_pointer_cast(theAttribute->owner()); + AttributeStringPtr anArcTypeAttr = anOwner->string(SketchPlugin_MacroArc::ARC_TYPE()); + if (anArcTypeAttr && anArcTypeAttr->value() != SketchPlugin_MacroArc::ARC_TYPE_BY_TRANSVERSAL_LINE()) + return true; // not applicable for non-transversal arcs + AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast(theAttribute); AttributePtr anAttr = aRefAttr->attr(); if (!anAttr) {