X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FGeometric2D%2FInterpKernelGeo2DEdge.cxx;h=f13b409dd5bbc3ca875a15c17db2dfc96a7170d0;hb=aa4f88a9573230e4469301d334bba03356dab168;hp=6d2e6ebee85e9519b9a5cd5e5d3b432ee26d076c;hpb=1123dccd6613b2e8abba35182759d5c4a11ecc8d;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx index 6d2e6ebee..f13b409dd 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DEdge.cxx @@ -876,6 +876,49 @@ inline bool eqpair(const std::pair& p1, const std::pair& subNodes) +{ + Bounds b; + b.prepareForAggregation(); + b.aggregate(getBounds()); + double xBary,yBary; + double dimChar(b.getCaracteristicDim()); + b.getBarycenter(xBary,yBary); + applySimilarity(xBary,yBary,dimChar); + _start->applySimilarity(xBary,yBary,dimChar); + _end->applySimilarity(xBary,yBary,dimChar); + // + std::size_t sz(subNodes.size()),i(0); + std::vector< std::pair > an2(sz); + std::map m; + for(std::vector::const_iterator it=subNodes.begin();it!=subNodes.end();it++,i++) + { + Node *n(new Node(coo[2*(*it)],coo[2*(*it)+1])); + n->applySimilarity(xBary,yBary,dimChar); + m[n]=*it; + an2[i]=std::pair(getCharactValueBtw0And1(*n),n); + } + std::sort(an2.begin(),an2.end()); + // + bool ret(false); + for(i=0;i::const_iterator it2=m.begin();it2!=m.end();it2++) + (*it2).first->decrRef(); + return ret; +} + /** * Sort nodes so that they all lie consecutively on the edge that has been cut. */