From: eap Date: Tue, 30 Nov 2010 17:43:19 +0000 (+0000) Subject: 0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement X-Git-Tag: tag_Before_ViscLayers_PrototypeVersion~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d628c6bca59a6d7130d7c83231e4c6a2de77761f;p=modules%2Fsmesh.git 0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement fix type of created group and python dump --- diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index d442601d5..d0491e5d0 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -5248,7 +5248,7 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource, SMESH_Group* smesh_group = 0; if ( strlen(groupName) ) { - group_var = mesh_i->CreateGroup( SMESH::ElementType(elemType),groupName); + group_var = mesh_i->CreateGroup( SMESH::ElementType(int(elemType)-1),groupName); if ( SMESH_GroupBase_i* group_i = SMESH::DownCast( group_var )) smesh_group = group_i->GetSmeshGroup(); } @@ -5264,6 +5264,8 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource, storeResult( aMeshEditor ); } + const char* dimName[] = { "BND_2DFROM3D", "BND_1DFROM3D", "BND_1DFROM2D" }; + // result of MakeBoundaryMesh() is a tuple (mesh, group) if ( mesh_var->_is_nil() ) pyDump << myMesh_i->_this() << ", "; @@ -5275,9 +5277,9 @@ SMESH_MeshEditor_i::MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr idSource, pyDump << group_var << " = "; pyDump << this << ".MakeBoundaryMesh( " << idSource << ", " - << dim << ", " - << groupName << ", " - << meshName<< ", " + << "SMESH." << dimName[int(dim)] << ", " + << "'" << groupName << "', " + << "'" << meshName<< "', " << toCopyElements << ", " << toCopyExistingBondary << ")";