]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Correction erreur valgrind dans SingleElementPlanarTests (jump on unitialised parameter) BR_Dev1_For_5_0
authorndjinga <ndjinga>
Fri, 30 Jan 2009 09:17:47 +0000 (09:17 +0000)
committerndjinga <ndjinga>
Fri, 30 Jan 2009 09:17:47 +0000 (09:17 +0000)
src/INTERP_KERNEL/PolygonAlgorithms.txx

index fbdd36cef2f96ecbfa80bf8484af09abe6de2e52..2e7ff2604aca7afc28822f8973e8be7dfb758ae8 100644 (file)
@@ -50,7 +50,11 @@ namespace INTERP_KERNEL
         switch(DIM)
           {
           case 2:
-            return false;
+                                               {
+                                                       if(distance2<DIM>(A,D)<_Epsilon)
+                                                               crossprod<DIM>(A,C,E,_Vdouble);//store the crossprod between vectors AC and AE (E=vertex preceding A)                     
+                                                       return false;//case of paralell segments
+                                               }
           case 3://beware AB and CD may belong to a vertical plane
             det = determinant(&AB[1],&DC[1]);//determinant of the last two coefficients
             if(fabs(det) > _Epsilon) 
@@ -68,11 +72,17 @@ namespace INTERP_KERNEL
                     t1=(AC[0]*DC[2]-AC[2]*DC[0])*inv_det;
                     t2=(AB[0]*AC[2]-AB[2]*AC[0])*inv_det;
                   }
-                else return false;//case of paralell segments
-              }
+                else   
+                                                                       {
+                                                                               if(distance2<DIM>(A,D)<_Epsilon)
+                                                                                       crossprod<DIM>(A,C,E,_Vdouble);//store the crossprod between vectors AC and AE (E=vertex preceding A)                     
+                                                                               return false;//case of paralell segments
+                                                                       }
+                                                       }
           }
       }
-    
+
+               //              std::cout<<"t1= " << t1  << " ; t2= " << t2<< std::endl;
     if(t1>_Precision && t1<1-_Precision)
       {
         if( t2>_Precision && t2<1-_Precision)
@@ -107,7 +117,7 @@ namespace INTERP_KERNEL
               }         
           }
         else if(fabs(t2-1) <= _Precision)//vertex on a vertex (A=D), first run
-          crossprod<DIM>(A,C,E,_Vdouble);//angle between vectors AC and AE (E=vertex preceding A)                     
+          crossprod<DIM>(A,C,E,_Vdouble);//store the angle between vectors AC and AE (E=vertex preceding A)                     
         else if(fabs(t2) <= _Precision)//vertex on a vertex (A=C), second run
           {
             double Vdoublebis[DIM];
@@ -396,7 +406,7 @@ namespace INTERP_KERNEL
         _Status.insert(std::make_pair(i_next_glob,std::make_pair(i_glob, false)));
         _Status.insert(std::make_pair(i_prev_glob,std::make_pair(i_glob, false))); 
         mi1++;
-        //std::cout<< "nb_prev= "<< 0 << " i_glob= " << i_glob << std::endl;
+                               //        std::cout<< "nb_prev= "<< 0 << " i_glob= " << i_glob << std::endl;
                                 
         /******* Loop until the second polygon is reached *******/  
         while( !four_neighbours)
@@ -429,7 +439,6 @@ namespace INTERP_KERNEL
                       four_neighbours = true;
                     else         /* Rare pothological case:  */
                       {
-                        //std::cout<<"coucou" << std::endl;
                         const pair< const double *, int > next_pt= *mi2;
                         events.erase(mi2);
                         mi1=events.insert(mi1,next_pt);