Merge from 1.10.2.4.6.5

This commit is contained in:
prascle 2010-12-06 17:02:23 +00:00
parent 85f3ec887b
commit 1df03b4615

View File

@ -67,12 +67,14 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME)
else else
{ {
int idInSubShape = ME->getIdInShape(); int idInSubShape = ME->getIdInShape();
if (idInSubShape >= 0)
{
MESSAGE("add element in subshape already belonging to that subshape " MESSAGE("add element in subshape already belonging to that subshape "
<< ME->GetID() << " " << oldShapeId << " " << idInSubShape); << ME->GetID() << " " << oldShapeId << " " << idInSubShape);
// check if ok: do nothing if ok // check if ok: do nothing if ok
if ((idInSubShape == -1) || (idInSubShape >= myElements.size())) if (idInSubShape >= myElements.size())
{ {
MESSAGE("out of bounds"); MESSAGE("out of bounds " << idInSubShape << " " << myElements.size());
throw SALOME_Exception(LOCALIZED("out of bounds")); throw SALOME_Exception(LOCALIZED("out of bounds"));
} }
if (ME != myElements[idInSubShape]) if (ME != myElements[idInSubShape])
@ -80,6 +82,9 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME)
MESSAGE("not the same element"); MESSAGE("not the same element");
throw SALOME_Exception(LOCALIZED("not the same element")); throw SALOME_Exception(LOCALIZED("not the same element"));
} }
MESSAGE("already done, OK, nothing to do");
return;
}
} }
} }