Salome HOME
Correction for regressions: sketch result line(green) stayed in the viewer by mouse...
authornds <nds@opencascade.com>
Fri, 22 Jan 2016 07:58:24 +0000 (10:58 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:27 +0000 (17:04 +0300)
src/PartSet/PartSet_CustomPrs.cpp

index 373ee633236663184bfd3b7f31767520d51939a6..fdb2a0f3b109478dbf225b25e81ea3004f78f18e 100755 (executable)
@@ -85,7 +85,7 @@ bool PartSet_CustomPrs::displayPresentation(
   // update the AIS objects content
   Handle(PartSet_OperationPrs) anOperationPrs = getPresentation(theFlag);
   // do nothing if the feature can not be displayed [is moved from presentation, to be checked]
-  if (!myFeature.get() || !myWorkshop->module()->canDisplayObject(myFeature))
+  if (!myFeature.get())
     return isModified;
 
   switch (theFlag) {
@@ -105,7 +105,9 @@ bool PartSet_CustomPrs::displayPresentation(
   // redisplay AIS objects
   Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
   if (!aContext.IsNull() && !aContext->IsDisplayed(anOperationPrs)) {
-    if (anOperationPrs->hasShapes()) {
+    // when the feature can not be visualized in the module, the operation preview should not
+    // be visualized also
+    if (anOperationPrs->hasShapes() && myWorkshop->module()->canDisplayObject(myFeature)) {
       // set color here because it can be changed in preferences
       Quantity_Color aShapeColor = getShapeColor(theFlag);
       anOperationPrs->setShapeColor(aShapeColor);
@@ -119,7 +121,9 @@ bool PartSet_CustomPrs::displayPresentation(
     }
   }
   else {
-    if (!anOperationPrs->hasShapes()) {
+    // when the feature can not be visualized in the module, the operation preview should not
+    // be visualized also
+    if (!anOperationPrs->hasShapes() || !myWorkshop->module()->canDisplayObject(myFeature)) {
       erasePresentation(theFlag, theUpdateViewer);
       isModified = true;
     }