From: eap Date: Wed, 14 Mar 2012 12:32:53 +0000 (+0000) Subject: Prevent recording nodes as elements X-Git-Tag: V6_5_0a1~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1e2742728ca8fe7f397c15ef0bbab5ed4f621b5d;p=modules%2Fsmesh.git Prevent recording nodes as elements --- diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index e73301dd9..9bbbf51d2 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -71,6 +71,11 @@ void SMESHDS_SubMesh::AddElement(const SMDS_MeshElement * ME) { if (!IsComplexSubmesh()) { + if ( ME->GetType() == SMDSAbs_Node ) + { + AddNode( static_cast< const SMDS_MeshNode* >( ME )); + return; + } //MESSAGE("in " << myIndex << " AddElement "<< ME->GetID()); int oldShapeId = ME->getshapeId(); if ( oldShapeId > 0 ) @@ -160,7 +165,7 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N) { // MESSAGE("========== AddNode already belonging to other subShape " << N->GetID()); // OK for vertex nodes - //this->getParent()->UnSetNodeOnShape(N); + throw SALOME_Exception(LOCALIZED("add node in subshape already belonging to a subshape")); } SMDS_MeshNode* node = (SMDS_MeshNode*)(N); node->setShapeId(myIndex);