From da6ada6975c41128a1890eade5127e700420390b Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 25 Aug 2016 08:21:29 +0300 Subject: [PATCH] Issue #1664 In the Sketcher, add the function Split a segment - correction for arc and coincidence to split feature's point --- src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp index fccbf1df4..6d9024796 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp @@ -92,11 +92,10 @@ void SketchPlugin_ConstraintSplit::execute() std::cout << "SketchPlugin_ConstraintSplit::execute()" << std::endl; std::cout << std::endl; - std::cout << "SKETCH FEATURES (before split):" << std::endl; SketchPlugin_Sketch* aSketch = sketch(); + std::cout << "SKETCH FEATURES (before split) [" << aSketch->numberOfSubs() << "]:" << std::endl; for (int i = 0, aNbSubs = aSketch->numberOfSubs(); i < aNbSubs; i++) { std::cout << getFeatureInfo(aSketch->subFeature(i), false) << std::endl; - std::cout << std::endl; } std::cout << std::endl; @@ -215,10 +214,9 @@ void SketchPlugin_ConstraintSplit::execute() } #ifdef DEBUG_SPLIT - std::cout << "SKETCH FEATURES (after split):" << std::endl; + std::cout << "SKETCH FEATURES (after split) [" << aSketch->numberOfSubs() << "]:" << std::endl; for (int i = 0, aNbSubs = aSketch->numberOfSubs(); i < aNbSubs; i++) { std::cout << getFeatureInfo(aSketch->subFeature(i), false) << std::endl; - std::cout << std::endl; } #endif } @@ -349,7 +347,7 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set& theFeatu if (aCurAttribute.get()) { FeaturePtr aCurFeature = ModelAPI_Feature::feature(aCurAttribute->owner()); if (aCurFeature.get() && aCurFeature == aBaseFeature) { - anAttribute = anAttrA->attr(); + anAttribute = anAttrB->attr(); anAttributeToBeModified = anAttrA->id(); } } @@ -359,7 +357,7 @@ void SketchPlugin_ConstraintSplit::getConstraints(std::set& theFeatu if (aCurAttribute.get()) { FeaturePtr aCurFeature = ModelAPI_Feature::feature(aCurAttribute->owner()); if (aCurFeature.get() && aCurFeature == aBaseFeature) { - anAttribute = anAttrB->attr(); + anAttribute = anAttrA->attr(); anAttributeToBeModified = anAttrB->id(); } } @@ -699,11 +697,11 @@ void SketchPlugin_ConstraintSplit::splitCircle(FeaturePtr& theSplitFeature, // additional constraints between split and base features aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Arc::END_ID()), - theSplitFeature->attribute(SketchPlugin_Arc::START_ID())); + theSplitFeature->attribute(SketchPlugin_Arc::END_ID())); theCreatedFeatures.insert(aConstraintFeature); aConstraintFeature = createConstraint(SketchPlugin_ConstraintCoincidence::ID(), theBaseFeatureModified->attribute(SketchPlugin_Arc::START_ID()), - theSplitFeature->attribute(SketchPlugin_Arc::END_ID())); + theSplitFeature->attribute(SketchPlugin_Arc::START_ID())); theCreatedFeatures.insert(aConstraintFeature); aConstraintFeature = createConstraintForObjects(SketchPlugin_ConstraintTangent::ID(), -- 2.39.2