From: eap Date: Fri, 12 Mar 2021 16:28:36 +0000 (+0300) Subject: Fix ID shift for testing export X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=293adaddb5853b87f9e519d189ba93d1e8b9843c;p=modules%2Fsmesh.git Fix ID shift for testing export --- diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index bd5a68380..162843db8 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -172,12 +172,12 @@ smIdType SMDS_ElementFactory::GetMinID() SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType ID ) { - smIdType id = ID - idShift; + smIdType id = ID > idShift ? ID - idShift : ID; smIdType iChunk = ( id - 1 ) / theChunkSize; smIdType index = ( id - 1 ) % theChunkSize; while ((smIdType) myChunks.size() <= iChunk ) { - smIdType id0 = myChunks.size() * theChunkSize + 1; + smIdType id0 = myChunks.size() * theChunkSize + 1 + idShift; myChunks.push_back( new SMDS_ElementChunk( this, id0 )); } SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType(index) );