+ return;
+ }
+
+ //================================================================================
+ /*!
+ * \brief Store an error about overlapping faces
+ */
+ //================================================================================
+
+ bool overlapError( SMESH_Mesh& mesh,
+ const SMDS_MeshElement* face1,
+ const SMDS_MeshElement* face2,
+ const TopoDS_Shape& shape = TopoDS_Shape())
+ {
+ if ( !face1 || !face2 ) return false;
+
+ SMESH_Comment msg;
+ msg << "face " << face1->GetID() << " overlaps face " << face2->GetID();
+
+ SMESH_subMesh * sm = 0;
+ if ( shape.IsNull() )
+ {
+ sm = mesh.GetSubMesh( mesh.GetShapeToMesh() );
+ }
+ else if ( shape.ShapeType() >= TopAbs_SOLID )
+ {
+ sm = mesh.GetSubMesh( shape );
+ }
+ else
+ {
+ TopoDS_Iterator it ( shape );
+ if ( it.More() )
+ sm = mesh.GetSubMesh( it.Value() );
+ }
+ if ( sm )
+ {
+ SMESH_ComputeErrorPtr& err = sm->GetComputeError();
+ if ( !err || err->IsOK() )
+ {
+ SMESH_BadInputElements* badElems =
+ new SMESH_BadInputElements( mesh.GetMeshDS(),COMPERR_BAD_INPUT_MESH, msg, sm->GetAlgo() );
+ badElems->add( face1 );
+ badElems->add( face2 );
+ err.reset( badElems );
+ }
+ }
+
+ return false; // == "algo fails"