Skip to content

Commit 687a36c

Browse files
authored
Modeling, Bnd_Box - CornerMax incorrect realisation (Open-Cascade-SAS#664)
- 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
1 parent 5998693 commit 687a36c

File tree

3 files changed

+776
-8
lines changed

3 files changed

+776
-8
lines changed

src/FoundationClasses/TKMath/Bnd/Bnd_Box.cxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,11 @@ gp_Pnt Bnd_Box::CornerMax() const
240240
aCornerMax.SetX(Bnd_Precision_Infinite);
241241
else
242242
aCornerMax.SetX(Xmax + Gap);
243-
if (IsOpenYmin())
243+
if (IsOpenYmax())
244244
aCornerMax.SetY(Bnd_Precision_Infinite);
245245
else
246246
aCornerMax.SetY(Ymax + Gap);
247-
if (IsOpenZmin())
247+
if (IsOpenZmax())
248248
aCornerMax.SetZ(Bnd_Precision_Infinite);
249249
else
250250
aCornerMax.SetZ(Zmax + Gap);
@@ -1106,12 +1106,13 @@ void Bnd_Box::Dump() const
11061106

11071107
//=================================================================================================
11081108

1109-
void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const {
1110-
OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin)
1111-
OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax)
1112-
1113-
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap)
1114-
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags)}
1109+
void Bnd_Box::DumpJson(Standard_OStream& theOStream, Standard_Integer) const
1110+
{
1111+
OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMin", 3, Xmin, Ymin, Zmin);
1112+
OCCT_DUMP_FIELD_VALUES_NUMERICAL(theOStream, "CornerMax", 3, Xmax, Ymax, Zmax);
1113+
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Gap);
1114+
OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Flags)
1115+
}
11151116

11161117
//=================================================================================================
11171118

0 commit comments

Comments
 (0)