//=============================================================================
bool StdMeshers_Hexa_3D::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 aCatch(SalomeException);
MESSAGE("StdMeshers_Hexa_3D::Compute");
SMESHDS_Mesh * meshDS = aMesh.GetMeshDS();
virtual bool Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
+ /*throw (SALOME_Exception)*/;
static TopoDS_Vertex OppositeVertex(const TopoDS_Vertex& aVertex,
const TopTools_IndexedMapOfShape& aQuads0Vertices,
}
if ( m + uvPtVec.size()-1 > mefistoToDS.size() ) {
MESSAGE("Wrong mefistoToDS.size: "<<mefistoToDS.size()<<" < "<<m + uvPtVec.size()-1);
- return error(dfltErr(),"Internal error");
+ return error("Internal error");
}
vector<UVPtStruct>::const_iterator uvPt = uvPtVec.begin();
else {
gp_Pnt topCoords = myShapeXYZ[ ID_TOP_FACE ];
if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE ))
- return error(dfltErr(),TCom("Can't compute normalized parameters ")
+ return error(TCom("Can't compute normalized parameters ")
<< "for node " << column.back()->GetID()
<< " on the face #"<< column.back()->GetPosition()->GetShapeId() );
}
// compute coords for a new node
gp_XYZ coords;
if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords ))
- return error(dfltErr(),"Can't compute coordinates by normalized parameters");
+ return error("Can't compute coordinates by normalized parameters");
// create a node
node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() );
if ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) {
bot_column = myBotToColumnMap.find( n );
if ( bot_column == myBotToColumnMap.end() )
- return error(dfltErr(),TCom("No nodes found above node ") << n->GetID() );
+ return error(TCom("No nodes found above node ") << n->GetID() );
columns[ i ] = & bot_column->second;
}
else {
columns[ i ] = myBlock.GetNodeColumn( n );
if ( !columns[ i ] )
- return error(dfltErr(),TCom("No side nodes found above node ") << n->GetID() );
+ return error(TCom("No side nodes found above node ") << n->GetID() );
}
}
// create prisms
SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS();
if ( !botSMDS || botSMDS->NbElements() == 0 )
- return error(dfltErr(),TCom("No elememts on face #") << botSM->GetId());
+ return error(TCom("No elememts on face #") << botSM->GetId());
bool needProject = false;
if ( !topSMDS ||
botSMDS->NbNodes() != topSMDS->NbNodes())
{
if ( myBlock.HasNotQuadElemOnTop() )
- return error(dfltErr(),TCom("Mesh on faces #") << botSM->GetId()
+ return error(TCom("Mesh on faces #") << botSM->GetId()
<<" and #"<< topSM->GetId() << " seems different" );
needProject = true;
}
if ( 0/*needProject && !myProjectTriangles*/ )
- return error(dfltErr(),TCom("Mesh on faces #") << botSM->GetId()
+ return error(TCom("Mesh on faces #") << botSM->GetId()
<<" and #"<< topSM->GetId() << " seems different" );
///RETURN_BAD_RESULT("Need to project but not allowed");
if ( !TAssocTool::FindSubShapeAssociation( botFace, myBlock.Mesh(),
topFace, myBlock.Mesh(),
shape2ShapeMap) )
- return error(dfltErr(),TCom("Topology of faces #") << botSM->GetId()
+ return error(TCom("Topology of faces #") << botSM->GetId()
<<" and #"<< topSM->GetId() << " seems different" );
// Find matching nodes of top and bottom faces
if ( ! TAssocTool::FindMatchingNodesOnFaces( botFace, myBlock.Mesh(),
topFace, myBlock.Mesh(),
shape2ShapeMap, n2nMap ))
- return error(dfltErr(),TCom("Mesh on faces #") << botSM->GetId()
+ return error(TCom("Mesh on faces #") << botSM->GetId()
<<" and #"<< topSM->GetId() << " seems different" );
// Fill myBotToColumnMap
TNode bN( botNode );
if ( zSize > 2 )
if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(), ID_BOT_FACE ))
- return error(dfltErr(),TCom("Can't compute normalized parameters ")
+ return error(TCom("Can't compute normalized parameters ")
<< "for node " << botNode->GetID() << " on the face #"<< botSM->GetId() );
// create node column
TNode2ColumnMap::iterator bN_col =
// compute bottom node params
TNode bN( botNode );
if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(), ID_BOT_FACE ))
- return error(dfltErr(),TCom("Can't compute normalized parameters ")
+ return error(TCom("Can't compute normalized parameters ")
<< "for node " << botNode->GetID() << " on the face #"<< botSM->GetId() );
// compute top node coords
gp_XYZ topXYZ; gp_XY topUV;
if ( !myBlock.FacePoint( ID_TOP_FACE, bN.GetParams(), topXYZ ) ||
!myBlock.FaceUV ( ID_TOP_FACE, bN.GetParams(), topUV ))
- return error(dfltErr(),TCom("Can't compute coordinates ")
+ return error(TCom("Can't compute coordinates ")
<< "by normalized parameters on the face #"<< topSM->GetId() );
SMDS_MeshNode * topNode = meshDS->AddNode( topXYZ.X(),topXYZ.Y(),topXYZ.Z() );
meshDS->SetNodeOnFace( topNode, topFaceID, topUV.X(), topUV.Y() );
if ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) {
TNode2ColumnMap::iterator bot_column = myBotToColumnMap.find( n );
if ( bot_column == myBotToColumnMap.end() )
- return error(dfltErr(),TCom("No nodes found above node ") << n->GetID() );
+ return error(TCom("No nodes found above node ") << n->GetID() );
nodes[ i ] = bot_column->second.back();
}
else {
const TNodeColumn* column = myBlock.GetNodeColumn( n );
if ( !column )
- return error(dfltErr(),TCom("No side nodes found above node ") << n->GetID() );
+ return error(TCom("No side nodes found above node ") << n->GetID() );
nodes[ i ] = column->back();
}
}
TAssocTool::InitVertexAssociation( _sourceHypo, shape2ShapeMap );
if ( !TAssocTool::FindSubShapeAssociation( tgtEdge, tgtMesh, srcEdge, srcMesh,
shape2ShapeMap) )
- return error(dfltErr(),SMESH_Comment("Vertices association failed" ));
+ return error(SMESH_Comment("Vertices association failed" ));
// ----------------------------------------------
// Assure that mesh on a source edge is computed
// from the point at given parameter.
GCPnts_AbscissaPoint Discret( curveAdaptor, dl * lengths[ i-1 ], tgtParams[ i-1 ] );
if ( !Discret.IsDone() )
- return error(dfltErr(),"GCPnts_AbscissaPoint failed");
+ return error("GCPnts_AbscissaPoint failed");
tgtParams[ i ] = Discret.Parameter();
}
// make internal nodes
mapper.Apply( tgtFace, tgtV1, reverse );
if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK )
- return error(dfltErr(),"Can't apply source mesh pattern to the face");
+ return error("Can't apply source mesh pattern to the face");
// Create the mesh
const bool toCreatePolygons = false, toCreatePolyedrs = false;
mapper.MakeMesh( tgtMesh, toCreatePolygons, toCreatePolyedrs );
if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK )
- return error(dfltErr(),"Can't make mesh by source mesh pattern");
+ return error("Can't make mesh by source mesh pattern");
// it will remove mesh built by pattern mapper on edges and vertices
// in failure case
TopExp::Vertices( TopoDS::Edge( exp.Current() ), tgtV000, tgtV100 );
if ( !shape2ShapeMap.IsBound( tgtV000 ) || !shape2ShapeMap.IsBound( tgtV100 ))
- return error(dfltErr(),"Association of subshapes failed" );
+ return error("Association of subshapes failed" );
srcV000 = TopoDS::Vertex( shape2ShapeMap( tgtV000 ));
srcV100 = TopoDS::Vertex( shape2ShapeMap( tgtV100 ));
if ( !TAssocTool::IsSubShape( srcV000, srcShell ) ||
!TAssocTool::IsSubShape( srcV100, srcShell ))
- return error(dfltErr(),"Incorrect association of subshapes" );
+ return error("Incorrect association of subshapes" );
}
// Load 2 SMESH_Block's with src and tgt shells
gp_Pnt srcCoord = gpXYZ( srcNode );
gp_XYZ srcParam;
if ( !srcBlock.ComputeParameters( srcCoord, srcParam ))
- return error(dfltErr(),SMESH_Comment("Can't compute normalized parameters ")
+ return error(SMESH_Comment("Can't compute normalized parameters ")
<< "for source node " << srcNode->GetID());
// compute coordinates of target node by srcParam
gp_XYZ tgtXYZ;
if ( !tgtBlock.ShellPoint( srcParam, tgtXYZ ))
- return error(dfltErr(),"Can't compute coordinates by normalized parameters");
+ return error("Can't compute coordinates by normalized parameters");
// add node
SMDS_MeshNode* newNode = tgtMeshDS->AddNode( tgtXYZ.X(), tgtXYZ.Y(), tgtXYZ.Z() );
tgtMeshDS->SetNodeInVolume( newNode, helper.GetSubShapeID() );
//=============================================================================
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);
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;
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);
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");
// 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);
typedef uvPtStruct UVPtStruct;
typedef struct faceQuadStruct
{
- //int nbPts[4];
- //TopoDS_Edge edge[4];
vector< StdMeshers_FaceSide*> side;
- //double first[4];
- //double last[4];
- //bool isEdgeForward[4];
bool isEdgeOut[4]; // true, if an edge has more nodes, than the opposite
- //UVPtStruct* uv_edges[4];
UVPtStruct* uv_grid;
~faceQuadStruct();
} FaceQuadStruct;
SMESH_Hypothesis::Hypothesis_Status& aStatus);
virtual bool Compute(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
+ const TopoDS_Shape& aShape);
FaceQuadStruct* CheckAnd2Dcompute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
- const bool CreateQuadratic)
- throw (SALOME_Exception);
+ const bool CreateQuadratic);
protected:
FaceQuadStruct* CheckNbEdges(SMESH_Mesh& aMesh,
- const TopoDS_Shape& aShape)
- throw (SALOME_Exception);
+ const TopoDS_Shape& aShape);
bool SetNormalizedGrid(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
- FaceQuadStruct*& quad)
- throw (SALOME_Exception);
+ FaceQuadStruct*& quad);
/**
* Special function for creation only quandrangle faces
*/
bool ComputeQuadPref(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape,
- FaceQuadStruct* quad)
- throw (SALOME_Exception);
+ FaceQuadStruct* quad);
UVPtStruct* LoadEdgePoints2(SMESH_Mesh& aMesh,
const TopoDS_Face& F, const TopoDS_Edge& E,
TopoDS_Face outFace = TopoDS::Face( exp.Current() );
TopoDS_Face inFace;
if ( !shape2ShapeMap.IsBound( outFace )) {
- return error(dfltErr(),SMESH_Comment("Corresponding inner face not found for face #" )
+ return error(SMESH_Comment("Corresponding inner face not found for face #" )
<< meshDS->ShapeToIndex( outFace ));
} else {
inFace = TopoDS::Face( shape2ShapeMap( outFace ));
const StdMeshers_LayerDistribution* hyp)
{
double len = pIn.Distance( pOut );
- if ( len <= DBL_MIN ) return error(dfltErr(),"Too close points of inner and outer shells");
+ if ( len <= DBL_MIN ) return error("Too close points of inner and outer shells");
if ( !hyp || !hyp->GetLayerDistribution() )
- return error(dfltErr(), "Invalid LayerDistribution hypothesis");
+ return error( "Invalid LayerDistribution hypothesis");
myUsedHyps.clear();
myUsedHyps.push_back( hyp->GetLayerDistribution() );
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut );
SMESH_Hypothesis::Hypothesis_Status aStatus;
if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus ))
- return error(dfltErr(), "StdMeshers_Regular_1D::CheckHypothesis() failed"
+ return error( "StdMeshers_Regular_1D::CheckHypothesis() failed"
"with LayerDistribution hypothesis");
BRepAdaptor_Curve C3D(edge);
double f = C3D.FirstParameter(), l = C3D.LastParameter();
list< double > params;
if ( !StdMeshers_Regular_1D::computeInternalParameters( C3D, len, f, l, params, false ))
- return error(dfltErr(),"StdMeshers_Regular_1D failed to compute layers distribution");
+ return error("StdMeshers_Regular_1D failed to compute layers distribution");
positions.clear();
positions.reserve( params.size() );
}
GCPnts_UniformAbscissa Discret(theC3d, eltSize, f, l);
if ( !Discret.IsDone() )
- return error( dfltErr(), "GCPnts_UniformAbscissa failed");
+ return error( "GCPnts_UniformAbscissa failed");
int NbPoints = Discret.NbPoints();
for ( int i = 2; i < NbPoints; i++ )