From: eap Date: Tue, 23 Mar 2010 14:32:26 +0000 (+0000) Subject: Move from StdMeshers_ProjectionUtils X-Git-Tag: V5_1_4a1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8951a462381b15bcfdaa3858cee5bb082d120749;p=modules%2Fsmesh.git Move from StdMeshers_ProjectionUtils + static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape ); + + static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh ); --- diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 1647d0a46..ef545254b 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -1451,6 +1451,42 @@ TopAbs_Orientation SMESH_MesherHelper::GetSubShapeOri(const TopoDS_Shape& shape, return ori; } +//======================================================================= +//function : IsSubShape +//purpose : +//======================================================================= + +bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape, + const TopoDS_Shape& mainShape ) +{ + if ( !shape.IsNull() && !mainShape.IsNull() ) + { + for ( TopExp_Explorer exp( mainShape, shape.ShapeType()); + exp.More(); + exp.Next() ) + if ( shape.IsSame( exp.Current() )) + return true; + } + SCRUTE((shape.IsNull())); + SCRUTE((mainShape.IsNull())); + return false; +} + +//======================================================================= +//function : IsSubShape +//purpose : +//======================================================================= + +bool SMESH_MesherHelper::IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh ) +{ + if ( shape.IsNull() || !aMesh ) + return false; + return + aMesh->GetMeshDS()->ShapeToIndex( shape ) || + // PAL16202 + shape.ShapeType() == TopAbs_COMPOUND && aMesh->GetMeshDS()->IsGroupOfSubShapes( 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 c4623a57a..a4c039120 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -134,6 +134,11 @@ public: static TopAbs_Orientation GetSubShapeOri(const TopoDS_Shape& shape, const TopoDS_Shape& subShape); + static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape ); + + static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh ); + + public: // ---------- PUBLIC INSTANCE METHODS ----------