Salome HOME
0021845: EDF 1855 SMESH : A no-regression test fails on RadialQuadrangle meshing
authoreap <eap@opencascade.com>
Tue, 11 Sep 2012 09:24:59 +0000 (09:24 +0000)
committereap <eap@opencascade.com>
Tue, 11 Sep 2012 09:24:59 +0000 (09:24 +0000)
+  static TopAbs_ShapeEnum GetGroupType(const TopoDS_Shape& group,
+                                       const bool          avoidCompound=false);

src/SMESH/SMESH_MesherHelper.cxx
src/SMESH/SMESH_MesherHelper.hxx

index 25a0b6434a9c81ebfcc22a173964332c1e2f831b..94a294341e6103b6e998363bb18f995069c3bf47 100644 (file)
@@ -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,
index c74dfb8583e122094edb5cda02d5706073122e1e..faffe5b7a412144a4e0e59407f84d7ec1702322c 100644 (file)
@@ -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 ----------