Protection before invalid hypothesises for "Evaluate" operation.
This commit is contained in:
parent
9a0411d941
commit
3cd53c4b5e
@ -471,6 +471,12 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Evaluate(SMESH_Mesh& aMesh,
|
||||
tmpMap.Add(E);
|
||||
SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
|
||||
MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
|
||||
if( anIt==aResMap.end() ) {
|
||||
SMESH_subMesh *sm = aMesh.GetSubMesh(F);
|
||||
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
|
||||
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
||||
return false;
|
||||
}
|
||||
std::vector<int> aVec = (*anIt).second;
|
||||
nb0d += aVec[0];
|
||||
nb1d += Max(aVec[1],aVec[2]);
|
||||
|
@ -657,6 +657,11 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
||||
TopoDS_Face F = TopoDS::Face( exp.Current() );
|
||||
SMESH_subMesh *sm = aMesh.GetSubMesh(F);
|
||||
MapShapeNbElemsItr anIt = aResMap.find(sm);
|
||||
if( anIt==aResMap.end() ) {
|
||||
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
|
||||
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
||||
return false;
|
||||
}
|
||||
std::vector<int> aVec = (*anIt).second;
|
||||
nbtri += Max(aVec[3],aVec[4]);
|
||||
nbqua += Max(aVec[5],aVec[6]);
|
||||
|
Loading…
Reference in New Issue
Block a user