]> OCCT Git - occt-copy.git/commitdiff
0029734: minor correction for compatibility with old version of OCCT
authorasl <asl@opencascade.com>
Tue, 19 Jun 2018 08:54:21 +0000 (11:54 +0300)
committerasl <asl@opencascade.com>
Tue, 19 Jun 2018 08:54:21 +0000 (11:54 +0300)
src/BRepGProp/BRepGProp.cxx

index 87f35d58a25beec1af0778542d17a22fff536124..4734c68d8e7543820aed810a3698e45190996661 100644 (file)
@@ -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);