Salome HOME
Fix for #24260 [CEA] Fatal error gp_Dir() input vector has zero norm when loading...
authormpv <mpv@opencascade.com>
Tue, 11 May 2021 14:52:10 +0000 (17:52 +0300)
committermpv <mpv@opencascade.com>
Tue, 11 May 2021 14:52:10 +0000 (17:52 +0300)
Make sketch invalid if external plane selected becomes invalid. And keep it while plane is re-selected.

src/Model/Model_AttributeSelection.cpp
src/Model/Model_Update.cpp
src/SHAPERGUI/SHAPERGUI.cpp

index 21cb7ee6eea0c727911709f3198dfa62a1dbabd0..432c6f1c2e7740d37293b040c46aafd89823e727 100644 (file)
@@ -604,6 +604,8 @@ bool Model_AttributeSelection::update()
     aResult = aSelector.restore(aContextShape);
     bool aWasInvalid = aSelLab.IsAttribute(kINVALID_SELECTION);
     setInvalidIfFalse(aSelLab, aResult);
+    if (!aResult)
+      aWasInvalid = false;
 
     TopoDS_Shape aNewShape;
     if (aSelLab.FindAttribute(TNaming_NamedShape::GetID(), aNS))
index 934df7d85c03a8a4a0d80426fc22e6f9dcd0f0b2..25c0cd9783f1f1393325751fb1ebd2b4c3681551 100644 (file)
@@ -894,7 +894,9 @@ void Model_Update::updateArguments(FeaturePtr theFeature) {
           bool isObligatory = !aFactory->isNotObligatory(
             theFeature->getKind(), theFeature->data()->id(aSel)) &&
             aFactory->isCase(theFeature, theFeature->data()->id(aSel));
-          if (isObligatory)
+          if (isObligatory ||
+            // #24260 : sketch plane was selected, but selection becomes wrong, make it invalid
+            (theFeature->getKind() == "Sketch" && aSel->id() == "External"))
             aState = ModelAPI_StateInvalidArgument;
         }
       }
index dca57ebb0c45f7c0b0bab34e001be2d5436409a2..8bb312a30e4ee8c7dc40acdb59d14465b6079a51 100644 (file)
@@ -686,14 +686,14 @@ QAction* SHAPERGUI::addFeature(const QString& theWBName, const QString& theTBNam
   aAction->setData(theId);
 
   int aWBMenu = createMenu(theWBName, -1, -1, 30/*10-Window, 1000 - Help*/);
-#ifdef _DEBUG
-  int aItemId =
-#endif
 
   if( theId == "PointCoordinates" )
     createMenu(separator(), aWBMenu);
 
-  createMenu(aId, aWBMenu);
+#ifdef _DEBUG
+  int aItemId =
+#endif
+    createMenu(aId, aWBMenu);
 
   if (isAddSeparator)
     createMenu(separator(), aWBMenu);