Salome HOME
Minor portability: Cygwin compiler seems to have _X as a standard symbol ...
authorabn <adrien.bruneton@cea.fr>
Mon, 2 May 2016 13:58:15 +0000 (15:58 +0200)
committerabn <adrien.bruneton@cea.fr>
Mon, 2 May 2016 14:50:30 +0000 (16:50 +0200)
src/INTERP_KERNEL/InterpolationUtils.hxx
src/INTERP_KERNEL/UnitTetraIntersectionBary.cxx

index 0c5a5a9490b73f1616fc81a054e568a9027dce74..8f7eaffa6ac16125248251c86cc3379873a6db3e 100644 (file)
@@ -421,7 +421,7 @@ namespace INTERP_KERNEL
    */
   inline void barycentric_coords(const std::vector<const double*>& n, const double *p, double *bc)
   {
-    enum { _X, _Y, _Z };
+    enum { _XX=0, _YY, _ZZ };
     switch(n.size())
       {
       case 2:
@@ -435,8 +435,8 @@ namespace INTERP_KERNEL
         { // TRIA3
           // matrix 2x2
           double
-            T11 = n[0][_X]-n[2][_X], T12 = n[1][_X]-n[2][_X],
-            T21 = n[0][_Y]-n[2][_Y], T22 = n[1][_Y]-n[2][_Y];
+            T11 = n[0][_XX]-n[2][_XX], T12 = n[1][_XX]-n[2][_XX],
+            T21 = n[0][_YY]-n[2][_YY], T22 = n[1][_YY]-n[2][_YY];
           // matrix determinant
           double Tdet = T11*T22 - T12*T21;
           if ( (std::fabs( Tdet) ) < (std::numeric_limits<double>::min()) )
@@ -447,7 +447,7 @@ namespace INTERP_KERNEL
           // matrix inverse
           double t11 = T22, t12 = -T12, t21 = -T21, t22 = T11;
           // vector
-          double r11 = p[_X]-n[2][_X], r12 = p[_Y]-n[2][_Y];
+          double r11 = p[_XX]-n[2][_XX], r12 = p[_YY]-n[2][_YY];
           // barycentric coordinates: mutiply matrix by vector
           bc[0] = (t11 * r11 + t12 * r12)/Tdet;
           bc[1] = (t21 * r11 + t22 * r12)/Tdet;
@@ -462,9 +462,9 @@ namespace INTERP_KERNEL
           // bc1*( z1 - z4 ) + bc2*( z2 - z4 ) + bc3*( z3 - z4 ) = px - z4
           
           double T[3][4]=
-            {{ n[0][_X]-n[3][_X], n[1][_X]-n[3][_X], n[2][_X]-n[3][_X], p[_X]-n[3][_X] },
-             { n[0][_Y]-n[3][_Y], n[1][_Y]-n[3][_Y], n[2][_Y]-n[3][_Y], p[_Y]-n[3][_Y] },
-             { n[0][_Z]-n[3][_Z], n[1][_Z]-n[3][_Z], n[2][_Z]-n[3][_Z], p[_Z]-n[3][_Z] }};
+            {{ n[0][_XX]-n[3][_XX], n[1][_XX]-n[3][_XX], n[2][_XX]-n[3][_XX], p[_XX]-n[3][_XX] },
+             { n[0][_YY]-n[3][_YY], n[1][_YY]-n[3][_YY], n[2][_YY]-n[3][_YY], p[_YY]-n[3][_YY] },
+             { n[0][_ZZ]-n[3][_ZZ], n[1][_ZZ]-n[3][_ZZ], n[2][_ZZ]-n[3][_ZZ], p[_ZZ]-n[3][_ZZ] }};
           
           if ( !solveSystemOfEquations<3>( T, bc ) )
             bc[0]=1., bc[1] = bc[2] = bc[3] = 0;
index e84d1b87829840e8f59a7f622ade8c82f2c1c444..9b4c727cb64a19ae0d58e5f8157409049aeb87fb 100644 (file)
@@ -35,7 +35,7 @@
 
 namespace INTERP_KERNEL
 {
-  enum { _X=0, _Y, _Z };
+  enum { _XX=0, _YY, _ZZ };
 
   inline bool samePoint( const double* p1, const double* p2 )
   {
@@ -86,7 +86,7 @@ namespace INTERP_KERNEL
     const std::vector<double*> * pPolygonA = &triangle.getPolygonA();
     if ( pPolygonA->size() < 3 )
       {
-        if ( !epsilonEqual( triNormal[_Z], 0 ))
+        if ( !epsilonEqual( triNormal[_ZZ], 0 ))
           return; // not vertical triangle does not intersect the unit tetra
 
         // Vertical triangle. Use inherited methods of TransformedTriangle to
@@ -378,8 +378,8 @@ namespace INTERP_KERNEL
         }
         // check if the segment p1-p2 is on the inclined side
         if ( sideFaces[3] &&
-             epsilonEqual( p1[_X] + p1[_Y] + p1[_Z], 1.0 ) &&
-             epsilonEqual( p2[_X] + p2[_Y] + p2[_Z], 1.0 ))
+             epsilonEqual( p1[_XX] + p1[_YY] + p1[_ZZ], 1.0 ) &&
+             epsilonEqual( p2[_XX] + p2[_YY] + p2[_ZZ], 1.0 ))
         {
           sideFaces[3]->push_back( new double[3] );
           copyVector3( p1, sideFaces[3]->back() );