Salome HOME
Implementation of MEDCoupling1SGTUMesh.computeTriangleHeight and DataArrayDouble...
[tools/medcoupling.git] / src / INTERP_KERNEL / TriangulationIntersector.txx
index 3cc53f66eca0394769a936e026ddd286c7a2b11b..a46de9fbc9f19973b1e0cf60bd6265d1391895b1 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  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
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
 #ifndef __TRIANGULATIONINTERSECTOR_TXX__
 #define __TRIANGULATIONINTERSECTOR_TXX__
 
@@ -38,9 +39,9 @@ namespace INTERP_KERNEL
 {
   TRI_INTER_TEMPLATE
   TRI_INTERSECTOR::TriangulationIntersector(const MyMeshType& meshT, const MyMeshType& meshS, 
-                                            double DimCaracteristic, double Precision, double md3DSurf,
+                                            double DimCaracteristic, double Precision, double md3DSurf, double minDot3DSurf,
                                             double MedianPlane, int orientation, int PrintLevel)
-    :InterpType<MyMeshType,MyMatrix,TRI_INTERSECTOR >(meshT,meshS,DimCaracteristic, Precision, md3DSurf,
+    :InterpType<MyMeshType,MyMatrix,TRI_INTERSECTOR >(meshT,meshS,DimCaracteristic, Precision, md3DSurf, minDot3DSurf,
                                                       MedianPlane, true, orientation, PrintLevel)
   {
     if(PlanarIntersector<MyMeshType,MyMatrix>::_print_level >= 1)
@@ -72,7 +73,7 @@ namespace INTERP_KERNEL
                                                 &CoordsS[0],&CoordsS[SPACEDIM*iS],&CoordsS[SPACEDIM*(iS+1)],
                                                 inter, PlanarIntersector<MyMeshType,MyMatrix>::_dim_caracteristic,
                                                 PlanarIntersector<MyMeshType,MyMatrix>::_precision);
-            ConnType nb_inter=((ConnType)inter.size())/2;
+            ConnType nb_inter=ToConnType(inter.size())/2;
             if(nb_inter >3) inter=reconstruct_polygon(inter);
             for(ConnType i = 1; i<nb_inter-1; i++)
               {
@@ -102,7 +103,7 @@ namespace INTERP_KERNEL
                                                           bool                       isSourceQuad)
   {
     double result = 0.;
-    ConnType nbNodesS=sourceCoords.size()/SPACEDIM;
+    ConnType nbNodesS=ToConnType(sourceCoords.size())/SPACEDIM;
     //Compute the intersection area
     double area[SPACEDIM];
     for(ConnType iT = 1; iT<3; iT++)
@@ -114,7 +115,7 @@ namespace INTERP_KERNEL
                                                 &sourceCoords[0],&sourceCoords[SPACEDIM*iS],&sourceCoords[SPACEDIM*(iS+1)],
                                                 inter, PlanarIntersector<MyMeshType,MyMatrix>::_dim_caracteristic,
                                                 PlanarIntersector<MyMeshType,MyMatrix>::_precision);
-            ConnType nb_inter=((ConnType)inter.size())/2;
+            ConnType nb_inter=ToConnType(inter.size())/2;
             if(nb_inter >3) inter=reconstruct_polygon(inter);
             for(ConnType i = 1; i<nb_inter-1; i++)
               {
@@ -143,8 +144,8 @@ namespace INTERP_KERNEL
                                                    const std::vector<double>& sourceCoords)
   {
     double result = 0.;
-    ConnType nbNodesS=sourceCoords.size()/SPACEDIM;
-    ConnType nbNodesT=targetCoords.size()/SPACEDIM;
+    ConnType nbNodesS=ToConnType(sourceCoords.size())/SPACEDIM;
+    ConnType nbNodesT=ToConnType(targetCoords.size())/SPACEDIM;
     //Compute the intersection area
     double area[SPACEDIM];
     for(ConnType iT = 1; iT<nbNodesT-1; iT++)
@@ -156,7 +157,7 @@ namespace INTERP_KERNEL
                                                 &sourceCoords[0],&sourceCoords[SPACEDIM*iS],&sourceCoords[SPACEDIM*(iS+1)],
                                                 inter, PlanarIntersector<MyMeshType,MyMatrix>::_dim_caracteristic,
                                                 PlanarIntersector<MyMeshType,MyMatrix>::_precision);
-            ConnType nb_inter=((ConnType)inter.size())/2;
+            ConnType nb_inter=ToConnType(inter.size())/2;
             if(nb_inter >3) inter=reconstruct_polygon(inter);
             for(ConnType i = 1; i<nb_inter-1; i++)
             {
@@ -193,7 +194,7 @@ namespace INTERP_KERNEL
     double inter_area[SPACEDIM], total_area = 0.;
     double total_barycenter[SPACEDIM]={0.,0.};
 
-    const ConnType nbNodesT=targetCell.size()/SPACEDIM;
+    const ConnType nbNodesT=ToConnType(targetCell.size())/SPACEDIM;
     for(ConnType iT = 1; iT<nbNodesT-1; iT++)
     {
       std::vector<double> inter;
@@ -201,7 +202,7 @@ namespace INTERP_KERNEL
                                           sourceCell[0], sourceCell[1], sourceCell[2],
                                           inter, PlanarIntersector<MyMeshType,MyMatrix>::_dim_caracteristic,
                                           PlanarIntersector<MyMeshType,MyMatrix>::_precision);
-      ConnType nb_inter=((ConnType)inter.size())/2;
+      ConnType nb_inter=ToConnType(inter.size())/2;
       if(nb_inter >3) inter=reconstruct_polygon(inter);
       for(ConnType i = 1; i<nb_inter-1; i++)
       {