From: azv Date: Tue, 1 Nov 2016 05:10:47 +0000 (+0300) Subject: Fix incorrect DoF after dump-import loop (issue #1767) X-Git-Tag: V_2.6.0~135 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=876df3f1e552699e9bea75c48245e92e1bedd81e;p=modules%2Fshaper.git Fix incorrect DoF after dump-import loop (issue #1767) There is changed processing of external entities, no need to calculate DoF for them. --- diff --git a/src/SketchSolver/SketchSolver_Manager.cpp b/src/SketchSolver/SketchSolver_Manager.cpp index 847607325..2449d61c0 100644 --- a/src/SketchSolver/SketchSolver_Manager.cpp +++ b/src/SketchSolver/SketchSolver_Manager.cpp @@ -579,6 +579,14 @@ static void collectPointsAndCopies(FeaturePtr theConstraint, std::listselection(SketchPlugin_SketchEntity::EXTERNAL_ID()); + return anAttr && anAttr->context() && !anAttr->isInvalid(); +} + // ============================================================================ // Function: degreesOfFreedom // Purpose: calculate DoFs for each sketch @@ -641,6 +649,9 @@ void SketchSolver_Manager::degreesOfFreedom() int aNbSubs = aSketch->numberOfSubs(); for (int i = 0; i < aNbSubs; ++i) { FeaturePtr aFeature = aSketch->subFeature(i); + // do not change DoF for external feature + if (isExternal(aFeature)) + continue; // check DoF delta for invariant types std::map::const_iterator aFound = aDoFDelta.find(aFeature->getKind()); if (aFound != aDoFDelta.end()) { @@ -751,6 +762,8 @@ void SketchSolver_Manager::degreesOfFreedom() } else { FeaturePtr anAttr = ModelAPI_Feature::feature(aRefAttr->object()); if (anAttr) { + if (isExternal(anAttr)) + continue; // feature is already fixed since it is external aDoF -= aDoFDelta[anAttr->getKind()]; std::list aPtAttrs = anAttr->data()->attributes(GeomDataAPI_Point2D::typeId()); aPoints.insert(aPtAttrs.begin(), aPtAttrs.end());