From: vsv Date: Tue, 15 Oct 2019 15:10:48 +0000 (+0300) Subject: Issue #3041: prevent crash on change sketch plane X-Git-Tag: V9_5_0a1~167^2~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4ce1fd8af764a1293ff5c54ef2bd723864fe8cdb;p=modules%2Fshaper.git Issue #3041: prevent crash on change sketch plane --- diff --git a/src/PartSet/PartSet_WidgetSketchLabel.cpp b/src/PartSet/PartSet_WidgetSketchLabel.cpp index 548d01d13..2ba13e6bd 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -734,6 +734,7 @@ void PartSet_WidgetSketchLabel::onChangePlane() SessionPtr aMgr = ModelAPI_Session::get(); aMgr->startOperation("Change Sketch plane"); myOpenTransaction = true; + myWorkshop->viewer()->update(); } } diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index 3a876982b..f5bcf8e3d 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -165,6 +165,8 @@ void SketcherPrs_Angle::Compute(const Handle(PrsMgr_PresentationManager3d)& theP const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { + if (!plane().get()) + return; gp_Pnt aFirstPoint, aSecondPoint, aCenterPoint; bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aFirstPoint, aSecondPoint, aCenterPoint); diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index b895b6d6b..6f1179f59 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -147,6 +147,8 @@ void SketcherPrs_LengthDimension::Compute( const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { + if (!plane().get()) + return; gp_Pnt aPnt1, aPnt2; bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aPnt1, aPnt2); if (aReadyToDisplay) { diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 8d3355d77..bd10874fc 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -145,6 +145,8 @@ void SketcherPrs_Radius::Compute( const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { + if (!plane().get()) + return; gp_Circ aCircle; gp_Pnt anAnchorPoint; bool aReadyToDisplay = readyToDisplay(myConstraint, plane(), aCircle, anAnchorPoint); diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index a251d2539..5f79c5fba 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -274,6 +274,8 @@ void SketcherPrs_SymbolPrs::Compute( const Handle(Prs3d_Presentation)& thePresentation, const Standard_Integer theMode) { + if (!plane().get()) + return; // Create an icon prepareAspect();