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_4_0b1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e7f4df4f1061daf465296a5d1f29eb32dd2e071;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 ae937d345..0dde98c1c 100644 --- a/src/PartSet/PartSet_WidgetSketchLabel.cpp +++ b/src/PartSet/PartSet_WidgetSketchLabel.cpp @@ -726,6 +726,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();