0020749: EDF 1291 SMESH : Create 2D Mesh from 3D improvement

fix calling MakeBoundaryMesh()
This commit is contained in:
eap 2010-10-15 06:35:11 +00:00
parent 307b2e336b
commit 194b484098

View File

@ -236,9 +236,9 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
LightApp_Dialog::TypesList types; LightApp_Dialog::TypesList types;
selected( names, types, ids ); selected( names, types, ids );
if ( names.count() == 1 ) if ( names.count() == 1 )
myDlg->selectObject( names, types, ids ); myDlg->selectObject( names, types, ids );
else else
myDlg->clearSelection(); myDlg->clearSelection();
} }
catch ( const SALOME::SALOME_Exception& S_ex ) { catch ( const SALOME::SALOME_Exception& S_ex ) {
SalomeApp_Tools::QtCatchCorbaException( S_ex ); SalomeApp_Tools::QtCatchCorbaException( S_ex );
@ -331,32 +331,32 @@ bool SMESHGUI_Make2DFrom3DOp::compute2DMesh()
if ( CORBA::is_nil( srcMesh ) ) { if ( CORBA::is_nil( srcMesh ) ) {
SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_narrow( obj ); SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_narrow( obj );
if ( !CORBA::is_nil( subMesh ) ) if ( !CORBA::is_nil( subMesh ) )
srcMesh = subMesh->GetFather(); srcMesh = subMesh->GetFather();
} }
if ( CORBA::is_nil( srcMesh ) ) { if ( CORBA::is_nil( srcMesh ) ) {
SMESH::SMESH_GroupBase_var grp = SMESH::SMESH_GroupBase::_narrow( obj ); SMESH::SMESH_GroupBase_var grp = SMESH::SMESH_GroupBase::_narrow( obj );
if ( !CORBA::is_nil( grp ) ) if ( !CORBA::is_nil( grp ) )
srcMesh = grp->GetMesh(); srcMesh = grp->GetMesh();
} }
if ( !CORBA::is_nil( srcMesh ) ) { if ( !CORBA::is_nil( srcMesh ) ) {
SMESH::SMESH_MeshEditor_var aMeshEditor = srcMesh->GetMeshEditor(); SMESH::SMESH_MeshEditor_var aMeshEditor = srcMesh->GetMeshEditor();
SMESH::SMESH_Group_var newGrp; SMESH::SMESH_Group_var newGrp;
SMESH::SMESH_Mesh_var mesh = aMeshEditor->MakeBoundaryMesh( obj.in(), SMESH::SMESH_Mesh_var mesh = aMeshEditor->MakeBoundaryMesh( obj.in(),
mode, mode,
meshName.toLatin1().constData(), groupName.toLatin1().constData(),
groupName.toLatin1().constData(), meshName.toLatin1().constData(),
copySrc, copySrc,
copyAll, copyAll,
newGrp.out() ); newGrp.out() );
if ( !mesh->_is_nil() ) { if ( !mesh->_is_nil() ) {
#ifdef WITHGENERICOBJ #ifdef WITHGENERICOBJ
mesh->Destroy(); mesh->Destroy();
#endif #endif
} }
if ( !newGrp->_is_nil() ) { if ( !newGrp->_is_nil() ) {
#ifdef WITHGENERICOBJ #ifdef WITHGENERICOBJ
newGrp->Destroy(); newGrp->Destroy();
#endif #endif
} }
ok = true; ok = true;