From 070f27d74e97e64a8e4b6e23dea078b944669a45 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 20 Feb 2009 07:14:17 +0000 Subject: [PATCH] PAL15429 Computation of the mesh, based on "014.brep" via Tetrahedron(NETGEN), is failed. fix for G7.py + /*! + * \brief Return number of unique ancestors of the shape + */ + static int NbAncestors(const TopoDS_Shape& shape, + const SMESH_Mesh& mesh, + TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE); + --- src/SMESH/SMESH_MesherHelper.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 292c29ecb..35bfeef1a 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -1149,6 +1149,25 @@ bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap, return true; } +//======================================================================= +/*! + * \brief Return number of unique ancestors of the shape + */ +//======================================================================= + +int SMESH_MesherHelper::NbAncestors(const TopoDS_Shape& shape, + const SMESH_Mesh& mesh, + TopAbs_ShapeEnum ancestorType/*=TopAbs_SHAPE*/) +{ + TopTools_MapOfShape ancestors; + TopTools_ListIteratorOfListOfShape ansIt( mesh.GetAncestors(shape) ); + for ( ; ansIt.More(); ansIt.Next() ) { + if ( ancestorType == TopAbs_SHAPE || ansIt.Value().ShapeType() == ancestorType ) + ancestors.Add( ansIt.Value() ); + } + return ancestors.Extent(); +} + //======================================================================= /** * Check mesh without geometry for: if all elements on this shape are quadratic, -- 2.39.2