]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task 2.5 Show where the remaining degrees of freedom are (issue #2997)
authorazv <azv@opencascade.com>
Thu, 10 Oct 2019 13:13:53 +0000 (16:13 +0300)
committerazv <azv@opencascade.com>
Thu, 10 Oct 2019 13:13:53 +0000 (16:13 +0300)
Show non-fixes shapes if no one constraint is assigned yet.

src/PartSet/PartSet_WidgetSketchLabel.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Solver.cpp
src/SketchSolver/PlaneGCSSolver/PlaneGCSSolver_Storage.cpp

index 1b65412e84c01db704cdcba5ee8ed0a9d819028b..1cdd66a5c324e3abef1ac08de2866e98e3dd6bb3 100644 (file)
@@ -778,7 +778,7 @@ bool PartSet_WidgetSketchLabel::restoreValueCustom()
 void PartSet_WidgetSketchLabel::onShowDOF()
 {
   CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(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);
index 9716ae68c4954f897e73428188767137f5e22d50..cfa6ccccb018012c4b28b9b54fc55d0610e39bbb 100644 (file)
@@ -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()
index eb3542bdd0f20b2d8ddb9ebeed93dccb4fd7ec60..833e1535284015a86aaa0d9d9d4f9c9aad0b528c 100644 (file)
@@ -666,6 +666,8 @@ void PlaneGCSSolver_Storage::getUnderconstrainedGeometry(std::set<ObjectPtr>& th
   std::map<double*, FeaturePtr> aParamOfFeatures;
   for (std::map<FeaturePtr, EntityWrapperPtr>::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;