]> OCCT Git - occt.git/commitdiff
Fix sensitivity CR31644_2
authormzernova <mzernova@opencascade.com>
Fri, 31 Jan 2025 23:19:19 +0000 (23:19 +0000)
committermzernova <mzernova@opencascade.com>
Sat, 1 Feb 2025 14:00:37 +0000 (14:00 +0000)
src/AIS/AIS_Manipulator.cxx
src/AIS/AIS_Manipulator.hxx
src/OpenGl/OpenGl_Structure.cxx
tests/vselect/bugs/bug32750

index 604f0eb73ab635638782b9d736c2c131da0596f8..e839f744a19a12bb8f9b7dd239e8babcb3ea931d 100644 (file)
@@ -646,6 +646,13 @@ Standard_Boolean AIS_Manipulator::ObjectTransformation(const Standard_Integer  t
         mySectorGroup->SetTransformation(aTrsf);
       }
 
+      // Change value of an angle if it should have different sign.
+      if (anAngle * myPrevState < 0 && Abs(anAngle) < M_PI_2)
+      {
+        Standard_Real aSign = myPrevState > 0 ? -1.0 : 1.0;
+        anAngle             = aSign * (M_PI * 2 - anAngle);
+      }
+
       gp_Trsf aNewTrsf;
       aNewTrsf.SetRotation(aCurrAxis, anAngle);
       theTrsf *= aNewTrsf;
@@ -720,14 +727,14 @@ Standard_Boolean AIS_Manipulator::ProcessDragging(const Handle(AIS_InteractiveCo
       return Standard_True;
     }
     case AIS_DragAction_Stop: {
-      // at the end of transformation redisplay for updating sensitive areas
       StopTransform(true);
       if (mySkinMode == ManipulatorSkin_Flat)
       {
         mySectorGroup->Clear();
       }
-      if (aCtx->IsDisplayed(this))
+      else if (aCtx->IsDisplayed(this))
       {
+        // at the end of transformation redisplay for updating sensitive areas
         aCtx->Redisplay(this, true);
       }
       return Standard_True;
@@ -1504,7 +1511,7 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
           // define sensitivity by point
           Handle(Select3D_SensitivePoint) aPnt =
             new Select3D_SensitivePoint(anOwner, myAxes[anIt].ScalerCubePosition());
-          aPnt->SetSensitivityFactor(15);
+          aPnt->SetSensitivityFactor(aHighSensitivity);
           theSelection->Add(aPnt);
         }
         // enlarge sensitivity by triangulation
index 7b9530b4a50522264aa188eca85afe224598d9f8..925d67b07c35fc69372b311b87deb34e66f8a447 100644 (file)
@@ -688,10 +688,7 @@ protected: //! @name Auxiliary classes to fill presentation with proper primitiv
 
     void SetIndent(const Standard_ShortReal theValue) { myIndent = theValue; }
 
-    Standard_ShortReal Size() const
-    {
-      return myLength + myBoxSize + myDiskThickness + myIndent * 2.0f;
-    }
+    Standard_ShortReal Size() const { return myInnerRadius + myDiskThickness + myIndent * 2; }
 
     Standard_ShortReal InnerRadius() const { return myInnerRadius + myIndent * 2.0f; }
 
index f0a5957e4595d517a1184047ec1158c0083de541..250896408122ba04e0c6b88dcd88a5079418083a 100644 (file)
@@ -407,7 +407,10 @@ void OpenGl_Structure::renderGeometry(const Handle(OpenGl_Workspace)& theWorkspa
     const OpenGl_Group* aGroup = aGroupIter.Value();
 
     const gp_Trsf& aTrsf = aGroup->Transformation();
-    applyTransformation(aCtx, aTrsf, Standard_True);
+    if (aTrsf.Form() != gp_Identity)
+    {
+      applyTransformation(aCtx, aTrsf, Standard_True);
+    }
 
     const Handle(Graphic3d_TransformPers)& aTrsfPers = aGroup->TransformPersistence();
     if (!aTrsfPers.IsNull())
@@ -425,7 +428,10 @@ void OpenGl_Structure::renderGeometry(const Handle(OpenGl_Workspace)& theWorkspa
       aCtx->ApplyModelViewMatrix();
     }
 
-    applyTransformation(aCtx, aTrsf, Standard_False);
+    if (aTrsf.Form() != gp_Identity)
+    {
+      applyTransformation(aCtx, aTrsf, Standard_False);
+    }
   }
 }
 
index 36cf6dbdc55b9ecdbc0c5cbb3ee2f19cd051f83e..a982d6bd2d9f944e1faf409c35c89629025bb652 100644 (file)
@@ -18,8 +18,8 @@ vzoom 0.5
 vmanipulator m -attach b
 
 #set mouse coordinates for actions
-set mouse_pick {205 155}
-set mouse_drag1 {205 55}
+set mouse_pick {206 155}
+set mouse_drag1 {206 55}
 set mouse_pick2 {250 10}
 set mouse_pick3 {250 200}