1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00

Fix sensitivity

This commit is contained in:
mzernova 2025-01-31 23:19:19 +00:00
parent b6b7767a4d
commit 706bd14880
4 changed files with 21 additions and 11 deletions

View 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

View 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; }

View 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);
}
}
}

View 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}