aStatus = SMESH_Hypothesis::HYP_OK;
// there is only one compatible Hypothesis so far
- const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape);
+ const list <const SMESHDS_Hypothesis * >&hyps = GetUsedHypothesis(aMesh, aShape, false);
myQuadranglePreference = hyps.size() > 0;
return isOk;
//=============================================================================
bool StdMeshers_Quadrangle_2D::Compute (SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape) throw (SALOME_Exception)
+ const TopoDS_Shape& aShape)// throw (SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
+ // PAL14921. Enable catching std::bad_alloc and Standard_OutOfMemory outside
+ //Unexpect aCatchSalomeException);
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
aMesh.GetSubMesh(aShape);
const vector<UVPtStruct>& uv_e2 = quad->side[2]->GetUVPtStruct(true,1 );
const vector<UVPtStruct>& uv_e3 = quad->side[3]->GetUVPtStruct(false,0);
+ if ( uv_e0.empty() || uv_e1.empty() || uv_e2.empty() || uv_e3.empty() )
+ return error( COMPERR_BAD_INPUT_MESH );
+
double eps = Precision::Confusion();
// Boundary quadrangles
FaceQuadStruct* StdMeshers_Quadrangle_2D::CheckNbEdges(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape)
- throw(SALOME_Exception)
+ //throw(SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
-
const TopoDS_Face & F = TopoDS::Face(aShape);
const bool ignoreMediumNodes = _quadraticMesh;
sideEdges.splice( sideEdges.end(), edges, edges.begin()); // edges.front() -> sideEdges.end()
bool sameSide = true;
while ( !edges.empty() && sameSide ) {
- GeomAbs_Shape cont = SMESH_Algo::Continuity( sideEdges.back(), edges.front() );
- sameSide = ( cont >= GeomAbs_G1 );
+ sameSide = SMESH_Algo::IsContinuous( sideEdges.back(), edges.front() );
if ( sameSide )
sideEdges.splice( sideEdges.end(), edges, edges.begin());
}
if ( nbSides == 0 ) { // go backward from the first edge
sameSide = true;
while ( !edges.empty() && sameSide ) {
- GeomAbs_Shape cont = SMESH_Algo::Continuity( sideEdges.front(), edges.back() );
- sameSide = ( cont >= GeomAbs_G1 );
+ sameSide = SMESH_Algo::IsContinuous( sideEdges.front(), edges.back() );
if ( sameSide )
sideEdges.splice( sideEdges.begin(), edges, --edges.end());
}
FaceQuadStruct *StdMeshers_Quadrangle_2D::CheckAnd2Dcompute
(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
- const bool CreateQuadratic) throw(SALOME_Exception)
+ const bool CreateQuadratic) //throw(SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
-
_quadraticMesh = CreateQuadratic;
FaceQuadStruct *quad = CheckNbEdges(aMesh, aShape);
if(!quad) return 0;
// set normalized grid on unit square in parametric domain
- SetNormalizedGrid(aMesh, aShape, quad);
+ bool stat = SetNormalizedGrid(aMesh, aShape, quad);
+ if(!stat) {
+ if(!quad)
+ delete quad;
+ quad = 0;
+ }
return quad;
}
bool StdMeshers_Quadrangle_2D::SetNormalizedGrid (SMESH_Mesh & aMesh,
const TopoDS_Shape& aShape,
- FaceQuadStruct* & quad) throw (SALOME_Exception)
+ FaceQuadStruct* & quad) //throw (SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
// Algorithme décrit dans "Génération automatique de maillages"
// P.L. GEORGE, MASSON, § 6.4.1 p. 84-85
// traitement dans le domaine paramétrique 2d u,v
const vector<UVPtStruct>& uv_e3 = GetUVPtStructIn( quad, 3, nbvertic - 1 );
if ( uv_e0.empty() || uv_e1.empty() || uv_e2.empty() || uv_e3.empty() )
- return error(dfltErr(), "Can't find nodes on sides");
+ //return error( "Can't find nodes on sides");
+ return error( COMPERR_BAD_INPUT_MESH );
// nodes Id on "in" edges
if (! quad->isEdgeOut[0]) {
bool StdMeshers_Quadrangle_2D::ComputeQuadPref (SMESH_Mesh & aMesh,
const TopoDS_Shape& aShape,
FaceQuadStruct* quad)
- throw (SALOME_Exception)
{
- Unexpect aCatch(SalomeException);
-
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
const TopoDS_Face& F = TopoDS::Face(aShape);
Handle(Geom_Surface) S = BRep_Tool::Surface(F);
- const TopoDS_Wire& W = BRepTools::OuterWire(F);
+// const TopoDS_Wire& W = BRepTools::OuterWire(F);
bool WisF = true;
// if(W.Orientation()==TopAbs_FORWARD)
// WisF = true;