Salome HOME
Minor: documentation and comments
[tools/medcoupling.git] / src / INTERP_KERNEL / InterpolationPlanar.txx
index 07fd4d5e9562d813f37fc738122d27e8fb090a30..13a6817c300ae411283d1233d6ef14ed23fb118c 100644 (file)
@@ -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
@@ -190,6 +190,8 @@ namespace INTERP_KERNEL
                                                                                                    InterpolationOptions::getPrecision(),
                                                                                                    InterpolationOptions::getOrientation());
             break;
+          default:
+            throw INTERP_KERNEL::Exception("For P0P0 planar interpolation possibities are : Triangulation, Convex, Geometric2D, PointLocator !");
           }
       }
     else if(meth=="P0P1")
@@ -227,6 +229,23 @@ namespace INTERP_KERNEL
                                                                            InterpolationOptions::getPrecision(),
                                                                            InterpolationOptions::getOrientation());
             break;
+          case Barycentric:
+            intersector=new TriangulationIntersector<MyMeshType,MatrixType,PlanarIntersectorP0P1Bary>(myMeshT,myMeshS,_dim_caracteristic,
+                                                                                                      InterpolationOptions::getPrecision(),
+                                                                                                      InterpolationOptions::getMaxDistance3DSurfIntersect(),
+                                                                                                      InterpolationOptions::getMedianPlane(),
+                                                                                                      InterpolationOptions::getOrientation(),
+                                                                                                      InterpolationOptions::getPrintLevel());
+            break;
+          case BarycentricGeo2D:
+            intersector=new Geometric2DIntersector<MyMeshType,MatrixType,PlanarIntersectorP0P1Bary>(myMeshT, myMeshS, _dim_caracteristic,
+                                                                                                    InterpolationOptions::getMaxDistance3DSurfIntersect(),
+                                                                                                    InterpolationOptions::getMedianPlane(),
+                                                                                                    InterpolationOptions::getPrecision(),
+                                                                                                    InterpolationOptions::getOrientation());
+            break;
+          default:
+            throw INTERP_KERNEL::Exception("For P0P1 planar interpolation possibities are : Triangulation, Convex, Geometric2D, PointLocator, Barycentric, BarycentricGeo2D !");
           }
       }
     else if(meth=="P1P0")
@@ -264,41 +283,23 @@ namespace INTERP_KERNEL
                                                                        InterpolationOptions::getPrecision(),
                                                                        InterpolationOptions::getOrientation());
             break;
+          case Barycentric:
+             intersector=new TriangulationIntersector<MyMeshType,MatrixType,PlanarIntersectorP1P0Bary>(myMeshT,myMeshS,_dim_caracteristic,
+                                                                                                       InterpolationOptions::getPrecision(),
+                                                                                                       InterpolationOptions::getMaxDistance3DSurfIntersect(),
+                                                                                                       InterpolationOptions::getMedianPlane(),
+                                                                                                       InterpolationOptions::getOrientation(),
+                                                                                                       InterpolationOptions::getPrintLevel());
+             break;
+          case BarycentricGeo2D:
+            intersector=new Geometric2DIntersector<MyMeshType,MatrixType,PlanarIntersectorP1P0Bary>(myMeshT, myMeshS, _dim_caracteristic,
+                                                                                                    InterpolationOptions::getMaxDistance3DSurfIntersect(),
+                                                                                                    InterpolationOptions::getMedianPlane(),
+                                                                                                    InterpolationOptions::getPrecision(),
+                                                                                                    InterpolationOptions::getOrientation());
+            break;
           }
       }
-    else if(meth=="P1P0Bary")
-    {
-      switch (InterpolationOptions::getIntersectionType())
-      {
-      case Triangulation:
-        intersector=new TriangulationIntersector<MyMeshType,MatrixType,PlanarIntersectorP1P0Bary>(myMeshT,myMeshS,_dim_caracteristic,
-                                                                                                  InterpolationOptions::getPrecision(),
-                                                                                                  InterpolationOptions::getMaxDistance3DSurfIntersect(),
-                                                                                                  InterpolationOptions::getMedianPlane(),
-                                                                                                  InterpolationOptions::getOrientation(),
-                                                                                                  InterpolationOptions::getPrintLevel());
-        break;
-      case Convex:
-        intersector=new ConvexIntersector<MyMeshType,MatrixType,PlanarIntersectorP1P0Bary>(myMeshT,myMeshS,_dim_caracteristic,
-                                                                                           InterpolationOptions::getPrecision(),
-                                                                                           InterpolationOptions::getMaxDistance3DSurfIntersect(),
-                                                                                           InterpolationOptions::getMedianPlane(),
-                                                                                           InterpolationOptions::getDoRotate(),
-                                                                                           InterpolationOptions::getOrientation(),
-                                                                                           InterpolationOptions::getPrintLevel());
-        break;
-      case Geometric2D:
-        intersector=new Geometric2DIntersector<MyMeshType,MatrixType,PlanarIntersectorP1P0Bary>(myMeshT, myMeshS, _dim_caracteristic,
-                                                                                                InterpolationOptions::getMaxDistance3DSurfIntersect(),
-                                                                                                InterpolationOptions::getMedianPlane(),
-                                                                                                InterpolationOptions::getPrecision(),
-                                                                                                InterpolationOptions::getOrientation());
-        break;
-      case PointLocator:
-        throw INTERP_KERNEL::Exception("Invalid intersector (PointLocator) for P1P0Bary !");
-        break;
-      }
-    }
     else if(meth=="P1P1")
       {
         switch (InterpolationOptions::getIntersectionType())
@@ -334,6 +335,8 @@ namespace INTERP_KERNEL
                                                                            InterpolationOptions::getPrecision(),
                                                                            InterpolationOptions::getOrientation());
             break;
+          default:
+            throw INTERP_KERNEL::Exception("For P1P1 planar interpolation possibities are : Triangulation, Convex, Geometric2D, PointLocator !");
           }
       }
     else