]> OCCT Git - occt.git/commitdiff
#remarks CR33084
authormzernova <mzernova@opencascade.com>
Wed, 3 Aug 2022 15:42:03 +0000 (18:42 +0300)
committermzernova <mzernova@opencascade.com>
Wed, 3 Aug 2022 15:42:03 +0000 (18:42 +0300)
src/Select3D/Select3D_SensitiveCylinder.cxx

index 392c6cae36674ab6b906693c2802bfccc4c51f9b..6c2ebf181e72bd6c04e30ad8bc8aedb583a3e3ab 100644 (file)
@@ -81,17 +81,14 @@ Handle(Select3D_SensitiveEntity) Select3D_SensitiveCylinder::GetConnected()
 Select3D_BndBox3d Select3D_SensitiveCylinder::BoundingBox()
 {
   Standard_Real aMaxRad = Max (myBottomRadius, myTopRadius);
-  gp_Pnt aCenterBottom (-aMaxRad, -aMaxRad, 0);
-  gp_Pnt aCenterTop (aMaxRad, aMaxRad, myHeight);
-  aCenterBottom.Transform (myTrsf);
-  aCenterTop.Transform (myTrsf);
-  const SelectMgr_Vec3 aMinPnt (Min (aCenterBottom.X(), aCenterTop.X()),
-                                Min (aCenterBottom.Y(), aCenterTop.Y()),
-                                Min (aCenterBottom.Z(), aCenterTop.Z()));
-  const SelectMgr_Vec3 aMaxPnt (Max (aCenterBottom.X(), aCenterTop.X()),
-                                Max (aCenterBottom.Y(), aCenterTop.Y()),
-                                Max (aCenterBottom.Z(), aCenterTop.Z()));
-  return Select3D_BndBox3d (aMinPnt, aMaxPnt);
+  Graphic3d_Mat4d aTrsf;
+  myTrsf.GetMat4 (aTrsf);
+
+  Select3D_BndBox3d aBox (SelectMgr_Vec3 (-aMaxRad, -aMaxRad, 0),
+                          SelectMgr_Vec3 (aMaxRad, aMaxRad, myHeight));
+  aBox.Transform (aTrsf);
+
+  return aBox;
 }
 
 //==================================================