From: eap Date: Tue, 11 Sep 2012 09:24:59 +0000 (+0000) Subject: 0021845: EDF 1855 SMESH : A no-regression test fails on RadialQuadrangle meshing X-Git-Tag: V6_6_0a1~123 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=118122435c0ec28daab9445e1730dedb8c6c823b;p=modules%2Fsmesh.git 0021845: EDF 1855 SMESH : A no-regression test fails on RadialQuadrangle meshing + static TopAbs_ShapeEnum GetGroupType(const TopoDS_Shape& group, + const bool avoidCompound=false); --- 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 ----------