From: nds Date: Thu, 28 Jul 2016 17:22:59 +0000 (+0300) Subject: Issue #1664: In the Sketcher, add the function Split a segment: split constraints X-Git-Tag: V_2.5.0~157 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d88a987ccdc391ed2adc420673691a1aad7749d2;p=modules%2Fshaper.git Issue #1664: In the Sketcher, add the function Split a segment: split constraints --- diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp index a98724cfa..67e5a2a65 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp @@ -886,7 +886,7 @@ void SketchPlugin_ConstraintSplit::splitArc(FeaturePtr& theSplitFeature, getFeatureResult(theSplitFeature)); createConstraint(SketchPlugin_ConstraintTangent::ID(), getFeatureResult(theSplitFeature), getFeatureResult(aBaseFeature)); - if (theAfterFeature.get()) { + if (theAfterFeature.get() && theAfterFeature != aBaseFeature) { createConstraint(SketchPlugin_ConstraintEqual::ID(), getFeatureResult(aBaseFeature), getFeatureResult(theAfterFeature)); createConstraint(SketchPlugin_ConstraintTangent::ID(), getFeatureResult(theSplitFeature), @@ -901,7 +901,7 @@ void SketchPlugin_ConstraintSplit::arrangePoints(const AttributePoint2DPtr& theS { /// if first point is closer to last point, wrap first and last values if (theStartPointAttr->pnt()->distance(theFirstPointAttr->pnt()) > - theEndPointAttr->pnt()->distance(theLastPointAttr->pnt())) { + theStartPointAttr->pnt()->distance(theLastPointAttr->pnt())) { AttributePoint2DPtr aTmpPoint = theFirstPointAttr; theFirstPointAttr = theLastPointAttr; theLastPointAttr = aTmpPoint; @@ -917,7 +917,7 @@ void SketchPlugin_ConstraintSplit::fillAttribute(const AttributePtr& theModified theSourceAttribute); if (aModifiedAttribute.get() && aSourceAttribute.get()) - aSourceAttribute->setValue(aModifiedAttribute->pnt()); + aModifiedAttribute->setValue(aSourceAttribute->pnt()); } FeaturePtr SketchPlugin_ConstraintSplit::createArcFeature(const FeaturePtr& theBaseFeature,