From c9339e5a17f7408b7af62eca29df353bfab0cef6 Mon Sep 17 00:00:00 2001 From: asl Date: Tue, 19 Jun 2018 11:54:21 +0300 Subject: [PATCH] 0029734: minor correction for compatibility with old version of OCCT --- src/BRepGProp/BRepGProp.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/BRepGProp/BRepGProp.cxx b/src/BRepGProp/BRepGProp.cxx index 87f35d58a2..4734c68d8e 100644 --- a/src/BRepGProp/BRepGProp.cxx +++ b/src/BRepGProp/BRepGProp.cxx @@ -168,7 +168,10 @@ static Standard_Real surfaceProperties(const TopoDS_Shape& S, GProp_GProps& Prop else { BF.Load(F); - Standard_Boolean IsNatRestr = (F.NbChildren() == 0); + //Standard_Boolean IsNatRestr = (F.NbChildren() == 0); + TopoDS_Iterator aWIter(F); + Standard_Boolean IsNatRestr = !aWIter.More(); + if (!IsNatRestr) BD.Init(F); if (Eps < 1.0) { G.Perform(BF, BD, Eps); @@ -282,7 +285,10 @@ static Standard_Real volumeProperties(const TopoDS_Shape& S, GProp_GProps& Props else { BF.Load(F); - Standard_Boolean IsNatRestr = (F.NbChildren () == 0); + //Standard_Boolean IsNatRestr = (F.NbChildren () == 0); + TopoDS_Iterator aWIter(F); + Standard_Boolean IsNatRestr = !aWIter.More(); + if (!IsNatRestr) BD.Init(F); if (Eps < 1.0) { G.Perform(BF, BD, Eps); -- 2.39.5