1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

Fix warnings

This commit is contained in:
mzernova 2025-01-31 17:57:42 +00:00
parent a8a8017114
commit e5f9f70649

View File

@ -1435,7 +1435,7 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
// define sensitivity by line // define sensitivity by line
Handle(Select3D_SensitiveSegment) aLine = Handle(Select3D_SensitiveSegment) aLine =
new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition()); new Select3D_SensitiveSegment(anOwner, gp::Origin(), anAxis.TranslatorTipPosition());
aLine->SetSensitivityFactor(15); aLine->SetSensitivityFactor(aHighSensitivity);
theSelection->Add(aLine); theSelection->Add(aLine);
} }
@ -1469,7 +1469,7 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
const gp_Circ aGeomCircle(gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()), const gp_Circ aGeomCircle(gp_Ax2(gp::Origin(), anAxis.ReferenceAxis().Direction()),
anAxis.RotatorDiskRadius()); anAxis.RotatorDiskRadius());
Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle); Handle(Select3D_SensitiveCircle) aCircle = new ManipSensCircle(anOwner, aGeomCircle);
aCircle->SetSensitivityFactor(15); aCircle->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aCircle); theSelection->Add(aCircle);
} }
// enlarge sensitivity by triangulation // enlarge sensitivity by triangulation
@ -1527,18 +1527,21 @@ void AIS_Manipulator::ComputeSelection(const Handle(SelectMgr_Selection)& theSel
if (mySkinMode == ManipulatorSkin_Shaded) if (mySkinMode == ManipulatorSkin_Shaded)
{ {
// define sensitivity by two crossed lines // define sensitivity by two crossed lines
gp_Pnt aP1, aP2; Standard_Real aSensitivityOffset =
aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition(); ZoomPersistence() ? aHighSensitivity * (0.5 + M_SQRT2) : 0.0;
aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition(); gp_Pnt aP1 = myAxes[((anIt + 1) % 3)].TranslatorTipPosition().Translated(
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0; myAxes[((anIt + 2) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_Pnt aP2 = myAxes[((anIt + 2) % 3)].TranslatorTipPosition().Translated(
myAxes[((anIt + 1) % 3)].ReferenceAxis().Direction().XYZ() * aSensitivityOffset);
gp_XYZ aMidP = (aP1.XYZ() + aP2.XYZ()) / 2.0;
gp_XYZ anOrig = aMidP.Normalized().Multiplied(aSensitivityOffset);
Handle(Select3D_SensitiveSegment) aLine1 = Handle(Select3D_SensitiveSegment) aLine1 = new Select3D_SensitiveSegment(anOwner, aP1, aP2);
new Select3D_SensitiveSegment(anOwner, aP1, aP2); aLine1->SetSensitivityFactor(aLowSensitivity);
aLine1->SetSensitivityFactor(10);
theSelection->Add(aLine1); theSelection->Add(aLine1);
Handle(Select3D_SensitiveSegment) aLine2 = Handle(Select3D_SensitiveSegment) aLine2 =
new Select3D_SensitiveSegment(anOwner, gp::Origin(), aMidP); new Select3D_SensitiveSegment(anOwner, anOrig, aMidP);
aLine2->SetSensitivityFactor(10); aLine2->SetSensitivityFactor(aLowSensitivity);
theSelection->Add(aLine2); theSelection->Add(aLine2);
} }
@ -1734,14 +1737,12 @@ void AIS_Manipulator::Sector::Init(const Standard_ShortReal theRadius,
myArray = new Graphic3d_ArrayOfTriangles(4, 6, Graphic3d_ArrayFlags_VertexNormal); myArray = new Graphic3d_ArrayOfTriangles(4, 6, Graphic3d_ArrayFlags_VertexNormal);
myTriangulation = new Poly_Triangulation(4, 2, Standard_False); myTriangulation = new Poly_Triangulation(4, 2, Standard_False);
Poly_Array1OfTriangle& aTriangles = myTriangulation->ChangeTriangles();
gp_Dir aNormal = gp_Dir(0.0, 0.0, -1.0).Transformed(aTrsf);
const Standard_Real anIndent = theRadius / 3.0; const Standard_Real anIndent = theRadius / 3.0;
gp_Pnt aV1 = gp_Pnt(anIndent, anIndent, 0.0).Transformed(aTrsf); gp_Pnt aV1 = gp_Pnt(anIndent, anIndent, 0.0).Transformed(aTrsf);
gp_Pnt aV2 = gp_Pnt(anIndent, anIndent * 2.0, 0.0).Transformed(aTrsf); gp_Pnt aV2 = gp_Pnt(anIndent, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV3 = gp_Pnt(anIndent * 2.0, anIndent * 2.0, 0.0).Transformed(aTrsf); gp_Pnt aV3 = gp_Pnt(anIndent * 2.0, anIndent * 2.0, 0.0).Transformed(aTrsf);
gp_Pnt aV4 = gp_Pnt(anIndent * 2.0, anIndent, 0.0).Transformed(aTrsf); gp_Pnt aV4 = gp_Pnt(anIndent * 2.0, anIndent, 0.0).Transformed(aTrsf);
gp_Dir aNormal = gp_Dir(0.0, 0.0, -1.0).Transformed(aTrsf);
myArray->AddVertex(aV1, aNormal); myArray->AddVertex(aV1, aNormal);
myArray->AddVertex(aV2, aNormal); myArray->AddVertex(aV2, aNormal);
@ -1754,8 +1755,8 @@ void AIS_Manipulator::Sector::Init(const Standard_ShortReal theRadius,
myTriangulation->SetNode(2, aV2); myTriangulation->SetNode(2, aV2);
myTriangulation->SetNode(3, aV3); myTriangulation->SetNode(3, aV3);
myTriangulation->SetNode(4, aV4); myTriangulation->SetNode(4, aV4);
aTriangles.SetValue(1, Poly_Triangle(3, 1, 2)); myTriangulation->SetTriangle(1, Poly_Triangle(3, 1, 2));
aTriangles.SetValue(2, Poly_Triangle(1, 3, 4)); myTriangulation->SetTriangle(2, Poly_Triangle(1, 3, 4));
} }
else else
{ {