From: azv Date: Mon, 27 Mar 2017 06:20:34 +0000 (+0300) Subject: Issue #2024: Redesign of circle and arc of circle X-Git-Tag: V_2.7.0~181 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=83be7aa2621fda02499965be2f70924e18df79a0;p=modules%2Fshaper.git Issue #2024: Redesign of circle and arc of circle Constraints for tangent arc --- diff --git a/src/SketchPlugin/SketchPlugin_MacroArc.cpp b/src/SketchPlugin/SketchPlugin_MacroArc.cpp index c1affb736..e53b85efe 100644 --- a/src/SketchPlugin/SketchPlugin_MacroArc.cpp +++ b/src/SketchPlugin/SketchPlugin_MacroArc.cpp @@ -7,6 +7,7 @@ #include "SketchPlugin_MacroArc.h" #include "SketchPlugin_Arc.h" +#include "SketchPlugin_ConstraintTangent.h" #include "SketchPlugin_Sketch.h" #include "SketchPlugin_Tools.h" @@ -225,6 +226,20 @@ void SketchPlugin_MacroArc::execute() anArcFeature->lastResult(), true); } else if(anArcType == ARC_TYPE_BY_TANGENT_EDGE()) { + // constraints for tangent arc + SketchPlugin_Tools::createConstraint(this, + TANGENT_POINT_ID(), + anArcFeature->attribute(SketchPlugin_Arc::START_ID()), + ObjectPtr(), + false); + FeaturePtr aTangent = sketch()->addFeature(SketchPlugin_ConstraintTangent::ID()); + AttributeRefAttrPtr aRefAttrA = aTangent->refattr(SketchPlugin_Constraint::ENTITY_A()); + AttributeRefAttrPtr aTgPntRefAttr = refattr(TANGENT_POINT_ID()); + FeaturePtr aTgFeature = ModelAPI_Feature::feature(aTgPntRefAttr->attr()->owner()); + aRefAttrA->setObject(aTgFeature->lastResult()); + AttributeRefAttrPtr aRefAttrB = aTangent->refattr(SketchPlugin_Constraint::ENTITY_B()); + aRefAttrB->setObject(anArcFeature->lastResult()); + // constraint for end point SketchPlugin_Tools::createConstraint(this, END_POINT_REF_ID(), anArcFeature->attribute(SketchPlugin_Arc::END_ID()),