]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1664: In the Sketcher, add the function Split a segment: split constraints
authornds <nds@opencascade.com>
Thu, 28 Jul 2016 17:22:59 +0000 (20:22 +0300)
committernds <nds@opencascade.com>
Thu, 28 Jul 2016 17:22:59 +0000 (20:22 +0300)
src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp

index a98724cfa1c5c7647f2c39749b74a88761d69bf6..67e5a2a6578542c4e2592aa71b4280119c981463 100755 (executable)
@@ -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,