extern MeshingParameters mparam;
extern volatile multithreadt multithread;
extern bool merge_solids;
+
+ // values used for occgeo.facemeshstatus
+ enum EFaceMeshStatus { FACE_NOT_TREATED = 0,
+ FACE_FAILED = -1,
+ FACE_MESHED_OK = 1,
+ };
}
#include <vector>
rootSM.push_back( mesh.GetSubMesh( it.Value() ));
}
+ int totNbFaces = 0;
+
// add subshapes of empty submeshes
list< SMESH_subMesh* >::iterator rootIt = rootSM.begin(), rootEnd = rootSM.end();
for ( ; rootIt != rootEnd; ++rootIt ) {
TopExp::MapShapes(root->GetSubShape(), subShapes);
while ( smIt->more() )
{
- SMESH_subMesh* sm = smIt->next();
+ SMESH_subMesh* sm = smIt->next();
TopoDS_Shape shape = sm->GetSubShape();
+ totNbFaces += ( shape.ShapeType() == TopAbs_FACE );
if ( intern && intern->isShapeToPrecompute( shape ))
continue;
if ( !meshedSM || sm->IsEmpty() )
}
}
}
- occgeo.facemeshstatus.SetSize (occgeo.fmap.Extent());
+ occgeo.facemeshstatus.SetSize (totNbFaces);
occgeo.facemeshstatus = 0;
- occgeo.face_maxh_modified.SetSize(occgeo.fmap.Extent());
+ occgeo.face_maxh_modified.SetSize(totNbFaces);
occgeo.face_maxh_modified = 0;
- occgeo.face_maxh.SetSize(occgeo.fmap.Extent());
+ occgeo.face_maxh.SetSize(totNbFaces);
occgeo.face_maxh = netgen::mparam.maxh;
}
// if second oreder is required, even already meshed faces must be passed to NETGEN
int fID = occgeom.fmap.Add( geomFace );
- while ( fID < faceNgID ) // geomFace is already in occgeom.fmap, add a copy
+ occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
+ while ( fID < faceNgID ) { // geomFace is already in occgeom.fmap, add a copy
fID = occgeom.fmap.Add( BRepBuilderAPI_Copy( geomFace, /*copyGeom=*/false ));
+ occgeom.facemeshstatus[ fID-1 ] = netgen::FACE_MESHED_OK;
+ }
// Problem with the second order in a quadrangular mesh remains.
// 1) All quadrangles generated by NETGEN are moved to an inexistent face
// by FillSMesh() (find "AddFaceDescriptor")
bool pb2D = false, pb3D = false;
for (int i = 1; i <= occgeo.fmap.Extent(); i++) {
int status = occgeo.facemeshstatus[i-1];
- if (status == 1 ) continue;
+ if (status == netgen::FACE_MESHED_OK ) continue;
if ( SMESH_subMesh* sm = _mesh->GetSubMeshContaining( occgeo.fmap( i ))) {
SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
if ( !smError || smError->IsOK() ) {
- if ( status == -1 )
+ if ( status == netgen::FACE_FAILED )
smError.reset( new SMESH_ComputeError( *error ));
else
smError.reset( new SMESH_ComputeError( COMPERR_ALGO_FAILED, "Ignored" ));