+using namespace std;
+
+namespace SMESH{
+ SMESH::SMESH_subMesh_var AddSubMesh(SMESH::SMESH_Mesh_ptr theMesh,
+ GEOM::GEOM_Object_ptr theShapeObject,
+ const char* theMeshName )
+ {
+ SMESH::SMESH_subMesh_var aSubMesh;
+ try {
+ if ( !theMesh->_is_nil() && !theShapeObject->_is_nil() )
+ aSubMesh = theMesh->GetSubMesh( theShapeObject, theMeshName );
+ }
+ catch( const SALOME::SALOME_Exception& S_ex ) {
+ QtCatchCorbaException( S_ex );
+ }
+ return aSubMesh._retn();
+ }
+}
+