From 1e2742728ca8fe7f397c15ef0bbab5ed4f621b5d Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 14 Mar 2012 12:32:53 +0000 Subject: [PATCH] Prevent recording nodes as elements --- src/SMESHDS/SMESHDS_SubMesh.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.39.2