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

0025768: Visualization, Graphic3d_Structure - do not use invalid bounding boxes of empty groups

Prs3d_WFShape::Add() - do not create empty group

Graphic3d_Structure::minMaxCoord() - do not use uninitialized bounding box

Added test case bugs/vis/bug25768
This commit is contained in:
kgv
2015-02-05 18:05:31 +03:00
committed by bugmaster
parent 15b54261a3
commit 8d3aa19e69
5 changed files with 97 additions and 48 deletions

View File

@@ -1749,21 +1749,12 @@ Handle(Graphic3d_StructureManager) Graphic3d_Structure::StructureManager() const
//function : minMaxCoord
//purpose :
//=============================================================================
Graphic3d_BndBox4f Graphic3d_Structure::minMaxCoord (const Standard_Boolean theToIgnoreInfiniteFlag) const
Graphic3d_BndBox4f Graphic3d_Structure::minMaxCoord() const
{
Graphic3d_BndBox4f aBnd;
for (Graphic3d_SequenceOfGroup::Iterator aGroupIter (myCStructure->Groups()); aGroupIter.More(); aGroupIter.Next())
{
if (!theToIgnoreInfiniteFlag)
{
aBnd.Combine (aGroupIter.Value()->BoundingBox());
}
else
{
Graphic3d_BndBox4f aValidBnd (aGroupIter.Value()->BoundingBox().CornerMin(),
aGroupIter.Value()->BoundingBox().CornerMax());
aBnd.Combine (aValidBnd);
}
aBnd.Combine (aGroupIter.Value()->BoundingBox());
}
return aBnd;
}
@@ -1775,7 +1766,7 @@ Graphic3d_BndBox4f Graphic3d_Structure::minMaxCoord (const Standard_Boolean theT
void Graphic3d_Structure::getBox (Graphic3d_BndBox4d& theBox,
const Standard_Boolean theToIgnoreInfiniteFlag) const
{
Graphic3d_BndBox4f aBoxF = minMaxCoord (theToIgnoreInfiniteFlag);
Graphic3d_BndBox4f aBoxF = minMaxCoord();
if (aBoxF.IsValid())
{
theBox = Graphic3d_BndBox4d (Graphic3d_Vec4d ((Standard_Real )aBoxF.CornerMin().x(),