X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FInterpolation3D.txx;h=67327f861a5b9765dacc630a018ba83611910156;hb=be4c3bb042d5426fbbe54378b9d7b35173ab27ef;hp=248207e02e07b8e0f457a0e1a5208967990dd59b;hpb=10f37bf6f33a762626d7f1093b2f5450c1688667;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/Interpolation3D.txx b/src/INTERP_KERNEL/Interpolation3D.txx index 248207e02..67327f861 100644 --- a/src/INTERP_KERNEL/Interpolation3D.txx +++ b/src/INTERP_KERNEL/Interpolation3D.txx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D +// Copyright (C) 2007-2013 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 @@ -16,6 +16,8 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Author : Anthony Geay (CEA/DEN) + #ifndef __INTERPOLATION3D_TXX__ #define __INTERPOLATION3D_TXX__ @@ -32,6 +34,7 @@ #include "PointLocator3DIntersectorP1P0.txx" #include "PolyhedronIntersectorP1P1.txx" #include "PointLocator3DIntersectorP1P1.txx" +#include "Barycentric3DIntersectorP1P1.txx" #include "Log.hxx" /// If defined, use recursion to traverse the binary search tree, else use the BBTree class //#define USE_RECURSIVE_BBOX_FILTER @@ -71,7 +74,7 @@ namespace INTERP_KERNEL * */ template - int Interpolation3D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const char *method) + int Interpolation3D::interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result, const std::string& method) { typedef typename MyMeshType::MyConnType ConnType; // create MeshElement objects corresponding to each element of the two meshes @@ -131,17 +134,13 @@ namespace INTERP_KERNEL case PointLocator: intersector=new PointLocator3DIntersectorP1P0(targetMesh, srcMesh, getPrecision()); break; + case Barycentric: + intersector=new PolyhedronIntersectorP1P0Bary(targetMesh, srcMesh, getSplittingPolicy()); + break; default: - throw INTERP_KERNEL::Exception("Invalid 3D intersection type for P1P0 interp specified : must be Triangle or PointLocator."); + throw INTERP_KERNEL::Exception("Invalid 3D intersection type for P1P0 interp specified : must be Triangle, PointLocator or Barycentric."); } } - else if(methC=="P1P0Bary") - { - if(InterpolationOptions::getIntersectionType()==Triangulation) - intersector=new PolyhedronIntersectorP1P0Bary(targetMesh, srcMesh, getSplittingPolicy()); - else - throw INTERP_KERNEL::Exception("Invalid 3D intersection type specified : must be Triangle."); - } else if(methC=="P1P1") { switch(InterpolationOptions::getIntersectionType()) @@ -152,6 +151,9 @@ namespace INTERP_KERNEL case PointLocator: intersector=new PointLocator3DIntersectorP1P1(targetMesh, srcMesh, getPrecision()); break; + case Barycentric: + intersector=new Barycentric3DIntersectorP1P1(targetMesh, srcMesh, getPrecision()); + break; default: throw INTERP_KERNEL::Exception("Invalid 3D intersection type for P1P1 interp specified : must be Triangle or PointLocator."); }