X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Projection_3D.cxx;h=e6a76eddc8eb5d9a7a248ccdccf8f87b5869f9d5;hp=76c29c82215f3cc96ac1a6784801c970ff30fbcc;hb=251f8c052dd12dd29922210dc901b295fe999a0e;hpb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6 diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx index 76c29c822..e6a76eddc 100644 --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -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 @@ -296,17 +297,17 @@ bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aS SMESH_Block::GetFaceEdgesIDs( fId, edgeIdVec ); for ( int i = 0; i < edgeIdVec.size(); ++i ) { int eID = edgeIdVec[ i ]; - shape2ShapeMap.Bind( tgtShapes( eID ), scrShapes( eID )); + shape2ShapeMap.Bind( scrShapes( eID ), tgtShapes( eID )); if ( i < 2 ) { vector< int > vertexIdVec; SMESH_Block::GetEdgeVertexIDs( eID, vertexIdVec ); - shape2ShapeMap.Bind( tgtShapes( vertexIdVec[0] ), scrShapes( vertexIdVec[0] )); - shape2ShapeMap.Bind( tgtShapes( vertexIdVec[1] ), scrShapes( vertexIdVec[1] )); + shape2ShapeMap.Bind( scrShapes( vertexIdVec[0]), tgtShapes( vertexIdVec[0]) ); + shape2ShapeMap.Bind( scrShapes( vertexIdVec[1]), tgtShapes( vertexIdVec[1]) ); } } } // Find matching nodes of tgt and src faces - TNodeNodeMap faceMatchingNodes; + TAssocTool::TNodeNodeMap faceMatchingNodes; if ( ! TAssocTool::FindMatchingNodesOnFaces( srcFace, srcMesh, tgtFace, tgtMesh, shape2ShapeMap, faceMatchingNodes )) return error(COMPERR_BAD_INPUT_MESH,SMESH_Comment("Mesh on faces #") @@ -459,13 +460,13 @@ bool StdMeshers_Projection_3D::Evaluate(SMESH_Mesh& aMesh, SMESH_Comment("Target shape must have 1 shell but not ") << nbShell); // Check that shapes are blocks - if ( TAssocTool::Count( tgtShell, TopAbs_FACE , 1 ) != 6 || - TAssocTool::Count( tgtShell, TopAbs_EDGE , 1 ) != 12 || - TAssocTool::Count( tgtShell, TopAbs_WIRE , 1 ) != 6 ) + if ( SMESH_MesherHelper::Count( tgtShell, TopAbs_FACE , 1 ) != 6 || + SMESH_MesherHelper::Count( tgtShell, TopAbs_EDGE , 1 ) != 12 || + SMESH_MesherHelper::Count( tgtShell, TopAbs_WIRE , 1 ) != 6 ) return error(COMPERR_BAD_SHAPE, "Target shape is not a block"); - if ( TAssocTool::Count( srcShell, TopAbs_FACE , 1 ) != 6 || - TAssocTool::Count( srcShell, TopAbs_EDGE , 1 ) != 12 || - TAssocTool::Count( srcShell, TopAbs_WIRE , 1 ) != 6 ) + if ( SMESH_MesherHelper::Count( srcShell, TopAbs_FACE , 1 ) != 6 || + SMESH_MesherHelper::Count( srcShell, TopAbs_EDGE , 1 ) != 12 || + SMESH_MesherHelper::Count( srcShell, TopAbs_WIRE , 1 ) != 6 ) return error(COMPERR_BAD_SHAPE, "Source shape is not a block"); // Assure that mesh on a source shape is computed