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(
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);
}
#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;
}
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);