Salome HOME
Implementation of MEDCoupling1SGTUMesh.computeTriangleHeight and DataArrayDouble...
[tools/medcoupling.git] / src / INTERP_KERNEL / TriangulationIntersector.txx
index db7f68a2aa7d2a148cd32832a3f1d82cc5ac4f87..a46de9fbc9f19973b1e0cf60bd6265d1391895b1 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  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
@@ -73,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++)
               {
@@ -103,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++)
@@ -115,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++)
               {
@@ -144,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++)
@@ -157,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++)
             {
@@ -194,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;
@@ -202,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++)
       {