From: vbd Date: Tue, 12 Feb 2008 13:01:24 +0000 (+0000) Subject: correcting bug (Michael) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=985204a8bdcd3d212d424f45534a4049fc6d86ea;p=tools%2Fmedcoupling.git correcting bug (Michael) --- diff --git a/src/INTERP_KERNEL/PolygonAlgorithms.txx b/src/INTERP_KERNEL/PolygonAlgorithms.txx index f95934cab..93f8fceee 100644 --- a/src/INTERP_KERNEL/PolygonAlgorithms.txx +++ b/src/INTERP_KERNEL/PolygonAlgorithms.txx @@ -168,24 +168,24 @@ namespace INTERP_KERNEL { if(!_Inter.empty() ) { - if(_End_segments[1] ==i_i_next) + if(_End_segments[0] ==i_i_next) { - for(int idim=0;idim=0;idim--) _Inter.push_front(ABCD[idim]); + _Terminus= (_End_segments[1]== j_j_next); + _End_segments[0] = j_j_next; } else { - if( _End_segments[1]== j_j_next) + if( _End_segments[0]== j_j_next) { - for(int idim=0;idim=0;idim--) _Inter.push_front(ABCD[idim]); + _Terminus= (_End_segments[1]== i_i_next); + _End_segments[0] = i_i_next; } else { - for(int idim=DIM-1;idim>-1;idim--) _Inter.push_front(ABCD[idim]); - _End_segments[0] = (_End_segments[0]== i_i_next) ? j_j_next : i_i_next; + for(int idim=0;idim::add_crossing0(const double * A, const double * B, int i, int i_next, const double * C, const double * D, int j, int j_next) { - double ABCD[DIM]; + double ABCD[DIM]; if(intersect_segment_segment(A,B,C,D,ABCD, ABCD)) //fifth and sixth arguments are useless here { - add_crossing(ABCD, std::make_pair(i, i_next), std::make_pair(j, j_next)); - _Status.insert(std::make_pair(i_next,std::make_pair(i, false))); - std::multimap< int, std::pair< int,bool> >::iterator mi; - mi=_Status.find(j_next); - ((* mi).second).second= !((* mi).second).second; + /* Updating _End_segments */ + pair< int,int > i_i_next = make_pair(i, i_next); + pair< int,int > j_j_next = make_pair(j, j_next); + if( _End_segments[0] == i_i_next) + { + for(int idim=DIM-1;idim>-1;idim--) _Inter.push_front(ABCD[idim]); + _End_segments[0] = j_j_next; + } + else + { + for(int idim=0;idim >::iterator mi =_Status.find(j_next); + ((* mi).second).second= !((* mi).second).second; } - else _Status.insert(std::make_pair(i_next,std::make_pair(i,true))); - } + else _Status.insert(make_pair(i_next,make_pair(i,true))); + } /*******************************************************/ /* adds the possible crossings between segments [A,B] (with end-point global indices i and i_next) */