From: nds Date: Thu, 25 Aug 2016 05:21:29 +0000 (+0300) Subject: Issue #1664 In the Sketcher, add the function Split a segment - correction for arc... X-Git-Tag: V_2.5.0~135 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=da6ada6975c41128a1890eade5127e700420390b;p=modules%2Fshaper.git Issue #1664 In the Sketcher, add the function Split a segment - correction for arc and coincidence to split feature's point --- 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(),