]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correct validators for tangent/transversal arcs.
authorazv <azv@opencascade.com>
Mon, 9 Sep 2019 13:38:40 +0000 (16:38 +0300)
committerazv <azv@opencascade.com>
Mon, 9 Sep 2019 13:39:24 +0000 (16:39 +0300)
src/SketchPlugin/SketchPlugin_Validators.cpp

index fb9be5197ed7a6dcf6272367797871a077953655..4ec13cbc7c60557a831afb02da8889f1340d29d2 100644 (file)
@@ -800,6 +800,11 @@ bool SketchPlugin_ArcTangentPointValidator::isValid(const AttributePtr& theAttri
     theError.arg(theAttribute->attributeType());
     return false;
   }
+  FeaturePtr anOwner = std::dynamic_pointer_cast<ModelAPI_Feature>(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<ModelAPI_AttributeRefAttr>(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<ModelAPI_Feature>(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<ModelAPI_AttributeRefAttr>(theAttribute);
   AttributePtr anAttr = aRefAttr->attr();
   if (!anAttr) {