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; }
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-
{
if ( it.More() )
index = _myMeshDS->AddCompoundSubmesh( aSubShape, it.Value().ShapeType() );
}
+// if ( !index )
+// return NULL; // neither sub-shape nor a group
map <int, SMESH_subMesh *>::iterator i_sm = _mapSubMesh.find(index);
if ( i_sm != _mapSubMesh.end())
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"
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;
}