1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-13 14:27:08 +03:00

0025935: Visualization, TKV3d, Exception when displaying shell in the viewer

Fixed processing of double precision numbers in Visual3d_View::MinMaxValues;
Test case for issue #25935.
This commit is contained in:
vpa
2015-03-30 12:28:26 +03:00
committed by bugmaster
parent 65360da3db
commit 53a701974a
4 changed files with 48 additions and 6 deletions

View File

@@ -1714,6 +1714,18 @@ inline void addStructureBndBox (const Handle(Graphic3d_Structure)& theStruct,
// "FitAll" operation ignores object with transform persistence parameter
const Bnd_Box aBox = theStruct->MinMaxValues (theToIgnoreInfiniteFlag);
// To prevent float overflow at camera parameters calculation and further
// rendering, bounding boxes with at least one vertex coordinate out of
// float range are skipped by view fit algorithms
if (Abs (aBox.CornerMax().X()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMax().Z()) >= ShortRealLast() ||
Abs (aBox.CornerMin().X()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Y()) >= ShortRealLast() ||
Abs (aBox.CornerMin().Z()) >= ShortRealLast())
return;
theBndBox.Add (aBox);
}