}
}
{
- // Check my state
+
+ // Set my _computeState
+
+ _computeState = FAILED_TO_COMPUTE;
if ( !_computeError || _computeError->IsOK() )
{
// no error description is set to this sub-mesh, check if any mesh is computed
_computeState = IsMeshComputed() ? COMPUTE_OK : FAILED_TO_COMPUTE;
+ if ( _computeState != COMPUTE_OK )
+ {
+ if ( _subShape.ShapeType() == TopAbs_EDGE &&
+ BRep_Tool::Degenerated( TopoDS::Edge( _subShape )) )
+ _computeState = COMPUTE_OK;
+ else
+ _computeError = SMESH_ComputeError::New(COMPERR_NO_MESH_ON_SHAPE,"",theAlgo);
+ }
+ noErrors = ( _computeState == COMPUTE_OK );
}
- else
+ if ( !noErrors )
{
if ( !_computeError->myAlgo )
_computeError->myAlgo = theAlgo;
_computeState = _computeError->IsKO() ? FAILED_TO_COMPUTE : COMPUTE_OK;
- noErrors = false;
}
}
return noErrors;
{
QString text;
switch ( errCode ) {
- CASE2TEXT( COMPERR_OK );
- CASE2TEXT( COMPERR_BAD_INPUT_MESH);
- CASE2TEXT( COMPERR_STD_EXCEPTION );
- CASE2TEXT( COMPERR_OCC_EXCEPTION );
+ CASE2TEXT( COMPERR_OK );
+ CASE2TEXT( COMPERR_BAD_INPUT_MESH );
+ CASE2TEXT( COMPERR_STD_EXCEPTION );
+ CASE2TEXT( COMPERR_OCC_EXCEPTION );
case SMESH::COMPERR_SLM_EXCEPTION: break; // avoid double "Salome exception"
- CASE2TEXT( COMPERR_EXCEPTION );
- CASE2TEXT( COMPERR_MEMORY_PB );
- CASE2TEXT( COMPERR_BAD_SHAPE );
- CASE2TEXT( COMPERR_CANCELED );
+ CASE2TEXT( COMPERR_EXCEPTION );
+ CASE2TEXT( COMPERR_MEMORY_PB );
+ CASE2TEXT( COMPERR_BAD_SHAPE );
+ CASE2TEXT( COMPERR_CANCELED );
+ CASE2TEXT( COMPERR_NO_MESH_ON_SHAPE );
case SMESH::COMPERR_ALGO_FAILED:
if ( strlen(comment) == 0 )
text = QObject::tr("COMPERR_ALGO_FAILED");
{
bool onlyWarnings = !theNoCompError; // == valid mesh computed but there are errors reported
for ( int i = 0; i < theCompErrors->length() && onlyWarnings; ++i )
- onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING );
+ onlyWarnings = ( theCompErrors[ i ].code == SMESH::COMPERR_WARNING ||
+ theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE );
// full or brief mesh info
SMESH::long_array_var aRes = myMesh->GetMeshInfo();