0022124: [CEA 763] Projection 1D does not work with Netgen 1D2D

1) namespace TAssocTool = StdMeshers_ProjectionUtils;
2) Use StdMeshers_ProjectionUtils::SourceNotComputedError()
This commit is contained in:
eap 2013-02-26 10:41:45 +00:00
parent 46c3601d73
commit 9635ee01fa
4 changed files with 22 additions and 12 deletions

View File

@ -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
// -----------------------------------------------

View File

@ -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))

View File

@ -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

View File

@ -57,7 +57,7 @@
// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
// }
typedef StdMeshers_ProjectionUtils TAssocTool;
namespace TAssocTool = StdMeshers_ProjectionUtils;
//=======================================================================
@ -233,13 +233,14 @@ bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aS
SMESH_subMesh* srcSubMesh = srcMesh->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