From f9fd6abc84fc8a4a181cba2deb3efb41e047c516 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 24 Dec 2014 18:11:11 +0300 Subject: [PATCH] Working with preselection after edit operation --- src/PartSet/PartSet_SketcherMgr.cpp | 10 +++++----- src/XGUI/XGUI_Displayer.cpp | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 33a9e91ae..7b6aea622 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -216,11 +216,11 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse if (!aViewer->isMultiSelectionEnabled()) { aViewer->enableMultiselection(true); } - aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView()); - if (theEvent->modifiers() & Qt::ShiftModifier) - aViewer->AISContext()->ShiftSelect(); - else - aViewer->AISContext()->Select(); + //aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView()); + //if (theEvent->modifiers() & Qt::ShiftModifier) + // aViewer->AISContext()->ShiftSelect(); + //else + // aViewer->AISContext()->Select(); } void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 09bc3494f..3b0cbc3e6 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -196,7 +196,13 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer) Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull()) return; - aContext->Redisplay(aAISIO, isUpdateViewer); + bool aToSelect = aContext->IsSelected(aAISIO); + aContext->Redisplay(aAISIO, false); + // Restore selection state after redisplay + if (aToSelect) + aContext->SetSelected(aAISIO); + if (isUpdateViewer) + updateViewer(); } } -- 2.39.2