From 9635ee01faa873a08f4592ad4aa50a5dfc61c67a Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 26 Feb 2013 10:41:45 +0000 Subject: [PATCH] 0022124: [CEA 763] Projection 1D does not work with Netgen 1D2D 1) namespace TAssocTool = StdMeshers_ProjectionUtils; 2) Use StdMeshers_ProjectionUtils::SourceNotComputedError() --- src/StdMeshers/StdMeshers_Projection_1D.cxx | 11 ++++++++--- src/StdMeshers/StdMeshers_Projection_1D2D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_2D.cxx | 12 ++++++++---- src/StdMeshers/StdMeshers_Projection_3D.cxx | 9 +++++---- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Projection_1D.cxx b/src/StdMeshers/StdMeshers_Projection_1D.cxx index 778b57c0e..a52ffe661 100644 --- a/src/StdMeshers/StdMeshers_Projection_1D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_1D.cxx @@ -57,7 +57,8 @@ using namespace std; #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; } -typedef StdMeshers_ProjectionUtils TAssocTool; +//typedef StdMeshers_ProjectionUtils TAssocTool; +namespace TAssocTool = StdMeshers_ProjectionUtils; //======================================================================= //function : StdMeshers_Projection_1D @@ -238,14 +239,18 @@ bool StdMeshers_Projection_1D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcEdge ); //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtEdge ); + string srcMeshError; if ( tgtMesh == srcMesh ) { if ( !TAssocTool::MakeComputed( srcSubMesh )) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this ); } else { if ( !srcSubMesh->IsMeshComputed() ) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + srcMeshError = TAssocTool::SourceNotComputedError(); } + if ( !srcMeshError.empty() ) + return error(COMPERR_BAD_INPUT_MESH, srcMeshError ); + // ----------------------------------------------- // Find out nodes distribution on the source edge // ----------------------------------------------- diff --git a/src/StdMeshers/StdMeshers_Projection_1D2D.cxx b/src/StdMeshers/StdMeshers_Projection_1D2D.cxx index f9fe63dc3..73feed3cc 100644 --- a/src/StdMeshers/StdMeshers_Projection_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_1D2D.cxx @@ -199,7 +199,7 @@ bool StdMeshers_Projection_1D2D::Evaluate(SMESH_Mesh& theMesh, if ( !srcMesh ) srcMesh = & theMesh; SMESH_subMesh* srcFaceSM = srcMesh->GetSubMesh( srcFace ); - typedef StdMeshers_ProjectionUtils SPU; + namespace SPU = StdMeshers_ProjectionUtils; SPU::TShapeShapeMap shape2ShapeMap; SPU::InitVertexAssociation( _sourceHypo, shape2ShapeMap ); if ( !SPU::FindSubShapeAssociation( theShape, &theMesh, srcFace, srcMesh, shape2ShapeMap)) diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 9742f8840..9f1c2fcf6 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -62,7 +62,8 @@ using namespace std; #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; } -typedef StdMeshers_ProjectionUtils TAssocTool; +namespace TAssocTool = StdMeshers_ProjectionUtils; +//typedef StdMeshers_ProjectionUtils TAssocTool; //======================================================================= //function : StdMeshers_Projection_2D @@ -824,14 +825,17 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace ); SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtFace ); + string srcMeshError; if ( tgtMesh == srcMesh ) { - if ( !TAssocTool::MakeComputed( srcSubMesh ) || !srcSubMesh->IsMeshComputed() ) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + if ( !TAssocTool::MakeComputed( srcSubMesh )) + srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this ); } else { if ( !srcSubMesh->IsMeshComputed() ) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + srcMeshError = TAssocTool::SourceNotComputedError(); } + if ( !srcMeshError.empty() ) + return error(COMPERR_BAD_INPUT_MESH, srcMeshError ); // =========== // Projection diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx index 7c07b40f3..cf42d5d41 100644 --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -57,7 +57,7 @@ // cout << msg << " ("<< p.X() << "; " <GetSubMesh( _sourceHypo->GetSource3DShape() ); //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( aShape ); - if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) { + string srcMeshError; + if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) { if ( !TAssocTool::MakeComputed( srcSubMesh )) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this ); } else { if ( !srcSubMesh->IsMeshComputed() ) - return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); + srcMeshError = TAssocTool::SourceNotComputedError(); } // Find 2 pairs of corresponding vertices -- 2.39.2