From: nds Date: Fri, 11 Sep 2015 14:57:39 +0000 (+0300) Subject: Issue #916 Sketch is broken after its modification X-Git-Tag: V_1.4.0_beta4~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8ff3185a40c003ac313018890037c5ec1930f289;p=modules%2Fshaper.git Issue #916 Sketch is broken after its modification --- diff --git a/src/PartSet/PartSet_CustomPrs.cpp b/src/PartSet/PartSet_CustomPrs.cpp index 3bf751b1e..0ac8ee0c6 100755 --- a/src/PartSet/PartSet_CustomPrs.cpp +++ b/src/PartSet/PartSet_CustomPrs.cpp @@ -36,7 +36,7 @@ bool PartSet_CustomPrs::isActive() Handle(PartSet_OperationPrs) anOperationPrs = getPresentation(); Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); - return aContext->IsDisplayed(anOperationPrs); + return !aContext.IsNull() && aContext->IsDisplayed(anOperationPrs); } bool PartSet_CustomPrs::activate(const FeaturePtr& theFeature, const bool theUpdateViewer) @@ -62,7 +62,7 @@ bool PartSet_CustomPrs::deactivate(const bool theUpdateViewer) anOperationPrs->setFeature(FeaturePtr()); Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); - if (aContext->IsDisplayed(anOperationPrs)) { + if (!aContext.IsNull() && aContext->IsDisplayed(anOperationPrs)) { erasePresentation(theUpdateViewer); isModified = true; } @@ -76,7 +76,7 @@ void PartSet_CustomPrs::displayPresentation(const bool theUpdateViewer) Handle(PartSet_OperationPrs) anOperationPrs = getPresentation(); Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); - if (!aContext->IsDisplayed(anOperationPrs)) { + if (!aContext.IsNull() && !aContext->IsDisplayed(anOperationPrs)) { PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); XGUI_Workshop* aWorkshop = workshop(); @@ -111,7 +111,7 @@ bool PartSet_CustomPrs::redisplay(const ObjectPtr& theObject, const bool theUpda // [it should be hiddend] or the new AIS depend on it [it should be visualized] Handle(PartSet_OperationPrs) anOperationPrs = getPresentation(); Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); - if (aContext->IsDisplayed(anOperationPrs)) { + if (!aContext.IsNull() && aContext->IsDisplayed(anOperationPrs)) { // if there are performance poblems, to improve them, the necessity of redisplay can be checked //bool aChanged = anOperationPrs->dependOn(theObject); anOperationPrs->updateShapes();