X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingVoronoi.cxx;h=2393d5512a0a9fc3d7b25d6ab9ad7c8b26cd702c;hb=b607ffc713080a567fb90595118069ac18181e99;hp=80e1b0e3da473fe92967d8c81a3a5ad38aeffe1f;hpb=b219559763498c4bd10c730cd3d2c62b1eed45db;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingVoronoi.cxx b/src/MEDCoupling/MEDCouplingVoronoi.cxx index 80e1b0e3d..2393d5512 100755 --- a/src/MEDCoupling/MEDCouplingVoronoi.cxx +++ b/src/MEDCoupling/MEDCouplingVoronoi.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 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 @@ -21,6 +21,7 @@ #include "MEDCouplingVoronoi.hxx" #include "MEDCoupling1GTUMesh.hxx" #include "MEDCouplingCMesh.hxx" +#include "MEDCouplingFieldDouble.hxx" #include "MCAuto.txx" #include "MEDCouplingNormalizedUnstructuredMesh.txx" @@ -90,6 +91,11 @@ MCAuto ComputeBigCellFrom(const double pt1[2], const double pt throw INTERP_KERNEL::Exception("ComputeBigCellFrom : expected single element !"); MCAuto ret(sp2->buildPartOfMySelfSlice(ccp[0],ccp[0]+1,1,true)); ret->zipCoords(); + { + MCAuto tmp(ret->getMeasureField(false)); + if(tmp->getArray()->getIJ(0,0)<0) + ret->invertOrientationOfAllCells(); + } return ret; } @@ -424,6 +430,11 @@ MCAuto MEDCoupling::Voronizer2D::doIt(const MEDCouplingUMesh * newVorCell->zipCoords(); MCAuto modifiedCell(a->buildPartOfMySelf(part->begin(),part->end())); modifiedCell->zipCoords(); + { + MCAuto tmp(modifiedCell->getMeasureField(false)); + if(tmp->getArray()->getIJ(0,0)<0) + modifiedCell->invertOrientationOfAllCells(); + } l0[poly]=modifiedCell; // MCAuto ids; @@ -455,7 +466,13 @@ MCAuto MEDCoupling::Voronizer2D::doIt(const MEDCouplingUMesh * } newVorCells.push_back(newVorCell); } - l0.push_back(MergeVorCells(newVorCells,eps)); + MCAuto mergedVorCell(MergeVorCells(newVorCells,eps)); + { + MCAuto tmp(mergedVorCell->getMeasureField(false)); + if(tmp->getArray()->getIJ(0,0)<0) + mergedVorCell->invertOrientationOfAllCells(); + } + l0.push_back(mergedVorCell); } std::vector< const MEDCouplingUMesh * > l0Bis(VecAutoToVecOfCstPt(l0)); MCAuto ret(MEDCouplingUMesh::MergeUMeshes(l0Bis));