]> OCCT Git - occt.git/commitdiff
0032750: Visualization, AIS_Manipulator - selection of moved object is broken
authordrochalo <diogo.lopes@opencascade.com>
Mon, 20 Nov 2023 10:25:09 +0000 (10:25 +0000)
committerdpasukhi <dpasukhi@opencascade.com>
Wed, 17 Apr 2024 22:19:48 +0000 (23:19 +0100)
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
tests/vselect/bugs/bug32750 [new file with mode: 0644]

index 21491cc35a791b5188a834d5bc4049f5d6f83440..bf93dbfc102dd629b24c9be1bc27d3365bfb343e 100644 (file)
@@ -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 (file)
index 0000000..36cf6db
--- /dev/null
@@ -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
+