From: azv Date: Thu, 10 Oct 2019 13:13:53 +0000 (+0300) Subject: Task 2.5 Show where the remaining degrees of freedom are (issue #2997) X-Git-Tag: V9_5_0a1~167^2~88 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=145c4502b392f091b6074d97760800877a3a6371;p=modules%2Fshaper.git Task 2.5 Show where the remaining degrees of freedom are (issue #2997) Show non-fixes shapes if no one constraint is assigned yet. --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 1b65412e8..1cdd66a5c 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -778,7 +778,7 @@ bool PartSet_WidgetSketchLabel::restoreValueCustom() void PartSet_WidgetSketchLabel::onShowDOF() { CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast(myFeature); - if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1) { + if (aCompFeature.get()) { static const Events_ID anEvent = Events_Loop::eventByName(EVENT_GET_DOF_OBJECTS); ModelAPI_EventCreator::get()->sendUpdated(aCompFeature->subFeature(0), anEvent); Events_Loop::loop()->flush(anEvent); diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp index 9716ae68c..cfa6ccccb 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp @@ -245,7 +245,10 @@ void PlaneGCSSolver_Solver::diagnose(const GCS::Algorithm& theAlgo) void PlaneGCSSolver_Solver::getFreeParameters(GCS::VEC_pD& theFreeParams) const { - myEquationSystem->getDependentParams(theFreeParams); + if (myConstraints.empty()) + theFreeParams = myParameters; + else + myEquationSystem->getDependentParams(theFreeParams); } void PlaneGCSSolver_Solver::addFictiveConstraintIfNecessary() diff --git a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp index eb3542bdd..833e15352 100644 --- a/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp +++ b/src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp @@ -666,6 +666,8 @@ void PlaneGCSSolver_Storage::getUnderconstrainedGeometry(std::set& th std::map aParamOfFeatures; for (std::map::const_iterator aFIt = myFeatureMap.begin(); aFIt != myFeatureMap.end(); ++aFIt) { + if (!aFIt->second) + continue; GCS::SET_pD aParams = PlaneGCSSolver_Tools::parameters(aFIt->second); for (GCS::SET_pD::iterator aPIt = aParams.begin(); aPIt != aParams.end(); ++aPIt) aParamOfFeatures[*aPIt] = aFIt->first;