X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FGeometric2D%2FInterpKernelGeo2DNode.cxx;h=47ec4e8887dd0ac856753f9b21285046fb081480;hb=aafcf704892f03308a84407e898d9e8b19496a1c;hp=57cacfd5cb9a6aa3dea09020f93841c34695a277;hpb=8763c12d01e33d6845dd53be65b001514d00bd42;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DNode.cxx b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DNode.cxx index 57cacfd5c..47ec4e888 100644 --- a/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DNode.cxx +++ b/src/INTERP_KERNEL/Geometric2D/InterpKernelGeo2DNode.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -148,19 +148,19 @@ void Node::unApplySimilarity(double xBary, double yBary, double dimChar) /*! * Called by QuadraticPolygon::splitAbs method. */ -void Node::fillGlobalInfoAbs(const std::map& mapThis, const std::map& mapOther, int offset1, int offset2, double fact, double baryX, double baryY, - std::vector& addCoo, std::map& mapAddCoo, int *nodeId) const +void Node::fillGlobalInfoAbs(const std::map& mapThis, const std::map& mapOther, mcIdType offset1, mcIdType offset2, double fact, double baryX, double baryY, + std::vector& addCoo, std::map& mapAddCoo, mcIdType *nodeId) const { - std::map::const_iterator it=mapThis.find(const_cast(this)); - if(it!=mapThis.end()) + std::map::const_iterator it=mapOther.find(const_cast(this)); + if(it!=mapOther.end()) // order matters, try in mapOther first. { - *nodeId=(*it).second; + *nodeId=(*it).second+offset1; return; } - it=mapOther.find(const_cast(this)); - if(it!=mapOther.end()) + it=mapThis.find(const_cast(this)); + if(it!=mapThis.end()) { - *nodeId=(*it).second+offset1; + *nodeId=(*it).second; return; } it=mapAddCoo.find(const_cast(this)); @@ -179,20 +179,21 @@ void Node::fillGlobalInfoAbs(const std::map& mapThis, /*! * Called by QuadraticPolygon::splitAbs method. */ -void Node::fillGlobalInfoAbs2(const std::map& mapThis, const std::map& mapOther, int offset1, int offset2, double fact, double baryX, double baryY, - std::vector& addCoo, std::map& mapAddCoo, std::vector& pointsOther) const +void Node::fillGlobalInfoAbs2(const std::map& mapThis, const std::map& mapOther, mcIdType offset1, mcIdType offset2, double fact, double baryX, double baryY, + std::vector& addCoo, std::map& mapAddCoo, std::vector& pointsOther) const { - int tmp; + mcIdType tmp; std::size_t sz1=addCoo.size(); fillGlobalInfoAbs(mapThis,mapOther,offset1,offset2,fact,baryX,baryY,addCoo,mapAddCoo,&tmp); - if(sz1!=addCoo.size()) + if(sz1!=addCoo.size() // newly created point + || (tmp >= offset2 // or previously created point merged with a neighbour + && (pointsOther.size() == 0 || pointsOther.back() != tmp))) { pointsOther.push_back(tmp); return ; } - std::vector::const_iterator it=std::find(pointsOther.begin(),pointsOther.end(),tmp); + std::vector::const_iterator it=std::find(pointsOther.begin(),pointsOther.end(),tmp); if(it!=pointsOther.end()) return ; - if(tmp