From: eap Date: Fri, 20 Feb 2009 07:14:17 +0000 (+0000) Subject: PAL15429 Computation of the mesh, based on "014.brep" via Tetrahedron(NETGEN), is... X-Git-Tag: V4_1_5rc1~40 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=070f27d74e97e64a8e4b6e23dea078b944669a45;p=modules%2Fsmesh.git 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); + --- 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,