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

0029814: Modeling Data - add method TopoDS_Shape::NbChildren() for simple check of sub-shapes number

TopoDS_Shape::NbChildren() - new method has been introduced.
TopoDS_Shape.lxx, TopoDS_TShape.lxx - inline methods have been moved to hxx.
TopoDS_TShape_Flags has been redeclared as enumeration instead of preprocessor macros.

Cyclic dependency between headers TopoDS_Shape.hxx and TopoDS_TShape.hxx eliminated.

Places where TopoDS_Iterator is used only for calculation of number of sub-shapes are updated to use NbChildren() instead
This commit is contained in:
kgv
2018-05-24 18:06:37 +03:00
committed by bugmaster
parent e67e482d99
commit b2d1851c43
68 changed files with 321 additions and 1090 deletions

View File

@@ -313,8 +313,7 @@ namespace
for (TopExp_Explorer aFaceIter (theShape, TopAbs_FACE); aFaceIter.More(); aFaceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIter.Current());
TopoDS_Iterator aSubShapeIter (aFace);
if (!aSubShapeIter.More())
if (aFace.NbChildren() == 0)
{
// handle specifically faces without boundary definition (triangulation-only)
StdPrs_WFShape::AddEdgesOnTriangulation (aSeqPntsExtra, aFace, Standard_False);
@@ -554,15 +553,13 @@ void StdPrs_ShadedShape::Add (const Handle (Prs3d_Presentation)& thePrs,
aBuilder.MakeCompound (anOpened);
ExploreSolids (theShape, aBuilder, aClosed, anOpened, Standard_True);
TopoDS_Iterator aShapeIter (aClosed);
if (aShapeIter.More())
if (aClosed.NbChildren() > 0)
{
shadeFromShape (aClosed, thePrs, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, true);
}
aShapeIter.Initialize (anOpened);
if (aShapeIter.More())
if (anOpened.NbChildren() > 0)
{
shadeFromShape (anOpened, thePrs, theDrawer,
theHasTexels, theUVOrigin, theUVRepeat, theUVScale, false);