PShapeIteratorPtr solidIt=helper.GetAncestors(geomFace,*sm->GetFather(),TopAbs_SOLID);
if ( const TopoDS_Shape * solid = solidIt->next() )
sm = _mesh->GetSubMesh( *solid );
- SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
- smError.reset( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"Not triangle sub-mesh"));
- smError->myBadElements.push_back( f );
+ SMESH_BadInputElements* badElems =
+ new SMESH_BadInputElements( helper.GetMeshDS(), COMPERR_BAD_INPUT_MESH,
+ "Not triangle sub-mesh");
+ badElems->add( f );
+ sm->GetComputeError().reset( badElems );
return false;
}
_mesh->GetMeshDS()->RemoveFreeNode( nodeVec[i], 0, /*fromGroups=*/false );
}
SMESH_ComputeErrorPtr readErr = ReadErrors(nodeVec);
- if ( readErr && !readErr->myBadElements.empty() )
+ if ( readErr && readErr->HasBadElems() )
{
error = readErr;
if ( !comment.empty() && !readErr->myComment.empty() ) comment += "\n";
{
smError->myName = COMPERR_WARNING;
}
- else if ( !smError->myBadElements.empty() ) // bad surface mesh
+ else if ( smError->HasBadElems() ) // bad surface mesh
{
- if ( !hasBadElemOnSolid( smError->myBadElements, sm ))
+ if ( !hasBadElemOnSolid
+ ( static_cast<SMESH_BadInputElements*>( smError.get() )->myBadElements, sm ))
smError.reset();
}
}
SMESH_ComputeErrorPtr
NETGENPlugin_Mesher::ReadErrors(const vector<const SMDS_MeshNode* >& nodeVec)
{
- SMESH_ComputeErrorPtr err = SMESH_ComputeError::New
- (COMPERR_BAD_INPUT_MESH, "Some edges multiple times in surface mesh");
+ if ( nodeVec.size() < 2 ) return SMESH_ComputeErrorPtr();
+ SMESH_BadInputElements* err =
+ new SMESH_BadInputElements( nodeVec.back()->GetMesh(), COMPERR_BAD_INPUT_MESH,
+ "Some edges multiple times in surface mesh");
SMESH_File file("test.out");
vector<int> two(2);
vector<int> three1(3), three2(3);
if ( nbBadElems ) nbBadElems++; // avoid warning: variable set but not used
#endif
- return err;
+ return SMESH_ComputeErrorPtr( err );
}
//================================================================================
{
// set bad faces into a compute error
const char* text = "Non-manifold mesh. Only manifold mesh can be re-meshed";
- SMESH_ComputeErrorPtr error = SMESH_ComputeError::New( COMPERR_BAD_INPUT_MESH, text );
+ SMESH_BadInputElements* error =
+ new SMESH_BadInputElements( myMeshDS, COMPERR_BAD_INPUT_MESH, text );
SMESH::Controls::MultiConnection2D fun;
fun.SetMesh( myMeshDS );
SMDS_ElemIteratorPtr fIt = myMeshDS->elementsIterator( SMDSAbs_Face );
if ( fun.GetValue( f->GetID() ) > 2 )
error->myBadElements.push_back( f );
}
- theMesh.GetSubMesh( theMesh.GetShapeToMesh() )->GetComputeError() = error;
+ theMesh.GetSubMesh( theMesh.GetShapeToMesh() )->GetComputeError().reset( error );
throw SALOME_Exception( text );
}
if ( !freeBords._coincidentGroups.empty() )
{
const char* text = "Can't re-meshed a mesh with coincident free edges";
- SMESH_ComputeErrorPtr error = SMESH_ComputeError::New( COMPERR_BAD_INPUT_MESH, text );
+ SMESH_BadInputElements* error =
+ new SMESH_BadInputElements( myMeshDS, COMPERR_BAD_INPUT_MESH, text );
for ( size_t i = 0; i < freeBords._borders.size(); ++i )
error->myBadElements.insert( error->myBadElements.end(),
freeBords._borders[i].begin(),
freeBords._borders[i].end() );
- theMesh.GetSubMesh( theMesh.GetShapeToMesh() )->GetComputeError() = error;
+ theMesh.GetSubMesh( theMesh.GetShapeToMesh() )->GetComputeError().reset( error );
throw SALOME_Exception( text );
}
}