1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0029939: Modeling Algorithms - add NULL check to BRepGProp_Face::Load()

BRepGProp_Face::Load() has been protected against crash in case of edges without p-curves.
This commit is contained in:
kgv
2018-07-04 12:09:50 +03:00
committed by bugmaster
parent e119b6c3c7
commit 8ff2e494f5
4 changed files with 238 additions and 13 deletions

View File

@@ -175,11 +175,14 @@ void BRepGProp_Face::Bounds(Standard_Real& U1,
//purpose :
//=======================================================================
void BRepGProp_Face::Load(const TopoDS_Edge& E)
bool BRepGProp_Face::Load(const TopoDS_Edge& E)
{
Standard_Real a,b;
Handle(Geom2d_Curve) C =
BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b);
Handle(Geom2d_Curve) C = BRep_Tool::CurveOnSurface(E, mySurface.Face(), a,b);
if (C.IsNull())
{
return false;
}
if (E.Orientation() == TopAbs_REVERSED) {
Standard_Real x = a;
a = C->ReversedParameter(b);
@@ -187,6 +190,7 @@ void BRepGProp_Face::Load(const TopoDS_Edge& E)
C = C->Reversed();
}
myCurve.Load(C,a,b);
return true;
}
//=======================================================================