Salome HOME
Porting documentation on the Doxygen-1.8.0
[modules/smesh.git] / src / SMESHDS / SMESHDS_SubMesh.cxx
index 82ba05748b3a4f47c537a44ef819f0a880205301..9bbbf51d2716b99bf010e7f2d574afa487206ee1 100644 (file)
@@ -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 )
@@ -158,9 +163,9 @@ void SMESHDS_SubMesh::AddNode(const SMDS_MeshNode * N)
       int shapeId = N->getshapeId();
       if ((shapeId > 0) && (idInSubShape >= 0))
         {
-          MESSAGE("========== AddNode already belonging to other subShape " << N->GetID());
+//           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);