From 5a8963c52d15b9ad5abd1517ef968c8cbf5e5663 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 6 Jul 2015 15:08:14 +0300 Subject: [PATCH] Issue #591 - Highlight of the first argument of constraints Sketch contour->hide, Extrusion start, select sketch. The multi control editor is not initialized by selection. --- src/XGUI/XGUI_Displayer.cpp | 15 ++++++++++++--- src/XGUI/XGUI_ModuleConnector.cpp | 2 -- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 98cea3cff..68d6ae9dc 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -575,14 +575,23 @@ ObjectPtr XGUI_Displayer::getObject(const AISObjectPtr& theIO) const ObjectPtr XGUI_Displayer::getObject(const Handle(AIS_InteractiveObject)& theIO) const { - ObjectPtr aFeature; + ObjectPtr anObject; foreach (ObjectPtr anObj, myResult2AISObjectMap.keys()) { AISObjectPtr aAIS = myResult2AISObjectMap[anObj]; Handle(AIS_InteractiveObject) anAIS = aAIS->impl(); if (anAIS == theIO) - return anObj; + anObject = anObj; + if (anObject.get()) + break; + } + if (!anObject.get()) { + std::shared_ptr anAISObj = AISObjectPtr(new GeomAPI_AISObject()); + if (!theIO.IsNull()) { + anAISObj->setImpl(new Handle(AIS_InteractiveObject)(theIO)); + } + anObject = myWorkshop->module()->findPresentedObject(anAISObj); } - return aFeature; + return anObject; } bool XGUI_Displayer::enableUpdateViewer(const bool isEnabled) diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index de204ffb4..700b25bc7 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -100,8 +100,6 @@ ObjectPtr XGUI_ModuleConnector::findPresentedObject(const AISObjectPtr& theAIS) { XGUI_Displayer* aDisp = myWorkshop->displayer(); ObjectPtr anObject = aDisp->getObject(theAIS); - if (!anObject.get()) - anObject = module()->findPresentedObject(theAIS); return anObject; } -- 2.39.2