From: mpv Date: Tue, 11 May 2021 14:52:10 +0000 (+0300) Subject: Fix for #24260 [CEA] Fatal error gp_Dir() input vector has zero norm when loading... X-Git-Tag: V9_8_0a1~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c2940ebb2ca8e823f1b06366f8b64ae440d3abb4;p=modules%2Fshaper.git Fix for #24260 [CEA] Fatal error gp_Dir() input vector has zero norm when loading python dump Make sketch invalid if external plane selected becomes invalid. And keep it while plane is re-selected. --- diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 21cb7ee6e..432c6f1c2 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -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)) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index 934df7d85..25c0cd978 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -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; } } diff --git a/src/SHAPERGUI/SHAPERGUI.cpp b/src/SHAPERGUI/SHAPERGUI.cpp index dca57ebb0..8bb312a30 100644 --- a/src/SHAPERGUI/SHAPERGUI.cpp +++ b/src/SHAPERGUI/SHAPERGUI.cpp @@ -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);