From d4dbeab49bea128a59ca34166532d96ebfaae445 Mon Sep 17 00:00:00 2001 From: drochalo Date: Mon, 20 Nov 2023 10:25:09 +0000 Subject: [PATCH] 0032750: Visualization, AIS_Manipulator - selection of moved object is broken Completed the stop transform action when dragging manipulator with mouse. Added context redisplay for update of interactive object sensitive areas. Added test. --- src/AIS/AIS_Manipulator.cxx | 13 +++++++++-- tests/vselect/bugs/bug32750 | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 tests/vselect/bugs/bug32750 diff --git a/src/AIS/AIS_Manipulator.cxx b/src/AIS/AIS_Manipulator.cxx index 21491cc35a..bf93dbfc10 100644 --- a/src/AIS/AIS_Manipulator.cxx +++ b/src/AIS/AIS_Manipulator.cxx @@ -643,7 +643,7 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation (const Standard_Integer t //function : ProcessDragging //purpose : //======================================================================= -Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveContext)&, +Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveContext)& aCtx, const Handle(V3d_View)& theView, const Handle(SelectMgr_EntityOwner)&, const Graphic3d_Vec2i& theDragFrom, @@ -676,7 +676,16 @@ Standard_Boolean AIS_Manipulator::ProcessDragging (const Handle(AIS_InteractiveC return Standard_True; } case AIS_DragAction_Stop: - break; + { + //at the end of transformation redisplay for updating sensitive areas + StopTransform (true); + if (aCtx->IsDisplayed (this)) + { + aCtx->Redisplay (this, true); + } + return Standard_True; + } + break; } return Standard_False; } diff --git a/tests/vselect/bugs/bug32750 b/tests/vselect/bugs/bug32750 new file mode 100644 index 0000000000..36cf6dbdc5 --- /dev/null +++ b/tests/vselect/bugs/bug32750 @@ -0,0 +1,44 @@ +puts "========" +puts "0032750: Visualization, AIS_Manipulator - selection of moved object is broken" +puts "========" +puts "" + +#load modules +pload MODELING VISUALIZATION +vinit + +#create box and attach manipulator +box b 100 100 100 +vdisplay b +vsetdispmode 1 +vaspects -shadingModel unlit +vfront +vfit +vzoom 0.5 +vmanipulator m -attach b + +#set mouse coordinates for actions +set mouse_pick {205 155} +set mouse_drag1 {205 55} +set mouse_pick2 {250 10} +set mouse_pick3 {250 200} + +#NOTE: issue not reproducible by draw command +#but similar action with mouse would show issue +#set mouse action +vmoveto {*}$mouse_pick +vselect {*}$mouse_pick +vmanipulator m -startTransform {*}$mouse_pick +vmanipulator m -transform {*}$mouse_drag1 +vmanipulator m -stopTransform +vselect 0 0 + +#check if object is selected +vremove m +vmoveto 0 0 +vdump $imagedir/${casename}_unselected.png +vmoveto {*}$mouse_pick2 +vdump $imagedir/${casename}_selectTop.png +vmoveto {*}$mouse_pick3 +vdump $imagedir/${casename}_selectBot.png +