From 3a5ea211f91dd6ac56e0bf7b673005ed368ae9d2 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 20 Aug 2018 16:52:19 +0300 Subject: [PATCH] Lock pre-highlighting of object --- src/XGUI/XGUI_ViewerProxy.cpp | 61 ++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index d763573e3..8687cba06 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -319,36 +319,37 @@ void XGUI_ViewerProxy::eraseHighlight() void XGUI_ViewerProxy::onMouseMove(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent) { - Handle(AIS_InteractiveContext) aContext = AISContext(); - if (!aContext.IsNull()) { - Handle(SelectMgr_EntityOwner) aOwner; - Handle(AIS_InteractiveObject) anIO; - ObjectPtr aObj; - bool isDisplayed = false; - XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) { - aOwner = aContext->DetectedOwner(); - anIO = Handle(AIS_InteractiveObject)::DownCast(aOwner->Selectable()); - aObj = aDisplayer->getObject(anIO); - if (aObj.get()) { - FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); - if (aFeature.get()) { - if (aFeature != myFeature) { - eraseHighlight(); - myFeature = aFeature; - displayHighlight(); - aContext->UpdateCurrentViewer(); - } - isDisplayed = true; - } - } - } - if (!isDisplayed) { - eraseHighlight(); - aContext->UpdateCurrentViewer(); - myFeature = FeaturePtr(); - } - } + // vsv: Display prehighlighting of detected object + //Handle(AIS_InteractiveContext) aContext = AISContext(); + //if (!aContext.IsNull()) { + // Handle(SelectMgr_EntityOwner) aOwner; + // Handle(AIS_InteractiveObject) anIO; + // ObjectPtr aObj; + // bool isDisplayed = false; + // XGUI_Displayer* aDisplayer = myWorkshop->displayer(); + // for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) { + // aOwner = aContext->DetectedOwner(); + // anIO = Handle(AIS_InteractiveObject)::DownCast(aOwner->Selectable()); + // aObj = aDisplayer->getObject(anIO); + // if (aObj.get()) { + // FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + // if (aFeature.get()) { + // if (aFeature != myFeature) { + // eraseHighlight(); + // myFeature = aFeature; + // displayHighlight(); + // aContext->UpdateCurrentViewer(); + // } + // isDisplayed = true; + // } + // } + // } + // if (!isDisplayed) { + // eraseHighlight(); + // aContext->UpdateCurrentViewer(); + // myFeature = FeaturePtr(); + // } + //} emit mouseMove(theWnd, theEvent); } -- 2.39.2