]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Crash fix in the second study.
authornds <nds@opencascade.com>
Tue, 16 Feb 2016 12:38:51 +0000 (15:38 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:49 +0000 (17:04 +0300)
src/PartSet/PartSet_CustomPrs.cpp
src/PartSet/PartSet_Module.cpp

index 3a0a054c76cd526a22ae881363ef56a8b7a65120..31c07ca077ebd45e94f9f43b76a7ff1028ca3259 100755 (executable)
@@ -148,8 +148,10 @@ void PartSet_CustomPrs::erasePresentation(const ModuleBase_IModule::ModuleBase_C
 void PartSet_CustomPrs::clearPresentation(const ModuleBase_IModule::ModuleBase_CustomizeFlag& theFlag)
 {
   Handle(PartSet_OperationPrs) anOperationPrs = getPresentation(theFlag);
+  anOperationPrs->featureShapes().clear();
   if (!anOperationPrs.IsNull())
     anOperationPrs.Nullify();
+  myPresentations[theFlag] = AISObjectPtr();
 }
 
 Handle(PartSet_OperationPrs) PartSet_CustomPrs::getPresentation(
@@ -159,8 +161,10 @@ Handle(PartSet_OperationPrs) PartSet_CustomPrs::getPresentation(
 
   if (myPresentations.contains(theFlag)) {
     AISObjectPtr anOperationPrs = myPresentations[theFlag];
-    if (!anOperationPrs.get())
+    if (!anOperationPrs.get()) {
       initPresentation(theFlag);
+      anOperationPrs = myPresentations[theFlag];
+    }
     Handle(AIS_InteractiveObject) anAISIO = anOperationPrs->impl<Handle(AIS_InteractiveObject)>();
     aPresentation = Handle(PartSet_OperationPrs)::DownCast(anAISIO);
   }
@@ -174,7 +178,9 @@ bool PartSet_CustomPrs::redisplay(const ObjectPtr& theObject,
 #ifdef DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
   return false;
 #endif
-  bool aRedisplayed = displayPresentation(theFlag, theUpdateViewer);
+  bool aRedisplayed = false;
+  if (myIsActive[theFlag])
+    aRedisplayed = displayPresentation(theFlag, theUpdateViewer);
 
   return aRedisplayed;
 }
index 641d17ac239f668baa3bd2e5efc6d8d9817dd933..cf5c2c7434f6454c83b8a9a59b8c9c02d854df11 100755 (executable)
@@ -296,8 +296,9 @@ void PartSet_Module::operationResumed(ModuleBase_Operation* theOperation)
 
 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
 {
-  bool isModified = myCustomPrs->deactivate(ModuleBase_IModule::CustomizeArguments, false) ||
-                    myCustomPrs->deactivate(ModuleBase_IModule::CustomizeResults, false);
+  bool isModifiedArgs = myCustomPrs->deactivate(ModuleBase_IModule::CustomizeArguments, false);
+  bool isModifiedResults = myCustomPrs->deactivate(ModuleBase_IModule::CustomizeResults, false);
+  bool isModified = isModifiedArgs || isModifiedResults;
 
   if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
     mySketchMgr->stopNestedSketch(theOperation);