]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Correction of bug.
authorageay <ageay>
Mon, 21 Nov 2011 15:43:23 +0000 (15:43 +0000)
committerageay <ageay>
Mon, 21 Nov 2011 15:43:23 +0000 (15:43 +0000)
src/INTERP_KERNEL/CellModel.cxx

index d3681de822e3f07fe0c6f4366cc33f2861a5df58..da006cbb65c8a87d34c4543f2d3707c88e9ba324 100644 (file)
@@ -421,8 +421,12 @@ namespace INTERP_KERNEL
         std::vector<int> tmp(2*lgth);
         std::vector<int>::iterator it=std::copy(conn1,conn1+lgth,tmp.begin());
         std::copy(conn1,conn1+lgth,it);
-        it=std::find_first_of(tmp.begin(),tmp.end(),conn2,conn2+lgth);
-        return it!=tmp.end();
+        it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth);
+        if(it==tmp.begin())
+          return true;
+        if(it!=tmp.end())
+          return false;
+        throw INTERP_KERNEL::Exception("CellModel::getOrientationStatus : Request of orientation status of non equal connectively cells !");
       }
     else
       {
@@ -431,13 +435,13 @@ namespace INTERP_KERNEL
             std::vector<int> tmp(lgth);
             std::vector<int>::iterator it=std::copy(conn1,conn1+lgth/2,tmp.begin());
             std::copy(conn1,conn1+lgth/2,it);
-            it=std::find_first_of(tmp.begin(),tmp.end(),conn2,conn2+lgth/2);
+            it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth/2);
             int d=std::distance(tmp.begin(),it);
             if(it==tmp.end())
               return false;
             it=std::copy(conn1+lgth/2,conn1+lgth,tmp.begin());
             std::copy(conn1+lgth/2,conn1+lgth,it);
-            it=std::find_first_of(tmp.begin(),tmp.end(),conn2,conn2+lgth);
+            it=std::search(tmp.begin(),tmp.end(),conn2,conn2+lgth);
             if(it==tmp.end())
               return false;
             int d2=std::distance(tmp.begin(),it);
@@ -449,14 +453,14 @@ namespace INTERP_KERNEL
             std::vector<int> tmp(2*p);
             std::vector<int>::iterator it=std::copy(conn1,conn1+p,tmp.begin());
             std::copy(conn1,conn1+p,it);
-            it=std::find_first_of(tmp.begin(),tmp.end(),conn2,conn2+p);
+            it=std::search(tmp.begin(),tmp.end(),conn2,conn2+p);
             int d=std::distance(tmp.begin(),it);
             if(it==tmp.end())
               return false;
             tmp.resize(2*p-2);
             it=std::copy(conn1+p,conn1+lgth,tmp.begin());
             std::copy(conn1+p,conn1+lgth,it);
-            it=std::find_first_of(tmp.begin(),tmp.end(),conn2+p,conn2+lgth);
+            it=std::search(tmp.begin(),tmp.end(),conn2+p,conn2+lgth);
             if(it==tmp.end())
               return false;
             int d2=std::distance(tmp.begin(),it);