]> OCCT Git - occt.git/commitdiff
Modeling, Bnd_Box - CornerMax incorrect realisation (#664)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Fri, 8 Aug 2025 09:18:29 +0000 (10:18 +0100)
committerdpasukhi <dpasukhi@opencascade.com>
Sat, 6 Sep 2025 20:18:29 +0000 (21:18 +0100)
- Fixed the logical error in `CornerMax()` method by correcting the openness condition checks
- Added comprehensive GTest suite for `Bnd_Box` class to prevent similar regressions
- Minor code formatting improvements in the `DumpJson()` method

src/Bnd/Bnd_Box.cxx

index 366692a1781fd4df215576c53c600a492829c808..7f6860ce6b00513984404c4b1dc9b7b28b50f5c7 100644 (file)
@@ -240,11 +240,11 @@ gp_Pnt Bnd_Box::CornerMax() const
     aCornerMax.SetX(Bnd_Precision_Infinite);
   else
     aCornerMax.SetX(Xmax + Gap);
-  if (IsOpenYmin())
+  if (IsOpenYmax())
     aCornerMax.SetY(Bnd_Precision_Infinite);
   else
     aCornerMax.SetY(Ymax + Gap);
-  if (IsOpenZmin())
+  if (IsOpenZmax())
     aCornerMax.SetZ(Bnd_Precision_Infinite);
   else
     aCornerMax.SetZ(Zmax + Gap);
@@ -1106,12 +1106,13 @@ void Bnd_Box::Dump() const
 
 //=================================================================================================
 
-void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const {
-  OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
-    OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
-
-      OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap)
-        OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags)}
+void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
+{
+  OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin);
+  OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax);
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap);
+  OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags)
+}
 
 //=================================================================================================