X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingUMesh_internal.hxx;h=7835309f89cf700070f10bc13cdaff2947d948ed;hb=2ae2dc6fcedbf241c7637284b3c7bde12aded04a;hp=ae8f17bab1484456d7aba12185846d4f516dc79d;hpb=dcc261ea8b9015285a05b5f7bc2960d883815c9a;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingUMesh_internal.hxx b/src/MEDCoupling/MEDCouplingUMesh_internal.hxx index ae8f17bab..7835309f8 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_internal.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh_internal.hxx @@ -129,30 +129,15 @@ void MEDCouplingUMesh::getCellsContainingPointsAlg(const double *coords, const d mcIdType sz(connI[(*iter)+1]-connI[*iter]-1); INTERP_KERNEL::NormalizedCellType ct((INTERP_KERNEL::NormalizedCellType)conn[connI[*iter]]); bool status(false); - // [ABN] : point locator algorithms are only properly working for linear cells. - if(ct!=INTERP_KERNEL::NORM_POLYGON && !sensibilityTo2DQuadraticLinearCellsFunc(ct,_mesh_dim)) - status=INTERP_KERNEL::PointLocatorAlgos >::isElementContainsPoint(pos+i*SPACEDIM,ct,coords,conn+connI[*iter]+1,sz,eps); + // [ABN] : point locator algorithms are not impl. for POLY or QPOLY in spaceDim3 + if( SPACEDIM!=2 && + (ct == INTERP_KERNEL::NORM_POLYGON || sensibilityTo2DQuadraticLinearCellsFunc(ct,_mesh_dim))) + throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getCellsContainingPointsAlg : not implemented yet for POLYGON and QPOLYGON in spaceDim 3 !"); + // Keep calling simple algorithm when this is desired and simple for speed reasons: + if (SPACEDIM == 2 && ct != INTERP_KERNEL::NORM_POLYGON && !sensibilityTo2DQuadraticLinearCellsFunc(ct,_mesh_dim)) + status=INTERP_KERNEL::PointLocatorAlgos >::isElementContainsPointAlgo2DSimple2(pos+i*SPACEDIM,ct,coords,conn+connI[*iter]+1,sz,eps); else - { - if(SPACEDIM!=2) - throw INTERP_KERNEL::Exception("MEDCouplingUMesh::getCellsContainingPointsAlg : not implemented yet for POLYGON and QPOLYGON in spaceDim 3 !"); - std::vector nodes(sz); - INTERP_KERNEL::QuadraticPolygon *pol(0); - for(mcIdType j=0;jnormalizeMe(b,c); n->applySimilarity(b,c,a); - status=pol->isInOrOut2(n); - delete pol; n->decrRef(); - } + status=INTERP_KERNEL::PointLocatorAlgos >::isElementContainsPoint(pos+i*SPACEDIM,ct,coords,conn+connI[*iter]+1,sz,eps); if(status) { eltsIndexPtr[i+1]++;