src/gsim/se_triangulator_search.cpp
//this is the original and simplest sector free algorithm, without any tests for special cases
this is the original and simplest sector free algorithm, without any tests for special cases
this is the original and simplest sector free algorithm without any tests for special cases
bool SeTriangulator::sector_free ( SeBase* s, double r2, double cx, double cy,
                                   double x1, double y1, double x2, double y2 )
 {
   double t, d2, x3, y3;
   d2 = gs_point_segment_dist2(cx,cy,x1,y1,x2,y2,t);
   if ( d2>=r2 ) return true; 
   if ( _man->is_constrained(s->edg()) ) return false; 
   s=s->sym()->nxt();
   _man->get_vertex_coordinates ( s->nvtx(), x3, y3 );
   if ( gs_ccw(cx,cy,x3,y3,x2,y2)>0 ) 
    { 
      if ( !sector_free(s->nxt(),r2,cx,cy,x3,y3,x2,y2) ) return false;
    }
   if ( gs_ccw(cx,cy,x1,y1,x3,y3)>0 ) 
    { 
      if ( !sector_free(s,r2,cx,cy,x1,y1,x3,y3) ) return false;
    }
   return true;
 }
bool SeTriangulator :: sector_free ( SeBase * s , double r2 , double cx , double cy , double x1 , double y1 , double x2 , double y2 ) { double t , d2 , x3 , y3 ; d2 = gs_point_segment_dist2 ( cx , cy , x1 , y1 , x2 , y2 , t ) ; if ( d2 >= r2 ) return true ; if ( _man -> is_constrained ( s -> edg ( ) ) ) return false ; s = s -> sym ( ) -> nxt ( ) ; _man -> get_vertex_coordinates ( s -> nvtx ( ) , x3 , y3 ) ; if ( gs_ccw ( cx , cy , x3 , y3 , x2 , y2 ) > 0 ) { if ( ! sector_free ( s -> nxt ( ) , r2 , cx , cy , x3 , y3 , x2 , y2 ) ) return false ; } if ( gs_ccw ( cx , cy , x1 , y1 , x3 , y3 ) > 0 ) { if ( ! sector_free ( s , r2 , cx , cy , x1 , y1 , x3 , y3 ) ) return false ; } return true ; }
this is the original and simplest sector free algorithm, without any tests for special cases
this is the original and simplest sector free algorithm without any tests for special cases
// check if s is distant enought from c: // ok enought space // if not, test if we're trying to cross an obstacle: // pt-seg blockage found: not passable // recurse: // c-p3-p2 // c-p1-p3