From: eap Date: Thu, 16 Feb 2006 13:43:27 +0000 (+0000) Subject: PAL11200. SMESH_Hypothesis::HYP_BAD_SUBSHAPE status added X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=df3619cd793867bfe8cddea34ea8aab753714764;p=modules%2Fsmesh.git PAL11200. SMESH_Hypothesis::HYP_BAD_SUBSHAPE status added --- diff --git a/src/SMESH/SMESH_Hypothesis.hxx b/src/SMESH/SMESH_Hypothesis.hxx index 2edcd141a..2ebd25a39 100644 --- a/src/SMESH/SMESH_Hypothesis.hxx +++ b/src/SMESH/SMESH_Hypothesis.hxx @@ -49,7 +49,8 @@ public: HYP_INCOMPATIBLE, // hypothesis does not fit algo HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis HYP_ALREADY_EXIST,// such hypothesis already exist - HYP_BAD_DIM // bad dimension + HYP_BAD_DIM, // bad dimension + HYP_BAD_SUBSHAPE // shape is neither the main one, nor its subshape, nor a group }; static bool IsStatusFatal(Hypothesis_Status theStatus) { return theStatus >= HYP_UNKNOWN_FATAL; } diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index e6aabf149..abe270cc3 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -267,6 +267,9 @@ SMESH_Hypothesis::Hypothesis_Status if(MYDEBUG) MESSAGE("SMESH_Mesh::AddHypothesis"); SMESH_subMesh *subMesh = GetSubMesh(aSubShape); + if ( !subMesh || !subMesh->GetId()) + return SMESH_Hypothesis::HYP_BAD_SUBSHAPE; + SMESHDS_SubMesh *subMeshDS = subMesh->GetSubMeshDS(); if ( subMeshDS && subMeshDS->IsComplexSubmesh() ) // group of sub-shapes and maybe of not sub- { @@ -628,6 +631,8 @@ SMESH_subMesh *SMESH_Mesh::GetSubMesh(const TopoDS_Shape & aSubShape) if ( it.More() ) index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() ); } +// if ( !index ) +// return NULL; // neither sub-shape nor a group map ::iterator i_sm = _mapSubMesh.find(index); if ( i_sm != _mapSubMesh.end()) diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index b0c73c29e..6dbef1d58 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -1219,6 +1219,9 @@ msgstr "Such dimention hypothesis is already assigned to the shape" msgid "SMESH_HYP_8" msgstr "Hypothesis and submesh dimensions mismatch" +msgid "SMESH_HYP_9" +msgstr "Shape is neither the main one, nor its subshape, nor a valid group" + msgid "MISSING_ALGO" msgstr "%3 %2D algorithm is missing" diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index c56c56918..388525add 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -316,6 +316,8 @@ static SMESH::Hypothesis_Status ConvertHypothesisStatus res = SMESH::HYP_ALREADY_EXIST; break; case SMESH_Hypothesis::HYP_BAD_DIM: res = SMESH::HYP_BAD_DIM; break; + case SMESH_Hypothesis::HYP_BAD_SUBSHAPE: + res = SMESH::HYP_BAD_SUBSHAPE; break; default: res = SMESH::HYP_UNKNOWN_FATAL; }