From: ageay Date: Tue, 30 Jul 2013 09:00:41 +0000 (+0000) Subject: MEDReader -> debugging session X-Git-Tag: B4PolyhIntersect~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c6f262001bfe2eb0d12974d2fa1ccf8eb76f03b;p=modules%2Fmed.git MEDReader -> debugging session --- diff --git a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx index 9398553ba..2e10e3001 100644 --- a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx +++ b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx @@ -244,8 +244,8 @@ DataArrayInt *MEDCouplingStructuredMesh::checkTypeConsistencyAndContig(const std */ void MEDCouplingStructuredMesh::splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType) const throw(INTERP_KERNEL::Exception) { - if(!profile) - throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::splitProfilePerType : input profile is NULL !"); + if(!profile || !profile->isAllocated()) + throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::splitProfilePerType : input profile is NULL or not allocated !"); if(profile->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("MEDCouplingStructuredMesh::splitProfilePerType : input profile should have exactly one component !"); int nbTuples=profile->getNumberOfTuples(); @@ -256,13 +256,15 @@ void MEDCouplingStructuredMesh::splitProfilePerType(const DataArrayInt *profile, if(profile->isIdentity() && nbTuples==nbOfCells) { code[2]=-1; - idsInPflPerType[0]=const_cast(profile); idsInPflPerType[0]->incrRef(); - idsPerType.clear(); + idsInPflPerType[0]=0; + idsPerType.clear(); + return ; } + code[1]=profile->getNumberOfTuples(); code[2]=0; profile->checkAllIdsInRange(0,nbOfCells); idsPerType.resize(1); - idsPerType[0]=const_cast(profile); idsPerType[0]->incrRef(); + idsPerType[0]=profile->deepCpy(); idsInPflPerType[0]=DataArrayInt::Range(0,nbTuples,1); }