virtual bool customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,
const bool theUpdateViewer);
+ /// Disable displaying of custom mode
+ /// \param theMode a mode to disable
+ virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode) {}
+
+ /// Enables disabled custom mode
+ virtual void enableCustomModes() {}
+
/// This method is called on object browser creation for customization of module specific features
/// \param theObjectBrowser a pinter on Object Browser widget
virtual void customizeObjectBrowser(QWidget* theObjectBrowser) {}
//********************************************************************
void ModuleBase_WidgetMultiSelector::deactivate()
{
+ myWorkshop->module()->enableCustomModes();
+
ModuleBase_WidgetSelector::deactivate();
if (myVisibleObjects.size())
onShowOnly(false);
for (aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
myVisibleObjects.removeAll(*aIt);
}
+ myWorkshop->module()->disableCustomMode(ModuleBase_IModule::CustomizeArguments);
}
+ else
+ myWorkshop->module()->enableCustomModes();
+
foreach(ObjectPtr aObj, myVisibleObjects) {
aObj->setDisplayed(!theChecked);
}
//#define DO_NOT_VISUALIZE_CUSTOM_PRESENTATION
PartSet_CustomPrs::PartSet_CustomPrs(ModuleBase_IWorkshop* theWorkshop)
- : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false)
+ : myWorkshop(theWorkshop), myFeature(FeaturePtr()), myPresentationIsEmpty(false),
+ myDisabledMode(-1)
{
Events_Loop* aLoop = Events_Loop::loop();
aLoop->registerListener(this, Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION));
{
bool isModified = false;
+ if (myDisabledMode == theFlag)
+ return isModified;
+
// update the AIS objects content
AISObjectPtr aPresentation = getPresentation(theFlag, true);
Handle(AIS_InteractiveObject) anAISIO = aPresentation->impl<Handle(AIS_InteractiveObject)>();
if (theFlag == ModuleBase_IModule::CustomizeArguments ||
theFlag == ModuleBase_IModule::CustomizeResults) {
anOperationPrs->setPointMarker(5, 2.);
- anOperationPrs->setWidth(1);
+ anOperationPrs->setWidth((theFlag == ModuleBase_IModule::CustomizeHighlightedObjects)? 2 : 1);
}
else if (theFlag == ModuleBase_IModule::CustomizeHighlightedObjects)
anAISPrs->useAISWidth();
/// it caused erroneus case because the presentation has linkage to the previous context.
void clearPrs();
+ /// Disable displaying of custom mode
+ /// \param theMode a mode to disable
+ void disableCustomMode(ModuleBase_IModule::ModuleBase_CustomizeFlag theMode) {
+ myDisabledMode = theMode;
+ erasePresentation(theMode, false);
+ }
+
+ /// Enables disabled custom mode
+ void enableCustomModes() { myDisabledMode = -1; }
+
//! Redefinition of Events_Listener method to listen a moment that the presentation becomes empty
virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, AISObjectPtr> myPresentations;
/// State whether the presentation is activated/deactivated
QMap<ModuleBase_IModule::ModuleBase_CustomizeFlag, bool> myIsActive;
+
+ int myDisabledMode;
};
#endif
{
return myRoot;
}
+
+//******************************************************
+void PartSet_Module::disableCustomMode(ModuleBase_CustomizeFlag theMode) {
+ myCustomPrs->disableCustomMode(theMode);
+}
+
+//******************************************************
+void PartSet_Module::enableCustomModes() {
+ myCustomPrs->enableCustomModes();
+}
virtual bool customizeObject(ObjectPtr theObject, const ModuleBase_CustomizeFlag& theFlag,
const bool theUpdateViewer);
+ /// Disable displaying of custom mode
+ /// \param theMode a mode to disable
+ virtual void disableCustomMode(ModuleBase_CustomizeFlag theMode);
+
+ /// Enables disabled custom mode
+ virtual void enableCustomModes();
+
/// This method is called on object browser creation for customisation of module specific features
/// \param theObjectBrowser a pinter on Object Browser widget
virtual void customizeObjectBrowser(QWidget* theObjectBrowser);
QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
{
XGUI_Displayer* aDisplayer = XGUI_Tools::workshop(theWorkshop)->displayer();
- if (XGUI_Displayer::isVisible(aDisplayer, theObject)) {
+ // VSV: Do not use isVisible checking because it can be used when state "Show Only" is ON
+ //if (XGUI_Displayer::isVisible(aDisplayer, theObject)) {
if (theGeomShape.get()) {
if (theObjectShapes.contains(theObject))
theObjectShapes[theObject].append(theGeomShape);
.arg(ModuleBase_Tools::objectInfo(theObject)).toStdString().c_str());
#endif
}
- }
+ //}
}
void PartSet_OperationPrs::getFeatureShapes(const FeaturePtr& theFeature,