From: nds Date: Mon, 6 Jul 2015 12:08:14 +0000 (+0300) Subject: Issue #591 - Highlight of the first argument of constraints X-Git-Tag: V_1.3.0~101 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5a8963c52d15b9ad5abd1517ef968c8cbf5e5663;p=modules%2Fshaper.git 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. --- 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; }