From: eap Date: Tue, 1 Nov 2011 14:07:50 +0000 (+0000) Subject: 0021408: EDf 2006 SMESH: USe of DoubleNodesOnGroupBoundaries on 2D leads to crash X-Git-Tag: V6_4_0b1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eea7a3b8246318ea72b867eb0cd8fe218453e55b;p=modules%2Fsmesh.git 0021408: EDf 2006 SMESH: USe of DoubleNodesOnGroupBoundaries on 2D leads to crash In DoubleNodesOnGroupBoundaries(), throw in case of not volume group --- diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 94273a2e0..bb38829be 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -5673,6 +5673,7 @@ CORBA::Boolean SMESH_MeshEditor_i::Make2DMeshFrom3D() CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains, CORBA::Boolean createJointElems ) + throw (SALOME::SALOME_Exception) { initData(); @@ -5686,8 +5687,10 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::Li for ( int i = 0, n = theDomains.length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGrp = theDomains[ i ]; - if ( !CORBA::is_nil( aGrp ) && ( aGrp->GetType() != SMESH::NODE ) ) + if ( !CORBA::is_nil( aGrp ) /*&& ( aGrp->GetType() != SMESH::NODE )*/ ) { + if ( aGrp->GetType() != SMESH::VOLUME ) + THROW_SALOME_CORBA_EXCEPTION("Not a volume group", SALOME::BAD_PARAM); TIDSortedElemSet domain; domain.clear(); domains.push_back(domain); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index 840008071..4efded98b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -713,7 +713,8 @@ public: * @return TRUE if operation has been completed successfully, FALSE otherwise */ CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains, - CORBA::Boolean createJointElems ); + CORBA::Boolean createJointElems ) + throw (SALOME::SALOME_Exception); /*! * \brief Double nodes on some external faces and create flat elements. * Flat elements are mainly used by some types of mechanic calculations.