X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_MeshEditor_i.cxx;h=421a0babf9d09ee7b3781f9222453746a5e7ec5d;hb=fe414fe4e7ff1d0488d8a9b9795e04a1ad34a75a;hp=c32453a9dbc4cd61651e439f4c6b726dee890fda;hpb=fad0945128baf5e8d6642d9805727269db28c4cd;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index c32453a9d..421a0babf 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -4115,8 +4115,6 @@ SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::Offset( SMESH::SMESH_IDSource_ptr theO } else { - theGroups = theCopyGroups ? getGroups( groupIds.get() ) : new SMESH::ListOfGroups; - if ( *theMeshName && mesh_var->NbFaces() == 0 ) { // new mesh empty, remove it @@ -4126,6 +4124,10 @@ SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::Offset( SMESH::SMESH_IDSource_ptr theO builder->RemoveObjectWithChildren( meshSO ); THROW_SALOME_CORBA_EXCEPTION("Offset failed", SALOME::INTERNAL_ERROR); } + if ( !groupIds ) // nothing changed in the current mesh + THROW_SALOME_CORBA_EXCEPTION("Offset failed", SALOME::INTERNAL_ERROR); + + theGroups = theCopyGroups ? getGroups( groupIds.get() ) : new SMESH::ListOfGroups; // result of Offset() is a tuple (mesh, groups) if ( mesh_var->_is_nil() ) pyDump << myMesh_i->_this() << ", "; @@ -5617,23 +5619,20 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide, initData(); const SMDS_MeshElement* elem = getMeshDS()->FindElement(ide); - if(!elem) return false; + if ( !elem ) return false; int nbn = newIDs.length(); - int i=0; vector aNodes(nbn); - int nbn1=-1; - for(; iFindNode(newIDs[i]); - if(aNode) { - nbn1++; - aNodes[nbn1] = aNode; - } + for ( int i = 0; i < nbn; i++ ) { + const SMDS_MeshNode* aNode = getMeshDS()->FindNode( newIDs[ i ]); + if ( !aNode ) + return false; + aNodes[ i ] = aNode; } TPythonDump() << "isDone = " << this << ".ChangeElemNodes( " << ide << ", " << newIDs << " )"; - bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], nbn1+1 ); + bool res = getMeshDS()->ChangeElementNodes( elem, & aNodes[0], aNodes.size() ); declareMeshModified( /*isReComputeSafe=*/ !res );