From 118122435c0ec28daab9445e1730dedb8c6c823b Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 11 Sep 2012 09:24:59 +0000 Subject: [PATCH] 0021845: EDF 1855 SMESH : A no-regression test fails on RadialQuadrangle meshing + static TopAbs_ShapeEnum GetGroupType(const TopoDS_Shape& group, + const bool avoidCompound=false); --- src/SMESH/SMESH_MesherHelper.cxx | 24 ++++++++++++++++++++++++ src/SMESH/SMESH_MesherHelper.hxx | 3 +++ 2 files changed, 27 insertions(+) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 25a0b6434..94a294341 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -1983,6 +1983,30 @@ TopoDS_Vertex SMESH_MesherHelper::IthVertex( const bool is2nd, return ( vIt.More() ? TopoDS::Vertex(vIt.Value()) : TopoDS_Vertex() ); } +//================================================================================ +/*! + * \brief Return type of shape contained in a group + * \param group - a shape of type TopAbs_COMPOUND + * \param avoidCompound - not to return TopAbs_COMPOUND + */ +//================================================================================ + +TopAbs_ShapeEnum SMESH_MesherHelper::GetGroupType(const TopoDS_Shape& group, + const bool avoidCompound) +{ + if ( !group.IsNull() ) + { + if ( group.ShapeType() != TopAbs_COMPOUND ) + return group.ShapeType(); + + // iterate on a compound + TopoDS_Iterator it( group ); + if ( it.More() ) + return avoidCompound ? GetGroupType( it.Value() ) : it.Value().ShapeType(); + } + return TopAbs_SHAPE; +} + //======================================================================= //function : IsQuadraticMesh //purpose : Check mesh without geometry for: if all elements on this shape are quadratic, diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index c74dfb858..faffe5b7a 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -164,6 +164,9 @@ public: static TopoDS_Vertex IthVertex( const bool is2nd, TopoDS_Edge anEdge, const bool CumOri=true ); + static TopAbs_ShapeEnum GetGroupType(const TopoDS_Shape& group, + const bool avoidCompound=false); + public: // ---------- PUBLIC INSTANCE METHODS ---------- -- 2.39.2