X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingUMesh_intersection.cxx;h=d1a9a974c0199350143827d9cbcfedf0a7e1424e;hb=e7a9d4f59978fd384ee98db1dfdd5ec2118331ca;hp=b480bec30b67740d31480fafa6b1662deac5ea0b;hpb=90b7c9c73054965b8085ab0ecd2646a3d59f475a;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index b480bec30..d1a9a974c 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -1489,8 +1489,8 @@ void InsertNodeInConnIfNecessary(mcIdType nodeIdToInsert, std::vector& mcIdType pt0(conn[i]),pt1(conn[(i+1)%sz]); double v1[3]={coords[3*pt1+0]-coords[3*pt0+0],coords[3*pt1+1]-coords[3*pt0+1],coords[3*pt1+2]-coords[3*pt0+2]},v2[3]={coords[3*nodeIdToInsert+0]-coords[3*pt0+0],coords[3*nodeIdToInsert+1]-coords[3*pt0+1],coords[3*nodeIdToInsert+2]-coords[3*pt0+2]}; double normm(sqrt(v1[0]*v1[0]+v1[1]*v1[1]+v1[2]*v1[2])); - std::transform(v1,v1+3,v1,std::bind2nd(std::multiplies(),1./normm)); - std::transform(v2,v2+3,v2,std::bind2nd(std::multiplies(),1./normm)); + std::transform(v1,v1+3,v1,std::bind(std::multiplies(),std::placeholders::_1,1./normm)); + std::transform(v2,v2+3,v2,std::bind(std::multiplies(),std::placeholders::_1,1./normm)); double v3[3]; v3[0]=v1[1]*v2[2]-v1[2]*v2[1]; v3[1]=v1[2]*v2[0]-v1[0]*v2[2]; v3[2]=v1[0]*v2[1]-v1[1]*v2[0]; double normm2(sqrt(v3[0]*v3[0]+v3[1]*v3[1]+v3[2]*v3[2])),dotTest(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]); @@ -1859,17 +1859,18 @@ void MEDCouplingUMesh::Intersect2DMeshWith1DLine(const MEDCouplingUMesh *mesh2D, std::set s1(realIdsInDesc2D->begin()+dd2->begin()[*cellId1], realIdsInDesc2D->begin()+dd2->begin()[*cellId1+1]); std::set s2(realIdsInDesc2D->begin()+dd2->begin()[*cellId2], realIdsInDesc2D->begin()+dd2->begin()[*cellId2+1]); - mcIdType commonEdgeId; - std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(), &commonEdgeId); + + std::vector commonEdgeId; + std::set_intersection(s1.begin(),s1.end(),s2.begin(),s2.end(), std::back_inserter(commonEdgeId)); // c- find correct orientation for commonEdgeId const mcIdType* firstNodeInColinearEdgeRet1 = cRet1 + ciRet1[*it]+1; const mcIdType* secondNodeInColinearEdgeRet1 = cRet1 + ciRet1[*it]+2; - std::vector v; v.push_back(commonEdgeId); - if(IsColinearOfACellOf(intersectEdge1, v, *firstNodeInColinearEdgeRet1,*secondNodeInColinearEdgeRet1,commonEdgeId)) + mcIdType commonEdgeIdCorrectlyOriented; + if(IsColinearOfACellOf(intersectEdge1, commonEdgeId, *firstNodeInColinearEdgeRet1,*secondNodeInColinearEdgeRet1, commonEdgeIdCorrectlyOriented)) { idsInRet1Colinear->pushBackSilent(*it); - idsInDescMesh2DForIdsInRetColinear->pushBackSilent(commonEdgeId); + idsInDescMesh2DForIdsInRetColinear->pushBackSilent(commonEdgeIdCorrectlyOriented); } } // ### End colinearity fix